From 6960e42f9d1e98770e7d3f58d59a5743dcb8aa7c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 29 Dec 2015 14:21:04 +0100 Subject: [PATCH] Improved logging. --- .../javascripts/app/lib/base/jquery.contenteditable.js | 9 +++++++++ .../javascripts/app/lib/base/jquery.fineuploader-3.0.js | 5 +++++ app/assets/javascripts/app/lib/base/jquery.textmodule.js | 3 +++ 3 files changed, 17 insertions(+) diff --git a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js index a58c484f5..6efd1490b 100644 --- a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js +++ b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js @@ -121,23 +121,29 @@ if (_this.options.mode === 'textonly') { if (!_this.options.multiline) { text = App.Utils.htmlRemoveTags(text) + _this.log('htmlRemoveTags', text) } else { + _this.log('htmlRemoveRichtext', text) text = App.Utils.htmlRemoveRichtext(text) } } else { + _this.log('htmlCleanup', text) text = App.Utils.htmlCleanup(text) } text = text.html() + _this.log('text.html()', text) // as fallback, take text if (!text) { text = App.Utils.text2html(text.text()) + _this.log('text2html', text) } } else { text = App.Utils.text2html(text) + _this.log('text2html', text) } // cleanup @@ -250,6 +256,9 @@ // log method Plugin.prototype.log = function() { + if (App && App.Log) { + App.Log.debug('contenteditable', arguments) + } if (this.options.debug) { console.log(this._name, arguments) } diff --git a/app/assets/javascripts/app/lib/base/jquery.fineuploader-3.0.js b/app/assets/javascripts/app/lib/base/jquery.fineuploader-3.0.js index 1d39039f7..5a5c70ece 100644 --- a/app/assets/javascripts/app/lib/base/jquery.fineuploader-3.0.js +++ b/app/assets/javascripts/app/lib/base/jquery.fineuploader-3.0.js @@ -143,6 +143,11 @@ var qq = function(element) { }; qq.log = function(message, level) { + // -start- add logger + if (App && App.Log) { + App.Log.debug(this._name, arguments) + } + // -end- add logger if (window.console) { if (!level || level === 'info') { window.console.log(message); diff --git a/app/assets/javascripts/app/lib/base/jquery.textmodule.js b/app/assets/javascripts/app/lib/base/jquery.textmodule.js index def5f474f..9a3f876f4 100644 --- a/app/assets/javascripts/app/lib/base/jquery.textmodule.js +++ b/app/assets/javascripts/app/lib/base/jquery.textmodule.js @@ -377,6 +377,9 @@ // log method Plugin.prototype.log = function() { + if (App && App.Log) { + App.Log.debug(this._name, arguments) + } if (this.options.debug) { console.log(this._name, arguments) }