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
fac01b2d
Commit
fac01b2d
authored
Mar 28, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for bug 34575. use asc_Save
parent
35478148
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
27 deletions
+54
-27
cell/api.js
cell/api.js
+11
-5
common/apiBase.js
common/apiBase.js
+21
-20
slide/api.js
slide/api.js
+11
-1
word/api.js
word/api.js
+11
-1
No files found.
cell/api.js
View file @
fac01b2d
...
...
@@ -311,17 +311,18 @@ var editor;
}
this
.
_asc_downloadAs
(
typeFile
,
c_oAscAsyncAction
.
DownloadAs
,
{
downloadType
:
bIsDownloadEvent
?
DownloadType
.
Download
:
DownloadType
.
None
});
};
spreadsheet_api
.
prototype
.
saveCheck
=
function
()
{
return
!
(
!
this
.
canSave
||
this
.
isChartEditor
||
c_oAscAdvancedOptionsAction
.
None
!==
this
.
advancedOptionsAction
||
this
.
isLongAction
());
};
spreadsheet_api
.
prototype
.
asc_Save
=
function
(
isAutoSave
)
{
this
.
IsUserSave
=
!
isAutoSave
;
if
(
!
this
.
canSave
||
this
.
isChartEditor
||
c_oAscAdvancedOptionsAction
.
None
!==
this
.
advancedOptionsAction
||
this
.
isLongAction
())
{
return
;
if
(
!
this
.
saveCheck
())
{
return
false
;
}
else
if
(
!
(
this
.
asc_isDocumentCanSave
()
||
this
.
collaborativeEditing
.
haveOtherChanges
()
||
this
.
canUnlockDocument
))
{
if
(
this
.
isForceSaveOnUserSave
&&
this
.
IsUserSave
)
{
this
.
forceSave
();
}
return
;
return
false
;
}
if
(
this
.
IsUserSave
)
{
...
...
@@ -338,6 +339,7 @@ var editor;
this
.
CoAuthoringApi
.
askSaveChanges
(
function
(
e
)
{
t
.
onSaveCallback
(
e
);
});
return
true
;
};
spreadsheet_api
.
prototype
.
asc_Print
=
function
(
adjustPrint
,
bIsDownloadEvent
)
{
...
...
@@ -1506,6 +1508,10 @@ var editor;
if
(
undefined
!==
window
[
"
AscDesktopEditor
"
])
{
window
[
"
AscDesktopEditor
"
][
"
OnSave
"
]();
}
if
(
t
.
disconnectOnSave
)
{
t
.
CoAuthoringApi
.
disconnect
(
t
.
disconnectOnSave
.
code
,
t
.
disconnectOnSave
.
reason
);
t
.
disconnectOnSave
=
null
;
}
};
// Пересылаем свои изменения
this
.
collaborativeEditing
.
sendChanges
(
this
.
IsUserSave
);
...
...
common/apiBase.js
View file @
fac01b2d
...
...
@@ -143,6 +143,7 @@
this
.
forceSaveButtonTimeout
=
null
;
this
.
forceSaveButtonContinue
=
false
;
this
.
forceSaveTimeoutTimeout
=
null
;
this
.
disconnectOnSave
=
null
;
// Version History
this
.
VersionHistory
=
null
;
// Объект, который отвечает за точку в списке версий
...
...
@@ -648,23 +649,10 @@
extendSession
=
false
;
}
if
(
!
extendSession
)
{
if
(
AscCommon
.
History
.
Have_Changes
())
{
if
(
t
.
asc_Save
())
{
//enter view mode because save async
t
.
sendEvent
(
'
asc_onCoAuthoringDisconnect
'
);
t
.
asc_setViewMode
(
true
);
t
.
CoAuthoringApi
.
onUnSaveLock
=
function
()
{
t
.
CoAuthoringApi
.
onUnSaveLock
=
null
;
t
.
CoAuthoringApi
.
disconnect
(
code
,
reason
);
};
if
(
t
.
collaborativeEditing
&&
t
.
collaborativeEditing
.
applyChanges
)
{
t
.
collaborativeEditing
.
applyChanges
();
t
.
collaborativeEditing
.
sendChanges
();
}
else
{
AscCommon
.
CollaborativeEditing
.
Apply_Changes
();
AscCommon
.
CollaborativeEditing
.
Send_Changes
();
}
t
.
setViewModeDisconnect
();
t
.
disconnectOnSave
=
{
code
:
code
,
reason
:
reason
};
}
else
{
t
.
CoAuthoringApi
.
disconnect
(
code
,
reason
);
}
...
...
@@ -745,10 +733,7 @@
}
if
(
null
!=
errorCode
)
{
// Посылаем наверх эвент об отключении от сервера
t
.
sendEvent
(
'
asc_onCoAuthoringDisconnect
'
);
// И переходим в режим просмотра т.к. мы не можем сохранить файл
t
.
asc_setViewMode
(
true
);
t
.
setViewModeDisconnect
();
t
.
sendEvent
(
'
asc_onError
'
,
errorCode
,
c_oAscError
.
Level
.
NoCritical
);
}
};
...
...
@@ -1335,6 +1320,9 @@
if
(
this
.
isEmbedVersion
)
return
0
;
if
(
!
this
.
saveCheck
())
return
0
;
return
new
Date
().
getTime
()
-
this
.
lastWorkTime
;
};
...
...
@@ -1343,6 +1331,19 @@
this
.
lastWorkTime
=
new
Date
().
getTime
();
};
baseEditorsApi
.
prototype
.
setViewModeDisconnect
=
function
()
{
// Посылаем наверх эвент об отключении от сервера
this
.
sendEvent
(
'
asc_onCoAuthoringDisconnect
'
);
// И переходим в режим просмотра т.к. мы не можем сохранить файл
this
.
asc_setViewMode
(
true
);
};
baseEditorsApi
.
prototype
.
saveCheck
=
function
()
{
return
false
;
};
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
'
AscCommon
'
].
baseEditorsApi
=
baseEditorsApi
;
...
...
slide/api.js
View file @
fac01b2d
...
...
@@ -1869,6 +1869,10 @@ background-repeat: no-repeat;\
{
window
[
"
AscDesktopEditor
"
][
"
OnSave
"
]();
}
if
(
t
.
disconnectOnSave
)
{
t
.
CoAuthoringApi
.
disconnect
(
t
.
disconnectOnSave
.
code
,
t
.
disconnectOnSave
.
reason
);
t
.
disconnectOnSave
=
null
;
}
};
var
CursorInfo
=
null
;
if
(
true
===
AscCommon
.
CollaborativeEditing
.
Is_Fast
())
...
...
@@ -1952,10 +1956,14 @@ background-repeat: no-repeat;\
}
}
};
asc_docs_api
.
prototype
.
saveCheck
=
function
()
{
return
true
===
this
.
canSave
&&
!
this
.
isLongAction
();
}
asc_docs_api
.
prototype
.
asc_Save
=
function
(
isAutoSave
,
isUndoRequest
)
{
var
res
=
false
;
this
.
IsUserSave
=
!
isAutoSave
;
if
(
t
rue
===
this
.
canSave
&&
!
this
.
isLongAction
())
if
(
t
his
.
saveCheck
())
{
if
(
this
.
asc_isDocumentCanSave
()
||
History
.
Have_Changes
()
||
AscCommon
.
CollaborativeEditing
.
Have_OtherChanges
()
||
true
===
isUndoRequest
||
this
.
canUnlockDocument
)
...
...
@@ -1967,12 +1975,14 @@ background-repeat: no-repeat;\
{
t
.
onSaveCallback
(
e
,
isUndoRequest
);
});
res
=
true
;
}
else
if
(
this
.
isForceSaveOnUserSave
&&
this
.
IsUserSave
)
{
this
.
forceSave
();
}
}
return
res
;
};
asc_docs_api
.
prototype
.
asc_DownloadAs
=
function
(
typeFile
,
bIsDownloadEvent
)
{
//передаем число соответствующее своему формату.
...
...
word/api.js
View file @
fac01b2d
...
...
@@ -1852,6 +1852,10 @@ background-repeat: no-repeat;\
{
window
[
"
AscDesktopEditor
"
][
"
OnSave
"
]();
}
if
(
t
.
disconnectOnSave
)
{
t
.
CoAuthoringApi
.
disconnect
(
t
.
disconnectOnSave
.
code
,
t
.
disconnectOnSave
.
reason
);
t
.
disconnectOnSave
=
null
;
}
};
var
CursorInfo
=
null
;
...
...
@@ -1933,10 +1937,14 @@ background-repeat: no-repeat;\
}
}
};
asc_docs_api
.
prototype
.
saveCheck
=
function
()
{
return
true
===
this
.
canSave
&&
!
this
.
isLongAction
();
}
asc_docs_api
.
prototype
.
asc_Save
=
function
(
isAutoSave
,
isUndoRequest
)
{
var
res
=
false
;
this
.
IsUserSave
=
!
isAutoSave
;
if
(
t
rue
===
this
.
canSave
&&
!
this
.
isLongAction
())
if
(
t
his
.
saveCheck
())
{
if
(
this
.
asc_isDocumentCanSave
()
||
History
.
Have_Changes
()
||
AscCommon
.
CollaborativeEditing
.
Have_OtherChanges
()
||
true
===
isUndoRequest
||
this
.
canUnlockDocument
)
...
...
@@ -1948,12 +1956,14 @@ background-repeat: no-repeat;\
{
t
.
onSaveCallback
(
e
,
isUndoRequest
);
});
res
=
true
;
}
else
if
(
this
.
isForceSaveOnUserSave
&&
this
.
IsUserSave
)
{
this
.
forceSave
();
}
}
return
res
;
};
asc_docs_api
.
prototype
.
asc_DownloadOrigin
=
function
(
bIsDownloadEvent
)
{
...
...
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