MediaWiki:Common.js: Difference between revisions

From NESG Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */  
 
//&lt;source lang="javascript"&gt;<br><br>/*<br>&nbsp;* Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page<br>&nbsp;* Maintainer: Cacycle<br>&nbsp;*/<br>if (wgArticleId == 0 &amp;&amp; wgUserName) {<br>&nbsp; var slash = wgPageName.indexOf('/');<br>&nbsp; var norm = wgPageName.substr(0, slash) + wgPageName.substr(slash).toLowerCase();<br>&nbsp; var test = 'User:' + wgUserName.replace(/ /g, '_') + '/skin.';<br>&nbsp; var ext = null;<br>&nbsp; if (norm == test + 'js') ext = 'js';<br>&nbsp; else if (norm == test + 'css') ext = 'css';<br>&nbsp; if (ext&nbsp;!= null) window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.' + ext);<br>}<br><br>/** extract a URL parameter from the current URL **********<br>&nbsp;* From [[En:User:Lupin/autoedit.js]]<br>&nbsp;*<br>&nbsp;* paramName&nbsp;&nbsp;: the name of the parameter to extract<br>&nbsp;*/<br>function getURLParamValue( paramName, url) <br>{<br>&nbsp;if (typeof (url) == 'undefined'&nbsp; || url === null) url = document.location.href;<br>&nbsp;var cmdRe=RegExp( '[&amp;?]' + paramName + '=([^&amp;#]*)' ); // Stop at hash<br>&nbsp;var m=cmdRe.exec(url);<br>&nbsp;if (m &amp;&amp; m.length &gt; 1) return decodeURIComponent(m[1]);<br>&nbsp;return null;<br>}<br><br>/** &amp;withJS= URL parameter *******<br>&nbsp;* Allow to try custom scripts from MediaWiki space <br>&nbsp;* without editing [[Special:Mypage/monobook.js]]<br>&nbsp;*/<br>var extraJS = getURLParamValue("withJS");<br>if ( extraJS &amp;&amp; extraJS.match("^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$") ) {<br>&nbsp; importScript(extraJS);<br>}<br><br>/* Import more specific scripts if necessary */<br><br>if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload") //scripts specific to editing pages<br>{<br>&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/edit.js")<br>}<br>else if (wgPageName == "Special:Watchlist") //watchlist scripts<br>{<br>&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/watchlist.js")<br>}<br>if( wgNamespaceNumber == 6 ) {<br>&nbsp;&nbsp;&nbsp; importScript('MediaWiki:Common.js/file.js');<br>}<br><br>/** For sysops and accountcreators *****************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Allows for sysop-specific Javascript at [[MediaWiki:Sysop.js]],<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and accountcreator-specific CSS at [[MediaWiki:Accountcreator.css]].<br>&nbsp;*/<br>if ( wgUserGroups ) {<br>&nbsp; for ( var g = 0; g &lt; wgUserGroups.length; ++g ) {<br>&nbsp;&nbsp;&nbsp; if ( wgUserGroups[g] == "sysop" ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importStylesheet("MediaWiki:Sysop.css");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addOnloadHook( function() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (&nbsp;!window.disableSysopJS ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Sysop.js");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } );<br>&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp; else if ( wgUserGroups[g] == "accountcreator" ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importStylesheet("MediaWiki:Accountcreator.css");<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br>}<br><br><br>/** WikiMiniAtlas *******************************************************<br>&nbsp; *<br>&nbsp; *&nbsp; Description: WikiMiniAtlas is a popup click and drag world map.<br>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This script causes all of our coordinate links to display the WikiMiniAtlas popup button.<br>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The script itself is located on meta because it is used by many projects.<br>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; See [[Meta:WikiMiniAtlas]] for more information. <br>&nbsp; *&nbsp; Maintainers: [[User:Dschwen]]<br>&nbsp; */<br><br>if (wgServer == "https://secure.wikimedia.org") {<br>&nbsp;&nbsp;&nbsp; var metaBase = "https://secure.wikimedia.org/wikipedia/meta";<br>} else {<br>&nbsp;&nbsp;&nbsp; var metaBase = "http://meta.wikimedia.org";<br>}<br>importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400")<br><br>/* Scripts specific to Internet Explorer */<br><br>if (navigator.appName == "Microsoft Internet Explorer")<br>{<br>&nbsp;&nbsp;&nbsp; /** Internet Explorer bug fix **************************************************<br>&nbsp;&nbsp;&nbsp;&nbsp; *<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp; Description: Fixes IE horizontal scrollbar bug<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp; Maintainers: [[User:Tom-]]?<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; var oldWidth;<br>&nbsp;&nbsp;&nbsp; var docEl = document.documentElement;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; function fixIEScroll()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!oldWidth || docEl.clientWidth &gt; oldWidth)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doFixIEScroll();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setTimeout(doFixIEScroll, 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oldWidth = docEl.clientWidth;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; function doFixIEScroll() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4)&nbsp;? "hidden"&nbsp;: "";<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; document.attachEvent("onreadystatechange", fixIEScroll);<br>&nbsp;&nbsp;&nbsp; document.attachEvent("onresize", fixIEScroll);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp;&nbsp; * Remove need for CSS hacks regarding MSIE and IPA.<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp; if (document.createStyleSheet) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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";');<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // In print IE (7?) does not like line-height<br>&nbsp;&nbsp;&nbsp; appendCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');<br><br>&nbsp;&nbsp;&nbsp; // IE overflow bug<br>&nbsp;&nbsp;&nbsp; appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');<br><br>&nbsp;&nbsp;&nbsp; // IE zoomfix<br>&nbsp;&nbsp;&nbsp; //Use to fix right floating div/table inside tables.<br>&nbsp;&nbsp;&nbsp; appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}' );<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; //Import scripts specific to Internet Explorer 6<br>&nbsp;&nbsp;&nbsp; if (navigator.appVersion.substr(22, 1) == "6") {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/IE60Fixes.js")<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>/* Test if an element has a certain class **************************************<br>&nbsp;*<br>&nbsp;* Description: Uses regular expressions and caching for better performance.<br>&nbsp;* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]<br>&nbsp;*/<br><br>var hasClass = (function () {<br>&nbsp;&nbsp;&nbsp; var reCache = {};<br>&nbsp;&nbsp;&nbsp; return function (element, className) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (reCache[className]&nbsp;? reCache[className]&nbsp;: (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);<br>&nbsp;&nbsp;&nbsp; };<br>})();<br><br><br>/** Interwiki links to good articles ***************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Highlights interwiki links to good articles (or<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equivalents) by changing the bullet before the interwiki link<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; into a good article symbol.<br>&nbsp;*&nbsp; Maintainers: [[User:R. Koot]]<br>&nbsp;*/<br>&nbsp;<br>function LinkGA() <br>{<br>&nbsp;&nbsp;&nbsp; if ( document.getElementById( "p-lang" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( document.getElementById( InterwikiLinks[i].className + "-ga" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].className += " GA"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].title = "This is a good article in another language.";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br>&nbsp;<br>addOnloadHook( LinkGA );<br><br>/** Interwiki links to featured articles ***************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Highlights interwiki links to featured articles (or<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equivalents) by changing the bullet before the interwiki link<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; into a star.<br>&nbsp;*&nbsp; Maintainers: [[User:R. Koot]]<br>&nbsp;*/<br><br>function LinkFA() <br>{<br>&nbsp;&nbsp;&nbsp; if ( document.getElementById( "p-lang" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].className += " FA"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].title = "This is a featured article in another language.";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>addOnloadHook( LinkFA );<br><br><br>/** Collapsible tables *********************************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Allows tables to be collapsed, showing only the header. See<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[wikipedia:NavFrame|RTENOTITLE]].<br>&nbsp;*&nbsp; Maintainers: [[User:R. Koot]]<br>&nbsp;*/<br><br>var autoCollapse = 2;<br>var collapseCaption = "hide";<br>var expandCaption = "show";<br><br>function collapseTable( tableIndex )<br>{<br>&nbsp;&nbsp;&nbsp; var Button = document.getElementById( "collapseButton" + tableIndex );<br>&nbsp;&nbsp;&nbsp; var Table = document.getElementById( "collapsibleTable" + tableIndex );<br><br>&nbsp;&nbsp;&nbsp; if (&nbsp;!Table ||&nbsp;!Button ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; var Rows = Table.rows;<br><br>&nbsp;&nbsp;&nbsp; if ( Button.firstChild.data == collapseCaption ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 1; i &lt; Rows.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rows[i].style.display = "none";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.firstChild.data = expandCaption;<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 1; i &lt; Rows.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rows[i].style.display = Rows[0].style.display;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.firstChild.data = collapseCaption;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>function createCollapseButtons()<br>{<br>&nbsp;&nbsp;&nbsp; var tableIndex = 0;<br>&nbsp;&nbsp;&nbsp; var NavigationBoxes = new Object();<br>&nbsp;&nbsp;&nbsp; var Tables = document.getElementsByTagName( "table" );<br><br>&nbsp;&nbsp;&nbsp; for ( var i = 0; i &lt; Tables.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( Tables[i], "collapsible" ) ) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* only add button and increment count if there is a header row to work with */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!HeaderRow) continue;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Header = HeaderRow.getElementsByTagName( "th" )[0];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!Header) continue;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavigationBoxes[ tableIndex ] = Tables[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Button&nbsp;&nbsp;&nbsp;&nbsp; = document.createElement( "span" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ButtonLink = document.createElement( "a" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ButtonText = document.createTextNode( collapseCaption );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.className = "collapseButton";&nbsp; //Styles are declared in Common.css<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.style.color = Header.style.color;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.appendChild( ButtonText );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.appendChild( document.createTextNode( "[" ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.appendChild( ButtonLink );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.appendChild( document.createTextNode( "]" ) );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header.insertBefore( Button, Header.childNodes[0] );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tableIndex++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; for ( var i = 0;&nbsp; i &lt; tableIndex; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collapseTable( i );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var element = NavigationBoxes[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (element = element.parentNode) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( element, "outercollapse" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collapseTable ( i );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>addOnloadHook( createCollapseButtons );<br><br><br>/** Dynamic Navigation Bars (experimental) *************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: See [[wikipedia:NavFrame|RTENOTITLE]].<br>&nbsp;*&nbsp; Maintainers: UNMAINTAINED<br>&nbsp;*/<br><br>// set up the words in your language<br>var NavigationBarHide = '[' + collapseCaption + ']';<br>var NavigationBarShow = '[' + expandCaption + ']';<br><br>// shows and hides content and picture (if available) of navigation bars<br>// Parameters:<br>//&nbsp;&nbsp;&nbsp;&nbsp; indexNavigationBar: the index of navigation bar to be toggled<br>function toggleNavigationBar(indexNavigationBar)<br>{<br>&nbsp;&nbsp;&nbsp; var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);<br>&nbsp;&nbsp;&nbsp; var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);<br><br>&nbsp;&nbsp;&nbsp; if (!NavFrame ||&nbsp;!NavToggle) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // if shown now<br>&nbsp;&nbsp;&nbsp; if (NavToggle.firstChild.data == NavigationBarHide) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavChild.style.display = 'none';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; NavToggle.firstChild.data = NavigationBarShow;<br><br>&nbsp;&nbsp;&nbsp; // if hidden now<br>&nbsp;&nbsp;&nbsp; } else if (NavToggle.firstChild.data == NavigationBarShow) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavChild.style.display = 'block';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.firstChild.data = NavigationBarHide;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>// adds show/hide-button to navigation bars<br>function createNavigationBarToggleButton()<br>{<br>&nbsp;&nbsp;&nbsp; var indexNavigationBar = 0;<br>&nbsp;&nbsp;&nbsp; // iterate over all &lt; div &gt;-elements <br>&nbsp;&nbsp;&nbsp; var divs = document.getElementsByTagName("div");<br>&nbsp;&nbsp;&nbsp; for (var i = 0; NavFrame = divs[i]; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if found a navigation bar<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavFrame, "NavFrame")) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; indexNavigationBar++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var NavToggle = document.createElement("a");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.className = 'NavToggle';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var isCollapsed = hasClass( NavFrame, "collapsed" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Check if any children are already hidden.&nbsp; This loop is here for backwards compatibility:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * the old way of making NavFrames start out collapsed was to manually add style="display:none"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * to all the NavPic/NavContent elements.&nbsp; Since this was bad for accessibility (no way to make<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * the content visible without JavaScript support), the new recommended way is to add the class<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * "collapsed" to the NavFrame itself, just like with collapsible tables.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null &amp;&amp;&nbsp;!isCollapsed; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( NavChild.style.display == 'none' ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isCollapsed = true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (isCollapsed) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavChild.style.display = 'none';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var NavToggleText = document.createTextNode(isCollapsed&nbsp;? NavigationBarShow&nbsp;: NavigationBarHide);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.appendChild(NavToggleText);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(var j=0; j &lt; NavFrame.childNodes.length; j++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavFrame.childNodes[j], "NavHead")) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavFrame.childNodes[j].appendChild(NavToggle);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>addOnloadHook( createNavigationBarToggleButton );<br><br><br>/** Main Page layout fixes *********************************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Adds an additional link to the complete list of languages available.<br>&nbsp;*&nbsp; Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]<br>&nbsp;*/<br><br>if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') <br>&nbsp;&nbsp;&nbsp; addOnloadHook(function () {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addPortletLink('p-lang', 'http://meta.wikimedia.org/wiki/List_of_Wikipedias',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var nstab = document.getElementById('ca-nstab-main')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nstab &amp;&amp; wgUserLanguage=='en') {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (nstab.firstChild) nstab = nstab.firstChild<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nstab.nodeValue = 'Main Page'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>)<br><br><br>/** Table sorting fixes ************************************************<br>&nbsp; *<br>&nbsp; *&nbsp; Description: Disables code in table sorting routine to set classes on even/odd rows<br>&nbsp; *&nbsp; Maintainers: [[User:Random832]]<br>&nbsp; */<br><br>ts_alternate_row_colors = false;<br><br><br>/***** uploadwizard_newusers ********<br>&nbsp;* Switches in a message for non-autoconfirmed users at [[wikipedia:Upload|RTENOTITLE]]<br>&nbsp;*<br>&nbsp;*&nbsp; Maintainers: [[User:Krimpet]]<br>&nbsp;****/<br>function uploadwizard_newusers() {<br>&nbsp; if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == "Upload" &amp;&amp; wgAction == "view") {<br>&nbsp;&nbsp;&nbsp; var oldDiv = document.getElementById("autoconfirmedusers"),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newDiv = document.getElementById("newusers");<br>&nbsp;&nbsp;&nbsp; if (oldDiv &amp;&amp; newDiv) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (typeof wgUserGroups == "object" &amp;&amp; wgUserGroups) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; wgUserGroups.length; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (wgUserGroups[i] == "autoconfirmed") {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oldDiv.style.display = "block";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newDiv.style.display = "none";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oldDiv.style.display = "none";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newDiv.style.display = "block";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br>}<br>addOnloadHook(uploadwizard_newusers);<br><br><br>/** IPv6 AAAA connectivity testing **/<br><br>var __ipv6wwwtest_factor = 100;<br>var __ipv6wwwtest_done = 0;<br>if ((wgServer&nbsp;!= "https://secure.wikimedia.org") &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {<br>&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/IPv6.js");<br>}<br><br>/** Magic editintros ****************************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Adds editintros on disambiguation pages and BLP pages.<br>&nbsp;*&nbsp; Maintainers: [[User:RockMFR]]<br>&nbsp;*/<br><br>function addEditIntro(name)<br>{<br>&nbsp; var el = document.getElementById('ca-edit');<br>&nbsp; if (!el)<br>&nbsp;&nbsp;&nbsp; return;<br>&nbsp; el = el.getElementsByTagName('a')[0];<br>&nbsp; if (el)<br>&nbsp;&nbsp;&nbsp; el.href += '&amp;editintro=' + name;<br>}<br><br><br>if (wgNamespaceNumber == 0) {<br>&nbsp; addOnloadHook(function(){<br>&nbsp;&nbsp;&nbsp; if (document.getElementById('disambigbox'))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addEditIntro('Template:Disambig_editintro');<br>&nbsp; });<br><br>&nbsp; addOnloadHook(function(){<br>&nbsp;&nbsp;&nbsp; var cats = document.getElementById('mw-normal-catlinks');<br>&nbsp;&nbsp;&nbsp; if (!cats)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; cats = cats.getElementsByTagName('a');<br>&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; cats.length; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addEditIntro('Template:BLP_editintro');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; });<br>}<br><br>/*<br>&nbsp;* Description: Stay on the secure server as much as possible<br>&nbsp;* Maintainers: [[User:TheDJ]]<br>&nbsp;*/<br>if(wgServer == 'https://secure.wikimedia.org') {<br>&nbsp;&nbsp;&nbsp; importScript( 'MediaWiki:Common.js/secure.js');<br>}<br><br>// Define ta for now. Bugzilla 23175<br>window.ta = [];<br><br>//&lt;/source&gt;<br>

