|
|
|
@ -9205,6 +9205,7 @@ function saveWithParts(fSendCommand, fCallback, fCallbackRequest, oAdditionalDat
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function loadFileContent(url, callback) {
|
|
|
|
|
console.error(url);
|
|
|
|
|
asc_ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
dataType: "text",
|
|
|
|
@ -9230,6 +9231,7 @@ function getImageFromChanges (name) {
|
|
|
|
|
function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
|
|
|
|
var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false;
|
|
|
|
|
var onEndOpen = function() {
|
|
|
|
|
console.error("this is where we should decrypt");
|
|
|
|
|
if (bEndLoadFile && bEndLoadChanges) {
|
|
|
|
|
if (callback) {
|
|
|
|
|
callback(bError, oResult);
|
|
|
|
@ -9257,6 +9259,7 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
|
|
|
|
}
|
|
|
|
|
bEndLoadFile = true;
|
|
|
|
|
onEndOpen();
|
|
|
|
|
console.error(oResult); // XXX
|
|
|
|
|
},
|
|
|
|
|
error: function() {
|
|
|
|
|
bEndLoadFile = true;
|
|
|
|
@ -9267,6 +9270,7 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null != changesUrl) {
|
|
|
|
|
console.error("null changesUrl"); // XXX
|
|
|
|
|
getJSZipUtils().getBinaryContent(changesUrl, function(err, data) {
|
|
|
|
|
bEndLoadChanges = true;
|
|
|
|
|
if (err) {
|
|
|
|
@ -9280,7 +9284,8 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
|
|
|
|
for (var i in oZipChanges.files) {
|
|
|
|
|
if (i.endsWith('.json')) {
|
|
|
|
|
// Заглушка на имя файла (стоило его начинать с цифры)
|
|
|
|
|
oResult.changes[parseInt(i.slice('changes'.length))] = JSON.parse(oZipChanges.files[i].asText());
|
|
|
|
|
oResult.changes[parseInt(i.slice('changes'.length))] =
|
|
|
|
|
JSON.parse(oZipChanges.files[i].asText());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onEndOpen();
|
|
|
|
@ -9290,6 +9295,7 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (window['IS_NATIVE_EDITOR']) {
|
|
|
|
|
console.error("is native editor");
|
|
|
|
|
var result = window["native"]["openFileCommand"](sFileUrl, changesUrl, Signature);
|
|
|
|
|
|
|
|
|
|
var url;
|
|
|
|
@ -9302,11 +9308,10 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
|
|
|
|
} else {
|
|
|
|
|
bError = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bEndLoadFile = true;
|
|
|
|
|
onEndOpen();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function sendCommand(editor, fCallback, rdata, dataContainer) {
|
|
|
|
|
//json не должен превышать размера 2097152, иначе при его чтении будет exception
|
|
|
|
|
var docConnectionId = editor.CoAuthoringApi.getDocId();
|
|
|
|
|