Commit 2d22ee46 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

ошибки в минимизации при обработке ответов от сервера.

Bug 21493 - [Print] Создается PPTX без расширения вместо PDF

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50868 954022d7-b5bf-4e40-9824-e11837661b57
parent a35046e9
...@@ -519,8 +519,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -519,8 +519,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Меняем тип состояния (на сохранение) // Меняем тип состояния (на сохранение)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Save; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Save;
this._asc_downloadAs(typeFile, function(incomeObject){ this._asc_downloadAs(typeFile, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
that.asc_processSavedFile(incomeObject.data, false); that.asc_processSavedFile(incomeObject["data"], false);
// Меняем тип состояния (на никакое) // Меняем тип состояния (на никакое)
that.advancedOptionsAction = c_oAscAdvancedOptionsAction.None; that.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
that.asc_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs); that.asc_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
...@@ -696,8 +696,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -696,8 +696,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this._asc_sendCommand(function (response) {t._startOpenDocument(response);}, JSON.stringify(v)); this._asc_sendCommand(function (response) {t._startOpenDocument(response);}, JSON.stringify(v));
} else if (this.advancedOptionsAction === c_oAscAdvancedOptionsAction.Save) } else if (this.advancedOptionsAction === c_oAscAdvancedOptionsAction.Save)
this._asc_downloadAs(c_oAscFileType.CSV, function(incomeObject){ this._asc_downloadAs(c_oAscFileType.CSV, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
t.asc_processSavedFile(incomeObject.data, false); t.asc_processSavedFile(incomeObject["data"], false);
// Меняем тип состояния (на никакое) // Меняем тип состояния (на никакое)
t.advancedOptionsAction = c_oAscAdvancedOptionsAction.None; t.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
t.asc_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs); t.asc_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
...@@ -751,9 +751,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -751,9 +751,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} }
else{ else{
var incomeObject = JSON.parse(msg); var incomeObject = JSON.parse(msg);
switch( incomeObject.type ){ switch( incomeObject["type"] ){
case "open": case "open":
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject.data; var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject["data"];
asc_ajax({ asc_ajax({
url: sJsonUrl, url: sJsonUrl,
dataType: "text", dataType: "text",
...@@ -800,7 +800,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -800,7 +800,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} }
} }
asc_ajax({ asc_ajax({
url: incomeObject.data, url: incomeObject["data"],
dataType: "text", dataType: "text",
success: function(result, textStatus) { success: function(result, textStatus) {
var cp = JSON.parse(result); var cp = JSON.parse(result);
...@@ -828,7 +828,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -828,7 +828,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
break; break;
} }
} }
var cp = JSON.parse(incomeObject.data); var cp = JSON.parse(incomeObject["data"]);
oThis.handlers.trigger("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV,cp), oThis.advancedOptionsAction); oThis.handlers.trigger("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV,cp), oThis.advancedOptionsAction);
//var value = {url: oThis.documentUrl, delimiter: c_oAscCsvDelimiter.Comma, codepage: 65001}; //65001 - utf8 //var value = {url: oThis.documentUrl, delimiter: c_oAscCsvDelimiter.Comma, codepage: 65001}; //65001 - utf8
//oThis._asc_sendCommand(callback, "opencsv", oThis.documentTitle, JSON.stringify(value)); //oThis._asc_sendCommand(callback, "opencsv", oThis.documentTitle, JSON.stringify(value));
...@@ -842,20 +842,20 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -842,20 +842,20 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
setTimeout(function(){oThis._asc_sendCommand(callback, JSON.stringify(rData));}, 3000); setTimeout(function(){oThis._asc_sendCommand(callback, JSON.stringify(rData));}, 3000);
break; break;
case "waitsave": case "waitsave":
var rData = {"id": oThis.documentId, "vkey": oThis.documentVKey, "title": oThis.documentTitleWithoutExtention, "c": "chsave", "data": incomeObject.data}; var rData = {"id": oThis.documentId, "vkey": oThis.documentVKey, "title": oThis.documentTitleWithoutExtention, "c": "chsave", "data": incomeObject["data"]};
setTimeout(function(){oThis._asc_sendCommand(callback, JSON.stringify(rData));}, 3000); setTimeout(function(){oThis._asc_sendCommand(callback, JSON.stringify(rData));}, 3000);
break; break;
case "savepart": case "savepart":
var outputData = JSON.parse(incomeObject.data); var outputData = JSON.parse(incomeObject["data"]);
oThis._asc_downloadAs(outputData.format, callback, false, null, outputData.savekey); oThis._asc_downloadAs(outputData["format"], callback, false, null, outputData["savekey"]);
break; break;
case "getsettings": case "getsettings":
if(callback) if(callback)
callback(incomeObject); callback(incomeObject);
break; break;
case "err": case "err":
result = {returnCode: c_oAscError.Level.Critical, val:parseInt(incomeObject.data)}; result = {returnCode: c_oAscError.Level.Critical, val:parseInt(incomeObject["data"])};
oThis.handlers.trigger("asc_onError", asc_mapAscServerErrorToAscError(parseInt(incomeObject.data)), c_oAscError.Level.Critical); oThis.handlers.trigger("asc_onError", asc_mapAscServerErrorToAscError(parseInt(incomeObject["data"])), c_oAscError.Level.Critical);
if(callback) if(callback)
callback(result); callback(result);
break; break;
...@@ -943,8 +943,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -943,8 +943,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
oAdditionalData["innersave"] = true; oAdditionalData["innersave"] = true;
oAdditionalData["savetype"] = "completeall"; oAdditionalData["savetype"] = "completeall";
this._asc_sendCommand (/*callback*/ function(incomeObject){ this._asc_sendCommand (/*callback*/ function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
that.asc_processSavedFile(incomeObject.data, true); that.asc_processSavedFile(incomeObject["data"], true);
}, "mnuSaveAs" + this.cCharDelimiter + JSON.stringify(oAdditionalData) + this.cCharDelimiter + data); }, "mnuSaveAs" + this.cCharDelimiter + JSON.stringify(oAdditionalData) + this.cCharDelimiter + data);
}, },
...@@ -2253,10 +2253,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2253,10 +2253,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var oThis = this; var oThis = this;
this.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage); this.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
this._asc_sendCommand( function(incomeObject){ this._asc_sendCommand( function(incomeObject){
if(null != incomeObject && "imgurl" == incomeObject.type) if(null != incomeObject && "imgurl" == incomeObject["type"])
{ {
var ws = oThis.wb.getWorksheet(); var ws = oThis.wb.getWorksheet();
return ws.objectRender.addImageDrawingObject(incomeObject.data, null); return ws.objectRender.addImageDrawingObject(incomeObject["data"], null);
} }
oThis.handlers.trigger("asc_onEndAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage); oThis.handlers.trigger("asc_onEndAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
}, JSON.stringify(rData) ); }, JSON.stringify(rData) );
......
...@@ -723,8 +723,8 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() ...@@ -723,8 +723,8 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject) asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
{ {
if(null != incomeObject && "getsettings" == incomeObject.type){ if(null != incomeObject && "getsettings" == incomeObject["type"]){
var oSettings = JSON.parse(incomeObject.data); var oSettings = JSON.parse(incomeObject["data"]);
//Set up coauthoring and spellcheker service //Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl']; window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
...@@ -1309,8 +1309,8 @@ asc_docs_api.prototype.asc_Print = function(){ ...@@ -1309,8 +1309,8 @@ asc_docs_api.prototype.asc_Print = function(){
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);
var editor = this; var editor = this;
_downloadAs(this, c_oAscFileType.PDF, function(incomeObject){ _downloadAs(this, c_oAscFileType.PDF, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject.data, false); editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);}, true); editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);}, true);
} }
asc_docs_api.prototype.Undo = function(){ asc_docs_api.prototype.Undo = function(){
...@@ -1390,8 +1390,8 @@ asc_docs_api.prototype.asc_DownloadAs = function(typeFile){//передаем ч ...@@ -1390,8 +1390,8 @@ asc_docs_api.prototype.asc_DownloadAs = function(typeFile){//передаем ч
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
var editor = this; var editor = this;
_downloadAs(this, typeFile, function(incomeObject){ _downloadAs(this, typeFile, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject.data, false); editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);}, true); editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);}, true);
} }
asc_docs_api.prototype.Resize = function(){ asc_docs_api.prototype.Resize = function(){
...@@ -1715,8 +1715,8 @@ asc_docs_api.prototype.onSaveCallback = function (e) { ...@@ -1715,8 +1715,8 @@ asc_docs_api.prototype.onSaveCallback = function (e) {
oAdditionalData["savetype"] = "completeall"; oAdditionalData["savetype"] = "completeall";
var sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(oAdditionalData) + cCharDelimiter + data; var sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(oAdditionalData) + cCharDelimiter + data;
sendCommand(editor, function(incomeObject){ sendCommand(editor, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject.data, true); editor.processSavedFile(incomeObject["data"], true);
}, sData); }, sData);
// Пересылаем свои изменения (ToDo) // Пересылаем свои изменения (ToDo)
...@@ -2893,8 +2893,8 @@ asc_docs_api.prototype.AddImageUrl = function(url){ ...@@ -2893,8 +2893,8 @@ asc_docs_api.prototype.AddImageUrl = function(url){
var oThis = this; var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
sendCommand(this, function(incomeObject){ sendCommand(this, function(incomeObject){
if(null != incomeObject && "imgurl" == incomeObject.type) if(null != incomeObject && "imgurl" == incomeObject["type"])
oThis.AddImageUrlAction(incomeObject.data); oThis.AddImageUrlAction(incomeObject["data"]);
oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
}, JSON.stringify(rData) ); }, JSON.stringify(rData) );
} }
...@@ -4793,9 +4793,9 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -4793,9 +4793,9 @@ function sendCommand(editor, fCallback, rdata){
}, },
success: function(msg){ success: function(msg){
var incomeObject = JSON.parse(msg); var incomeObject = JSON.parse(msg);
switch(incomeObject.type){ switch(incomeObject["type"]){
case "open": case "open":
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject.data; var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject["data"];
asc_ajax({ asc_ajax({
url: sJsonUrl, url: sJsonUrl,
dataType: "text", dataType: "text",
...@@ -4832,9 +4832,9 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -4832,9 +4832,9 @@ function sendCommand(editor, fCallback, rdata){
}); });
break; break;
case "waitopen": case "waitopen":
if (incomeObject.data) if (incomeObject["data"])
{ {
editor._lastConvertProgress = incomeObject.data / 2; editor._lastConvertProgress = incomeObject["data"] / 2;
editor.sync_SendProgress(editor._lastConvertProgress); editor.sync_SendProgress(editor._lastConvertProgress);
} }
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Presentation, "c":"chopen"}; var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Presentation, "c":"chopen"};
...@@ -4845,19 +4845,19 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -4845,19 +4845,19 @@ function sendCommand(editor, fCallback, rdata){
fCallback(incomeObject); fCallback(incomeObject);
break; break;
case "waitsave": case "waitsave":
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject.data}; var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject["data"]};
setTimeout( function(){sendCommand(editor, fCallback, JSON.stringify(rData))}, 3000); setTimeout( function(){sendCommand(editor, fCallback, JSON.stringify(rData))}, 3000);
break; break;
case "savepart": case "savepart":
var outputData = JSON.parse(incomeObject.data); var outputData = JSON.parse(incomeObject["data"]);
_downloadAs(editor, outputData.format, fCallback, false, outputData.savekey); _downloadAs(editor, outputData["format"], fCallback, false, outputData["savekey"]);
break; break;
case "getsettings": case "getsettings":
if(fCallback) if(fCallback)
fCallback(incomeObject); fCallback(incomeObject);
break; break;
case "err": case "err":
editor.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(parseInt(incomeObject.data)),c_oAscError.Level.Critical); editor.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(parseInt(incomeObject["data"])),c_oAscError.Level.Critical);
if(fCallback) if(fCallback)
fCallback(incomeObject); fCallback(incomeObject);
break; break;
......
...@@ -842,8 +842,8 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() ...@@ -842,8 +842,8 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject) asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
{ {
if(null != incomeObject && "getsettings" == incomeObject.type){ if(null != incomeObject && "getsettings" == incomeObject["type"]){
var oSettings = JSON.parse(incomeObject.data); var oSettings = JSON.parse(incomeObject["data"]);
//Set up coauthoring and spellcheker service //Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl']; window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
...@@ -2464,8 +2464,8 @@ asc_docs_api.prototype.asc_Print = function() ...@@ -2464,8 +2464,8 @@ asc_docs_api.prototype.asc_Print = function()
} }
else else
_downloadAs(this, c_oAscFileType.PDF, function(incomeObject){ _downloadAs(this, c_oAscFileType.PDF, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject.data, false); editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);}, true); editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);}, true);
} }
} }
...@@ -2574,8 +2574,8 @@ function OnSave_Callback(e) ...@@ -2574,8 +2574,8 @@ function OnSave_Callback(e)
var sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(oAdditionalData) + cCharDelimiter + data; var sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(oAdditionalData) + cCharDelimiter + data;
sendCommand(editor, function(incomeObject){ sendCommand(editor, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject.data, true); editor.processSavedFile(incomeObject["data"], true);
}, sData); }, sData);
} }
...@@ -2615,8 +2615,8 @@ asc_docs_api.prototype.asc_DownloadAs = function(typeFile){//передаем ч ...@@ -2615,8 +2615,8 @@ asc_docs_api.prototype.asc_DownloadAs = function(typeFile){//передаем ч
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
var editor = this; var editor = this;
_downloadAs(this, typeFile, function(incomeObject){ _downloadAs(this, typeFile, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type) if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject.data, false); editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);}, true); editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);}, true);
} }
asc_docs_api.prototype.Resize = function(){ asc_docs_api.prototype.Resize = function(){
...@@ -4833,8 +4833,8 @@ asc_docs_api.prototype.AddImageUrl = function(url, imgProp) ...@@ -4833,8 +4833,8 @@ asc_docs_api.prototype.AddImageUrl = function(url, imgProp)
var oThis = this; var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
sendCommand( oThis, function(incomeObject){ sendCommand( oThis, function(incomeObject){
if(null != incomeObject && "imgurl" ==incomeObject.type) if(null != incomeObject && "imgurl" ==incomeObject["type"])
oThis.AddImageUrlAction(incomeObject.data, imgProp); oThis.AddImageUrlAction(incomeObject["data"], imgProp);
oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
}, JSON.stringify(rData) ); }, JSON.stringify(rData) );
} }
...@@ -6773,9 +6773,9 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -6773,9 +6773,9 @@ function sendCommand(editor, fCallback, rdata){
}, },
success: function(msg){ success: function(msg){
var incomeObject = JSON.parse(msg); var incomeObject = JSON.parse(msg);
switch(incomeObject.type){ switch(incomeObject["type"]){
case "open": case "open":
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject.data; var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject["data"];
asc_ajax({ asc_ajax({
url: sJsonUrl, url: sJsonUrl,
dataType: "text", dataType: "text",
...@@ -6812,9 +6812,9 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -6812,9 +6812,9 @@ function sendCommand(editor, fCallback, rdata){
sendCommand(editor, fCallback, JSON.stringify(rData)) sendCommand(editor, fCallback, JSON.stringify(rData))
break; break;
case "waitopen": case "waitopen":
if (incomeObject.data) if (incomeObject["data"])
{ {
editor._lastConvertProgress = incomeObject.data / 2; editor._lastConvertProgress = incomeObject["data"] / 2;
editor.sync_SendProgress(editor._lastConvertProgress); editor.sync_SendProgress(editor._lastConvertProgress);
} }
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Word, "c":"chopen"}; var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Word, "c":"chopen"};
...@@ -6835,20 +6835,20 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -6835,20 +6835,20 @@ function sendCommand(editor, fCallback, rdata){
break; break;
case "waitsave": case "waitsave":
{ {
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject.data}; var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject["data"]};
setTimeout( function(){sendCommand(editor, fCallback, JSON.stringify(rData))}, 3000); setTimeout( function(){sendCommand(editor, fCallback, JSON.stringify(rData))}, 3000);
} }
break; break;
case "savepart": case "savepart":
var outputData = JSON.parse(incomeObject.data); var outputData = JSON.parse(incomeObject["data"]);
_downloadAs(editor, outputData.format, fCallback, false, outputData.savekey); _downloadAs(editor, outputData["format"], fCallback, false, outputData["savekey"]);
break; break;
case "getsettings": case "getsettings":
if(fCallback) if(fCallback)
fCallback(incomeObject); fCallback(incomeObject);
break; break;
case "err": case "err":
editor.asc_fireCallback("asc_onError", _mapAscServerErrorToAscError(parseInt(incomeObject.data)), c_oAscError.Level.Critical); editor.asc_fireCallback("asc_onError", _mapAscServerErrorToAscError(parseInt(incomeObject["data"])), c_oAscError.Level.Critical);
if(fCallback) if(fCallback)
fCallback(incomeObject); fCallback(incomeObject);
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