20,192
edits
(documented LocaleDate support) |
m (updated doc for search.js) |
||
| (6 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 | 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. | ||
==Common.css== | ==Common.css== | ||
Common.css contains various small fixes borrowed from Wikipedia for shortcomings in MediaWiki's appearance or behavior | 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: | ||
* | *Many classes are 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 27: | 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 35: | 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). | ||
* | *[[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. | ||
Following that are | Following that are these additions by OniGalore editors: | ||
*When someone visits the Main Page, the browser is told to focus on the go/search box so that the user can immediately start typing a search term or page name. | *When someone visits the Main Page, the browser is told to focus on the go/search box so that the user can immediately start typing a search term or page name. | ||
| Line 48: | Line 38: | ||
*Next to last, there is code to allow tables to automatically sort themselves by a given column when the page is loaded. This is utilized in several places on the wiki. To make an autosort table, first the table must be declared with the class "wikitable". Next, as part of the same class declaration, you must also add in "sortable" to enable MediaWiki's built-in sortable column feature. Finally add the third class "autosort" to trigger this feature. By default, the table will be sorted by column 1, but you can specify another column by declaring a fourth class for the table called "by-column-''x''", where 'x' is a number from 1 to 9. See [[Oni 2 (Angel Studios)/Levels]] for a sample usage of this feature. | *Next to last, there is code to allow tables to automatically sort themselves by a given column when the page is loaded. This is utilized in several places on the wiki. To make an autosort table, first the table must be declared with the class "wikitable". Next, as part of the same class declaration, you must also add in "sortable" to enable MediaWiki's built-in sortable column feature. Finally add the third class "autosort" to trigger this feature. By default, the table will be sorted by column 1, but you can specify another column by declaring a fourth class for the table called "by-column-''x''", where 'x' is a number from 1 to 9. See [[Oni 2 (Angel Studios)/Levels]] for a sample usage of this feature. | ||
*Finally comes support for [[Template:LocaleDate]], which allows | *Finally comes support for [[Template:LocaleDate]], which allows dates to dynamically re-format between MDY and DMY based on the user's browser locale. | ||
[[Category:Policies and documentation]] | [[Category:Policies and documentation]] | ||