Modifications

Aller à : navigation, rechercher

MediaWiki:Common.js

595 octets ajoutés, 6 mars 2012 à 09:46
m
removeclass + addclass
//importScript( 'MediaWiki:Editpage.js' );
includePage( 'MediaWiki:Editpage.js' );
}
 
function addClass(node, className) {
if (hasClass(node, className)) {
return false;
}
var cache = node.className;
if (cache) {
node.className = cache + ' ' + className;
} else {
node.className = className;
}
return true;
}
function removeClass(node, className) {
if (!hasClass(node, className)) {
return false;
}
node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);
return true;
}
function eregReplace(search, replace, subject) {
return subject.replace(new RegExp(search,'g'), replace);
}

Menu de navigation