diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index f319b23b4..4462b5739 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -49,6 +49,11 @@ define([ var CHECKPOINT_INTERVAL = 50; + var debug = function (x) { + if (!window.CP_DEV_MODE) { return; } + console.log(x); + }; + var stringify = function (obj) { return JSONSortify(obj); }; @@ -203,7 +208,7 @@ define([ cpIndex: 0 }; - var getContent = APP.getContent = function () { + var getContent = function () { try { return window.frames[0].editor.asc_nativeGetFile(); } catch (e) { @@ -560,10 +565,12 @@ define([ APP.chan = chan; var send = ooChannel.send = function (obj) { + debug(obj); chan.event('CMD', obj); }; chan.on('CMD', function (obj) { + debug(obj); switch (obj.type) { case "auth": handleAuth(obj, send); diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 37697ad2c..4d25d0c50 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -302,6 +302,7 @@ define([ password: password, channel: secret.channel, enableSF: localStorage.CryptPad_SF === "1", // TODO to remove when enabled by default + devMode: localStorage.CryptPad_dev === "1", }; if (window.CryptPad_newSharedFolder) { additionalPriv.newSharedFolder = window.CryptPad_newSharedFolder; diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index d6cbfc350..36f9bd449 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -587,6 +587,10 @@ define([ console.error("Can't check permissions for the app"); } + try { + window.CP_DEV_MODE = ctx.metadataMgr.getPrivateData().devMode; + } catch (e) {} + ctx.sframeChan.on('EV_LOADING_ERROR', function (err) { if (err === 'DELETED') { var msg = Messages.deletedError + '
' + Messages.errorRedirectToHome;