Add a dev mode to facilitate debugging

This commit is contained in:
yflory
2019-01-31 15:27:01 +01:00
parent 07cd0b21b6
commit 4abed38bb1
3 changed files with 13 additions and 1 deletions

View File

@@ -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);