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
Line 1: Line 1:
/* <source lang="css"> */
//<source lang="javascript">
/* Main page fixes */
#interwiki-completelist {
    font-weight: bold;
}
body.page-Main_Page #ca-delete {
    display: none !important;
}


body.page-Main_Page #mp-topbanner {
/*
  clear: both;
* 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);
}
}


/* Edit window toolbar */
/** extract a URL parameter from the current URL **********
#toolbar {
* From [[en:User:Lupin/autoedit.js]]
    height: 22px;
*
    margin-bottom: 6px;
* 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;
}
}


/* Margins for <ol> and <ul> */
/** &withJS= URL parameter *******
#content ol, #content ul,
* Allow to try custom scripts from MediaWiki space
#mw_content ol, #mw_content ul {
* without editing [[Special:Mypage/monobook.js]]
   margin-bottom: 0.5em;
*/
var extraJS = getURLParamValue("withJS");
if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\.js$") ) {
   importScript(extraJS);
}
}


/* Make the list of references in [[Template:Reflist]] smaller */
/* Import more specific scripts if necessary */
.references-small {
    font-size: 90%;
}


/* Highlight clicked reference in blue to help navigation */
if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload") //scripts specific to editing pages
ol.references > li:target,
{
sup.reference:target,
     importScript("MediaWiki:Common.js/edit.js")
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 */
/** WikiMiniAtlas *******************************************************
table.wikitable,
  *
table.prettytable {
  *  Description: WikiMiniAtlas is a popup click and drag world map.
    margin: 1em 1em 1em 0;
  *              This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
    background: #f9f9f9;
  *              The script itself is located on meta because it is used by many projects.
    border: 1px #aaa solid;
  *              See [[Meta:WikiMiniAtlas]] for more information.  
    border-collapse: collapse;
  *  Maintainers: [[User:Dschwen]]
}
  */
.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 (wgServer == "https://secure.wikimedia.org") {
table.navbox {            /* Navbox container style */
     var metaBase = "https://secure.wikimedia.org/wikipedia/meta";
  border: 1px solid #aaa;
} else {
  width: 100%;
     var metaBase = "http://meta.wikimedia.org";
  margin: auto;
  clear: both;
  font-size: 88%;
  text-align: center;
  padding: 1px;
}
table.navbox + table.navbox {  /* Single pixel border between adjacent navboxes */
  margin-top: -1px;            /* (doesn't work for IE6, but that's okay)      */
}
.navbox-title,
.navbox-abovebelow,
table.navbox th {
  text-align: center;      /* Title and above/below styles */
  padding-left: 1em;
  padding-right: 1em;
}
.navbox-group {            /* Group style */
  white-space: nowrap;
  text-align: right;
  font-weight: bold;
  padding-left: 1em;
  padding-right: 1em;
}
.navbox, .navbox-subgroup {
  background: #fdfdfd;     /* Background color */
}
.navbox-list {
  border-color: #fdfdfd;  /* Must match background color */
}
.navbox-title,
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 */
}
}
importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")


.collapseButton {          /* 'show'/'hide' buttons created dynamically */
    float: right;          /* by the CollapsibleTables javascript in    */
    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.        */


/** Mobile Redirect Helper ************************************************
*
*  Redirects to the mobile-optimized gateway at en.m.wikimedia.org
*  for viewers on iPhone, iPod Touch, Palm Pre, and Android devices.
*
*  You can turn off the redirect by setting the cookie "stopMobileRedirect=true"
*
*  This code cannot be imported, because the JS only loads after all other files
*  and this was causing major issues for users with mobile devices. Must be loaded
*  *before* the images and etc of the page on all mobile devices.
*
*  Maintainer: [[User:Brion VIBBER]], [[User:hcatlin]]
*/
if (/(Android|iPhone|iPod|webOS|NetFront|Opera Mini|SEMC-Browser|PlayStation Portable|Nintendo Wii)/.test(navigator.userAgent)) {


/* Infobox template style */
  var wgMainPageName = 'Main_Page';
.infobox {
    border: 1px solid #aaa;
  var stopMobileRedirectCookieExists = function() {
    background-color: #f9f9f9;
     return (document.cookie.indexOf("stopMobileRedirect=true") >= 0);
    color: black;
  }
     margin: 0.5em 0 0.5em 1em;
    padding: 0.2em;
  var mobileSiteLink = function() {
    float: right;
     if (wgCanonicalNamespace == 'Special' && wgCanonicalSpecialPageName == 'Search') {
    clear: right;
        var pageLink = '?search=' + encodeURIComponent(document.getElementById('searchText').value);
}
    } else if (wgPageName == wgMainPageName) {
.infobox td,
        var pageLink = '::Home'; // Special case
.infobox th {
    } else {
     vertical-align: top;
        var pageLink = encodeURIComponent(wgPageName).replace('%2F','/').replace('%3A',':');
}
    }
.infobox caption {
    return 'http://' + wgContentLanguage + '.m.wikipedia.org/wiki/' + pageLink + "?wasRedirected=true"
    font-size: larger;
  }
}
.infobox.bordered {
  if (!stopMobileRedirectCookieExists()) {
    border-collapse: collapse;
     document.location = mobileSiteLink();
}
  }
.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 {
/* Scripts specific to Internet Explorer */
    border: 1px solid #c0c090;
    background-color: #f8eaba;
}
.infobox.standard-talk.bordered td,
.infobox.standard-talk.bordered th {
    border: 1px solid #c0c090;
}


/* styles for bordered infobox with merged rows */
if (navigator.appName == "Microsoft Internet Explorer")
.infobox.bordered .mergedtoprow td,
{
.infobox.bordered .mergedtoprow th {
    /** Internet Explorer bug fix **************************************************
     border: 0;
    *
     border-top: 1px solid #aaa;
    *  Description: Fixes IE horizontal scrollbar bug
     border-right: 1px solid #aaa;
    *  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";');
    }


.infobox.bordered .mergedrow td,
    // In print IE (7?) does not like line-height
.infobox.bordered .mergedrow th {
    appendCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');
    border: 0;
    border-right: 1px solid #aaa;
}


/* Styles for geography infoboxes, eg countries,
    // IE overflow bug
  country subdivisions, cities, etc.            */
    appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');
.infobox.geography {
    text-align: left;
    border-collapse: collapse;
    line-height: 1.2em;  
    font-size: 90%;
}


.infobox.geography  td,
    // IE zoomfix
.infobox.geography  th {
    //Use to fix right floating div/table inside tables.
    border-top: solid 1px #aaa;
    appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}' );
     padding: 0.4em 0.6em 0.4em 0.6em;
      
}
    //Import scripts specific to Internet Explorer 6
.infobox.geography .mergedtoprow td,
    if (navigator.appVersion.substr(22, 1) == "6") {
.infobox.geography .mergedtoprow th {
        importScript("MediaWiki:Common.js/IE60Fixes.js")
     border-top: solid 1px #aaa;
     }
    padding: 0.4em 0.6em 0.2em 0.6em;
}
}


.infobox.geography .mergedrow td,
.infobox.geography .mergedrow th {
    border: 0;
    padding: 0 0.6em 0.2em 0.6em;
}


.infobox.geography .mergedbottomrow td,
/* Test if an element has a certain class **************************************
.infobox.geography .mergedbottomrow th {
*
    border-top: 0;
* Description: Uses regular expressions and caching for better performance.
    border-bottom: solid 1px #aaa;
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
    padding: 0 0.6em 0.4em 0.6em;
*/
}


.infobox.geography .maptable td,
var hasClass = (function () {
.infobox.geography .maptable th {
    var reCache = {};
     border: 0;
     return function (element, className) {
     padding: 0;
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
}
     };
})();


/* Makes redirects appear in italics in categories and on [[Special:Allpages]] */
.redirect-in-category, .allpagesredirect {
    font-style: italic;
}


/* Icons for medialist templates [[Template:Listen]],
/** Interwiki links to featured articles ***************************************
  [[Template:Multi-listen_start]], [[Template:Video]],
*
  [[Template:Multi-video_start]]
*  Description: Highlights interwiki links to featured articles (or
*/
*               equivalents) by changing the bullet before the interwiki link
div.listenlist {
*              into a star.
    background:
*  Maintainers: [[User:R. Koot]]
        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 LinkFA()
div.medialist {
{
     min-height: 50px;
     if ( document.getElementById( "p-lang" ) ) {
    margin: 1em;
        var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );
    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
        for ( var i = 0; i < InterwikiLinks.length; i++ ) {
  in browsers that support these CSS selectors, like Mozilla and Opera */
            if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {
#content a[href$=".pdf"].external,
                InterwikiLinks[i].className += " FA"
#content a[href*=".pdf?"].external,
                InterwikiLinks[i].title = "This is a featured article in another language.";
#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
addOnloadHook( LinkFA );
  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]] */
div.columns-2 div.column {
    float: left;
    width: 50%;
    min-width: 300px;
}
div.columns-3 div.column {
    float: left;
    width: 33.3%;
    min-width: 200px;
}
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 */
/** Collapsible tables *********************************************************
.messagebox {
*
    border: 1px solid #aaa;
*  Description: Allows tables to be collapsed, showing only the header. See
    background-color: #f9f9f9;
*              [[Wikipedia:NavFrame]].
    width: 80%;
*  Maintainers: [[User:R. Koot]]
    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;
}


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


/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
function collapseTable( tableIndex )
th.mbox-text, td.mbox-text {    /* The message body cell(s) */
{
    border: none;
     var Button = document.getElementById( "collapseButton" + tableIndex );
    padding: 0.25em 0.9em;      /* 0.9em left/right */
     var Table = document.getElementById( "collapsibleTable" + tableIndex );
    width: 100%;    /* Make all mboxes the same width regardless of text length */
}
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 */
     if ( !Table || !Button ) {
table.ambox {
        return false;
    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 Rows = Table.rows;
    border-left: 10px solid #1e90ff;    /* Blue */
}
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 */
    if ( Button.firstChild.data == collapseCaption ) {
table.imbox {
        for ( var i = 1; i < Rows.length; i++ ) {
    margin: 4px 10%;  
            Rows[i].style.display = "none";
    border-collapse: collapse;  
        }
    border: 3px solid #1e90ff;    /* Default "notice" blue */
        Button.firstChild.data = expandCaption;
    background: #fbfbfb;
    } else {
}
        for ( var i = 1; i < Rows.length; i++ ) {
.imbox .mbox-text .imbox {   /* For imboxes inside imbox-text cells. */
            Rows[i].style.display = Rows[0].style.display;
    margin: 0 -0.5em;   /* 0.9 - 0.5 = 0.4em left/right. */
        }
}
        Button.firstChild.data = collapseCaption;
.mbox-inside .imbox {    /* For imboxes inside other templates. */
     }
     margin: 4px;
}
}


table.imbox-notice {
function createCollapseButtons()
    border: 3px solid #1e90ff;    /* Blue */
{
}
     var tableIndex = 0;
table.imbox-speedy {
     var NavigationBoxes = new Object();
    border: 3px solid #b22222;    /* Red */
     var Tables = document.getElementsByTagName( "table" );
    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 */
     for ( var i = 0; i < Tables.length; i++ ) {
table.cmbox {
        if ( hasClass( Tables[i], "collapsible" ) ) {
     margin: 3px 10%;
    border-collapse: collapse;
    border: 1px solid #aaa;
    background: #DFE8FF;    /* Default "notice" blue */
}


table.cmbox-notice {
            /* only add button and increment count if there is a header row to work with */
    background: #D8E8FF;    /* Blue */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
}
            if (!HeaderRow) continue;
table.cmbox-speedy {
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
    margin-top: 4px;
            if (!Header) continue;
    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 */
            NavigationBoxes[ tableIndex ] = Tables[i];
table.ombox {
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
    margin: 4px 10%;
    border-collapse: collapse;
    border: 1px solid #aaa;      /* Default "notice" gray */
    background: #f9f9f9;
}


table.ombox-notice {
             var Button     = document.createElement( "span" );
    border: 1px solid #aaa;      /* Gray */
            var ButtonLink = document.createElement( "a" );
}
            var ButtonText = document.createTextNode( collapseCaption );
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 {
             Button.className = "collapseButton"; //Styles are declared in Common.css
    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 */
            ButtonLink.style.color = Header.style.color;
table.dmbox {
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
    clear: both;
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
    margin: 0.9em 1em;
            ButtonLink.appendChild( ButtonText );
    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
            Button.appendChild( document.createTextNode( "[" ) );
  ambox/tmbox/ombox etc classes. "body.mediawiki" is so
            Button.appendChild( ButtonLink );
  they override "table.ambox + table.ambox" above. */
            Button.appendChild( document.createTextNode( "]" ) );
body.mediawiki table.mbox-small {  /* For the "small=yes" option. */
    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;
}


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


/* Remove default styles for [[MediaWiki:Noarticletext]]. */
    for ( var i = 0;  i < tableIndex; i++ ) {
div.noarticletext {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
    border: none;
            collapseTable( i );
    background: transparent;
        }
     padding: 0;
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, "outercollapse" ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
     }
}
}


/* Support for Template:IPA, Template:Unicode and Template:Polytonic.
addOnloadHook( createCollapseButtons );
  The second declarations reset the styles for all browsers except
  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 {
    font-weight: bold;
}


/* class hiddenStructure is defunct. See [[Wikipedia:hiddenStructure]] */
/** Dynamic Navigation Bars (experimental) *************************************
.hiddenStructure {
*
    display: inline ! important;
*  Description: See [[Wikipedia:NavFrame]].
    color: #f00;
*  Maintainers: UNMAINTAINED
    background-color: #0f0;
*/
}


/* suppress missing interwiki image links where #ifexist cannot
// set up the words in your language
  be used due to high number of requests see .hidden-redlink on
var NavigationBarHide = '[' + collapseCaption + ']';
  http://meta.wikimedia.org/wiki/MediaWiki:Common.css
var NavigationBarShow = '[' + expandCaption + ']';
*/
.check-icon a.new {
    display: none;  
    speak: none;
}


/* Removes underlines from links */
// shows and hides content and picture (if available) of navigation bars
.nounderlines a {  
// Parameters:
     text-decoration: none;
//    indexNavigationBar: the index of navigation bar to be toggled
}
function toggleNavigationBar(indexNavigationBar)
{
     var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
    var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);


/* Remove underline from IPA links */
    if (!NavFrame || !NavToggle) {
.IPA a:link, .IPA a:visited {
        return false;
    text-decoration: none;
    }
}


/* Standard Navigationsleisten, aka box hiding thingy
    // if shown now
  from .de.  Documentation at [[Wikipedia:NavFrame]]. */
     if (NavToggle.firstChild.data == NavigationBarHide) {
div.NavFrame {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
     margin: 0;
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
    padding: 4px;
                NavChild.style.display = 'none';
    border: 1px solid #aaa;
            }
    text-align: center;
        }
    border-collapse: collapse;
     NavToggle.firstChild.data = NavigationBarShow;
    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 */
    // if hidden now
.rellink,
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
.dablink {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
    font-style: italic;
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
    padding-left: 2em;
                NavChild.style.display = 'block';
    margin-bottom: 0.5em;
            }
}
        }
.rellink i,
        NavToggle.firstChild.data = NavigationBarHide;
.dablink i {
     }
     font-style: normal;
}
}


/* Style for horizontal UL lists */
// adds show/hide-button to navigation bars
.horizontal ul {
function createNavigationBarToggleButton()
     padding: 0;
{
     margin: 0;
     var indexNavigationBar = 0;
}
     // iterate over all < div >-elements
.horizontal li {
     var divs = document.getElementsByTagName("div");
     padding: 0 0.6em 0 0.4em;
     for (var i = 0; NavFrame = divs[i]; i++) {
     display: inline;
        // if found a navigation bar
    border-right: 1px solid;
        if (hasClass(NavFrame, "NavFrame")) {
}
.horizontal li:last-child {
    border-right: none;
    padding-right: 0;
}


/* Allow transcluded pages to display in lists rather than a table.
            indexNavigationBar++;
  Compatible in Firefox; incompatible in IE6. */
            var NavToggle = document.createElement("a");
.listify td    { display: list-item; }
            NavToggle.className = 'NavToggle';
.listify tr    { display: block; }
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
.listify table { display: block; }
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');


/* Geographical coordinates defaults. See [[Template:Coord/link]]
            var isCollapsed = hasClass( NavFrame, "collapsed" );
  for how these are used. The classes "geo", "longitude", and
            /*
  "latitude" are used by the [[Geo microformat]].
            * 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"
.geo-default, .geo-dms, .geo-dec  { display: inline; }
            * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
.geo-nondefault, .geo-multi-punct { display: none; }
            * the content visible without JavaScript support), the new recommended way is to add the class
.longitude, .latitude            { white-space: nowrap; }
            * "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);


/* When <div class="nonumtoc"> is used on the table of contents,
            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
  the ToC will display without numbers */
            for(var j=0; j < NavFrame.childNodes.length; j++) {
.nonumtoc .tocnumber { display: none; }
                if (hasClass(NavFrame.childNodes[j], "NavHead")) {
.nonumtoc #toc ul,
                    NavFrame.childNodes[j].appendChild(NavToggle);
.nonumtoc .toc ul {
                }
    line-height: 1.5em;
            }
    list-style: none;
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
    margin: .3em 0 0;
        }
    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;
addOnloadHook( createNavigationBarToggleButton );
  <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
/** Main Page layout fixes *********************************************************
  there shouldn't be according to the MoS).
*
*  Description: Adds an additional link to the complete list of languages available.
*  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
  */
  */
.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 */
if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page')
blockquote.templatequote {  
    addOnloadHook(function () {
    margin-top: 0;
        addPortletLink('p-lang', 'http://meta.wikimedia.org/wiki/List_of_Wikipedias',
}
                'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')
blockquote.templatequote div.templatequotecite {
        var nstab = document.getElementById('ca-nstab-main')
    line-height: 1em;
        if (nstab && wgUserLanguage=='en') {
    text-align: left;
            while (nstab.firstChild) nstab = nstab.firstChild
    padding-left: 2em;
            nstab.nodeValue = 'Main Page'
    margin-top: 0;
        }
}
     }
blockquote.templatequote div.templatequotecite cite {
)
     font-size: 85%;
}


div.user-block {
    padding: 5px;
    border: 1px solid #A9A9A9;
    background-color: #FFEFD5;
}


/* Prevent line breaks in silly places:
/** Table sorting fixes ************************************************
  1) Links when we don't want them to
  *
  2) Bold "links" to the page itself
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  2) HTML formulae
  *  Maintainers: [[User:Random832]]
  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 */
ts_alternate_row_colors = false;
.template-documentation {
    clear: both;
    margin: 1em 0 0 0;
    border: 1px solid #aaa;
    background-color: #ecfcf4;
    padding: 1em;
}


.thumbinner {
    min-width: 100px;
}


/* Inline divs in ImageMaps (code borrowed from de.wiki) */
/***** uploadwizard_newusers ********
.imagemap-inline div {
* Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
    display: inline;
*
*  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);


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


/* Reduce line-height for <sup> and <sub> */
/** IPv6 AAAA connectivity testing **/
sup, sub {
    line-height: 1em;
}


/* Remove white border from thumbnails */
var __ipv6wwwtest_factor = 100;
div.thumb {
var __ipv6wwwtest_done = 0;
    border: none;
if ((wgServer != "https://secure.wikimedia.org") && (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
}
     importScript("MediaWiki:Common.js/IPv6.js");
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. */
/** Magic editintros ****************************************************
/* Only visible with transparent images. */
*
div.thumb img.thumbimage {
*  Description: Adds editintros on disambiguation pages and BLP pages.
    background-color: #fff;
* Maintainers: [[User:RockMFR]]
}
*/
/* The backgrounds for galleries. */
#content .gallerybox div.thumb {
    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,
function addEditIntro(name)
  file histories, edit previews, and edit [Show changes] views */
{
#mw-subcategories, #mw-pages, #mw-category-media,
  var el = document.getElementById('ca-edit');
#filehistory, #wikiPreview, #wikiDiff {
  if (!el)
     clear: both;
    return;
  el = el.getElementsByTagName('a')[0];
  if (el)
     el.href += '&editintro=' + name;
}
}


/* Selectively hide headers in WikiProject banners */
.wpb .wpb-header            { display: none; }
.wpbs-inner .wpb .wpb-header { display: block; }    /* for IE */
.wpbs-inner .wpb .wpb-header { display: table-row; } /* for real browsers */
.wpbs-inner .wpb-outside    { display: none; }      /* hide things that should only display outside shells */


/* Styling for Abuse Filter tags */
if (wgNamespaceNumber == 0) {
.mw-tag-markers {
  addOnloadHook(function(){
font-family:sans-serif;
    if (document.getElementById('disambigbox'))
font-style:italic;
      addEditIntro('Template:Disambig_editintro');
font-size:90%;
  });
}


/* Fix so <tt>, <code> and <pre> tags get normal text size also in
  addOnloadHook(function(){
  some versions of Firefox, Safari, Konqueror, Chrome etc. */
    var cats = document.getElementById('mw-normal-catlinks');
tt, code, pre {
    if (!cats)
     font-family: monospace, sans-serif;
      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;
      }
     }
  });
}
}


/* Remove bullets when there are multiple edit page warnings */
/*
ul.permissions-errors > li {
* Description: Stay on the secure server as much as possible
    list-style: none;
* Maintainers: [[User:TheDJ]]
}
*/
ul.permissions-errors {
if(wgServer == 'https://secure.wikimedia.org') {
     margin: 0;
     importScript( 'MediaWiki:Common.js/secure.js');
}
}


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

Revision as of 16:06, 3 April 2010

//<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");
    }
  }
}


