Commit 519451d7 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

add g_fLoadFileContent

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66773 954022d7-b5bf-4e40-9824-e11837661b57
parent 433c8fee
...@@ -181,6 +181,17 @@ function g_fSaveWithParts(fSendCommand, fCallback, fCallbackRequest, oAdditional ...@@ -181,6 +181,17 @@ function g_fSaveWithParts(fSendCommand, fCallback, fCallbackRequest, oAdditional
}, oAdditionalData, dataContainer); }, oAdditionalData, dataContainer);
} }
function g_fLoadFileContent(url, callback) {
asc_ajax({
url: url,
dataType: "text",
success: callback,
error: function() {
callback(null);
}
});
}
function g_fGetJSZipUtils() { function g_fGetJSZipUtils() {
return window['JSZipUtils'] ? window['JSZipUtils'] : require('jsziputils'); return window['JSZipUtils'] ? window['JSZipUtils'] : require('jsziputils');
} }
......
...@@ -1933,20 +1933,17 @@ asc_docs_api.prototype.processSavedFile = function(url, downloadType) { ...@@ -1933,20 +1933,17 @@ asc_docs_api.prototype.processSavedFile = function(url, downloadType) {
var t = this; var t = this;
if (DownloadType.MailMerge === downloadType) { if (DownloadType.MailMerge === downloadType) {
this.mailMergeFileData = null; this.mailMergeFileData = null;
asc_ajax({ g_fLoadFileContent(url, function(result) {
url: url, if (null === result) {
dataType: "text", t.asc_fireCallback("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical);
success: function (result) { return;
try { }
t.asc_StartMailMergeByList(JSON.parse(result)); try {
} catch (e) { t.asc_StartMailMergeByList(JSON.parse(result));
t.asc_fireCallback("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical); } catch (e) {
} t.asc_fireCallback("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical);
}, }
error: function () { });
t.asc_fireCallback("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical);
}
});
} else { } else {
this.constructor.prototype.processSavedFile(url, downloadType); this.constructor.prototype.processSavedFile(url, downloadType);
} }
......
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