MediaWiki:Common.js

// <pre>
/*
UWAGA! Ten JavaScript działa dla wszystkich skórek. Należy zachować szczególną ostrożność wprowadzając tutaj zmiany!
*/
/** ? *********************************************************
  *
  *  Description: ?
  *  Maintainers: ?
  */
jQuery(function()
{
//
// Ustawienie wysokości "Usunięcie" pustego elementu contentSub
//
	var el=document.getElementById('mw-revisiontag');
	if (el && el.className.indexOf('flaggedrevs_short')!=-1)
	{
		if (el.parentNode.id=='contentSub') el.parentNode.style.height='17px';
	}

//
	jQuery('table.navbox').first().addClass('firstNavbox');

//Pomyłki przy archiwizowaniu stron dyskusji
	if($('#wpNewTitleNs select').val() == 3) {
		$('#wpMovesubpages input').prop('checked', false);
	}
});

/** sortable config *********************************************************
  *
  *  Description: Various tweaks for sortable tables.
  *  Maintainers: ?
  */

// Kod pozwalający na skonstruowanie niesortującej się kolumny z liczbą porządkową w sortowalnych tabelkach.
// Odpowiednia komórka nagłówkowa sortowalnej tabelki (class="sortable") musi być oznaczona
// jako niesortowalna i zawierająca liczby porządkowe (class="unsortable ordinal").
// Dyskusja w kawiarence: [[Wikipedia:Kawiarenka/Kwestie techniczne#Poprawa tabeli w Miasta w Polsce (statystyki)]]
// Zgłoszenie na Bugzilli: [https://bugzilla.wikimedia.org/show_bug.cgi?id=40618]
$('table.sortable th.unsortable.ordinal').each(function(i, th) {
	var $th = $(th), $table = $th.closest('table');
	$table.on('sortEnd.tablesorter', function() {
		$table.find('tr td:nth-child('+ (th.cellIndex+1) +')').each(function(j, td) {
			$(td).text( (j+1) );
		});
	});
});

/** autocollapse for collapsible *********************************************************
  *
  *  Description: (legacy) Automatyczne zwijanie szablonów nawigacyjnych. Pozostałość po starej składni (~2010).
  *               Zwija navboksy, jeśli są co najmniej dwa. Aktualnie (2023) stosowane tylko poza przestrzenią główną.
  *  Maintainers: -
  */
mw.loader.using( "mediawiki.util" ).then(function() {
	function mwCollapsibleSetup( $collapsibleContent ) {
		if ($($collapsibleContent).length > 2) {
			$.each( $collapsibleContent, function (index, element) {
				var $element = $( element );
				if ( $element.hasClass( 'autocollapse' ) ) {
					$element.data( 'mw-collapsible' ).collapse();
				}
			} );
		}
	}
	
	mw.hook( 'wikipage.collapsibleContent' ).add( mwCollapsibleSetup );
});

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Kembali kehalaman sebelumnya