Open main menu

Changes

MediaWiki:Common.js

2,829 bytes removed, 13:40, 27 October 2020
m
UploadWizard message fix.
/* Any JavaScript here will be loaded for all users on every page load. */
window/* Improvements for the HarvardReferences Mediawiki extension.hasClass = ( function() { var reCache = {};*/ return function (element, className) { return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).testimportScript(element'HarvardReferences.className); };})(js');
var myElement = document.getElementById/* Test function, for testing if js works */(function ('mw-testing');myElement.innerHTML = 'This is test HTML';{
var myElement = document.getElementById('mw-testing');
myElement.innerHTML = 'This is test HTML';
/** * Dynamic Navigation Bars. See [[Wikipedia:NavFrame]] * * Based on script from en.wikipedia.org, 2008-09-15. * * @source www.mediawiki.org/wiki/MediaWiki:Gadget-NavFrame.js * @maintainer Helder.wiki, 2012–2013 * @maintainer Krinkle, 2013 */}());
// * Set up the words in your languagevar collapseCaption = 'hide';var expandCaption = 'show'; var navigationBarHide = '[' + collapseCaption + ']';var navigationBarShow = '[' + expandCaption + ']'; some UploadWizard messages */** * Shows and hides content and picture (if available) of navigation barsmw. * * @param {number} indexNavigationBar The index of navigation bar to be toggled * @param {jQuerymessages.Event} e Event object */function toggleNavigationBarset( indexNavigationBar, e ) { var navChild, navToggle = document'mwe-upwiz-license-gpl-3.getElementById( 'NavToggle0' + indexNavigationBar ), navFrame = document"GNU General Public Licence 3.getElementById0 ( 'NavFrame' + indexNavigationBar [$2 legal code]);  // Prevent browser from jumping to href "#" e.preventDefault();  if ( !navFrame || !navToggle ) { return false; }  // If shown now if ( navToggle.firstChild.data == navigationBarHide ) { for ( navChild = navFramemw.firstChild; navChild != null; navChild = navChildmessages.nextSibling ) { if ( hasClassset( navChild, 'NavPic' ) ) { navChildmwe-upwiz-source-ownwork-gpl-3.style.display = 0-explain'none'; } if , "( hasClass( navChildAnyone may use, 'NavContent' ) ) share or remix { navChild.style.display = 'none'; } } navToggle.firstChild.data = navigationBarShow;  // If hidden now } else if ( navToggle.firstChild.data == navigationBarShow ) { for ( navChild = navFrame.firstChild; navChild != null; navChild = navChild.nextSibling ) { if ( PLURAL:$( navChild ).hasClass( 'NavPic' ) 1|this work| $( navChild ).hasClass( 'NavContent' ) ) { navChild.style.display = 'block'; } } navToggle.firstChild.data = navigationBarHide; these works}} /** * Adds show/hide-button to navigation bars. * * @param {jQuery} $content */function createNavigationBarToggleButton( $content ) { var i, j, navFrame, navToggle, navToggleText, navChild, indexNavigationBar = 0, navFrames = $content.find( 'divas long as they credit me and share any derivative work under this licence.NavFrame' ).toArray(");  // Iterate over all (new) nav frames for ( i = 0; i < navFramesmw.length; i++ ) { navFrame = navFrames[i]; // If found a navigation bar indexNavigationBar++; navToggle = documentmessages.createElementset( 'a' ); navTogglemwe-upwiz-source-ownwork-assert-gpl-3.className = 'NavToggle'; navToggle.setAttribute( 'id0', 'NavToggle' + indexNavigationBar ); navToggle.setAttribute( 'href'"I, '#' ); $( navToggle ).on( 'click'2, {{GENDER:$.proxy( toggleNavigationBar, null, indexNavigationBar ) );  navToggleText = document.createTextNode( navigationBarHide ); for ( navChild = navFrame.firstChild; navChild != null; navChild = navChild.nextSibling ) 4|the copyright holder}} of {{ if ( PLURAL:$( navChild ).hasClass( 'NavPic' ) 1|this work| $( navChild ).hasClass( 'NavContent' ) ) these works}}, irrevocably grant anyone the right to use { if ( navChild.style.display == 'none' ) { navToggleText = document.createTextNode( navigationBarShow ); break; PLURAL:$1|this work|these works} } }  navToggleunder the GNU General Public 3.appendChild( navToggleText ); // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked) for ( j = 0; j < navFrame.childNodes.length; j++ ) { if licence ( [$( navFrame.childNodes[j3 legal code] ).hasClass( 'NavHead' ) ) { navFrame.childNodes[j].appendChild( navToggle ); } } navFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar ); }} mw.hook( 'wikipage.content' ).add( createNavigationBarToggleButton ");
Trusted, Bureaucrats
4,223

edits