|
|
@ -601,12 +601,6 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var handleChanges = function (obj, send) {
|
|
|
|
var handleChanges = function (obj, send) {
|
|
|
|
// Allow the changes
|
|
|
|
|
|
|
|
send({
|
|
|
|
|
|
|
|
type: "unSaveLock",
|
|
|
|
|
|
|
|
index: ooChannel.cpIndex,
|
|
|
|
|
|
|
|
time: +new Date()
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// Send the changes
|
|
|
|
// Send the changes
|
|
|
|
rtChannel.sendMsg({
|
|
|
|
rtChannel.sendMsg({
|
|
|
|
type: "saveChanges",
|
|
|
|
type: "saveChanges",
|
|
|
@ -616,6 +610,15 @@ define([
|
|
|
|
excelAdditionalInfo: null
|
|
|
|
excelAdditionalInfo: null
|
|
|
|
}, null, function (err, hash) {
|
|
|
|
}, null, function (err, hash) {
|
|
|
|
if (err) { return void console.error(err); }
|
|
|
|
if (err) { return void console.error(err); }
|
|
|
|
|
|
|
|
// Call unSaveLock to tell onlyoffice that the patch was sent.
|
|
|
|
|
|
|
|
// It will allow you to make changes to another cell.
|
|
|
|
|
|
|
|
// If there is an error and unSaveLock is not called, onlyoffice
|
|
|
|
|
|
|
|
// will try to send the patch again
|
|
|
|
|
|
|
|
send({
|
|
|
|
|
|
|
|
type: "unSaveLock",
|
|
|
|
|
|
|
|
index: ooChannel.cpIndex,
|
|
|
|
|
|
|
|
time: +new Date()
|
|
|
|
|
|
|
|
});
|
|
|
|
// Increment index and update latest hash
|
|
|
|
// Increment index and update latest hash
|
|
|
|
ooChannel.cpIndex++;
|
|
|
|
ooChannel.cpIndex++;
|
|
|
|
ooChannel.lastHash = hash;
|
|
|
|
ooChannel.lastHash = hash;
|
|
|
@ -748,7 +751,9 @@ define([
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"events": {
|
|
|
|
"events": {
|
|
|
|
"onAppReady": function(/*evt*/) {
|
|
|
|
"onAppReady": function(/*evt*/) {
|
|
|
|
var $tb = $('iframe[name="frameEditor"]').contents().find('head');
|
|
|
|
var $iframe = $('iframe[name="frameEditor"]').contents();
|
|
|
|
|
|
|
|
$iframe.prop('tabindex', '-1');
|
|
|
|
|
|
|
|
var $tb = $iframe.find('head');
|
|
|
|
var css = // Old OO
|
|
|
|
var css = // Old OO
|
|
|
|
'#id-toolbar-full .toolbar-group:nth-child(2), #id-toolbar-full .separator:nth-child(3) { display: none; }' +
|
|
|
|
'#id-toolbar-full .toolbar-group:nth-child(2), #id-toolbar-full .separator:nth-child(3) { display: none; }' +
|
|
|
|
'#fm-btn-save { display: none !important; }' +
|
|
|
|
'#fm-btn-save { display: none !important; }' +
|
|
|
@ -1301,10 +1306,13 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var setEditable = function (state) {
|
|
|
|
var setEditable = function (state) {
|
|
|
|
|
|
|
|
$('#cp-app-oo-editor').find('#cp-app-oo-offline').remove();;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
window.frames[0].editor.asc_setViewMode(!state);
|
|
|
|
|
|
|
|
//window.frames[0].editor.setViewModeDisconnect(true);
|
|
|
|
|
|
|
|
} catch (e) {}
|
|
|
|
if (!state) {
|
|
|
|
if (!state) {
|
|
|
|
try {
|
|
|
|
$('#cp-app-oo-editor').append(h('div#cp-app-oo-offline'));
|
|
|
|
window.frames[0].editor.setViewModeDisconnect(true);
|
|
|
|
|
|
|
|
} catch (e) {}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
debug(state);
|
|
|
|
debug(state);
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -1569,10 +1577,11 @@ define([
|
|
|
|
setEditable(info.state);
|
|
|
|
setEditable(info.state);
|
|
|
|
if (info.state) {
|
|
|
|
if (info.state) {
|
|
|
|
UI.findOKButton().click();
|
|
|
|
UI.findOKButton().click();
|
|
|
|
UI.confirm(Messages.oo_reconnect, function (yes) {
|
|
|
|
offline = false;
|
|
|
|
|
|
|
|
/*UI.confirm(Messages.oo_reconnect, function (yes) {
|
|
|
|
if (!yes) { return; }
|
|
|
|
if (!yes) { return; }
|
|
|
|
common.gotoURL();
|
|
|
|
common.gotoURL();
|
|
|
|
});
|
|
|
|
});*/
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
offline = true;
|
|
|
|
offline = true;
|
|
|
|
UI.findOKButton().click();
|
|
|
|
UI.findOKButton().click();
|
|
|
|