mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
31 lines
548 B
JavaScript
31 lines
548 B
JavaScript
|
var HTML5 = require('../html5');
|
||
|
|
||
|
var debugFlags = {any: true}
|
||
|
|
||
|
HTML5.debug = function() {
|
||
|
section = arguments[0];
|
||
|
if(debugFlags[section] || debugFlags[section.split('.')[0]]) {
|
||
|
var out = [];
|
||
|
for(var i in arguments) {
|
||
|
out.push(arguments[i])
|
||
|
}
|
||
|
console.dir(out)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
HTML5.enableDebug = function(section) {
|
||
|
debugFlags[section] = true;
|
||
|
}
|
||
|
|
||
|
HTML5.disableDebug = function(section) {
|
||
|
debugFlags[section] = false;
|
||
|
}
|
||
|
|
||
|
HTML5.dumpTagStack = function(tags) {
|
||
|
var r = [];
|
||
|
for(i in tags) {
|
||
|
r.push(tags[i].tagName);
|
||
|
}
|
||
|
return r.join(', ');
|
||
|
}
|