Jump to content

MediaWiki:Common: Difference between revisions

m
updated doc for search.js
(added mention of hidden Help button; removed mentions of TOCnonum/TOClimit because they are obsolete in Vector 2022; misc. wording)
m (updated doc for search.js)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The purpose of [[MediaWiki:Common.css]] and [[MediaWiki:Common.js]] is to augment the MediaWiki CSS and JS code in a way that takes effect for all users. Note that changes to skin-specific pages such as MediaWiki:Vector.css/MediaWiki:Vector.js (our original default skin) or MediaWiki:Vector-2022.css/MediaWiki:Vector-2022.js (our current default skin) override these general changes for anyone using that particular skin. Those in turn are overridden by users' local vector.css and vector.js pages.
The purpose of [[MediaWiki:Common.css]] and [[MediaWiki:Common.js]] is to augment the MediaWiki CSS and JS code in a way that takes effect for all users. Note that changes to skin-specific pages such as [[MediaWiki:Vector-2022.css]] and [[MediaWiki:Vector-2022.js]] (for our current default skin) or [[MediaWiki:Vector.css]] and [[MediaWiki:Vector.js]] (for our original default skin) or  override these general changes for anyone using that particular skin. Those in turn are overridden by users' local vector.css and vector.js pages.


Following are all the features of the CSS and JS pages in the order in which they occur.
Following are all the features of the CSS and JS pages in the order in which they occur.
Line 6: Line 6:
Common.css contains various small fixes borrowed from Wikipedia for shortcomings in MediaWiki's appearance or behavior. There are additional appearance customizations created by us, plus supporting markup for features added to the wiki through Common.js. The Wikipedia carry-overs are not documented below because the comments in the markup should suffice. Following are our self-made customizations:
Common.css contains various small fixes borrowed from Wikipedia for shortcomings in MediaWiki's appearance or behavior. There are additional appearance customizations created by us, plus supporting markup for features added to the wiki through Common.js. The Wikipedia carry-overs are not documented below because the comments in the markup should suffice. Following are our self-made customizations:


*The "? Help" button which would appear on some special pages at the top-right is hidden because it pushes down the lede text on category pages. We have a Help link in the sidebar at all times so it's unneeded anyway.
*Many classes are declared for the message boxes that can be generated by [[Template:Fmbox]].
 
*Several link icon customizations:
**A custom [http://www.example.com external link arrow] replaces the default one ([[Image:MediaWiki default external link icon.png]]); the box element has been removed, making it visually less cluttered and easier to read.
**External links which use HTTPS are modified to use the [https://www.example.com same arrow] as HTTP links instead of the distracting and unnecessary padlock icon.
**External links to other subdomains on Oni2.net get a [http://iritscen.oni2.net sideways arrow].
**External links that specifically go to movie files get a [http://geyser.oni2.net/genesis/E3_1998/Oni_Trailer_(E3_1998).mov movie icon].
**External links that specifically go to sound files get a [http://geyser.oni2.net/oni1/music/09-Ambient_Suite.mp3 sound icon].
**Interwiki links get a green arrow to show that they point to a fellow wiki (by default MediaWiki shows no outbound arrow at all for interwiki links, ambushing the reader with a site change when they click it).
**Links formatted as if they're external, but which point back to this wiki, get a looping arrow [http://wiki.oni2.net/Main_Page like this].
 
*Following this are many classes declared for the message boxes that can be generated by [[Template:Fmbox]].


*A declared is for use with the unfinished hover table feature (see comments under Common.js below).
*A declared is for use with the unfinished hover table feature (see comments under Common.js below).
Line 26: Line 15:


*Finally, support is added for references to use letters instead of numbers, which is utilized by [[Template:Reflist]].
*Finally, support is added for references to use letters instead of numbers, which is utilized by [[Template:Reflist]].
These changes have all been marked with a "TODO" note to port them to use the extension TemplateStyles now that we have it installed.


==Common.js==
==Common.js==
Line 34: Line 25:
*First we allow for a user to add an "&withJS=MediaWiki:__.js" to a URL in order to view that page with a custom JS file that normally does not load for you (untested, so this documentation may be incorrect).
*First we allow for a user to add an "&withJS=MediaWiki:__.js" to a URL in order to view that page with a custom JS file that normally does not load for you (untested, so this documentation may be incorrect).


*If the user is on the advanced search page, [[MediaWiki:Common.js/search.js]] is imported in order to modify the page. It adds a dropdown menu that lets you pick another search engine in place of the barely useable built-in one.
*[[MediaWiki:Common.js/search.js]] is imported in order to modify the page (it will only take action if it detects we're on Special:Search). It adds a dropdown menu that lets you pick another search engine in place of the barely useable built-in one.


*The mw-collapsible class from MediaWiki core is extended to actually be collapsible, which allows [[Template:Divhide]] to work.
*The mw-collapsible class from MediaWiki core is extended to actually be collapsible, which allows [[Template:Divhide]] to work.