Very simple js console switcher.
This commit is contained in:
parent
8a93cc14f6
commit
b51b9539d0
|
@ -1,3 +1,19 @@
|
||||||
|
/**
|
||||||
|
* 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
|
* translate a string
|
||||||
* @param app the id of the app for which to translate the string
|
* @param app the id of the app for which to translate the string
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var oc_debug = <?php echo (defined('DEBUG') && DEBUG) ? 'true' : 'false'; ?>;
|
||||||
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
|
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
|
||||||
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
|
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
|
||||||
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
|
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var oc_debug = <?php echo (defined('DEBUG') && DEBUG) ? 'true' : 'false'; ?>;
|
||||||
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
|
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
|
||||||
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
|
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
|
||||||
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
|
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var oc_debug = <?php echo (defined('DEBUG') && DEBUG) ? 'true' : 'false'; ?>;
|
||||||
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
|
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
|
||||||
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
|
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
|
||||||
var oc_current_user = '<?php echo OC_User::getUser() ?>';
|
var oc_current_user = '<?php echo OC_User::getUser() ?>';
|
||||||
|
|
Loading…
Reference in New Issue