MediaWiki:Common.js: Difference between revisions

From B'z Wiki
Jump to navigation Jump to search
(Created page with '→‎<source lang="css">: →‎Main page fixes: #interwiki-completelist { font-weight: bold; } body.page-Main_Page #ca-delete { display: none !important; } body.page-M…')
 
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* <source lang="css"> */
//<source lang="javascript">
   
 
/* Main page fixes */
/*
#interwiki-completelist {
* Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page
    font-weight: bold;
  * Maintainer: Cacycle
}
*/
body.page-Main_Page #ca-delete {
if (wgArticleId == 0 && wgUserName) {
    display: none !important;
  var slash = wgPageName.indexOf('/');
  var norm = wgPageName.substr(0, slash) + wgPageName.substr(slash).toLowerCase();
  var test = 'User:' + wgUserName.replace(/ /g, '_') + '/skin.';
  var ext = null;
  if (norm == test + 'js') ext = 'js';
  else if (norm == test + 'css') ext = 'css';
  if (ext != null) window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.' + ext);
}
}


body.page-Main_Page #mp-topbanner {
/** extract a URL parameter from the current URL **********
  clear: both;
* From [[en:User:Lupin/autoedit.js]]
*
* paramName  : the name of the parameter to extract
*/
function getURLParamValue( paramName, url)
{
if (typeof (url) == 'undefined'  || url === null) url = document.location.href;
var cmdRe=RegExp( '[&?]' + paramName + '=([^&#]*)' ); // Stop at hash
var m=cmdRe.exec(url);
if (m && m.length > 1) return decodeURIComponent(m[1]);
return null;
}
}


/* Edit window toolbar */
/** &withJS= URL parameter *******
#toolbar {
* Allow to try custom scripts from MediaWiki space
    height: 22px;
* without editing [[Special:Mypage/monobook.js]]
    margin-bottom: 6px;
*/
var extraJS = getURLParamValue("withJS");
if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\.js$") ) {
  importScript(extraJS);
}
}


/* Margins for <ol> and <ul> */
/* Import more specific scripts if necessary */
#content ol, #content ul,
#mw_content ol, #mw_content ul {
  margin-bottom: 0.5em;
}


/* Make the list of references in [[Template:Reflist]] smaller */
if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload") //scripts specific to editing pages
.references-small {  
{
     font-size: 90%;
     importScript("MediaWiki:Common.js/edit.js")
}


/* Highlight clicked reference in blue to help navigation */
ol.references > li:target,
sup.reference:target,
span.citation:target {
    background-color: #DEF;
}
}
 
else if (wgPageName == "Special:Watchlist") //watchlist scripts
/* Ensure refs in table headers and the like aren't bold or italic */
{
sup.reference {
     importScript("MediaWiki:Common.js/watchlist.js")
     font-weight: normal;
    font-style: normal;
}
}
 
if( wgNamespaceNumber == 6 ) {
 
     importScript('MediaWiki:Common.js/file.js');
/* Styling for citations */
span.citation, cite {
     font-style: normal;
    word-wrap: break-word;
}
}


/* For linked citation numbers and document IDs, where
/** For sysops and accountcreators *****************************************
  the number need not be shown on a screen or a handheld,
*
  but should be included in the printed version
*  Description: Allows for sysop-specific Javascript at [[MediaWiki:Sysop.js]],
*/
*              and accountcreator-specific CSS at [[MediaWiki:Accountcreator.css]].
@media screen, handheld {
*/
     span.citation *.printonly {
if ( wgUserGroups ) {
         display: none;
  for ( var g = 0; g < wgUserGroups.length; ++g ) {
     if ( wgUserGroups[g] == "sysop" ) {
      importStylesheet("MediaWiki:Sysop.css");
      addOnloadHook( function() {
        if ( !window.disableSysopJS ) {
          importScript("MediaWiki:Sysop.js");
         }
      } );
    }
    else if ( wgUserGroups[g] == "accountcreator" ) {
      importStylesheet("MediaWiki:Accountcreator.css");
     }
     }
  }
}
}




/* wikitable/prettytable class for skinning normal tables */
/* Scripts specific to Internet Explorer */
table.wikitable,
table.prettytable {
    margin: 1em 1em 1em 0;
    background: #f9f9f9;
    border: 1px #aaa solid;
    border-collapse: collapse;
}
.wikitable th, .wikitable td,
.prettytable th, .prettytable td {
    border: 1px #aaa solid;
    padding: 0.2em;
}
.wikitable th,
.prettytable th {
    background: #f2f2f2;
    text-align: center;
}
.wikitable caption,
.prettytable caption {
    font-weight: bold;
}


/* Default skin for navigation boxes */
if (navigator.appName == "Microsoft Internet Explorer")
table.navbox {            /* Navbox container style */
{
  border: 1px solid #aaa;
    /** Internet Explorer bug fix **************************************************
  width: 100%;
    *
  margin: auto;
    *  Description: Fixes IE horizontal scrollbar bug
  clear: both;
    *  Maintainers: [[User:Tom-]]?
  font-size: 88%;
    */
  text-align: center;
   
  padding: 1px;
    var oldWidth;
}
    var docEl = document.documentElement;
table.navbox + table.navbox {  /* Single pixel border between adjacent navboxes */
   
  margin-top: -1px;           /* (doesn't work for IE6, but that's okay)      */
    function fixIEScroll()
}
    {
.navbox-title,
        if (!oldWidth || docEl.clientWidth > oldWidth)
.navbox-abovebelow,
            doFixIEScroll();
table.navbox th {
        else
  text-align: center;     /* Title and above/below styles */
            setTimeout(doFixIEScroll, 1);
  padding-left: 1em;
       
  padding-right: 1em;
        oldWidth = docEl.clientWidth;
}
    }
.navbox-group {            /* Group style */
   
  white-space: nowrap;
     function doFixIEScroll() {
  text-align: right;
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth < 4) ? "hidden" : "";
  font-weight: bold;
    }
  padding-left: 1em;
   
  padding-right: 1em;
    document.attachEvent("onreadystatechange", fixIEScroll);
}
     document.attachEvent("onresize", fixIEScroll);