Revision as of 21:11, 14 June 2010

/* Any JavaScript here will be loaded for all users on every page load. */ 

//&lt;source lang="javascript"&gt;<br><br>/*<br>&nbsp;* Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page<br>&nbsp;* Maintainer: Cacycle<br>&nbsp;*/<br>if (wgArticleId == 0 &amp;&amp; wgUserName) {<br>&nbsp; var slash = wgPageName.indexOf('/');<br>&nbsp; var norm = wgPageName.substr(0, slash) + wgPageName.substr(slash).toLowerCase();<br>&nbsp; var test = 'User:' + wgUserName.replace(/ /g, '_') + '/skin.';<br>&nbsp; var ext = null;<br>&nbsp; if (norm == test + 'js') ext = 'js';<br>&nbsp; else if (norm == test + 'css') ext = 'css';<br>&nbsp; if (ext&nbsp;!= null) window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.' + ext);<br>}<br><br>/** extract a URL parameter from the current URL **********<br>&nbsp;* From [[En:User:Lupin/autoedit.js]]<br>&nbsp;*<br>&nbsp;* paramName&nbsp;&nbsp;: the name of the parameter to extract<br>&nbsp;*/<br>function getURLParamValue( paramName, url) <br>{<br>&nbsp;if (typeof (url) == 'undefined'&nbsp; || url === null) url = document.location.href;<br>&nbsp;var cmdRe=RegExp( '[&amp;?]' + paramName + '=([^&amp;#]*)' ); // Stop at hash<br>&nbsp;var m=cmdRe.exec(url);<br>&nbsp;if (m &amp;&amp; m.length &gt; 1) return decodeURIComponent(m[1]);<br>&nbsp;return null;<br>}<br><br>/** &amp;withJS= URL parameter *******<br>&nbsp;* Allow to try custom scripts from MediaWiki space <br>&nbsp;* without editing [[Special:Mypage/monobook.js]]<br>&nbsp;*/<br>var extraJS = getURLParamValue("withJS");<br>if ( extraJS &amp;&amp; extraJS.match("^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$") ) {<br>&nbsp; importScript(extraJS);<br>}<br><br>/* Import more specific scripts if necessary */<br><br>if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload") //scripts specific to editing pages<br>{<br>&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/edit.js")<br>}<br>else if (wgPageName == "Special:Watchlist") //watchlist scripts<br>{<br>&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/watchlist.js")<br>}<br>if( wgNamespaceNumber == 6 ) {<br>&nbsp;&nbsp;&nbsp; importScript('MediaWiki:Common.js/file.js');<br>}<br><br>/** For sysops and accountcreators *****************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Allows for sysop-specific Javascript at [[MediaWiki:Sysop.js]],<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and accountcreator-specific CSS at [[MediaWiki:Accountcreator.css]].<br>&nbsp;*/<br>if ( wgUserGroups ) {<br>&nbsp; for ( var g = 0; g &lt; wgUserGroups.length; ++g ) {<br>&nbsp;&nbsp;&nbsp; if ( wgUserGroups[g] == "sysop" ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importStylesheet("MediaWiki:Sysop.css");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addOnloadHook( function() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (&nbsp;!window.disableSysopJS ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Sysop.js");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } );<br>&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp; else if ( wgUserGroups[g] == "accountcreator" ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importStylesheet("MediaWiki:Accountcreator.css");<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br>}<br><br><br>/** WikiMiniAtlas *******************************************************<br>&nbsp; *<br>&nbsp; *&nbsp; Description: WikiMiniAtlas is a popup click and drag world map.<br>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This script causes all of our coordinate links to display the WikiMiniAtlas popup button.<br>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The script itself is located on meta because it is used by many projects.<br>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; See [[Meta:WikiMiniAtlas]] for more information. <br>&nbsp; *&nbsp; Maintainers: [[User:Dschwen]]<br>&nbsp; */<br><br>if (wgServer == "https://secure.wikimedia.org") {<br>&nbsp;&nbsp;&nbsp; var metaBase = "https://secure.wikimedia.org/wikipedia/meta";<br>} else {<br>&nbsp;&nbsp;&nbsp; var metaBase = "http://meta.wikimedia.org";<br>}<br>importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400")<br><br>/* Scripts specific to Internet Explorer */<br><br>if (navigator.appName == "Microsoft Internet Explorer")<br>{<br>&nbsp;&nbsp;&nbsp; /** Internet Explorer bug fix **************************************************<br>&nbsp;&nbsp;&nbsp;&nbsp; *<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp; Description: Fixes IE horizontal scrollbar bug<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp; Maintainers: [[User:Tom-]]?<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; var oldWidth;<br>&nbsp;&nbsp;&nbsp; var docEl = document.documentElement;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; function fixIEScroll()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!oldWidth || docEl.clientWidth &gt; oldWidth)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doFixIEScroll();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setTimeout(doFixIEScroll, 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oldWidth = docEl.clientWidth;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; function doFixIEScroll() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4)&nbsp;? "hidden"&nbsp;: "";<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; document.attachEvent("onreadystatechange", fixIEScroll);<br>&nbsp;&nbsp;&nbsp; document.attachEvent("onresize", fixIEScroll);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp;&nbsp; * Remove need for CSS hacks regarding MSIE and IPA.<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp; if (document.createStyleSheet) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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";');<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // In print IE (7?) does not like line-height<br>&nbsp;&nbsp;&nbsp; appendCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');<br><br>&nbsp;&nbsp;&nbsp; // IE overflow bug<br>&nbsp;&nbsp;&nbsp; appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');<br><br>&nbsp;&nbsp;&nbsp; // IE zoomfix<br>&nbsp;&nbsp;&nbsp; //Use to fix right floating div/table inside tables.<br>&nbsp;&nbsp;&nbsp; appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}' );<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; //Import scripts specific to Internet Explorer 6<br>&nbsp;&nbsp;&nbsp; if (navigator.appVersion.substr(22, 1) == "6") {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/IE60Fixes.js")<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>/* Test if an element has a certain class **************************************<br>&nbsp;*<br>&nbsp;* Description: Uses regular expressions and caching for better performance.<br>&nbsp;* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]<br>&nbsp;*/<br><br>var hasClass = (function () {<br>&nbsp;&nbsp;&nbsp; var reCache = {};<br>&nbsp;&nbsp;&nbsp; return function (element, className) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (reCache[className]&nbsp;? reCache[className]&nbsp;: (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);<br>&nbsp;&nbsp;&nbsp; };<br>})();<br><br><br>/** Interwiki links to good articles ***************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Highlights interwiki links to good articles (or<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equivalents) by changing the bullet before the interwiki link<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; into a good article symbol.<br>&nbsp;*&nbsp; Maintainers: [[User:R. Koot]]<br>&nbsp;*/<br>&nbsp;<br>function LinkGA() <br>{<br>&nbsp;&nbsp;&nbsp; if ( document.getElementById( "p-lang" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( document.getElementById( InterwikiLinks[i].className + "-ga" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].className += " GA"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].title = "This is a good article in another language.";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br>&nbsp;<br>addOnloadHook( LinkGA );<br><br>/** Interwiki links to featured articles ***************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Highlights interwiki links to featured articles (or<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equivalents) by changing the bullet before the interwiki link<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; into a star.<br>&nbsp;*&nbsp; Maintainers: [[User:R. Koot]]<br>&nbsp;*/<br><br>function LinkFA() <br>{<br>&nbsp;&nbsp;&nbsp; if ( document.getElementById( "p-lang" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].className += " FA"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterwikiLinks[i].title = "This is a featured article in another language.";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>addOnloadHook( LinkFA );<br><br><br>/** Collapsible tables *********************************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Allows tables to be collapsed, showing only the header. See<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[wikipedia:NavFrame|RTENOTITLE]].<br>&nbsp;*&nbsp; Maintainers: [[User:R. Koot]]<br>&nbsp;*/<br><br>var autoCollapse = 2;<br>var collapseCaption = "hide";<br>var expandCaption = "show";<br><br>function collapseTable( tableIndex )<br>{<br>&nbsp;&nbsp;&nbsp; var Button = document.getElementById( "collapseButton" + tableIndex );<br>&nbsp;&nbsp;&nbsp; var Table = document.getElementById( "collapsibleTable" + tableIndex );<br><br>&nbsp;&nbsp;&nbsp; if (&nbsp;!Table ||&nbsp;!Button ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; var Rows = Table.rows;<br><br>&nbsp;&nbsp;&nbsp; if ( Button.firstChild.data == collapseCaption ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 1; i &lt; Rows.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rows[i].style.display = "none";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.firstChild.data = expandCaption;<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ( var i = 1; i &lt; Rows.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rows[i].style.display = Rows[0].style.display;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.firstChild.data = collapseCaption;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>function createCollapseButtons()<br>{<br>&nbsp;&nbsp;&nbsp; var tableIndex = 0;<br>&nbsp;&nbsp;&nbsp; var NavigationBoxes = new Object();<br>&nbsp;&nbsp;&nbsp; var Tables = document.getElementsByTagName( "table" );<br><br>&nbsp;&nbsp;&nbsp; for ( var i = 0; i &lt; Tables.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( Tables[i], "collapsible" ) ) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* only add button and increment count if there is a header row to work with */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!HeaderRow) continue;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Header = HeaderRow.getElementsByTagName( "th" )[0];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!Header) continue;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavigationBoxes[ tableIndex ] = Tables[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Button&nbsp;&nbsp;&nbsp;&nbsp; = document.createElement( "span" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ButtonLink = document.createElement( "a" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ButtonText = document.createTextNode( collapseCaption );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.className = "collapseButton";&nbsp; //Styles are declared in Common.css<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.style.color = Header.style.color;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ButtonLink.appendChild( ButtonText );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.appendChild( document.createTextNode( "[" ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.appendChild( ButtonLink );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Button.appendChild( document.createTextNode( "]" ) );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header.insertBefore( Button, Header.childNodes[0] );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tableIndex++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; for ( var i = 0;&nbsp; i &lt; tableIndex; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collapseTable( i );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var element = NavigationBoxes[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (element = element.parentNode) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( element, "outercollapse" ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collapseTable ( i );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>addOnloadHook( createCollapseButtons );<br><br><br>/** Dynamic Navigation Bars (experimental) *************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: See [[wikipedia:NavFrame|RTENOTITLE]].<br>&nbsp;*&nbsp; Maintainers: UNMAINTAINED<br>&nbsp;*/<br><br>// set up the words in your language<br>var NavigationBarHide = '[' + collapseCaption + ']';<br>var NavigationBarShow = '[' + expandCaption + ']';<br><br>// shows and hides content and picture (if available) of navigation bars<br>// Parameters:<br>//&nbsp;&nbsp;&nbsp;&nbsp; indexNavigationBar: the index of navigation bar to be toggled<br>function toggleNavigationBar(indexNavigationBar)<br>{<br>&nbsp;&nbsp;&nbsp; var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);<br>&nbsp;&nbsp;&nbsp; var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);<br><br>&nbsp;&nbsp;&nbsp; if (!NavFrame ||&nbsp;!NavToggle) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // if shown now<br>&nbsp;&nbsp;&nbsp; if (NavToggle.firstChild.data == NavigationBarHide) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavChild.style.display = 'none';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; NavToggle.firstChild.data = NavigationBarShow;<br><br>&nbsp;&nbsp;&nbsp; // if hidden now<br>&nbsp;&nbsp;&nbsp; } else if (NavToggle.firstChild.data == NavigationBarShow) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavChild.style.display = 'block';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.firstChild.data = NavigationBarHide;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>// adds show/hide-button to navigation bars<br>function createNavigationBarToggleButton()<br>{<br>&nbsp;&nbsp;&nbsp; var indexNavigationBar = 0;<br>&nbsp;&nbsp;&nbsp; // iterate over all &lt; div &gt;-elements <br>&nbsp;&nbsp;&nbsp; var divs = document.getElementsByTagName("div");<br>&nbsp;&nbsp;&nbsp; for (var i = 0; NavFrame = divs[i]; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if found a navigation bar<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavFrame, "NavFrame")) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; indexNavigationBar++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var NavToggle = document.createElement("a");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.className = 'NavToggle';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var isCollapsed = hasClass( NavFrame, "collapsed" );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Check if any children are already hidden.&nbsp; This loop is here for backwards compatibility:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * the old way of making NavFrames start out collapsed was to manually add style="display:none"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * to all the NavPic/NavContent elements.&nbsp; Since this was bad for accessibility (no way to make<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * the content visible without JavaScript support), the new recommended way is to add the class<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * "collapsed" to the NavFrame itself, just like with collapsible tables.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null &amp;&amp;&nbsp;!isCollapsed; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( NavChild.style.display == 'none' ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isCollapsed = true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (isCollapsed) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var NavChild = NavFrame.firstChild; NavChild&nbsp;!= null; NavChild = NavChild.nextSibling) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavChild.style.display = 'none';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var NavToggleText = document.createTextNode(isCollapsed&nbsp;? NavigationBarShow&nbsp;: NavigationBarHide);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavToggle.appendChild(NavToggleText);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(var j=0; j &lt; NavFrame.childNodes.length; j++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hasClass(NavFrame.childNodes[j], "NavHead")) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavFrame.childNodes[j].appendChild(NavToggle);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>addOnloadHook( createNavigationBarToggleButton );<br><br><br>/** Main Page layout fixes *********************************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Adds an additional link to the complete list of languages available.<br>&nbsp;*&nbsp; Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]<br>&nbsp;*/<br><br>if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') <br>&nbsp;&nbsp;&nbsp; addOnloadHook(function () {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addPortletLink('p-lang', 'http://meta.wikimedia.org/wiki/List_of_Wikipedias',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var nstab = document.getElementById('ca-nstab-main')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nstab &amp;&amp; wgUserLanguage=='en') {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (nstab.firstChild) nstab = nstab.firstChild<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nstab.nodeValue = 'Main Page'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>)<br><br><br>/** Table sorting fixes ************************************************<br>&nbsp; *<br>&nbsp; *&nbsp; Description: Disables code in table sorting routine to set classes on even/odd rows<br>&nbsp; *&nbsp; Maintainers: [[User:Random832]]<br>&nbsp; */<br><br>ts_alternate_row_colors = false;<br><br><br>/***** uploadwizard_newusers ********<br>&nbsp;* Switches in a message for non-autoconfirmed users at [[wikipedia:Upload|RTENOTITLE]]<br>&nbsp;*<br>&nbsp;*&nbsp; Maintainers: [[User:Krimpet]]<br>&nbsp;****/<br>function uploadwizard_newusers() {<br>&nbsp; if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == "Upload" &amp;&amp; wgAction == "view") {<br>&nbsp;&nbsp;&nbsp; var oldDiv = document.getElementById("autoconfirmedusers"),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newDiv = document.getElementById("newusers");<br>&nbsp;&nbsp;&nbsp; if (oldDiv &amp;&amp; newDiv) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (typeof wgUserGroups == "object" &amp;&amp; wgUserGroups) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; wgUserGroups.length; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (wgUserGroups[i] == "autoconfirmed") {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oldDiv.style.display = "block";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newDiv.style.display = "none";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oldDiv.style.display = "none";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newDiv.style.display = "block";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br>}<br>addOnloadHook(uploadwizard_newusers);<br><br><br>/** IPv6 AAAA connectivity testing **/<br><br>var __ipv6wwwtest_factor = 100;<br>var __ipv6wwwtest_done = 0;<br>if ((wgServer&nbsp;!= "https://secure.wikimedia.org") &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {<br>&nbsp;&nbsp;&nbsp; importScript("MediaWiki:Common.js/IPv6.js");<br>}<br><br>/** Magic editintros ****************************************************<br>&nbsp;*<br>&nbsp;*&nbsp; Description: Adds editintros on disambiguation pages and BLP pages.<br>&nbsp;*&nbsp; Maintainers: [[User:RockMFR]]<br>&nbsp;*/<br><br>function addEditIntro(name)<br>{<br>&nbsp; var el = document.getElementById('ca-edit');<br>&nbsp; if (!el)<br>&nbsp;&nbsp;&nbsp; return;<br>&nbsp; el = el.getElementsByTagName('a')[0];<br>&nbsp; if (el)<br>&nbsp;&nbsp;&nbsp; el.href += '&amp;editintro=' + name;<br>}<br><br><br>if (wgNamespaceNumber == 0) {<br>&nbsp; addOnloadHook(function(){<br>&nbsp;&nbsp;&nbsp; if (document.getElementById('disambigbox'))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addEditIntro('Template:Disambig_editintro');<br>&nbsp; });<br><br>&nbsp; addOnloadHook(function(){<br>&nbsp;&nbsp;&nbsp; var cats = document.getElementById('mw-normal-catlinks');<br>&nbsp;&nbsp;&nbsp; if (!cats)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; cats = cats.getElementsByTagName('a');<br>&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; cats.length; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addEditIntro('Template:BLP_editintro');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; });<br>}<br><br>/*<br>&nbsp;* Description: Stay on the secure server as much as possible<br>&nbsp;* Maintainers: [[User:TheDJ]]<br>&nbsp;*/<br>if(wgServer == 'https://secure.wikimedia.org') {<br>&nbsp;&nbsp;&nbsp; importScript( 'MediaWiki:Common.js/secure.js');<br>}<br><br>// Define ta for now. Bugzilla 23175<br>window.ta = [];<br><br>//&lt;/source&gt;<br>