Prepare possible OO migration

pull/1/head
yflory 3 years ago
parent 448a2abb93
commit 8f0543c3f3

@ -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) { assert(function (cb, msg) {
msg.innerText = "Missing HTTP headers required for .xlsx export from sheets. "; msg.innerText = "Missing HTTP headers required for .xlsx export from sheets. ";
@ -671,7 +671,7 @@ define([
}); });
assert(function (cb, msg) { 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)); msg.appendChild(CSP_WARNING(url));
deferredPostMessage({ deferredPostMessage({
command: 'GET_HEADER', command: 'GET_HEADER',

@ -2856,8 +2856,8 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
} }
readOnly = true; readOnly = true;
} }
} else if (content && content.version <= 3) { // V2 or V3 } else if (content && content.version <= 4) { // V2 or V3
version = 'v2b/'; version = content.version <= 3 ? 'v2b/' : 'v4/';
APP.migrate = true; APP.migrate = true;
// Registedred ~~users~~ editors can start the migration // Registedred ~~users~~ editors can start the migration
if (common.isLoggedIn() && !readOnly) { if (common.isLoggedIn() && !readOnly) {

@ -5,7 +5,7 @@ define([
], function (ApiConfig, nThen, Util) { ], function (ApiConfig, nThen, Util) {
var X2T = {}; var X2T = {};
var CURRENT_VERSION = X2T.CURRENT_VERSION = 'v4'; var CURRENT_VERSION = X2T.CURRENT_VERSION = 'v5';
var debug = function (str) { var debug = function (str) {
if (localStorage.CryptPad_dev !== "1") { return; } if (localStorage.CryptPad_dev !== "1") { return; }
console.debug(str); console.debug(str);

@ -10,6 +10,7 @@ define([
'/common/common-interface.js', '/common/common-interface.js',
'/common/common-util.js', '/common/common-util.js',
'/common/outer/worker-channel.js', '/common/outer/worker-channel.js',
'/common/outer/x2t.js',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
@ -25,10 +26,12 @@ define([
Messages, Messages,
UI, UI,
Util, Util,
Channel Channel,
X2T
) )
{ {
var APP = window.APP = {}; var APP = window.APP = {};
var CURRENT_VERSION = X2T.CURRENT_VERSION;
var common; var common;
var sFrameChan; var sFrameChan;
@ -111,7 +114,7 @@ define([
var loadOO = function (blob, type, name, cb) { var loadOO = function (blob, type, name, cb) {
var s = h('script', { var s = h('script', {
type:'text/javascript', 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); var file = getFileType(type);
APP.$rightside.append(s); APP.$rightside.append(s);

Loading…
Cancel
Save