.navbox, .navbox-subgroup {
   
  background: #fdfdfd;     /* Background color */
   
}
     /**
.navbox-list {
    * Remove need for CSS hacks regarding MSIE and IPA.
  border-color: #fdfdfd;   /* Must match background color */
    */
}
    if (document.createStyleSheet) {
.navbox-title,
        document.createStyleSheet().addRule('.IPA', 'font-family: "Doulos SIL", "Charis SIL", Gentium, "DejaVu Sans", Code2000, "TITUS Cyberbit Basic", "Arial Unicode MS", "Lucida Sans Unicode", "Chrysanthi Unicode";');
table.navbox th {
    }
  background: #ccccff;     /* Level 1 color */
}
.navbox-abovebelow,
.navbox-group,
.navbox-subgroup .navbox-title {
  background: #ddddff;     /* Level 2 color */
}
.navbox-subgroup .navbox-group, .navbox-subgroup .navbox-abovebelow {
  background: #e6e6ff;    /* Level 3 color */
}
.navbox-even {
  background: #f7f7f7;    /* Even row striping */
}
.navbox-odd {
  background: transparent; /* Odd row striping */
}


.collapseButton {          /* 'show'/'hide' buttons created dynamically */
     // In print IE (7?) does not like line-height
     float: right;          /* by the CollapsibleTables javascript in    */
     appendCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');
     font-weight: normal;   /* [[MediaWiki:Common.js]]are styled here    */
    text-align: right;    /* so they can be customised.                */
    width: auto;
}
.navbox .collapseButton {  /* In navboxes, the show/hide button balances */
    width: 6em;           /* the vde links from [[Template:Tnavbar]],  */
}                          /* so they need to be the same width.        */


    // IE overflow bug
    appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');


/* Infobox template style */
    // IE zoomfix
.infobox {
     //Use to fix right floating div/table inside tables.
     border: 1px solid #aaa;
     appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}' );
    background-color: #f9f9f9;
   
    color: black;
     //Import scripts specific to Internet Explorer 6
    margin: 0.5em 0 0.5em 1em;
     if (navigator.appVersion.substr(22, 1) == "6") {
    padding: 0.2em;
        importScript("MediaWiki:Common.js/IE60Fixes.js")
    float: right;
     }
     clear: right;
}
.infobox td,
.infobox th {
    vertical-align: top;
}
.infobox caption {
     font-size: larger;
}
.infobox.bordered {
     border-collapse: collapse;
}
.infobox.bordered td,
.infobox.bordered th {
    border: 1px solid #aaa;
}
.infobox.bordered .borderless td,
.infobox.bordered .borderless th {
     border: 0;
}
}


.infobox.sisterproject {
    width: 20em;
    font-size: 90%;
}


.infobox.standard-talk {
/* Test if an element has a certain class **************************************
    border: 1px solid #c0c090;
*
    background-color: #f8eaba;
* Description: Uses regular expressions and caching for better performance.
}
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
.infobox.standard-talk.bordered td,
*/
.infobox.standard-talk.bordered th {
    border: 1px solid #c0c090;
}


/* styles for bordered infobox with merged rows */
var hasClass = (function () {
.infobox.bordered .mergedtoprow td,
     var reCache = {};
.infobox.bordered .mergedtoprow th {
     return function (element, className) {
     border: 0;
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
     border-top: 1px solid #aaa;
     };
     border-right: 1px solid #aaa;
})();
}


.infobox.bordered .mergedrow td,
.infobox.bordered .mergedrow th {
    border: 0;
    border-right: 1px solid #aaa;
}


/* Styles for geography infoboxes, eg countries,
/** Interwiki links to featured articles ***************************************
  country subdivisions, cities, etc.            */
*
.infobox.geography {
*  Description: Highlights interwiki links to featured articles (or
    text-align: left;
*              equivalents) by changing the bullet before the interwiki link
    border-collapse: collapse;
*              into a star.
    line-height: 1.2em;
*  Maintainers: [[User:R. Koot]]
    font-size: 90%;
*/
}


.infobox.geography  td,
function LinkFA()
.infobox.geography  th {
{
     border-top: solid 1px #aaa;
     if ( document.getElementById( "p-lang" ) ) {
    padding: 0.4em 0.6em 0.4em 0.6em;
        var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );
}
.infobox.geography .mergedtoprow td,
.infobox.geography .mergedtoprow th {
    border-top: solid 1px #aaa;
    padding: 0.4em 0.6em 0.2em 0.6em;
}


.infobox.geography .mergedrow td,
        for ( var i = 0; i < InterwikiLinks.length; i++ ) {
.infobox.geography .mergedrow th {
            if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {
    border: 0;
                InterwikiLinks[i].className += " FA"
     padding: 0 0.6em 0.2em 0.6em;
                InterwikiLinks[i].title = "This is a featured article in another language.";
            }
        }
     }
}
}


.infobox.geography .mergedbottomrow td,
addOnloadHook( LinkFA );
.infobox.geography .mergedbottomrow th {
    border-top: 0;
    border-bottom: solid 1px #aaa;
    padding: 0 0.6em 0.4em 0.6em;
}


.infobox.geography .maptable td,
.infobox.geography .maptable th {
    border: 0;
    padding: 0;
}


