Jump to content

MediaWiki:Common: Difference between revisions

→‎Common.js: adding documentation on new search-focusing feature; wording
m (uploaded MW link icon in case internal link breaks or icon changes in an update)
(→‎Common.js: adding documentation on new search-focusing feature; wording)
Line 23: Line 23:
*Common.js allows 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).
*Common.js allows 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).


*Next, it looks at whether we're on the advanced search page, and if so, it imports the code from [[MediaWiki:Common.js/search.js]] for customizing the page (i.e., adding a dropdown menu that lets one pick another search engine besides MW's).
*If the user is on the Main Page, the browser is told to focus on the go/search box so that they can immediately start typing a search term or page name.


*More fixes for Internet Explorer.
*Next, if the user is on the advanced search page, [[MediaWiki:Common.js/search.js]] is imported to modify the page by adding a dropdown menu that lets one pick another search engine besides the barely-useable built-in one.
 
*Various fixes for Internet Explorer.


*Hover tables are added next, which can display a description of the table cell being pointed to. They are demonstrated, in their unfinished state, [[User:Iritscen/HoverTableDemo|here]].
*Hover tables are added next, which can display a description of the table cell being pointed to. They are demonstrated, in their unfinished state, [[User:Iritscen/HoverTableDemo|here]].


*Next is an even more unfinished feature called hover GIFs, which are GIFs that only animate when hovered over. It accomplishes this by swapping a still image with a GIF. However, this method does not work as it's currently coded because it merely changes the suffix of an image between .gif and .jpg; since images are stored in various "random" sub-directories on the server, the entire path for both images would need to be hardcoded in order to perform a successful swap. These paths could be supplied using an approach similar to the hover table class "hovertable_descrip", if one was determined to make this feature work.
*Next is an even more unfinished feature called hover GIFs, which are GIFs that only animate when hovered over. This is accomplished by swapping between a still image and a GIF. However, this method does not work as currently coded because it merely changes the suffix of an image between .gif and .jpg; since images are stored in various "random" sub-directories on the server, the entire path for both images would need to be hardcoded in order to perform a successful swap. These paths could be supplied using an approach similar to the hover table class "hovertable_descrip" if one was determined to make this feature work.


*The next code uses the NavFrame class from Common.css to create the collapsible tables that [[Template:Divhide|divhide]] boxes use.
*The NavFrame class from Common.css is used to create the collapsible tables upon which [[Template:Divhide|divhide]] boxes are built.


* 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 [[User:Iritscen/vector.js|custom JS page]] for a sample usage.
* 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 [[User:Iritscen/vector.js|custom JS page]] for a sample usage.