Commit c71db6ea authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил advancedOptionsAction в презентациях (только Open).

При проверке на ошибку проверяем тип состояния.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63197 954022d7-b5bf-4e40-9824-e11837661b57
parent 0dc9b872
...@@ -935,7 +935,7 @@ parserHelper.prototype.setDigitSeparator = function( sep ){ ...@@ -935,7 +935,7 @@ parserHelper.prototype.setDigitSeparator = function( sep ){
rx_array = new RegExp("^\\{(([+-]?\\d*(\\d|"+digitSeparatorDef+")\\d*([eE][+-]?\\d+)?)?(\"((\"\"|[^\"])*)\")?(#NULL!|#DIV\/0!|#VALUE!|#REF!|#NAME\\?|#NUM!|#UNSUPPORTED_FUNCTION!|#N\/A|#GETTING_DATA|FALSE|TRUE)?["+arrayRowSeparatorDef+"\\"+arrayColSeparatorDef +"]?)*\\}","i"); rx_array = new RegExp("^\\{(([+-]?\\d*(\\d|"+digitSeparatorDef+")\\d*([eE][+-]?\\d+)?)?(\"((\"\"|[^\"])*)\")?(#NULL!|#DIV\/0!|#VALUE!|#REF!|#NAME\\?|#NUM!|#UNSUPPORTED_FUNCTION!|#N\/A|#GETTING_DATA|FALSE|TRUE)?["+arrayRowSeparatorDef+"\\"+arrayColSeparatorDef +"]?)*\\}","i");
rx_arraySeparators = new RegExp("^ *["+arrayRowSeparatorDef+"\\"+arrayColSeparatorDef+"] *"); rx_arraySeparators = new RegExp("^ *["+arrayRowSeparatorDef+"\\"+arrayColSeparatorDef+"] *");
}*/ }*/
} };
var parserHelp = new parserHelper(); var parserHelp = new parserHelper();
......
...@@ -124,6 +124,9 @@ function asc_docs_api(name) ...@@ -124,6 +124,9 @@ function asc_docs_api(name)
this.OpenDocumentProgress = new CDocOpenProgress(); this.OpenDocumentProgress = new CDocOpenProgress();
this._lastConvertProgress = 0; this._lastConvertProgress = 0;
// Тип состояния на данный момент (сохранение, открытие или никакое)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
// CoAuthoring and Chat // CoAuthoring and Chat
this.User = undefined; this.User = undefined;
this.CoAuthoringApi = new CDocsCoApi(); this.CoAuthoringApi = new CDocsCoApi();
...@@ -840,6 +843,9 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -840,6 +843,9 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName); window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName);
} }
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (this.DocInfo.get_OfflineApp() === true) if (this.DocInfo.get_OfflineApp() === true)
{ {
this.OfflineAppDocumentStartLoad(); this.OfflineAppDocumentStartLoad();
...@@ -4007,6 +4013,9 @@ asc_docs_api.prototype.OpenDocumentEndCallback = function() ...@@ -4007,6 +4013,9 @@ asc_docs_api.prototype.OpenDocumentEndCallback = function()
if (this.isViewMode) if (this.isViewMode)
this.SetViewMode(true); this.SetViewMode(true);
// Меняем тип состояния (на никакое)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
}; };
asc_docs_api.prototype.asyncFontStartLoaded = function() asc_docs_api.prototype.asyncFontStartLoaded = function()
...@@ -5094,7 +5103,7 @@ asc_docs_api.prototype.sync_ContextMenuCallback = function(Data) ...@@ -5094,7 +5103,7 @@ asc_docs_api.prototype.sync_ContextMenuCallback = function(Data)
this.asc_fireCallback("asc_onContextMenu", Data); this.asc_fireCallback("asc_onContextMenu", Data);
}; };
function _sendCommandCallback (fCallback, error, result, rdata) { function _sendCommandCallback (fCallback, error, result) {
if (error || !result) { if (error || !result) {
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical); editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback) if(fCallback)
...@@ -5133,8 +5142,7 @@ function _sendCommandCallback (fCallback, error, result, rdata) { ...@@ -5133,8 +5142,7 @@ function _sendCommandCallback (fCallback, error, result, rdata) {
setTimeout( function(){sendCommand2(fCallback, _sendCommandCallback, rData)}, 3000); setTimeout( function(){sendCommand2(fCallback, _sendCommandCallback, rData)}, 3000);
break; break;
case "save": case "save":
if(fCallback) if(fCallback) fCallback(result);
fCallback(result);
break; break;
case "waitsave": case "waitsave":
rData = { rData = {
...@@ -5148,21 +5156,18 @@ function _sendCommandCallback (fCallback, error, result, rdata) { ...@@ -5148,21 +5156,18 @@ function _sendCommandCallback (fCallback, error, result, rdata) {
setTimeout( function(){sendCommand2(fCallback, _sendCommandCallback, rData)}, 3000); setTimeout( function(){sendCommand2(fCallback, _sendCommandCallback, rData)}, 3000);
break; break;
case "getsettings": case "getsettings":
if(fCallback) if(fCallback) fCallback(result);
fCallback(result);
break; break;
case "err": case "err":
var nErrorLevel = c_oAscError.Level.NoCritical; var nErrorLevel = c_oAscError.Level.NoCritical;
//todo передалеть работу с callback //todo передалеть работу с callback
if("getsettings" == rdata["c"] || "open" == rdata["c"] || "chopen" == rdata["c"] || "create" == rdata["c"]) if (c_oAscAdvancedOptionsAction.Open === editor.advancedOptionsAction)
nErrorLevel = c_oAscError.Level.Critical; nErrorLevel = c_oAscError.Level.Critical;
editor.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(result["data"])), nErrorLevel); editor.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(result["data"] >> 0), nErrorLevel);
if(fCallback) if (fCallback) fCallback(result);
fCallback(result);
break; break;
default: default:
if(fCallback) if(fCallback) fCallback(result);
fCallback(result);
break; break;
} }
} }
......
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