/* Makes redirects appear in italics in categories and on [[Special:Allpages]] */
/** Collapsible tables *********************************************************
.redirect-in-category, .allpagesredirect {
*
    font-style: italic;
*  Description: Allows tables to be collapsed, showing only the header. See
}
*              [[Wikipedia:NavFrame]].
*  Maintainers: [[User:R. Koot]]
*/


/* Icons for medialist templates [[Template:Listen]],
var autoCollapse = 2;
  [[Template:Multi-listen_start]], [[Template:Video]],
var collapseCaption = "hide";
  [[Template:Multi-video_start]]
var expandCaption = "show";
*/
div.listenlist {
    background:
        url("http://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Gnome-speakernotes.png/30px-Gnome-speakernotes.png");
    padding-left: 40px;
}


/* Style rules for media list templates */
function collapseTable( tableIndex )
div.medialist {
{
     min-height: 50px;
     var Button = document.getElementById( "collapseButton" + tableIndex );
    margin: 1em;
     var Table = document.getElementById( "collapsibleTable" + tableIndex );
    background-position: top left;
    background-repeat: no-repeat;
}
div.medialist ul {
    list-style-type: none;
    list-style-image: none;
     margin: 0;
}
div.medialist ul li {
    padding-bottom: 0.5em;
}
div.medialist ul li li {
    font-size: 91%;
    padding-bottom: 0;
}


/* Change the external link icon to an Adobe icon for all PDF files
     if ( !Table || !Button ) {
  in browsers that support these CSS selectors, like Mozilla and Opera */
        return false;
#content a[href$=".pdf"].external,
     }
#content a[href*=".pdf?"].external,
#content a[href*=".pdf#"].external,
#content a[href$=".PDF"].external,
#content a[href*=".PDF?"].external,
#content a[href*=".PDF#"].external,
#mw_content  a[href$=".pdf"].external,
#mw_content  a[href*=".pdf?"].external,
#mw_content  a[href*=".pdf#"].external,
#mw_content  a[href$=".PDF"].external,
#mw_content  a[href*=".PDF?"].external,
#mw_content  a[href*=".PDF#"].external {
     background: url("http://upload.wikimedia.org/wikipedia/commons/2/23/Icons-mini-file_acrobat.gif") center right no-repeat;
     padding-right: 16px;
}


/* Change the external link icon to an Adobe icon anywhere the PDFlink class
     var Rows = Table.rows;
  is used (notably Template:PDFlink). This works in IE, unlike the above. */
#content span.PDFlink a,
#mw_content span.PDFlink a {
     background: url("http://upload.wikimedia.org/wikipedia/commons/2/23/Icons-mini-file_acrobat.gif") center right no-repeat;
    padding-right: 17px;
}


/* Content in columns with CSS instead of tables [[Template:Columns]] */
    if ( Button.firstChild.data == collapseCaption ) {
div.columns-2 div.column {
        for ( var i = 1; i < Rows.length; i++ ) {
    float: left;
            Rows[i].style.display = "none";
    width: 50%;
        }
    min-width: 300px;
        Button.firstChild.data = expandCaption;
}
     } else {
div.columns-3 div.column {
        for ( var i = 1; i < Rows.length; i++ ) {
    float: left;
            Rows[i].style.display = Rows[0].style.display;
    width: 33.3%;
        }
     min-width: 200px;
        Button.firstChild.data = collapseCaption;
}
     }
div.columns-4 div.column {
    float: left;
    width: 25%;
    min-width: 150px;
}
div.columns-5 div.column {
    float: left;
     width: 20%;
    min-width: 120px;
}
}


