Commit d5a1c375 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 36162

delete asc_LoadEmptyDocument, now use asc_LoadDocument with url = offlineMode
delete set relative path to document in offlineMode
in offlineMode load empty document with flag chartEditor (previously loaded deprecated test document).
parent ead0ea78
...@@ -284,11 +284,6 @@ var editor; ...@@ -284,11 +284,6 @@ var editor;
return AscCommon.g_oDefaultCultureInfo.LCID; return AscCommon.g_oDefaultCultureInfo.LCID;
}; };
spreadsheet_api.prototype.asc_LoadEmptyDocument = function() {
this.CoAuthoringApi.auth(this.getViewMode());
this.onEndLoadFile(true);
};
spreadsheet_api.prototype._openDocument = function(data) { spreadsheet_api.prototype._openDocument = function(data) {
var wb = new AscCommonExcel.Workbook(this.handlers, this); var wb = new AscCommonExcel.Workbook(this.handlers, this);
this.initGlobalObjects(wb); this.initGlobalObjects(wb);
...@@ -676,11 +671,8 @@ var editor; ...@@ -676,11 +671,8 @@ var editor;
}; };
spreadsheet_api.prototype._OfflineAppDocumentEndLoad = function() { spreadsheet_api.prototype._OfflineAppDocumentEndLoad = function() {
var data = getTestWorkbook(); this.isChartEditor = true;
var sData = data + ""; this.onEndLoadFile(AscCommonExcel.getEmptyWorkbook());
if (AscCommon.c_oSerFormat.Signature === sData.substring(0, AscCommon.c_oSerFormat.Signature.length)) {
this.openDocument(sData);
}
}; };
spreadsheet_api.prototype._asc_save2 = function () { spreadsheet_api.prototype._asc_save2 = function () {
...@@ -942,15 +934,6 @@ var editor; ...@@ -942,15 +934,6 @@ var editor;
spreadsheet_api.prototype.openDocument = function(sData) { spreadsheet_api.prototype.openDocument = function(sData) {
var t = this; var t = this;
if (true === sData) {
// Empty Document
sData = AscCommonExcel.getEmptyWorkbook() + "";
if (sData.length && (AscCommon.c_oSerFormat.Signature === sData.substring(0, AscCommon.c_oSerFormat.Signature.length))) {
this.isChartEditor = true;
} else {
return;
}
}
this.wbModel = this._openDocument(sData); this.wbModel = this._openDocument(sData);
this.openDocumentFromZip(this.wbModel, AscCommon.g_oDocumentUrls.getUrl('Editor.xlsx')).then(function() { this.openDocumentFromZip(this.wbModel, AscCommon.g_oDocumentUrls.getUrl('Editor.xlsx')).then(function() {
t.FontLoader.LoadDocumentFonts(t.wbModel.generateFontMap2()); t.FontLoader.LoadDocumentFonts(t.wbModel.generateFontMap2());
...@@ -3561,7 +3544,6 @@ var editor; ...@@ -3561,7 +3544,6 @@ var editor;
prot["asc_getLocale"] = prot.asc_getLocale; prot["asc_getLocale"] = prot.asc_getLocale;
prot["asc_getEditorPermissions"] = prot.asc_getEditorPermissions; prot["asc_getEditorPermissions"] = prot.asc_getEditorPermissions;
prot["asc_LoadDocument"] = prot.asc_LoadDocument; prot["asc_LoadDocument"] = prot.asc_LoadDocument;
prot["asc_LoadEmptyDocument"] = prot.asc_LoadEmptyDocument;
prot["asc_DownloadAs"] = prot.asc_DownloadAs; prot["asc_DownloadAs"] = prot.asc_DownloadAs;
prot["asc_Save"] = prot.asc_Save; prot["asc_Save"] = prot.asc_Save;
prot["forceSave"] = prot.forceSave; prot["forceSave"] = prot.forceSave;
......
...@@ -280,7 +280,6 @@ ...@@ -280,7 +280,6 @@
if (AscCommon.offlineMode === this.documentUrl) if (AscCommon.offlineMode === this.documentUrl)
{ {
this.documentUrl = '/sdkjs/' + this._editorNameById() + '/document/';
this.DocInfo.put_OfflineApp(true); this.DocInfo.put_OfflineApp(true);
} }
...@@ -469,16 +468,7 @@ ...@@ -469,16 +468,7 @@
}; };
baseEditorsApi.prototype._OfflineAppDocumentStartLoad = function() baseEditorsApi.prototype._OfflineAppDocumentStartLoad = function()
{ {
var t = this; this._OfflineAppDocumentEndLoad();
var scriptElem = document.createElement('script');
scriptElem.onload = scriptElem.onerror = function()
{
t._OfflineAppDocumentEndLoad();
};
scriptElem.setAttribute('src', this.documentUrl + 'editor.js');
scriptElem.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem);
}; };
baseEditorsApi.prototype._onOpenCommand = function(data) baseEditorsApi.prototype._onOpenCommand = function(data)
{ {
......
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