|
|
Line 18: |
Line 18: |
| } | | } |
| mw.hook( 'wikipage.content' ).add( makeCollapsibleMwCollapsible ); | | mw.hook( 'wikipage.content' ).add( makeCollapsibleMwCollapsible ); |
|
| |
|
| |
| /** Dynamic Navigation Bars (experimental) *************************************
| |
| *
| |
| * Description: See [[w:NavFrame]].
| |
| * Maintainers: UNMAINTAINED
| |
| */
| |
|
| |
| // set up the words in your language
| |
| var NavigationBarHide = '[' + collapseCaption + ']';
| |
| var NavigationBarShow = '[' + expandCaption + ']';
| |
|
| |
| // shows and hides content and picture (if available) of navigation bars
| |
| // Parameters:
| |
| // indexNavigationBar: the index of navigation bar to be toggled
| |
| function toggleNavigationBar(indexNavigationBar)
| |
| {
| |
| var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
| |
| var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
| |
|
| |
| if (!NavFrame || !NavToggle) {
| |
| return false;
| |
| }
| |
|
| |
| // if shown now
| |
| if (NavToggle.firstChild.data == NavigationBarHide) {
| |
| for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
| |
| if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
| |
| NavChild.style.display = 'none';
| |
| }
| |
| }
| |
| NavToggle.firstChild.data = NavigationBarShow;
| |
|
| |
| // if hidden now
| |
| } else if (NavToggle.firstChild.data == NavigationBarShow) {
| |
| for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
| |
| if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
| |
| NavChild.style.display = 'block';
| |
| }
| |
| }
| |
| NavToggle.firstChild.data = NavigationBarHide;
| |
| }
| |
| }
| |
| | | |
| // adds show/hide-button to navigation bars | | // adds show/hide-button to navigation bars |