/* Messagebox templates */
function createCollapseButtons()
.messagebox {
{
     border: 1px solid #aaa;
     var tableIndex = 0;
    background-color: #f9f9f9;
     var NavigationBoxes = new Object();
    width: 80%;
     var Tables = document.getElementsByTagName( "table" );
    margin: 0 auto 1em auto;
    padding: .2em;
}
.messagebox.merge {
    border: 1px solid #c0b8cc;
    background-color: #f0e5ff;
    text-align: center;
}
.messagebox.cleanup {
    border: 1px solid #9f9fff;
     background-color: #efefff;
     text-align: center;
}
.messagebox.standard-talk {
    border: 1px solid #c0c090;
    background-color: #f8eaba;
    margin: 4px auto;
}
/* For old WikiProject banners inside banner shells. */
.mbox-inside .standard-talk,
.messagebox.nested-talk {
    border: 1px solid #c0c090;
    background-color: #f8eaba;
    width: 100%;
    margin: 2px 0;
    padding: 2px;
}
.messagebox.small {
    width: 238px;
    font-size: 85%;
    float: right;
    clear: both;
    margin: 0 0 1em 1em;
    line-height: 1.25em;
}
.messagebox.small-talk {
    width: 238px;
    font-size: 85%;
    float: right;
    clear: both;
    margin: 0 0 1em 1em;
    line-height: 1.25em;
    background: #F8EABA;
}


    for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "collapsible" ) ) {


/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
            /* only add button and increment count if there is a header row to work with */
th.mbox-text, td.mbox-text {    /* The message body cell(s) */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
    border: none;
            if (!HeaderRow) continue;
    padding: 0.25em 0.9em;       /* 0.9em left/right */
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
    width: 100%;   /* Make all mboxes the same width regardless of text length */
             if (!Header) continue;
}
td.mbox-image {                  /* The left image cell */
    border: none;
    padding: 2px 0 2px 0.9em;    /* 0.9em left, 0px right */
    text-align: center;  
}
td.mbox-imageright {             /* The right image cell */
    border: none;
    padding: 2px 0.9em 2px 0;    /* 0px left, 0.9em right */
    text-align: center;  
}
td.mbox-empty-cell {        /* An empty narrow cell */
    border: none;
    padding: 0px;
    width: 1px;
}


/* Article message box styles */
            NavigationBoxes[ tableIndex ] = Tables[i];
table.ambox {
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
    margin: 0px 10%;  /* 10% = Will not overlap with other elements */
    border: 1px solid #aaa;  
    border-left: 10px solid #1e90ff;    /* Default "notice" blue */
    background: #fbfbfb;
}
table.ambox + table.ambox {  /* Single border between stacked boxes. */
    margin-top: -1px;
}
.ambox th.mbox-text,
.ambox td.mbox-text {            /* The message body cell(s) */
    padding: 0.25em 0.5em;      /* 0.5em left/right */
}
.ambox td.mbox-image {          /* The left image cell */
    padding: 2px 0 2px 0.5em;   /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright {      /* The right image cell */
    padding: 2px 0.5em 2px 0;    /* 0px left, 0.5em right */
}


table.ambox-notice {
            var Button     = document.createElement( "span" );
     border-left: 10px solid #1e90ff;    /* Blue */
            var ButtonLink = document.createElement( "a" );
}
            var ButtonText = document.createTextNode( collapseCaption );
table.ambox-speedy {
    border-left: 10px solid #b22222;    /* Red */
    background: #fee;                   /* Pink */
}
table.ambox-delete {
    border-left: 10px solid #b22222;   /* Red */
}
table.ambox-content {
    border-left: 10px solid #f28500;   /* Orange */
}
table.ambox-style {
    border-left: 10px solid #f4c430;    /* Yellow */
}
table.ambox-move {
    border-left: 10px solid #9932cc;    /* Purple */
}
table.ambox-protection {
    border-left: 10px solid #bba;      /* Gray-gold */
}


/* Image message box styles */
            Button.className = "collapseButton"; //Styles are declared in Common.css
table.imbox {
    margin: 4px 10%;
    border-collapse: collapse;
    border: 3px solid #1e90ff;    /* Default "notice" blue */
    background: #fbfbfb;
}
.imbox .mbox-text .imbox {    /* For imboxes inside imbox-text cells. */
    margin: 0 -0.5em;    /* 0.9 - 0.5 = 0.4em left/right. */
}
.mbox-inside .imbox {    /* For imboxes inside other templates. */
    margin: 4px;
}


table.imbox-notice {
             ButtonLink.style.color = Header.style.color;
    border: 3px solid #1e90ff;    /* Blue */
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
}
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
table.imbox-speedy {
            ButtonLink.appendChild( ButtonText );
    border: 3px solid #b22222;    /* Red */
    background: #fee;             /* Pink */
}
table.imbox-delete {
    border: 3px solid #b22222;    /* Red */
}
table.imbox-content {
    border: 3px solid #f28500;    /* Orange */
}
table.imbox-style {
    border: 3px solid #f4c430;    /* Yellow */
}
table.imbox-move {
    border: 3px solid #9932cc;   /* Purple */
}
table.imbox-protection {
    border: 3px solid #bba;       /* Gray-gold */
}
table.imbox-license {
    border: 3px solid #88a;       /* Dark gray */
    background: #f7f8ff;         /* Light gray */
}
table.imbox-featured {
    border: 3px solid #cba135;   /* Brown-gold */
}


/* Category message box styles */
            Button.appendChild( document.createTextNode( "[" ) );
table.cmbox {
            Button.appendChild( ButtonLink );
    margin: 3px 10%;
            Button.appendChild( document.createTextNode( "]" ) );
    border-collapse: collapse;
    border: 1px solid #aaa;
    background: #DFE8FF;    /* Default "notice" blue */
}


table.cmbox-notice {
            Header.insertBefore( Button, Header.childNodes[0] );
    background: #D8E8FF;    /* Blue */
            tableIndex++;
}
        }
table.cmbox-speedy {
     }
    margin-top: 4px;
    margin-bottom: 4px;
    border: 4px solid #b22222;    /* Red */
    background: #FFDBDB;         /* Pink */
}
table.cmbox-delete {
    background: #FFDBDB;   /* Red */
}
table.cmbox-content {
     background: #FFE7CE;    /* Orange */
}
table.cmbox-style {
    background: #FFF9DB;    /* Yellow */
}
table.cmbox-move {
    background: #E4D8FF;    /* Purple */
}
table.cmbox-protection {
    background: #EFEFE1;    /* Gray-gold */
}


/* Other pages message box styles */
     for ( var i = 0; i < tableIndex; i++ ) {
table.ombox {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
     margin: 4px 10%;  
            collapseTable( i );
    border-collapse: collapse;  
        }  
    border: 1px solid #aaa;      /* Default "notice" gray */
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
    background: #f9f9f9;
            var element = NavigationBoxes[i];
}
             while (element = element.parentNode) {
 
                if ( hasClass( element, "outercollapse" ) ) {
table.ombox-notice {
                    collapseTable ( i );
    border: 1px solid #aaa;       /* Gray */
                    break;
}
                }
table.ombox-speedy {
            }
    border: 2px solid #b22222;   /* Red */
        }
    background: #fee;             /* Pink */
     }
}
table.ombox-delete {
    border: 2px solid #b22222;    /* Red */
}
table.ombox-content {
    border: 1px solid #f28500;   /* Orange */
}
table.ombox-style {
    border: 1px solid #f4c430;   /* Yellow */
}
table.ombox-move {
    border: 1px solid #9932cc;    /* Purple */
}
table.ombox-protection {
    border: 2px solid #bba;      /* Gray-gold */
}
/* Talk page message box styles */
table.tmbox {
    margin: 4px 10%;
    border-collapse: collapse;
     border: 1px solid #c0c090;    /* Default "notice" gray-brown */
    background: #f8eaba;
}
.mediawiki .mbox-inside .tmbox { /* For tmboxes inside other templates. The "mediawiki" */
    margin: 2px 0;              /* class ensures that this declaration overrides other */
    width: 100%;  /* For Safari and Opera */    /* styles (including mbox-small above) */
}
.mbox-inside .tmbox.mbox-small { /* "small" tmboxes should not be small when  */
    line-height: 1.5em;          /* also "nested", so reset styles that are  */ 
    font-size: 100%;            /* set in "mbox-small" above.                */
}
}


