Commit 1c971f55 authored by Alexander.Trofimov's avatar Alexander.Trofimov

LongActionCallbacks, LongActionCallbacksParams, checkLongActionCallback to baseEditorsApi

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66494 954022d7-b5bf-4e40-9824-e11837661b57
parent 44c2307b
......@@ -43,6 +43,8 @@ function baseEditorsApi(name) {
// Long action
this.IsLongActionCurrent = 0;
this.LongActionCallbacks = [];
this.LongActionCallbacksParams = [];
// AutoSave
this.autoSaveGap = 0; // Интервал автосохранения (0 - означает, что автосохранения нет) в милесекундах
......@@ -193,6 +195,15 @@ baseEditorsApi.prototype.decrementCounterLongAction = function() {
this.LongActionCallbacksParams.splice(0, _length);
}
};
baseEditorsApi.prototype.checkLongActionCallback = function(_callback, _param) {
if (this.isLongAction()) {
this.LongActionCallbacks[this.LongActionCallbacks.length] = _callback;
this.LongActionCallbacksParams[this.LongActionCallbacksParams.length] = _param;
return false;
} else {
return true;
}
};
// Open
baseEditorsApi.prototype._onOpenCommand = function(data) {
};
......
......@@ -357,7 +357,7 @@ CCollaborativeEditing.prototype.OnCallback_AskLock = function(result)
{
if (true === CollaborativeEditing.m_bGlobalLock)
{
if (false == editor.asc_CheckLongActionCallback(CollaborativeEditing.OnCallback_AskLock, result))
if (false == editor.checkLongActionCallback(CollaborativeEditing.OnCallback_AskLock, result))
return;
// Снимаем глобальный лок
......
......@@ -88,8 +88,6 @@ function asc_docs_api(name)
//выставляем тип copypaste
g_bIsDocumentCopyPaste = false;
this.LongActionCallbacks = [];
this.LongActionCallbacksParams = [];
if (window.editor == undefined)
{
......@@ -1343,20 +1341,6 @@ asc_docs_api.prototype.sync_EndAction = function(type, id){
}
};
asc_docs_api.prototype.asc_CheckLongActionCallback = function(_callback, _param)
{
if (this.isLongAction())
{
this.LongActionCallbacks[this.LongActionCallbacks.length] = _callback;
this.LongActionCallbacksParams[this.LongActionCallbacksParams.length] = _param;
return false;
}
else
{
return true;
}
};
asc_docs_api.prototype.sync_AddURLCallback = function(){
this.asc_fireCallback("asc_onAddURL");
};
......
......@@ -92,7 +92,6 @@ asc_docs_api.prototype['sync_SaveCallBack'] = asc_docs_api.prototype.sync_SaveCa
asc_docs_api.prototype['sync_DownloadAsCallBack'] = asc_docs_api.prototype.sync_DownloadAsCallBack;
asc_docs_api.prototype['sync_StartAction'] = asc_docs_api.prototype.sync_StartAction;
asc_docs_api.prototype['sync_EndAction'] = asc_docs_api.prototype.sync_EndAction;
asc_docs_api.prototype['asc_CheckLongActionCallback'] = asc_docs_api.prototype.asc_CheckLongActionCallback;
asc_docs_api.prototype['sync_AddURLCallback'] = asc_docs_api.prototype.sync_AddURLCallback;
asc_docs_api.prototype['sync_ErrorCallback'] = asc_docs_api.prototype.sync_ErrorCallback;
asc_docs_api.prototype['sync_HelpCallback'] = asc_docs_api.prototype.sync_HelpCallback;
......
......@@ -250,7 +250,7 @@ CWordCollaborativeEditing.prototype.OnCallback_AskLock = function(result)
{
// Здесь проверяем есть ли длинная операция, если она есть, то до ее окончания нельзя делать
// Undo, иначе точка истории уберется, а изменения допишутся в предыдущую.
if (false == oEditor.asc_CheckLongActionCallback(oThis.OnCallback_AskLock, result))
if (false == oEditor.checkLongActionCallback(oThis.OnCallback_AskLock, result))
return;
// Снимаем глобальный лок
......
......@@ -357,9 +357,6 @@ function asc_docs_api(name)
g_bIsDocumentCopyPaste = true;
this.DocumentReaderMode = null;
this.LongActionCallbacks = [];
this.LongActionCallbacksParams = [];
this.ParcedDocument = false;
this.isStartCoAuthoringOnEndLoad = false; // Подсоединились раньше, чем документ загрузился
......@@ -2168,20 +2165,6 @@ asc_docs_api.prototype.sync_EndAction = function(type, id){
}
};
asc_docs_api.prototype.asc_CheckLongActionCallback = function(_callback, _param)
{
if (this.isLongAction())
{
this.LongActionCallbacks[this.LongActionCallbacks.length] = _callback;
this.LongActionCallbacksParams[this.LongActionCallbacksParams.length] = _param;
return false;
}
else
{
return true;
}
};
asc_docs_api.prototype.sync_AddURLCallback = function(){
this.asc_fireCallback("asc_onAddURL");
};
......
......@@ -188,7 +188,6 @@ asc_docs_api.prototype['sync_SaveCallBack'] = asc_docs_api.prototype.sync_SaveCa
asc_docs_api.prototype['sync_DownloadAsCallBack'] = asc_docs_api.prototype.sync_DownloadAsCallBack;
asc_docs_api.prototype['sync_StartAction'] = asc_docs_api.prototype.sync_StartAction;
asc_docs_api.prototype['sync_EndAction'] = asc_docs_api.prototype.sync_EndAction;
asc_docs_api.prototype['asc_CheckLongActionCallback'] = asc_docs_api.prototype.asc_CheckLongActionCallback;
asc_docs_api.prototype['sync_AddURLCallback'] = asc_docs_api.prototype.sync_AddURLCallback;
asc_docs_api.prototype['sync_ErrorCallback'] = asc_docs_api.prototype.sync_ErrorCallback;
asc_docs_api.prototype['sync_HelpCallback'] = asc_docs_api.prototype.sync_HelpCallback;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment