aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-11-15 15:05:47 -0800
committerThomas Tanghus <thomas@tanghus.net>2012-11-15 15:05:47 -0800
commitb99213f7a769ec61a64877203441adb276388fa5 (patch)
tree22320e25b8bf8b415360441a654920b61a3c0ef0 /core/js
parentd86a368e54dee57b093ae52b1d1e4b7bc78127b0 (diff)
parentb51b9539d074222d01bd4a9836be6fe2f191a31e (diff)
downloadnextcloud-server-b99213f7a769ec61a64877203441adb276388fa5.tar.gz
nextcloud-server-b99213f7a769ec61a64877203441adb276388fa5.zip
Merge pull request #458 from owncloud/js_console_switch
Very simple js console switcher.
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js16
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