Jump to content

MediaWiki:Common: Difference between revisions

m
→‎Common.js: better sample usage of autosort
m (→‎Common.css: wording)
m (→‎Common.js: better sample usage of autosort)
Line 29: Line 29:
*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 written 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 be needed 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. 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.


*The next code uses the NavFrame class from Common.css to create the collapsible tables that [[Template:Divhide|divhide]] boxes use.
*The next code uses the NavFrame class from Common.css to create the collapsible tables that [[Template:Divhide|divhide]] boxes use.
Line 41: Line 41:
*Next are an untested fix for table sorting and a tweak to the Upload page for unregistered users (does this do anything?).
*Next are an untested fix for table sorting and a tweak to the Upload page for unregistered users (does this do anything?).


*Finally, there is code to allow the creation of tables that automatically sort themselves by a given column when the page is loaded. 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 the MediaWiki feature where each column has an arrow that can be clicked to sort that column. Now that you've declared both those classes, add the third class "autosort" to trigger the feature added by this code. By default, the table will be sorted by column 1, but you can specify another column by declaring a fourth class, "by-column-''x''", where 'x' is a number from 1 to 9. See [[BSL:List]] for a sample usage of this feature.
*Finally, there is code to allow the creation of tables that automatically sort themselves by a given column when the page is loaded. 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 the MediaWiki feature where each column has an arrow that can be clicked to sort that column. Now that you've declared both those classes, add the third class "autosort" to trigger the feature added by this code. By default, the table will be sorted by column 1, but you can specify another column by declaring a fourth class, "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.


[[Category:Policies and documentation]]
[[Category:Policies and documentation]]