User:PerfektesChaos/js/catTreeToggling
Appearance
(Redirected from User:PerfektesChaos/js/catTreeToggling/r)
JavaScript gadget – toggle all branches of all CategoryTree elements in current page.
Usage
[edit]- If your project has registered this as a gadget, just activate on your Preferences page.
- Otherwise include the following line into your common.js, global.js etc.:
mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/catTreeToggling/r.js&action=raw&maxage=86400&ctype=text/javascript" );
If you want to avoid unnecessary JavaScript execution you may limit loading to category pages only:
if ( mw.config.get( "wgNamespaceNumber" ) === 14 ) {
mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/catTreeToggling/r.js&action=raw&maxage=86400&ctype=text/javascript" );
}
Please note that there is also Special:CategoryTree which is excluded by this rule as well.
Functionality
[edit]Every CategoryTree can be expanded at various stages, or collapsed interactively.
- If you loose track, you may want to close all trees immediately since you have opened too many.
- If you want to explore sub-categories, it may be helpful to open all (first) sub-categories at once.
On pages with a CategoryTree element and activated catTreeToggling the toolbox will appear in the upper right corner (as demonstrated on this page). Just click a triangle.
Internationalization
[edit]A translation of this page may be offered.
Codes
[edit]Source code |
|
ResourceLoader |
|
Namespaces | all |
Actions | view edit submit
|
mw.libs
|
catTreeToggling (reserved, but currently unused)
|
mw.hook
|
|
MediaWiki | MW 1.22 |
JavaScript | 1.5 (2000)
|