Zmiany
remove unused class per request
// <pre>/**UWAGA! Ten JavaScript działa dla wszystkich skórek. Należy zachować szczególną ostrożność wprowadzając tutaj zmiany!/ *==== funkcja insertTagsTo_ ====; AuthorKeep code in MediaWiki: phpBB Team, WikiMedia, Maciej Jaros [[:pl:User:Nux]]; Licence: [http://opensource.org/licenses/gpl-licenseCommon.php GNU General Public License v2]; Description: Apply tagOpen/tagClose js to selection in given textarea/input, use sampleText instead of selection if there a minimum as it is none. Copied and adapted from phpBBunconditionally */// outputid = 'some_id_of_a_textarea_or_a_text_input'function insertTagsTo_(tagOpen, tagClose, sampleText, outputid) { var txtarea = documentloaded for all users on every wiki page.getElementById(outputid);If possible create a gadget that is if * enabled by default instead of adding it here (!txtarea)since gadgets are fully return ; // IE if (document * optimized ResourceLoader modules with possibility to add dependencies etc.selection) { var theSelection = document.selection.createRange().text; * if (!theSelection) theSelection=sampleText; txtarea * Since Common.focus();js isn't a gadget, there is no place to declare its if (theSelection.charAt(theSelection.length - 1) == " ") { // exclude ending space char * dependencies, if any theSelection = theSelectionso we have to lazy load them with mw.substring(0, theSelectionloader.length - 1);using on demand and document.selection.createRange() * then execute the rest in the callback.text = tagOpen + theSelection + tagClose + " ";In most cases these dependencies will } else { document.selection.createRange * be loaded (or loading)already and the callback will not be delayed.text = tagOpen + theSelection + tagClose;In case a } // Mozilla } else if(txtarea.selectionStart || txtarea.selectionStart == * dependency hasn'0t arrived yet it') { var replaced = false; var startPos = txtareall make sure those are loaded before this.selectionStart; var endPos = txtarea.selectionEnd; if (endPos-startPos) replaced = true; var scrollTop = txtarea.scrollTop; var myText = (txtarea.value).substring(startPos, endPos); if (!myText) myText=sampleText; if (myText.charAt(myText.length - 1) == " ") { *// exclude ending space char, if any subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; } else { subst = tagOpen + myText + tagClose; } txtarea.value = txtarea.value.substring(0, startPos) + subst + txtarea.value.substring(endPos, txtarea.value.length); txtarea.focus(); //set new selection if (replaced) { var cPos = startPos+(tagOpen.length+myText.length+tagClose.length); txtarea.selectionStart = cPos; txtarea.selectionEnd = cPos; } else { txtarea.selectionStart = startPos+tagOpen.length; txtarea.selectionEnd = startPos+tagOpen.length+myText.length; } txtarea.scrollTop = scrollTop; } // reposition cursor if possible if (txtarea.createTextRange && document.selection) txtarea.caretPos = document.selection.createRange().duplicate();}
/** Collapsible tables ******************************************************** *Main Page layout fixes * * Description: Allows tables Adds an additional link to be collapsed, showing only the headercomplete list of languages available. See * Maintainers: [[enUser:Wikipedia:NavFrameAzaToth]]. * Maintainers: , [[User:R. Koot]], [[User:Alex Smotrov]] */ var autoCollapse = 2;var collapseCaption = "ukryj";var expandCaption = "pokaż"; function collapseTableif ( tableIndex ){ var Button = documentmw.config.getElementByIdget( "collapseButton" + tableIndex 'wgPageName' ); var Table = document== 'Main_Page' || mw.getElementById( "collapsibleTable" + tableIndex ); if config.get( !Table || !Button 'wgPageName' ) { return false; } var Rows = Table.rows; if ( Button.firstChild.data == collapseCaption 'Talk:Main_Page' ) { for $( function ( var i = 1; i < Rows.length; i++ ) { Rows[i] mw.styleutil.display = "none"; } ButtonaddPortletLink( 'p-lang', '//meta.firstChildwikimedia.data = expandCaption;org/wiki/List_of_Wikipedias', } else { for ( var i = 1; i < Rows.length; i++ 'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias' ) { Rows[i].style.display = Rows[0].style.display; } Button.firstChild.data = collapseCaption); }
}
}
}
}
/**
* Extract a URL parameter from the current URL
* @deprecated: Use mw.util.getParamValue with proper escaping
*/
mw.log.deprecate( window, 'getURLParamValue', mw.util.getParamValue, 'Use mw.util.getParamValue instead' );
/** Dynamic Navigation Bars (experimental) ************************************* *Test if an element has a certain class * @deprecated: Description: See [[Wikipedia:NavFrame]]Use $(element).hasClass() instead. * Maintainers: UNMAINTAINED
*/
mw.log.deprecate( window, 'hasClass', function ( element, className ) {
return $( element ).hasClass( className );
}, 'Use jQuery.hasClass() instead' );
/** * @source www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL * @rev 6 */ set up the words in your languagevar NavigationBarHide extraCSS = mw.util.getParamValue( '[withCSS' + collapseCaption + ']';),var NavigationBarShow extraJS = mw.util.getParamValue( '[' + expandCaption + ']withJS');
}
}
}
// adds show/hide-** * 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 to navigation bars.function createNavigationBarToggleButton() * The script itself is located on meta because it is used by many projects.{ * See [[Meta:WikiMiniAtlas]] for more information. var indexNavigationBar = 0; * Note - use of this service is recommended to be repalced with mw:Help:Extension:Kartographer / */ iterate over all < div >-elements var divs = document.getElementsByTagName("div"function ();{ for ( var i = 0; NavFrame require_wikiminiatlas = divs[i]false; i++) { var coord_filter = /geohack/ if found a navigation bar; if $(hasClassfunction (NavFrame, "NavFrame")) { indexNavigationBar++; var NavToggle = document.createElement $("'a"); NavToggle.className = external.text'NavToggle'; NavToggle).setAttributeeach( function('id'key, 'NavToggle' + indexNavigationBarlink );{ NavToggle if ( link.setAttributehref && coord_filter.exec('link.href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');{ var isCollapsed require_wikiminiatlas = hasClass( NavFrame, "collapsed" )true; /* * Check if any children are already hidden. This / break from loop is here for backwards compatibility: * the old way of making NavFrames start out collapsed was to manually add style="display:none" return false; * 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, 'NavPicdiv.kmldata' ) || hasClass( NavChild, 'NavContent' ) ) { if ( NavChild.style.display == 'none' length ) { isCollapsed require_wikiminiatlas = true; }
}
}
}
}
}
/**
* Skrypt dla SzablonAdd support to mw-collapsible for autocollapse, innercollapse and outercollapse * * Maintainers:GaleriaTheDJ
*/
function toggleImage mwCollapsibleSetup(group, remindex, shwindex$collapsibleContent ) { jQuery("#ImageGroupsGr" + group + "Im" + remindex).hide();var $element, $toggle, jQuery("#ImageGroupsGr" + group + "Im" + shwindex).show() autoCollapseThreshold = 2;}function ImageGroup() { jQuery('div.ImageGroup')$.each($collapsibleContent, function(iindex, groupelement) { var unitnode $element = jQuery('div.ImageGroupUnits', group).get$(0element ); if (unitnode == undefined$element.hasClass( 'collapsible' ) ) { return 1$element.find('tr:first > th:first').prepend( $element.find('tr:first > * > .mw-collapsible-toggle'));
}
}
}
}
mw.loader.usinghook( ["mediawiki.util", "jquery.cookie"] ).then( function() { if ( mw'wikipage.config.get( 'wgUserNamecollapsibleContent' ) == null ) { mw.util.addCSSadd( '.anon_hide_block{display:none}' mwCollapsibleSetup );
}
navToggle.firstChild.data = navigationBarShow; // If hidden now } else if ( jQuerynavToggle.firstChild.cookiedata === navigationBarShow ) { for ( 'read_memail_go_away' ) navChild = navFrame.firstChild; navChild !==null; navChild = '1' navChild.nextSibling ) { mw.utilif ( $( navChild ).addCSShasClass( 'NavContent' ) ) { navChild.style.usermessage {display:none= 'block'; }' );
}
}
/** Parametr &withJS= ******* * Spróbuj załadować dodatkowy skrypt z przestrzeni MediaWiki * bez potrzeby edytowania [[Special:MypageAdds show/monobookhide-button to navigation bars.js]]
*
* Maintainer: commons: [[User:Platonides]], plwiki: [[User:Saper]]@param {jQuery} $content
*/
function createNavigationBarToggleButton( $content ) {
var i, j, navChild, navToggle, navToggleText, isCollapsed,
indexNavigationBar = 0;
// Iterate over all < div >-elements
var $divs = $content.find( 'div.NavFrame:not(.mw-collapsible)' );
$divs.each( function ( i, navFrame ) {
indexNavigationBar++;
navToggle = document.createElement( 'a' );
navToggle.className = 'NavToggle';
navToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar );
navToggle.setAttribute( 'href', '#' );
$( navToggle ).on( 'click', $.proxy( toggleNavigationBar, null, indexNavigationBar ) );
}
//// Ustawienie wysokości "Usunięcie" pustego elementu contentSub//jQuery(functionFind the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked){ var el for ( j =document0; j < navFrame.childNodes.getElementById('mw-revisiontag'length; j++ );{ if (el && el$( navFrame.classNamechildNodes[j] ).indexOfhasClass('flaggedrevs_shortNavHead')!=-1) { if (el navToggle.parentNodestyle.id=color ='contentSub') elnavFrame.parentNodechildNodes[j].style.height=color; navFrame.childNodes[j].appendChild( navToggle ); } } navFrame.setAttribute( 'id', '17pxNavFrame'+ indexNavigationBar ); });});
/** * Magic editintros **************************************************** * * Description: Redirects from User:UserName/skin.js or Adds editintros on disambiguation pages and BLP pages.css to the user's actual skin page * MaintainerMaintainers: [[User: NuxRockMFR]]
*/
}
if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) {
$( function () {
if ( document.getElementById( 'disambigbox' ) ) {
addEditIntro( 'Template:Disambig_editintro' );
}
} );
/* Actions specific to the edit page */ Sortowanie tekstów w tabelach if (class="sortable") uwzględniające polskie diakrytyki.// Nie jest to rozwiązanie "poprawne", ale de facto działa.mw.config.setget('tableSorterCollationwgAction', { ) === 'ąedit':|| mw.config.get( 'azzwgAction', ) === 'Ąsubmit':'AZZ', ) { 'ć':'czz', 'Ć':'CZZ', /** 'ę':'ezz', 'Ę':'EZZ', 'ł':'lzz', 'Ł':'LZZ', * Fix edit summary prompt for undo 'ń':'nzz', 'Ń':'NZZ', * 'ó':'ozz', 'Ó':'OZZ', * Fixes the fact that the undo function combined with the "no edit summary prompter" 'ś':'szz', 'Ś':'SZZ' * complains about missing editsummary, if leaving the edit summary unchanged. 'ź' * Added by [[User:'zzz'Deskana]], 'Ź'code by [[User:'ZZZ', 'ż':'zzzz', 'Ż':'ZZZZ'Tra]].}); // Załaduj edytor dla * See also [[Wikipediaphab:Indeks biografiiT10912]], gdy ktoś zechce go edytować. */ $( function() { if($('document.bioindex-entry')location.length === 0) { return; } mwsearch.loader.usingindexOf('jquery.spinnerundo=').then(function() { function loadHandler(e) { if(e.type === 'keypress' && e.which !== 13 -1 && edocument.which !== 32) { return; // handle enter and space } var $editlink = $getElementsByName(this); var $spinner = $.createSpinner().css('margin-left', '1emwpAutoSummary'); $editlink.after($spinner[0]); { mwdocument.loader.usinggetElementsByName('ext.gadget.bioindex-editorwpAutoSummary')[0].then(function() { $spinner.remove(); $editlink.trigger('click'); }); $('#mw-content-text').off('click keypressvalue = ', '.bioindex-entry .bioindex-edit a1', loadHandler); e.preventDefault();
}
});
}
} );
/* DO NOT ADD CODE BELOW THIS LINE */ ładuj tylko anonimowym (a nie wszystkim, a potem wychodź po sprawdzeniu)if (mw.config.get('wgUserName') === null) { mw.loader.load('ext.gadget.allinterwiki');}