MediaWiki:Common

From OniGalore
Revision as of 20:14, 14 November 2011 by Iritscen (talk | contribs) (→‎Common.js: documenting ModifySidebar())
Jump to navigation Jump to search

The purpose of MediaWiki:Common.css and MediaWiki:Common.js is to augment the MediaWiki CSS and JS code, in a way that is effective for all users.

Common.css

  • Common.css mainly contains fixes for annoying glitches in MediaWiki's appearance or behavior, and minor style tweaks.
  • There are also various extended standards declared here for the appearance of things like infoboxes.
  • The NavFrame class is declared here, which is used by message templates such as the nifty divhide box.
  • There's also a modified fix brought over from WP for the annoyingly small text MediaWiki uses for monospaced fonts, which show up when you use <code>, <tt>, and <pre> tags.

Common.js

  • Next, Common.js sets up hasClass(), which is used by the next code, which places the show/hide buttons in those divhide boxes mentioned above. The code after that uses the NavFrame class from Common.css to create the collapsible tables that divhide uses.
  • A function called ModifySidebar() is made available for customizing the items listed in the sections on the left of all wiki pages. See Iritscen's custom JS page for a sample usage.
    • Parameter 1: The string "add" or "remove".
    • Parameter 2: The name of the section; "navigation", "languages" (not displayed on this wiki), or "toolbox".
    • Parameter 3: The display name of the URL you will be adding.
    • Parameter 4: The full URL of the wiki page to add (this should allow the adding of external links as well).
  • There are also some fixes for IE and table sorting.