From 8f0543c3f382cea6f0df23ef26427091cd9467e6 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 2 Nov 2021 12:42:44 +0100 Subject: [PATCH] Prepare possible OO migration --- www/checkup/main.js | 4 ++-- www/common/onlyoffice/inner.js | 4 ++-- www/common/outer/x2t.js | 2 +- www/convert/inner.js | 7 +++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/www/checkup/main.js b/www/checkup/main.js index fd0b41a27..d710747d7 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -363,7 +363,7 @@ define([ }); }); - var sheetURL = '/common/onlyoffice/v4/web-apps/apps/spreadsheeteditor/main/index.html'; + var sheetURL = '/common/onlyoffice/v5/web-apps/apps/spreadsheeteditor/main/index.html'; assert(function (cb, msg) { msg.innerText = "Missing HTTP headers required for .xlsx export from sheets. "; @@ -671,7 +671,7 @@ define([ }); assert(function (cb, msg) { - var url = '/common/onlyoffice/v4/web-apps/apps/spreadsheeteditor/main/index.html'; + var url = '/common/onlyoffice/v5/web-apps/apps/spreadsheeteditor/main/index.html'; msg.appendChild(CSP_WARNING(url)); deferredPostMessage({ command: 'GET_HEADER', diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 5684a1dd8..db4f98f52 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -2856,8 +2856,8 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null } readOnly = true; } - } else if (content && content.version <= 3) { // V2 or V3 - version = 'v2b/'; + } else if (content && content.version <= 4) { // V2 or V3 + version = content.version <= 3 ? 'v2b/' : 'v4/'; APP.migrate = true; // Registedred ~~users~~ editors can start the migration if (common.isLoggedIn() && !readOnly) { diff --git a/www/common/outer/x2t.js b/www/common/outer/x2t.js index 76dcd2f75..494c25a62 100644 --- a/www/common/outer/x2t.js +++ b/www/common/outer/x2t.js @@ -5,7 +5,7 @@ define([ ], function (ApiConfig, nThen, Util) { var X2T = {}; - var CURRENT_VERSION = X2T.CURRENT_VERSION = 'v4'; + var CURRENT_VERSION = X2T.CURRENT_VERSION = 'v5'; var debug = function (str) { if (localStorage.CryptPad_dev !== "1") { return; } console.debug(str); diff --git a/www/convert/inner.js b/www/convert/inner.js index c8b2cdd71..062d37592 100644 --- a/www/convert/inner.js +++ b/www/convert/inner.js @@ -10,6 +10,7 @@ define([ '/common/common-interface.js', '/common/common-util.js', '/common/outer/worker-channel.js', + '/common/outer/x2t.js', '/bower_components/file-saver/FileSaver.min.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', @@ -25,10 +26,12 @@ define([ Messages, UI, Util, - Channel + Channel, + X2T ) { var APP = window.APP = {}; + var CURRENT_VERSION = X2T.CURRENT_VERSION; var common; var sFrameChan; @@ -111,7 +114,7 @@ define([ var loadOO = function (blob, type, name, cb) { var s = h('script', { type:'text/javascript', - src: '/common/onlyoffice/v4/web-apps/apps/api/documents/api.js' + src: '/common/onlyoffice/'+CURRENT_VERSION+'/web-apps/apps/api/documents/api.js' }); var file = getFileType(type); APP.$rightside.append(s);