Merge branch 'soon' into staging

pull/1/head
ansuz 4 years ago
commit f786dd8993

@ -1409,7 +1409,7 @@ define([
// Migration required but read-only: continue... // Migration required but read-only: continue...
if (readOnly) { if (readOnly) {
setEditable(true); setEditable(true);
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
} else { } else {
// No changes after the cp: migrate now // No changes after the cp: migrate now
onMigrateRdy.fire(); onMigrateRdy.fire();
@ -1434,12 +1434,9 @@ define([
return; return;
} }
if (lock) { if (lock || readOnly) {
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
} else if (readOnly) { //getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup
try {
getEditor().asc_setRestriction(true);
} catch (e) {}
} else { } else {
setEditable(true); setEditable(true);
deleteOfflineLocks(); deleteOfflineLocks();
@ -1459,7 +1456,6 @@ define([
} }
} }
if (isLockedModal.modal && force) { if (isLockedModal.modal && force) {
isLockedModal.modal.closeModal(); isLockedModal.modal.closeModal();
delete isLockedModal.modal; delete isLockedModal.modal;
@ -1469,7 +1465,8 @@ define([
} }
if (APP.template) { if (APP.template) {
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
//getEditor().setViewModeDisconnect();
UI.removeLoadingScreen(); UI.removeLoadingScreen();
makeCheckpoint(true); makeCheckpoint(true);
return; return;
@ -1483,7 +1480,7 @@ define([
} catch (e) {} } catch (e) {}
} }
if (APP.migrate && !readOnly) { if (lock && !readOnly) {
onMigrateRdy.fire(); onMigrateRdy.fire();
} }
@ -2065,7 +2062,7 @@ define([
UI.removeModals(); UI.removeModals();
UI.confirm(Messages.oo_uploaded, function (yes) { UI.confirm(Messages.oo_uploaded, function (yes) {
try { try {
getEditor().setViewModeDisconnect(); getEditor().asc_setRestriction(true);
} catch (e) {} } catch (e) {}
if (!yes) { return; } if (!yes) { return; }
common.gotoURL(); common.gotoURL();
@ -2232,7 +2229,9 @@ define([
APP.history = true; APP.history = true;
APP.template = true; APP.template = true;
var editor = getEditor(); var editor = getEditor();
if (editor) { editor.setViewModeDisconnect(); } if (editor) {
try { getEditor().asc_setRestriction(true); } catch (e) {}
}
var content = parsed.content; var content = parsed.content;
// Get checkpoint // Get checkpoint
@ -2372,7 +2371,7 @@ define([
var setHistoryMode = function (bool) { var setHistoryMode = function (bool) {
if (bool) { if (bool) {
APP.history = true; APP.history = true;
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
return; return;
} }
// Cancel button: redraw from lastCp // Cancel button: redraw from lastCp
@ -2579,7 +2578,11 @@ define([
APP.onLocal(); APP.onLocal();
} else { } else {
msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor); msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor);
if (APP.helpMenu) {
$(APP.helpMenu.menu).after(msg); $(APP.helpMenu.menu).after(msg);
} else {
$('#cp-app-oo-editor').prepend(msg);
}
readOnly = true; readOnly = true;
} }
} else if (content && content.version <= 3) { // V2 or V3 } else if (content && content.version <= 3) { // V2 or V3
@ -2591,7 +2594,11 @@ define([
APP.onLocal(); APP.onLocal();
} else { } else {
msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor); msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor);
if (APP.helpMenu) {
$(APP.helpMenu.menu).after(msg); $(APP.helpMenu.menu).after(msg);
} else {
$('#cp-app-oo-editor').prepend(msg);
}
readOnly = true; readOnly = true;
} }
} }

Loading…
Cancel
Save