MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 19: | Line 19: | ||
/* For Favicon */ | /* For Favicon */ | ||
$("<link>", { | |||
rel: "shortcut icon", | |||
type: "image/x-icon", | |||
href: "https://linguifex.com/assets/Linguifex4v1.png" | |||
}).appendTo("head"); | |||
Revision as of 18:27, 16 September 2025
// Gadgets
//syntax highlighter
mw.loader.load('//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-DotsSyntaxHighlighter.js&action=raw&ctype=text/javascript');
/** Test if an element has a certain class **************************************
*
* Description: Uses regular expressions and caching for better performance.
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
*/
var hasClass = ( function() {
var reCache = {};
return function( element, className ) {
return ( reCache[className] ? reCache[className] : ( reCache[className] = new RegExp( "(?:\\s|^)" + className + "(?:\\s|$)" ) ) ).test( element.className );
};
})();
/* For Favicon */
$("<link>", {
rel: "shortcut icon",
type: "image/x-icon",
href: "https://linguifex.com/assets/Linguifex4v1.png"
}).appendTo("head");