table.tmbox-speedy {
addOnloadHook( createCollapseButtons );
    border: 2px solid #b22222;   /* Red */
    background: #fee;            /* Pink */
}
table.tmbox-delete {
    border: 2px solid #b22222;    /* Red */
}
table.tmbox-content {
    border: 2px solid #f28500;    /* Orange */
}
table.tmbox-style {
    border: 2px solid #f4c430;    /* Yellow */
}
table.tmbox-move {
    border: 2px solid #9932cc;    /* Purple */
}
table.tmbox-protection,
table.tmbox-notice {
    border: 1px solid #c0c090;    /* Gray-brown */
}


/* Disambig and set index box styles */
table.dmbox {
    clear: both;
    margin: 0.9em 1em;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    background: transparent;
}
/* Footer and header message box styles */
table.fmbox {
    clear: both;
    margin: 0.2em 0;
    width: 100%;
    border: 1px solid #aaa;
    background: #f9f9f9;    /* Default "system" gray */
}
table.fmbox-system {
    background: #f9f9f9;
}
table.fmbox-warning {
    border: 1px solid #bb7070;  /* Dark pink */
    background: #ffdbdb;        /* Pink */
}
table.fmbox-editnotice {
    background: transparent;
}
/* Div based "warning" style fmbox messages. */
div.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon {
    clear: both;
    margin: 0.2em 0;
    border: 1px solid #bb7070;
    background: #ffdbdb;
    padding: 0.25em 0.9em;
}
/* Div based "system" style fmbox messages.
  Used in [[MediaWiki:Readonly lag]]. */
div.mw-lag-warn-normal,
div.fmbox-system {
    clear: both;
    margin: 0.2em 0;
    border: 1px solid #aaa;
    background: #f9f9f9;
    padding: 0.25em 0.9em;
}


/* These mbox-small classes must be placed after all other
/** Dynamic Navigation Bars (experimental) *************************************
  ambox/tmbox/ombox etc classes. "body.mediawiki" is so
*
  they override "table.ambox + table.ambox" above. */
*  Description: See [[Wikipedia:NavFrame]].
body.mediawiki table.mbox-small {  /* For the "small=yes" option. */
*  Maintainers: UNMAINTAINED
    clear: right;
*/
    float: right;
    margin: 4px 0 4px 1em;
    width: 238px;
    font-size: 88%;
    line-height: 1.25em;
}
body.mediawiki table.mbox-small-left {  /* For the "small=left" option. */
    margin: 4px 1em 4px 0;
    width: 238px;
    border-collapse: collapse;
    font-size: 88%;
    line-height: 1.25em;
}


// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';


/* Remove default styles for [[MediaWiki:Noarticletext]]. */
// shows and hides content and picture (if available) of navigation bars
div.noarticletext {
// Parameters:
     border: none;
//     indexNavigationBar: the index of navigation bar to be toggled
     background: transparent;
function toggleNavigationBar(indexNavigationBar)
     padding: 0;
{
}
     var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
     var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);


/* Support for Template:IPA, Template:Unicode and Template:Polytonic.
     if (!NavFrame || !NavToggle) {
  The second declarations reset the styles for all browsers except
        return false;
  IE6, which chokes on the empty comment tags. Please copy any changes
     }
  to [[Template:IPA fonts]] and [[Template:Unicode fonts]].
*/
.IPA {
    font-family: "Charis SIL", "Doulos SIL", Gentium, GentiumAlt,
                "DejaVu Sans", Code2000, "TITUS Cyberbit Basic",
                "Arial Unicode MS", "Lucida Sans Unicode",
                "Chrysanthi Unicode";
    font-family /**/: inherit;
}
.Unicode {
     font-family: Code2000, Code2001, "Free Serif", "TITUS Cyberbit Basic",
                "Doulos SIL", "Chrysanthi Unicode", "Bitstream Cyberbit",
                "Bitstream CyberBase", Thryomanes, Gentium, GentiumAlt,
                "Lucida Grande", "Free Sans", "Arial Unicode MS",
                "Microsoft Sans Serif", "Lucida Sans Unicode";
    font-family /**/: inherit;
}
.polytonic {
    font-family: "Athena Unicode", Gentium, "Palatino Linotype",
                "Arial Unicode MS", "Lucida Sans Unicode",
                "Lucida Grande", Code2000;  
     font-family /**/: inherit;
}


#wpSave {
    // if shown now
    font-weight: bold;
    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;


/* class hiddenStructure is defunct. See [[Wikipedia:hiddenStructure]] */
    // if hidden now
.hiddenStructure {
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
    display: inline ! important;
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
    color: #f00;  
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
     background-color: #0f0;
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
     }
}
}


/* suppress missing interwiki image links where #ifexist cannot
// adds show/hide-button to navigation bars
  be used due to high number of requests see .hidden-redlink on
function createNavigationBarToggleButton()
  http://meta.wikimedia.org/wiki/MediaWiki:Common.css
{
*/
    var indexNavigationBar = 0;
.check-icon a.new {
    // iterate over all < div >-elements
     display: none;  
     var divs = document.getElementsByTagName("div");
     speak: none;
     for (var i = 0; NavFrame = divs[i]; i++) {
}
        // if found a navigation bar
        if (hasClass(NavFrame, "NavFrame")) {


/* Removes underlines from links */
            indexNavigationBar++;
.nounderlines a {
            var NavToggle = document.createElement("a");
    text-decoration: none;
            NavToggle.className = 'NavToggle';
}
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');


/* Remove underline from IPA links */
            var isCollapsed = hasClass( NavFrame, "collapsed" );
.IPA a:link, .IPA a:visited {
            /*
    text-decoration: none;
            * Check if any children are already hidden.  This loop is here for backwards compatibility:
}
            * the old way of making NavFrames start out collapsed was to manually add style="display:none"
            * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
            * the content visible without JavaScript support), the new recommended way is to add the class
            * "collapsed" to the NavFrame itself, just like with collapsible tables.
            */
            for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);


/* Standard Navigationsleisten, aka box hiding thingy
            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
  from .de.  Documentation at [[Wikipedia:NavFrame]]. */
            for(var j=0; j < NavFrame.childNodes.length; j++) {
div.NavFrame {
                if (hasClass(NavFrame.childNodes[j], "NavHead")) {
    margin: 0;
                    NavFrame.childNodes[j].appendChild(NavToggle);
    padding: 4px;
                }
    border: 1px solid #aaa;
            }
    text-align: center;
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
    border-collapse: collapse;
        }
    font-size: 95%;
     }
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
     margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    position: absolute;
    top: 0;
    right: 3px;
    font-weight: normal;
    font-size: 90%;
}
}


/* Hatnotes and disambiguation notices */
addOnloadHook( createNavigationBarToggleButton );
.rellink,
.dablink {
    font-style: italic;
    padding-left: 2em;
    margin-bottom: 0.5em;
}
.rellink i,
.dablink i {
    font-style: normal;
}


/* Style for horizontal UL lists */
.horizontal ul {
    padding: 0;
    margin: 0;
}
.horizontal li {
    padding: 0 0.6em 0 0.4em;
    display: inline;
    border-right: 1px solid;
}
.horizontal li:last-child {
    border-right: none;
    padding-right: 0;
}


/* Allow transcluded pages to display in lists rather than a table.
/** Main Page layout fixes *********************************************************
  Compatible in Firefox; incompatible in IE6. */
*
.listify td    { display: list-item; }
*  Description: Adds an additional link to the complete list of languages available.
.listify tr    { display: block; }
*  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
.listify table { display: block; }
 
/* Geographical coordinates defaults. See [[Template:Coord/link]]
  for how these are used. The classes "geo", "longitude", and
  "latitude" are used by the [[Geo microformat]].
  */
  */
.geo-default, .geo-dms, .geo-dec  { display: inline; }
.geo-nondefault, .geo-multi-punct { display: none; }
.longitude, .latitude            { white-space: nowrap; }


/* When <div class="nonumtoc"> is used on the table of contents,
if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page')
  the ToC will display without numbers */
    addOnloadHook(function () {
.nonumtoc .tocnumber { display: none; }
        addPortletLink('p-lang', 'http://meta.wikimedia.org/wiki/List_of_Wikipedias',
.nonumtoc #toc ul,
                'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')
.nonumtoc .toc ul {
        var nstab = document.getElementById('ca-nstab-main')
    line-height: 1.5em;
        if (nstab && wgUserLanguage=='en') {
    list-style: none;
            while (nstab.firstChild) nstab = nstab.firstChild
    margin: .3em 0 0;
            nstab.nodeValue = 'Main Page'
    padding: 0;
        }
}
    }
.nonumtoc #toc ul ul,  
)
.nonumtoc .toc ul ul {
    margin: 0 0 0 2em;
}
 
/* Allow limiting of which header levels are shown in a TOC;
  <div class="toclimit-3">, for instance, will limit to
  showing ==headings== and ===headings=== but no further
  (as long as there are no =headings= on the page, which
  there shouldn't be according to the MoS).
*/
.toclimit-2 .toclevel-2,
.toclimit-3 .toclevel-3,
.toclimit-4 .toclevel-4,
.toclimit-5 .toclevel-5,
.toclimit-6 .toclevel-6,
.toclimit-7 .toclevel-7 { display: none; }


/* Styling for Template:Quote */
blockquote.templatequote {
    margin-top: 0;
}
blockquote.templatequote div.templatequotecite {
    line-height: 1em;
    text-align: left;
    padding-left: 2em;
    margin-top: 0;
}
blockquote.templatequote div.templatequotecite cite {
    font-size: 85%;
}


div.user-block {
/** Table sorting fixes ************************************************
    padding: 5px;
  *
    border: 1px solid #A9A9A9;
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
    background-color: #FFEFD5;
  *  Maintainers: [[User:Random832]]
}
  */


/* Prevent line breaks in silly places:
ts_alternate_row_colors = false;
  1) Links when we don't want them to
  2) Bold "links" to the page itself
  2) HTML formulae
  3) Ref tags with group names <ref group="Note"> --> "[Note 1]"
*/
.nowraplinks a,
.nowraplinks .selflink,
span.texhtml,
sup.reference a {
    white-space: nowrap;
}


/* For template documentation */
.template-documentation {
    clear: both;
    margin: 1em 0 0 0;
    border: 1px solid #aaa;
    background-color: #ecfcf4;
    padding: 1em;
}


.thumbinner {
/***** uploadwizard_newusers ********
     min-width: 100px;
* Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
*
*  Maintainers: [[User:Krimpet]]
****/
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 && wgTitle == "Upload" && wgAction == "view") {
    var oldDiv = document.getElementById("autoconfirmedusers"),
        newDiv = document.getElementById("newusers");
    if (oldDiv && newDiv) {
      if (typeof wgUserGroups == "object" && wgUserGroups) {
        for (i = 0; i < wgUserGroups.length; i++) {
          if (wgUserGroups[i] == "autoconfirmed") {
            oldDiv.style.display = "block";
            newDiv.style.display = "none";
            return;
          }
        }
      }
      oldDiv.style.display = "none";
      newDiv.style.display = "block";
      return;
     }
  }
}
}
addOnloadHook(uploadwizard_newusers);


/* Inline divs in ImageMaps (code borrowed from de.wiki) */
.imagemap-inline div {
    display: inline;
}


/* Increase the height of the image upload box */
/** IPv6 AAAA connectivity testing **/
#wpUploadDescription {
    height: 13em;
}


/* Reduce line-height for <sup> and <sub> */
var __ipv6wwwtest_factor = 100;
sup, sub {
var __ipv6wwwtest_done = 0;
     line-height: 1em;
if ((wgServer != "https://secure.wikimedia.org") && (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
     importScript("MediaWiki:Common.js/IPv6.js");
}
}


/* Remove white border from thumbnails */
/** Magic editintros ****************************************************
div.thumb {
*
    border: none;
*  Description: Adds editintros on disambiguation pages and BLP pages.
}
*  Maintainers: [[User:RockMFR]]
div.tright {
*/
    border: none;
    margin: 0.5em 0 0.8em 1.4em;
}
div.tleft {
    border: none;
    margin: 0.5em 1.4em 0.8em 0;
}


/* Makes the background of a framed image white instead of gray. */
function addEditIntro(name)
/* Only visible with transparent images. */
{
div.thumb img.thumbimage {
  var el = document.getElementById('ca-edit');
    background-color: #fff;
  if (!el)
}
     return;
   el = el.getElementsByTagName('a')[0];
/* The backgrounds for galleries. */
  if (el)
#content .gallerybox div.thumb {
    el.href += '&editintro=' + name;
     background-color: #F9F9F9/* Light gray padding */
}
/* Put a chequered background behind images, only visible if they have transparency */
.gallerybox .thumb img,
#file img {
    background: white url("http://upload.wikimedia.org/wikipedia/commons/5/5d/Checker-16x16.png") repeat;
}
/* But not on articles, user pages, portals or with opt-out. */
.ns-0 .gallerybox .thumb img,
.ns-2 .gallerybox .thumb img,
.ns-100 .gallerybox .thumb img,
.nochecker .gallerybox .thumb img {
    background: white;
}
}


/* Prevent floating boxes from overlapping any category listings,
  file histories, edit previews, and edit [Show changes] views */
#mw-subcategories, #mw-pages, #mw-category-media,
#filehistory, #wikiPreview, #wikiDiff {
    clear: both;
}


/* Selectively hide headers in WikiProject banners */
if (wgNamespaceNumber == 0) {
.wpb .wpb-header            { display: none; }
  addOnloadHook(function(){
.wpbs-inner .wpb .wpb-header { display: block; }    /* for IE */
    if (document.getElementById('disambigbox'))
.wpbs-inner .wpb .wpb-header { display: table-row; } /* for real browsers */
      addEditIntro('Template:Disambig_editintro');
.wpbs-inner .wpb-outside    { display: none; }      /* hide things that should only display outside shells */
  });


/* Styling for Abuse Filter tags */
  addOnloadHook(function(){
.mw-tag-markers {
    var cats = document.getElementById('mw-normal-catlinks');
font-family:sans-serif;
    if (!cats)
font-style:italic;
      return;
font-size:90%;
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i < cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}
}


/* Fix so <tt>, <code> and <pre> tags get normal text size also in
/*
  some versions of Firefox, Safari, Konqueror, Chrome etc. */
* Description: Stay on the secure server as much as possible
tt, code, pre {
* Maintainers: [[User:TheDJ]]
    font-family: monospace, sans-serif;
*/
}
if(wgServer == 'https://secure.wikimedia.org') {
 
     importScript( 'MediaWiki:Common.js/secure.js');
/* Remove bullets when there are multiple edit page warnings */
ul.permissions-errors > li {
     list-style: none;
}
ul.permissions-errors {
    margin: 0;
}
}


/* </source> */
//</source>

Latest revision as of 10:32, 3 November 2017

//<source lang="javascript">

/*
 * Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page
 * Maintainer: Cacycle
 */
if (wgArticleId == 0 && wgUserName) {
  var slash = wgPageName.indexOf('/');
  var norm = wgPageName.substr(0, slash) + wgPageName.substr(slash).toLowerCase();
  var test = 'User:' + wgUserName.replace(/ /g, '_') + '/skin.';
  var ext = null;
  if (norm == test + 'js') ext = 'js';
  else if (norm == test + 'css') ext = 'css';
  if (ext != null) window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.' + ext);
}

/** extract a URL parameter from the current URL **********
 * From [[en:User:Lupin/autoedit.js]]
 *
 * paramName  : the name of the parameter to extract
 */
function getURLParamValue( paramName, url) 
{
 if (typeof (url) == 'undefined'  || url === null) url = document.location.href;
 var cmdRe=RegExp( '[&?]' + paramName + '=([^&#]*)' ); // Stop at hash
 var m=cmdRe.exec(url);
 if (m && m.length > 1) return decodeURIComponent(m[1]);
 return null;
}

/** &withJS= URL parameter *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing [[Special:Mypage/monobook.js]]
 */
var extraJS = getURLParamValue("withJS");
if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\.js$") ) {
  importScript(extraJS);
}

/* Import more specific scripts if necessary */

if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload") //scripts specific to editing pages
{
    importScript("MediaWiki:Common.js/edit.js")

}
else if (wgPageName == "Special:Watchlist") //watchlist scripts
{
    importScript("MediaWiki:Common.js/watchlist.js")
}
if( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/** For sysops and accountcreators *****************************************
 *
 *  Description: Allows for sysop-specific Javascript at [[MediaWiki:Sysop.js]],
 *               and accountcreator-specific CSS at [[MediaWiki:Accountcreator.css]].
 */
if ( wgUserGroups ) {
  for ( var g = 0; g < wgUserGroups.length; ++g ) {
    if ( wgUserGroups[g] == "sysop" ) {
      importStylesheet("MediaWiki:Sysop.css");
      addOnloadHook( function() {
        if ( !window.disableSysopJS ) {
          importScript("MediaWiki:Sysop.js");
        }
      } );
    } 
    else if ( wgUserGroups[g] == "accountcreator" ) {
      importStylesheet("MediaWiki:Accountcreator.css");
    }
  }
}


/* Scripts specific to Internet Explorer */

if (navigator.appName == "Microsoft Internet Explorer")
{
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    function fixIEScroll()
    {
        if (!oldWidth || docEl.clientWidth > oldWidth)
            doFixIEScroll();
        else
            setTimeout(doFixIEScroll, 1);
        
        oldWidth = docEl.clientWidth;
    }
    
    function doFixIEScroll() {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth < 4) ? "hidden" : "";
    }
    
    document.attachEvent("onreadystatechange", fixIEScroll);
    document.attachEvent("onresize", fixIEScroll);
    
    
    /**
     * Remove need for CSS hacks regarding MSIE and IPA.
     */
    if (document.createStyleSheet) {
        document.createStyleSheet().addRule('.IPA', 'font-family: "Doulos SIL", "Charis SIL", Gentium, "DejaVu Sans", Code2000, "TITUS Cyberbit Basic", "Arial Unicode MS", "Lucida Sans Unicode", "Chrysanthi Unicode";');
    }

    // In print IE (7?) does not like line-height
    appendCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');

    // IE overflow bug
    appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    //Use to fix right floating div/table inside tables.
    appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}' );
    
    //Import scripts specific to Internet Explorer 6
    if (navigator.appVersion.substr(22, 1) == "6") {
        importScript("MediaWiki:Common.js/IE60Fixes.js")
    }
}


/* Test if an element has a certain class **************************************
 *
 * Description: Uses regular expressions and caching for better performance.
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 */

var hasClass = (function () {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() 
{
    if ( document.getElementById( "p-lang" ) ) {
        var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );

        for ( var i = 0; i < InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {
                InterwikiLinks[i].className += " FA"
                InterwikiLinks[i].title = "This is a featured article in another language.";
            }
        }
    }
}

addOnloadHook( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = "hide";
var expandCaption = "show";

function collapseTable( tableIndex )
{
    var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = "none";
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons()
{
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );

    for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "collapsible" ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );

            var Button     = document.createElement( "span" );
            var ButtonLink = document.createElement( "a" );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = "collapseButton";  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( "[" ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( "]" ) );

            Header.insertBefore( Button, Header.childNodes[0] );
            tableIndex++;
        }
    }

    for ( var i = 0;  i < tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, "outercollapse" ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

addOnloadHook( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia: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
function createNavigationBarToggleButton()
{
    var indexNavigationBar = 0;
    // iterate over all < div >-elements 
    var divs = document.getElementsByTagName("div");
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, "NavFrame")) {

            indexNavigationBar++;
            var NavToggle = document.createElement("a");
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, "collapsed" );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style="display:none"
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * "collapsed" to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j < NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], "NavHead")) {
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

addOnloadHook( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') 
    addOnloadHook(function () {
        addPortletLink('p-lang', 'http://meta.wikimedia.org/wiki/List_of_Wikipedias',
                 'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')
        var nstab = document.getElementById('ca-nstab-main')
        if (nstab && wgUserLanguage=='en') {
            while (nstab.firstChild) nstab = nstab.firstChild
            nstab.nodeValue = 'Main Page'
        }
    }
)


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */

ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 ****/
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 && wgTitle == "Upload" && wgAction == "view") {
    var oldDiv = document.getElementById("autoconfirmedusers"),
        newDiv = document.getElementById("newusers");
    if (oldDiv && newDiv) {
      if (typeof wgUserGroups == "object" && wgUserGroups) {
        for (i = 0; i < wgUserGroups.length; i++) {
          if (wgUserGroups[i] == "autoconfirmed") {
            oldDiv.style.display = "block";
            newDiv.style.display = "none";
            return;
          }
        }
      }
      oldDiv.style.display = "none";
      newDiv.style.display = "block";
      return;
    }
  }
}
addOnloadHook(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing **/

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != "https://secure.wikimedia.org") && (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript("MediaWiki:Common.js/IPv6.js");
}

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro(name)
{
  var el = document.getElementById('ca-edit');
  if (!el)
    return;
  el = el.getElementsByTagName('a')[0];
  if (el)
    el.href += '&editintro=' + name;
}


if (wgNamespaceNumber == 0) {
  addOnloadHook(function(){
    if (document.getElementById('disambigbox'))
      addEditIntro('Template:Disambig_editintro');
  });

  addOnloadHook(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats)
      return;
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i < cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/*
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if(wgServer == 'https://secure.wikimedia.org') {
    importScript( 'MediaWiki:Common.js/secure.js');
}

//</source>