Spiderjjr45 (talk | contribs) No edit summary |
Spiderjjr45 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
/** |
|||
* Adds CSS classes to the body tag based on the categories this page belongs to |
|||
* |
|||
* @source https://www.mediawiki.org/wiki/Snippets/Style_pages_based_on_categories |
|||
* @revision 2016-01-18 |
|||
*/ |
|||
(function($, mw) { |
|||
var fn = function() { |
|||
var cats = mw.config.get('wgCategories'), newClasses; |
|||
if (cats) { |
|||
newClasses = $.map(cats, function(el) { |
|||
return 'cat-' + encodeURIComponent(el.replace(/[ .]/g, '_')).replace(/%/g, '_'); |
|||
}).join(' '); |
|||
$(document.body).addClass(newClasses); |
|||
} |
|||
}; |
|||
if (document.body) { |
|||
fn(); |
|||
} else { |
|||
$(fn); |
|||
} |
|||
})(jQuery, mw); |
|||
function Bebop(){ |
function Bebop(){ |
||
console.log("OK 3 2 1 Let's Jam"); |
console.log("OK 3 2 1 Let's Jam"); |
Revision as of 01:15, 22 March 2022
/** * Adds CSS classes to the body tag based on the categories this page belongs to * * @source https://www.mediawiki.org/wiki/Snippets/Style_pages_based_on_categories * @revision 2016-01-18 */ (function($, mw) { var fn = function() { var cats = mw.config.get('wgCategories'), newClasses; if (cats) { newClasses = $.map(cats, function(el) { return 'cat-' + encodeURIComponent(el.replace(/[ .]/g, '_')).replace(/%/g, '_'); }).join(' '); $(document.body).addClass(newClasses); } }; if (document.body) { fn(); } else { $(fn); } })(jQuery, mw); function Bebop(){ console.log("OK 3 2 1 Let's Jam"); var x = document.getElementById("myaudio"); x.play(); } setTimeout(Bebop, 2000);