Join the PidgiNet Discord! https://discord.gg/Eg9QahqpXf

MediaWiki:Common.js

on PidgiWiki, the video game media repository

Revision as of 16:52, 19 June 2014 by Immewnity (talk | contribs) (testing)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* 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
        });
    });

});
Cookies help us deliver our services. By using our services, you agree to our use of cookies.