Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
8274a409
Commit
8274a409
authored
Mar 14, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continue c_oAscAsyncAction.Save long action if start forceSave by button
parent
41b4a3f2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
17 deletions
+46
-17
cell/api.js
cell/api.js
+7
-5
common/apiBase.js
common/apiBase.js
+20
-4
common/docscoapi.js
common/docscoapi.js
+10
-3
slide/api.js
slide/api.js
+5
-3
word/api.js
word/api.js
+4
-2
No files found.
cell/api.js
View file @
8274a409
...
@@ -131,7 +131,7 @@ var editor;
...
@@ -131,7 +131,7 @@ var editor;
this
.
_init
();
this
.
_init
();
return
this
;
return
this
;
}
}
spreadsheet_api
.
prototype
=
Object
.
create
(
AscCommon
.
baseEditorsApi
.
prototype
);
spreadsheet_api
.
prototype
=
Object
.
create
(
AscCommon
.
baseEditorsApi
.
prototype
);
spreadsheet_api
.
prototype
.
constructor
=
spreadsheet_api
;
spreadsheet_api
.
prototype
.
constructor
=
spreadsheet_api
;
spreadsheet_api
.
prototype
.
sendEvent
=
function
()
{
spreadsheet_api
.
prototype
.
sendEvent
=
function
()
{
this
.
handlers
.
trigger
.
apply
(
this
.
handlers
,
arguments
);
this
.
handlers
.
trigger
.
apply
(
this
.
handlers
,
arguments
);
...
@@ -1464,9 +1464,9 @@ var editor;
...
@@ -1464,9 +1464,9 @@ var editor;
this
.
CoAuthoringApi
.
onUnSaveLock
=
function
()
{
this
.
CoAuthoringApi
.
onUnSaveLock
=
function
()
{
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
if
(
t
.
isForceSaveOnUserSave
&&
t
.
IsUserSave
)
{
if
(
t
.
isForceSaveOnUserSave
&&
t
.
IsUserSave
)
{
t
.
forceSave
();
t
.
forceSaveButtonContinue
=
t
.
forceSave
();
}
}
if
(
t
.
collaborativeEditing
.
getCollaborativeEditing
())
{
if
(
t
.
collaborativeEditing
.
getCollaborativeEditing
())
{
// Шлем update для toolbar-а, т.к. когда select в lock ячейке нужно заблокировать toolbar
// Шлем update для toolbar-а, т.к. когда select в lock ячейке нужно заблокировать toolbar
...
@@ -1477,7 +1477,9 @@ var editor;
...
@@ -1477,7 +1477,9 @@ var editor;
t
.
IsUserSave
=
false
;
t
.
IsUserSave
=
false
;
t
.
lastSaveTime
=
null
;
t
.
lastSaveTime
=
null
;
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
if
(
!
t
.
forceSaveButtonContinue
)
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
}
// Обновляем состояние возможности сохранения документа
// Обновляем состояние возможности сохранения документа
t
.
onUpdateDocumentModified
(
History
.
Have_Changes
());
t
.
onUpdateDocumentModified
(
History
.
Have_Changes
());
...
...
common/apiBase.js
View file @
8274a409
...
@@ -141,6 +141,7 @@
...
@@ -141,6 +141,7 @@
this
.
IsUserSave
=
false
;
// Флаг, контролирующий сохранение было сделано пользователем или нет (по умолчанию - нет)
this
.
IsUserSave
=
false
;
// Флаг, контролирующий сохранение было сделано пользователем или нет (по умолчанию - нет)
this
.
isForceSaveOnUserSave
=
false
;
this
.
isForceSaveOnUserSave
=
false
;
this
.
forceSaveButtonTimeout
=
null
;
this
.
forceSaveButtonTimeout
=
null
;
this
.
forceSaveButtonContinue
=
false
;
this
.
forceSaveTimeoutTimeout
=
null
;
this
.
forceSaveTimeoutTimeout
=
null
;
// Version History
// Version History
...
@@ -488,7 +489,7 @@
...
@@ -488,7 +489,7 @@
};
};
baseEditorsApi
.
prototype
.
forceSave
=
function
()
baseEditorsApi
.
prototype
.
forceSave
=
function
()
{
{
this
.
CoAuthoringApi
.
forceSave
()
return
this
.
CoAuthoringApi
.
forceSave
();
};
};
baseEditorsApi
.
prototype
.
asc_setIsForceSaveOnUserSave
=
function
(
val
)
baseEditorsApi
.
prototype
.
asc_setIsForceSaveOnUserSave
=
function
(
val
)
{
{
...
@@ -658,20 +659,35 @@
...
@@ -658,20 +659,35 @@
this
.
CoAuthoringApi
.
onForceSave
=
function
(
data
)
{
this
.
CoAuthoringApi
.
onForceSave
=
function
(
data
)
{
if
(
AscCommon
.
c_oAscForceSaveTypes
.
Button
===
data
.
type
)
{
if
(
AscCommon
.
c_oAscForceSaveTypes
.
Button
===
data
.
type
)
{
if
(
data
.
start
)
{
if
(
data
.
start
)
{
if
(
null
===
t
.
forceSaveButtonTimeout
)
{
if
(
null
===
t
.
forceSaveButtonTimeout
&&
!
t
.
forceSaveButtonContinue
)
{
t
.
sync_StartAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
ForceSaveButton
);
t
.
sync_StartAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
ForceSaveButton
);
}
else
{
}
else
{
clearInterval
(
t
.
forceSaveButtonTimeout
);
clearInterval
(
t
.
forceSaveButtonTimeout
);
}
}
t
.
forceSaveButtonTimeout
=
setInterval
(
function
()
{
t
.
forceSaveButtonTimeout
=
setInterval
(
function
()
{
t
.
forceSaveButtonTimeout
=
null
;
t
.
forceSaveButtonTimeout
=
null
;
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
ForceSaveButton
);
if
(
t
.
forceSaveButtonContinue
)
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
}
else
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
ForceSaveButton
);
}
t
.
forceSaveButtonContinue
=
false
;
},
Asc
.
c_nMaxConversionTime
);
},
Asc
.
c_nMaxConversionTime
);
}
else
if
(
data
.
refuse
)
{
if
(
t
.
forceSaveButtonContinue
)
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
}
t
.
forceSaveButtonContinue
=
false
;
}
else
{
}
else
{
if
(
null
!==
t
.
forceSaveButtonTimeout
)
{
if
(
null
!==
t
.
forceSaveButtonTimeout
)
{
clearInterval
(
t
.
forceSaveButtonTimeout
);
clearInterval
(
t
.
forceSaveButtonTimeout
);
t
.
forceSaveButtonTimeout
=
null
;
t
.
forceSaveButtonTimeout
=
null
;
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
ForceSaveButton
);
if
(
t
.
forceSaveButtonContinue
)
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
}
else
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
ForceSaveButton
);
}
t
.
forceSaveButtonContinue
=
false
;
}
}
}
}
}
else
{
}
else
{
...
...
common/docscoapi.js
View file @
8274a409
...
@@ -364,8 +364,9 @@
...
@@ -364,8 +364,9 @@
CDocsCoApi
.
prototype
.
forceSave
=
function
()
{
CDocsCoApi
.
prototype
.
forceSave
=
function
()
{
if
(
this
.
_CoAuthoringApi
&&
this
.
_onlineWork
)
{
if
(
this
.
_CoAuthoringApi
&&
this
.
_onlineWork
)
{
this
.
_CoAuthoringApi
.
forceSave
();
return
this
.
_CoAuthoringApi
.
forceSave
();
}
}
return
false
;
};
};
CDocsCoApi
.
prototype
.
callback_OnAuthParticipantsChanged
=
function
(
e
,
count
)
{
CDocsCoApi
.
prototype
.
callback_OnAuthParticipantsChanged
=
function
(
e
,
count
)
{
...
@@ -876,11 +877,14 @@
...
@@ -876,11 +877,14 @@
};
};
DocsCoApi
.
prototype
.
forceSave
=
function
()
{
DocsCoApi
.
prototype
.
forceSave
=
function
()
{
var
res
=
false
;
var
newForceSaveButtonTime
=
Math
.
max
(
this
.
lastOtherSaveTime
,
this
.
lastOwnSaveTime
);
var
newForceSaveButtonTime
=
Math
.
max
(
this
.
lastOtherSaveTime
,
this
.
lastOwnSaveTime
);
if
(
this
.
_lastForceSaveButtonTime
<
newForceSaveButtonTime
)
{
if
(
this
.
_lastForceSaveButtonTime
<
newForceSaveButtonTime
)
{
this
.
_lastForceSaveButtonTime
=
newForceSaveButtonTime
;
this
.
_lastForceSaveButtonTime
=
newForceSaveButtonTime
;
this
.
_send
({
'
type
'
:
'
forceSaveStart
'
});
this
.
_send
({
'
type
'
:
'
forceSaveStart
'
});
res
=
true
;
}
}
return
res
;
};
};
DocsCoApi
.
prototype
.
openDocument
=
function
(
data
)
{
DocsCoApi
.
prototype
.
openDocument
=
function
(
data
)
{
...
@@ -994,10 +998,13 @@
...
@@ -994,10 +998,13 @@
};
};
DocsCoApi
.
prototype
.
_onForceSaveStart
=
function
(
data
)
{
DocsCoApi
.
prototype
.
_onForceSaveStart
=
function
(
data
)
{
if
(
data
[
'
code
'
]
===
c_oAscServerCommandErrors
.
NoError
)
{
var
code
=
data
[
'
code
'
];
if
(
code
===
c_oAscServerCommandErrors
.
NoError
)
{
this
.
_lastForceSaveButtonTime
=
data
[
'
time
'
];
this
.
_lastForceSaveButtonTime
=
data
[
'
time
'
];
this
.
onForceSave
({
type
:
c_oAscForceSaveTypes
.
Button
,
start
:
true
});
this
.
onForceSave
({
type
:
c_oAscForceSaveTypes
.
Button
,
start
:
true
});
}
else
if
(
data
[
'
code
'
]
!==
c_oAscServerCommandErrors
.
NotModified
)
{
}
else
if
(
code
===
c_oAscServerCommandErrors
.
NotModified
)
{
this
.
onForceSave
({
type
:
c_oAscForceSaveTypes
.
Button
,
refuse
:
true
});
}
else
{
this
.
onWarning
(
Asc
.
c_oAscError
.
ID
.
Unknown
);
this
.
onWarning
(
Asc
.
c_oAscError
.
ID
.
Unknown
);
}
}
};
};
...
...
slide/api.js
View file @
8274a409
...
@@ -1849,14 +1849,16 @@ background-repeat: no-repeat;\
...
@@ -1849,14 +1849,16 @@ background-repeat: no-repeat;\
{
{
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
if
(
t
.
isForceSaveOnUserSave
&&
t
.
IsUserSave
)
{
if
(
t
.
isForceSaveOnUserSave
&&
t
.
IsUserSave
)
{
t
.
forceSave
();
t
.
forceSave
ButtonContinue
=
t
.
forceSave
();
}
}
// Выставляем, что документ не модифицирован
// Выставляем, что документ не модифицирован
t
.
CheckChangedDocument
();
t
.
CheckChangedDocument
();
t
.
canSave
=
true
;
t
.
canSave
=
true
;
t
.
IsUserSave
=
false
;
t
.
IsUserSave
=
false
;
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
if
(
!
t
.
forceSaveButtonContinue
)
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
}
// Обновляем состояние возможности сохранения документа
// Обновляем состояние возможности сохранения документа
t
.
_onUpdateDocumentCanSave
();
t
.
_onUpdateDocumentCanSave
();
...
...
word/api.js
View file @
8274a409
...
@@ -1831,14 +1831,16 @@ background-repeat: no-repeat;\
...
@@ -1831,14 +1831,16 @@ background-repeat: no-repeat;\
{
{
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
if
(
t
.
isForceSaveOnUserSave
&&
t
.
IsUserSave
)
{
if
(
t
.
isForceSaveOnUserSave
&&
t
.
IsUserSave
)
{
t
.
forceSave
();
t
.
forceSave
ButtonContinue
=
t
.
forceSave
();
}
}
// Выставляем, что документ не модифицирован
// Выставляем, что документ не модифицирован
t
.
CheckChangedDocument
();
t
.
CheckChangedDocument
();
t
.
canSave
=
true
;
t
.
canSave
=
true
;
t
.
IsUserSave
=
false
;
t
.
IsUserSave
=
false
;
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
if
(
!
t
.
forceSaveButtonContinue
)
{
t
.
sync_EndAction
(
c_oAscAsyncActionType
.
Information
,
c_oAscAsyncAction
.
Save
);
}
// Обновляем состояние возможности сохранения документа
// Обновляем состояние возможности сохранения документа
t
.
_onUpdateDocumentCanSave
();
t
.
_onUpdateDocumentCanSave
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment