MediaWiki:Uncyclopedia.js

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

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

  • Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
  • Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
  • Opera, Konqueror and Safari users can just click the Reload button.
  • Chrome: press Ctrl+F5 or Shift+F5
/**
 * This file is site-wide JavaScript.  It will take effect for users who (1) have selected the "uncyclopedia" skin
 * and (2) have JavaScript enabled.  Users who select "uncyclopedia" probably want to maximize our resemblance to
 * Wikipedia.  Users who don't, probably use other Wikia wikis and may want to maximize our resemblance to them.
 *
 * For these reasons, code put here will not take universal effect.  Code that should apply regardless of the skin
 * should go in [MediaWiki:Common.js].  It will take wider effect if you make a change using CSS whenever possible.
 *
 * Editing tips from Jack Phoenix <jack@countervandalism.net>, 26 July 2009:
 ** Test your code in the latest version of Firefox AND Internet Explorer!
 ** No compressed JS. Ever. Compressed JS is annoying to edit or debug.
 ** Follow the MediaWiki coding conventions (http://www.mediawiki.org/wiki/Manual:Coding_conventions)
 */
// Tools: [http://uncyclopedia.wikia.com/index.php?title=-&action=raw&smaxage=0&gen=js reload cache]

/************
 * THUMBNAILS
 ************
 * Wikia retired the "sprite" anchor from thumbnails in May'14.  See [Forum:Thumbnails are broken] and [Forum:I think I fixed the sprite]
 */
  $("FIGCAPTION:has(P.caption)").prepend("<A style='display:inline; float:right' title='This button does nothing but resemble Wikipedia'><IMG class='sprite' src='https://images.wikia.nocookie.net/__cb20140528181652/uncyclopedia/images/6/6b/Magnify-clip.png'></A>");
/* Then, in Aug'14, added an "info-icon" in the photo itself when you hover over it.  Not like Wikipedia.
 * (Now set to "display: none" in Uncyclopedia.css)
 */

/**********************
 * SECTION EDIT BUTTONS
 **********************
 * MAKE IT LOOK LIKE WIKIPEDIA
 * Was a SPAN.editsection before the SPAN with the section heading, and with float:right
 * Will be a SPAN.editsection moved after that other SPAN, with no float
 */
  $(" .editsection ").each(function () {
    $(this).css({"float": "none",
                 "padding-left": "1em",
                 "display": "inline"})
           .parent()
           .append(this);
    });