diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-11-15 19:43:10 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-11-15 19:43:10 +0100 |
commit | b51b9539d074222d01bd4a9836be6fe2f191a31e (patch) | |
tree | c5aff4e3f55fceb97eb6c747c61bff4307658eb6 /core/js/js.js | |
parent | 8a93cc14f66b6d2d725ae52ce0bf632a03fac59d (diff) | |
download | nextcloud-server-b51b9539d074222d01bd4a9836be6fe2f191a31e.tar.gz nextcloud-server-b51b9539d074222d01bd4a9836be6fe2f191a31e.zip |
Very simple js console switcher.
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 164fab80ed4..3b4cabe710b 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1,4 +1,20 @@ /** + * Disable console output unless DEBUG mode is enabled. + * Add + * define('DEBUG', true); + * To the end of config/config.php to enable debug mode. + */ +if (oc_debug !== true) { + if (!window.console) { + window.console = {}; + } + var methods = ['log', 'debug', 'warn', 'info', 'error', 'assert']; + for (var i = 0; i < methods.length; i++) { + console[methods[i]] = function () { }; + } +} + +/** * translate a string * @param app the id of the app for which to translate the string * @param text the string to translate |