Join the PidgiNet Discord! https://discord.gg/Eg9QahqpXf
Difference between revisions of "MediaWiki:Common.js"
on PidgiWiki, the video game media repository
(testing) |
|||
Line 13: | Line 13: | ||
addOnloadHook(loadAutoAboutfileTemplate); | addOnloadHook(loadAutoAboutfileTemplate); | ||
} | } | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
/*Q*/ | /*Q*/ | ||
$(".header").click(function () { | $(".header").click(function () { |
Revision as of 16:52, 19 June 2014
/* Any JavaScript here will be loaded for all users on every page load. */ /* Automatically add Aboutfile in file-description by running a script. Source: http://www.mariowiki.com/wiki/MediaWiki:Common.js */ if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload') { function loadAutoAboutfileTemplate() { uploadDescription = document.getElementById('wpUploadDescription'); var doubleBracket = '{' + '{'; uploadDescription.value = doubleBracket + 'info\n|description=\n|game=\n|event=\n|movie=\n|set=\n|series=\n|subseries=\n|generation=\n|characters=\n|system=\n|language=\n|artist=\n|style=\n|source=\n|sourcelink=\n}}'; } addOnloadHook(loadAutoAboutfileTemplate); } /*Q*/ $(".header").click(function () { $header = $(this); //getting the next element $content = $header.next(); //open up the content needed - toggle the slide- if visible, slide up, if not slidedown. $content.slideToggle(500, function () { //execute this after slideToggle is done //change text of header based on visibility of content div $header.text(function () { //change text based on condition }); }); });