/** WikiMiniAtlas *******************************************************
  *
  *  Description: WikiMiniAtlas is a popup click and drag world map.
  *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
  *               The script itself is located on meta because it is used by many projects.
  *               See [[Meta:WikiMiniAtlas]] for more information. 
  *  Maintainers: [[User:Dschwen]]
  */

if (wgServer == "https://secure.wikimedia.org") {
    var metaBase = "https://secure.wikimedia.org/wikipedia/meta";
} else {
    var metaBase = "http://meta.wikimedia.org";
}
importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")


/** Mobile Redirect Helper ************************************************
 *
 *  Redirects to the mobile-optimized gateway at en.m.wikimedia.org
 *  for viewers on iPhone, iPod Touch, Palm Pre, and Android devices.
 *
 *  You can turn off the redirect by setting the cookie "stopMobileRedirect=true"
 *
 *  This code cannot be imported, because the JS only loads after all other files
 *  and this was causing major issues for users with mobile devices. Must be loaded
 *  *before* the images and etc of the page on all mobile devices.
 *
 *  Maintainer: [[User:Brion VIBBER]], [[User:hcatlin]]
 */
if (/(Android|iPhone|iPod|webOS|NetFront|Opera Mini|SEMC-Browser|PlayStation Portable|Nintendo Wii)/.test(navigator.userAgent)) {

  var wgMainPageName = 'Main_Page';
 
  var stopMobileRedirectCookieExists = function() {
    return (document.cookie.indexOf("stopMobileRedirect=true") >= 0);
  }
 
  var mobileSiteLink = function() {
    if (wgCanonicalNamespace == 'Special' && wgCanonicalSpecialPageName == 'Search') {
        var pageLink = '?search=' + encodeURIComponent(document.getElementById('searchText').value);
    } else if (wgPageName == wgMainPageName) {
        var pageLink = '::Home'; // Special case
    } else {
        var pageLink = encodeURIComponent(wgPageName).replace('%2F','/').replace('%3A',':');
    }
    return 'http://' + wgContentLanguage + '.m.wikipedia.org/wiki/' + pageLink + "?wasRedirected=true"
  }
 
  if (!stopMobileRedirectCookieExists()) {
    document.location = mobileSiteLink();
  }
}


/* 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>