Line 1: |
Line 1: |
− | /* Any JavaScript here will be loaded for all users on every page load. */
| |
| | | |
− | // Stolen from http://www.mediawiki.org/wiki/Manual:Collapsible_elements
| |
− |
| |
− | /** 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 );
| |
− | };
| |
− | })();
| |
− |
| |
− | // Import some more scripts
| |
− | importScript('MediaWiki:Common.js/Collapsible.js');
| |