|
|
@ -122,9 +122,12 @@ require.config({ |
|
|
|
var debugDefault = window.location.href.match(/(\?|&)debug($|&|=)/); |
|
|
|
var debugDefault = window.location.href.match(/(\?|&)debug($|&|=)/); |
|
|
|
// Overwrite console to not log stuff per default.
|
|
|
|
// Overwrite console to not log stuff per default.
|
|
|
|
// Write debug(true) in console to enable or start with ?debug parameter.
|
|
|
|
// Write debug(true) in console to enable or start with ?debug parameter.
|
|
|
|
window.consoleBackup = window.console; |
|
|
|
window.consoleBackup = null; |
|
|
|
window.debug = function(flag) { |
|
|
|
window.debug = function(flag) { |
|
|
|
if (!flag) { |
|
|
|
if (!flag) { |
|
|
|
|
|
|
|
if (window.consoleBackup === null) { |
|
|
|
|
|
|
|
window.consoleBackup = window.console; |
|
|
|
|
|
|
|
} |
|
|
|
window.console = { |
|
|
|
window.console = { |
|
|
|
log: function() {}, |
|
|
|
log: function() {}, |
|
|
|
info: function() {}, |
|
|
|
info: function() {}, |
|
|
@ -134,7 +137,9 @@ require.config({ |
|
|
|
trace: function() {} |
|
|
|
trace: function() {} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
window.console = consoleBackup; |
|
|
|
if (window.consoleBackup) { |
|
|
|
|
|
|
|
window.console = window.consoleBackup; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
window.debug(debugDefault && true); |
|
|
|
window.debug(debugDefault && true); |
|
|
|