|
Thanks for using our site! |
MediaWiki:Common.js: Difference between revisions
From ranchstory
Jump to navigationJump to search
imported>Stephen64 No edit summary |
Kiwibasket (talk | contribs) No edit summary |
||
| (13 intermediate revisions by 4 users not shown) | |||
| Line 2: | Line 2: | ||
/* Loads the JS Required fro the Discord Widget */ | /* Loads the JS Required fro the Discord Widget */ | ||
mw.loader.load( '/w/index.php?title=MediaWiki:DiscordWidget.js&action=raw&ctype=text/javascript' ); | mw.loader.load( '/w/index.php?title=MediaWiki:DiscordWidget.js&action=raw&ctype=text/javascript' ); | ||
/* Loads the JS Required for a Twitter Widget */ | // /* Loads the JS Required for a Twitter Widget */ | ||
// window.twttr = (function(d, s, id) { | |||
/* Loads the JS Required fro the Twitter Widget */ | // var js, fjs = d.getElementsByTagName(s)[0], | ||
// t = window.twttr || {}; | |||
// if (d.getElementById(id)) return t; | |||
// js = d.createElement(s); | |||
// js.id = id; | |||
// js.src = "https://platform.twitter.com/widgets.js"; | |||
// fjs.parentNode.insertBefore(js, fjs); | |||
// t._e = []; | |||
// t.ready = function(f) { | |||
// t._e.push(f); | |||
// }; | |||
// return t; | |||
// }(document, "script", "twitter-wjs")); | |||
// /* Loads the JS Required fro the Twitter Widget */ | |||
// mw.loader.load( '/w/index.php?title=MediaWiki:TwitterWidget.js&action=raw&ctype=text/javascript' ); | |||
/* adds imagemap capabilities to images */ | |||
mw.loader.load('//he.wikipedia.org/w/index.php?title=Mediawiki:Gadget-ime.js&action=raw&ctype=text/javascript'); | |||
/* | |||
Template:Spoiler on dev.miraheze.org | |||
*/ | |||
$(function(){ | |||
//spoiler block behavior | |||
$('.spoiler').click(function(){ | |||
$(this).toggleClass('off'); | |||
}); | |||
// spoiler button behavior | |||
$('#spoilerbtn').text('Show all spoilers'); | |||
$('#spoilerbtn').click(function(){ | |||
$(this).toggleClass('hide'); | |||
$('.spoiler').toggleClass('showall'); | |||
if ($(this).is('.hide')){ $(this).text('Hide all spoilers'); } | |||
else { $(this).text('Show all spoilers'); } | |||
}); | |||
}); | }); | ||
<!-- Matomo Tag Manager --> | |||
<script> | |||
var _mtm = window._mtm = window._mtm || []; | |||
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); | |||
(function() { | |||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | |||
g.async=true; g.src='https://wiki.ranchstory.farm/matomo/js/container_jkE94F60.js'; s.parentNode.insertBefore(g,s); | |||
})(); | |||
</script> | |||
<!-- End Matomo Tag Manager --> | |||
Latest revision as of 10:50, 5 April 2026
/* Any JavaScript here will be loaded for all users on every page load. */
/* Loads the JS Required fro the Discord Widget */
mw.loader.load( '/w/index.php?title=MediaWiki:DiscordWidget.js&action=raw&ctype=text/javascript' );
// /* Loads the JS Required for a Twitter Widget */
// window.twttr = (function(d, s, id) {
// var js, fjs = d.getElementsByTagName(s)[0],
// t = window.twttr || {};
// if (d.getElementById(id)) return t;
// js = d.createElement(s);
// js.id = id;
// js.src = "https://platform.twitter.com/widgets.js";
// fjs.parentNode.insertBefore(js, fjs);
// t._e = [];
// t.ready = function(f) {
// t._e.push(f);
// };
// return t;
// }(document, "script", "twitter-wjs"));
// /* Loads the JS Required fro the Twitter Widget */
// mw.loader.load( '/w/index.php?title=MediaWiki:TwitterWidget.js&action=raw&ctype=text/javascript' );
/* adds imagemap capabilities to images */
mw.loader.load('//he.wikipedia.org/w/index.php?title=Mediawiki:Gadget-ime.js&action=raw&ctype=text/javascript');
/*
Template:Spoiler on dev.miraheze.org
*/
$(function(){
//spoiler block behavior
$('.spoiler').click(function(){
$(this).toggleClass('off');
});
// spoiler button behavior
$('#spoilerbtn').text('Show all spoilers');
$('#spoilerbtn').click(function(){
$(this).toggleClass('hide');
$('.spoiler').toggleClass('showall');
if ($(this).is('.hide')){ $(this).text('Hide all spoilers'); }
else { $(this).text('Show all spoilers'); }
});
});
<!-- Matomo Tag Manager -->
<script>
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
(function() {
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://wiki.ranchstory.farm/matomo/js/container_jkE94F60.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Tag Manager -->