MediaWiki:Common.js: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
Nie podano opisu zmian |
dNie podano opisu zmian |
||
| Linia 382: | Linia 382: | ||
options = {days:7, path:'/'} // defaults | options = {days:7, path:'/'} // defaults | ||
*/ | */ | ||
function addLongTermCookie(name, value, options) | /* function addLongTermCookie(name, value, options) | ||
{ | { | ||
// options | // options | ||
| Linia 399: | Linia 399: | ||
document.cookie = name+"="+value+"; path="+path+"; expires=" + dt.toGMTString(); | document.cookie = name+"="+value+"; path="+path+"; expires=" + dt.toGMTString(); | ||
} | } | ||
*/ | |||
/* | /* | ||
==== funkcja insertTagsTo_ ==== | ==== funkcja insertTagsTo_ ==== | ||
| Linia 407: | Linia 407: | ||
*/ | */ | ||
// outputid = 'some_id_of_a_textarea_or_a_text_input' | // outputid = 'some_id_of_a_textarea_or_a_text_input' | ||
function insertTagsTo_(tagOpen, tagClose, sampleText, outputid) { | /* function insertTagsTo_(tagOpen, tagClose, sampleText, outputid) { | ||
var txtarea = document.getElementById(outputid); | var txtarea = document.getElementById(outputid); | ||
if (!txtarea) | if (!txtarea) | ||
| Linia 460: | Linia 460: | ||
txtarea.caretPos = document.selection.createRange().duplicate(); | txtarea.caretPos = document.selection.createRange().duplicate(); | ||
} | } | ||
*/ | |||
/* | /* | ||
==== Dodanie linka [edytuj] dla sekcji nagłówkowej ==== | ==== Dodanie linka [edytuj] dla sekcji nagłówkowej ==== | ||
| Linia 560: | Linia 560: | ||
http://www.gnu.org/licenses/gpl.html | http://www.gnu.org/licenses/gpl.html | ||
*/ | */ | ||
addOnloadHook(function() { | /* addOnloadHook(function() { | ||
try { | try { | ||
if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return; | if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return; | ||
| Linia 575: | Linia 575: | ||
}); | }); | ||
*/ | |||
/** Interwiki links to featured articles *************************************** | /** Interwiki links to featured articles *************************************** | ||
* | * | ||
| Linia 583: | Linia 583: | ||
* Maintainers: [[User:R. Koot]] | * Maintainers: [[User:R. Koot]] | ||
*/ | */ | ||
/* | |||
function LinkFA() | function LinkFA() | ||
{ | { | ||
| Linia 607: | Linia 607: | ||
} | } | ||
addOnloadHook( LinkFA ); | addOnloadHook( LinkFA ); | ||
*/ | |||
/* Test if an element has a certain class ************************************** | /* Test if an element has a certain class ************************************** | ||
* | * | ||
| Linia 613: | Linia 613: | ||
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]] | * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]] | ||
*/ | */ | ||
/* | |||
var hasClass = (function () { | var hasClass = (function () { | ||
var reCache = {}; | var reCache = {}; | ||
| Linia 620: | Linia 620: | ||
}; | }; | ||
})(); | })(); | ||
*/ | |||
/** | /** | ||
* Skrypt dla Szablon:Galeria | * Skrypt dla Szablon:Galeria | ||
*/ | */ | ||
/* | |||
function toggleImage(group, remindex, shwindex) { | function toggleImage(group, remindex, shwindex) { | ||
document.getElementById("ImageGroupsGr"+group+"Im"+remindex).style.display="none"; | document.getElementById("ImageGroupsGr"+group+"Im"+remindex).style.display="none"; | ||
| Linia 679: | Linia 680: | ||
} | } | ||
addOnloadHook(ImageGroup); | addOnloadHook(ImageGroup); | ||
*/ | |||
// | // | ||
// "Focus the cursor in the search bar on loading the Main Page" | // "Focus the cursor in the search bar on loading the Main Page" | ||
| Linia 686: | Linia 687: | ||
// | // | ||
// opis działania: skrypt ustawia automatycznie kursor w polu wyszukiwania. | // opis działania: skrypt ustawia automatycznie kursor w polu wyszukiwania. | ||
/* | |||
if (wgPageName == "Strona_główna") { | if (wgPageName == "Strona_główna") { | ||
addOnloadHook(function() { | addOnloadHook(function() { | ||
| Linia 693: | Linia 695: | ||
}); | }); | ||
} | } | ||
*/ | |||
// | // | ||
// search box for anonimous users (styles in Common.css) | // search box for anonimous users (styles in Common.css) | ||
// | // | ||
/* | |||
if ( | if ( | ||
(wgPageName == "Strona_główna" && wgUserGroups == null) | (wgPageName == "Strona_główna" && wgUserGroups == null) | ||
| Linia 725: | Linia 728: | ||
}); | }); | ||
} | } | ||
*/ | |||
///////////////////////////////////////// | ///////////////////////////////////////// | ||
///// Skrypty zewnętrzne ////// | ///// Skrypty zewnętrzne ////// | ||
| Linia 732: | Linia 735: | ||
// Importowanie funkcji działających podczas edycji. Patrz: [[MediaWiki:Common-edit.js]] | // Importowanie funkcji działających podczas edycji. Patrz: [[MediaWiki:Common-edit.js]] | ||
/* | |||
if (wgAction == 'edit' || wgAction == 'submit') | if (wgAction == 'edit' || wgAction == 'submit') | ||
{ | { | ||
| Linia 791: | Linia 794: | ||
importStylesheet( "MediaWiki:CommonsTicker.css" ); | importStylesheet( "MediaWiki:CommonsTicker.css" ); | ||
} | } | ||
*/ | |||
/** WikiMiniAtlas ******************************************************* | /** WikiMiniAtlas ******************************************************* | ||
* | * | ||
| Linia 800: | Linia 803: | ||
* Maintainers: [[User:Dschwen]] | * Maintainers: [[User:Dschwen]] | ||
*/ | */ | ||
/* | |||
if (wgServer == "https://secure.wikimedia.org") { | if (wgServer == "https://secure.wikimedia.org") { | ||
var metaBase = "https://secure.wikimedia.org/wikipedia/meta"; | var metaBase = "https://secure.wikimedia.org/wikipedia/meta"; | ||
| Linia 813: | Linia 816: | ||
width : 700 | width : 700 | ||
} | } | ||
*/ | |||
/** extract a URL parameter from the current URL ********** | /** extract a URL parameter from the current URL ********** | ||
* From [[en:User:Lupin/autoedit.js]] | * From [[en:User:Lupin/autoedit.js]] | ||
* Local Maintainer: [[User:Saper]] | * Local Maintainer: [[User:Saper]] | ||
*/ | */ | ||
function getParamValue( paramName, url) | /* function getParamValue( paramName, url) | ||
{ | { | ||
if (typeof (url) == 'undefined' ) url = document.location.href; | if (typeof (url) == 'undefined' ) url = document.location.href; | ||
| Linia 829: | Linia 832: | ||
} | } | ||
return null; | return null; | ||
} | } */ | ||
/** Parametr &withJS= ******* | /** Parametr &withJS= ******* | ||
* Spróbuj załadować dodatkowy skrypt z przestrzeni MediaWiki | * Spróbuj załadować dodatkowy skrypt z przestrzeni MediaWiki | ||
| Linia 836: | Linia 839: | ||
* Maintainer: commons: [[User:Platonides]], plwiki: [[User:Saper]] | * Maintainer: commons: [[User:Platonides]], plwiki: [[User:Saper]] | ||
*/ | */ | ||
{ | /* { | ||
var extraJS = getParamValue("withJS"); | var extraJS = getParamValue("withJS"); | ||
if (extraJS) | if (extraJS) | ||
| Linia 844: | Linia 847: | ||
alert("Plik " + extraJS + " nie powinien byc ladowany."); | alert("Plik " + extraJS + " nie powinien byc ladowany."); | ||
} | } | ||
*/ | |||
/* | /* | ||
== Drobne skrypty == | == Drobne skrypty == | ||
| Linia 853: | Linia 856: | ||
// Zaznacza wszystkie elementy typu "checkbox" na stronie - wywołanie javascript:ZaznaczWszystkie() | // Zaznacza wszystkie elementy typu "checkbox" na stronie - wywołanie javascript:ZaznaczWszystkie() | ||
// | // | ||
function ZaznaczWszystkie() | /* function ZaznaczWszystkie() | ||
{ | { | ||
var inpt = document.getElementsByTagName('input'); | var inpt = document.getElementsByTagName('input'); | ||
| Linia 859: | Linia 862: | ||
if (inpt[i].type=='checkbox') | if (inpt[i].type=='checkbox') | ||
inpt[i].checked=true; | inpt[i].checked=true; | ||
} | }*/ | ||
// | // | ||
// RSS kategorii | // RSS kategorii | ||
// | // | ||
if (wgNamespaceNumber == 14) | /* if (wgNamespaceNumber == 14) | ||
{ | { | ||
addOnloadHook(function() | addOnloadHook(function() | ||
| Linia 875: | Linia 878: | ||
mw.util.addPortletLink('p-tb', rsslink, 'RSS kategorii', 't-katrss', 'RSS kategorii ' + wgTitle, null, null); | mw.util.addPortletLink('p-tb', rsslink, 'RSS kategorii', 't-katrss', 'RSS kategorii ' + wgTitle, null, null); | ||
}); | }); | ||
} | }*/ | ||
// | // | ||
// Array.indexOf() dla kompatybilności różnych skryptów z IE | // Array.indexOf() dla kompatybilności różnych skryptów z IE | ||
// (skrypt z Mozilli) | // (skrypt z Mozilli) | ||
if (!Array.prototype.indexOf) | /* if (!Array.prototype.indexOf) | ||
{ | { | ||
Array.prototype.indexOf = function(elt /*, from*/) | Array.prototype.indexOf = function(elt /*, from*/) | ||
| Linia 897: | Linia 900: | ||
return -1; | return -1; | ||
}; | }; | ||
} | }*/ | ||
// | // | ||
// Ustawienie wysokości "Usunięcie" pustego elementu contentSub | // Ustawienie wysokości "Usunięcie" pustego elementu contentSub | ||
// | // | ||
addOnloadHook(function() | /* addOnloadHook(function() | ||
{ | { | ||
var el=document.getElementById('mw-revisiontag'); | var el=document.getElementById('mw-revisiontag'); | ||
| Linia 915: | Linia 918: | ||
if (fn.length) fn[0].className+=' firstNavbox'; | if (fn.length) fn[0].className+=' firstNavbox'; | ||
}) | }) | ||
*/ | |||
/* | /* | ||
=== Link do brudnopisów w menu osobistym === | === Link do brudnopisów w menu osobistym === | ||
| Linia 921: | Linia 924: | ||
; autor: [[Wikipedysta:Herr Kriss]] | ; autor: [[Wikipedysta:Herr Kriss]] | ||
*/ | */ | ||
/* | |||
var disableSandboxLink = 0; // ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność | var disableSandboxLink = 0; // ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność | ||
| Linia 935: | Linia 938: | ||
} | } | ||
}); | }); | ||
*/ | |||
/* | /* | ||
* Description: Redirects from User:UserName/skin.js or .css to the user's actual skin page | * Description: Redirects from User:UserName/skin.js or .css to the user's actual skin page | ||
* Maintainer: Nux | * Maintainer: Nux | ||
*/ | */ | ||
if (wgNamespaceNumber==2 && wgArticleId==0 && wgAction=="view" // Nonexistent User:... page in view mode | /* if (wgNamespaceNumber==2 && wgArticleId==0 && wgAction=="view" // Nonexistent User:... page in view mode | ||
&& wgUserName // Logged in User | && wgUserName // Logged in User | ||
&& wgTitle.indexOf(wgUserName+"/skin.")===0 | && wgTitle.indexOf(wgUserName+"/skin.")===0 | ||
| Linia 948: | Linia 951: | ||
window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.$1'); | window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.$1'); | ||
} | } | ||
*/ | |||
// | // | ||
// Import usergroup-specific stylesheet, only for admins atm | // Import usergroup-specific stylesheet, only for admins atm | ||
// | // | ||
for( var key=0; wgUserGroups && key < wgUserGroups.length; key++ ) | for( var key=0; wgUserGroups && key < wgUserGroups.length; key++ ) | ||
{ | /* { | ||
if (wgUserGroups[key] =="sysop") | if (wgUserGroups[key] =="sysop") | ||
{ | { | ||
| Linia 959: | Linia 962: | ||
break; | break; | ||
} | } | ||
} | }*/ | ||
/* START MINECRAFT WIKI SCRIPT */ | /* START MINECRAFT WIKI SCRIPT */ | ||
/** Grid/slide **/ | /** Grid/slide **/ | ||
// this needs to be unminified; MediaWiki automatically minifies all CSS and JS before | // this needs to be unminified; MediaWiki automatically minifies all CSS and JS before | ||
// serving it to users, so minifying it here just makes it nigh-unmaintainable | // serving it to users, so minifying it here just makes it nigh-unmaintainable | ||
/* | |||
jQuery(function(){jQuery(".GridSlide").each(function(){jQuery("div.GridSlideChild:first",this).addClass("active").show()});setInterval(function(){jQuery(".GridSlide").each(function(){var b=jQuery("div.active",this),a=b.next();a.length<1&&(a=jQuery("div.GridSlideChild:first",this));b.removeClass("active").hide();a.addClass("active").show()})},2E3)}); | jQuery(function(){jQuery(".GridSlide").each(function(){jQuery("div.GridSlideChild:first",this).addClass("active").show()});setInterval(function(){jQuery(".GridSlide").each(function(){var b=jQuery("div.active",this),a=b.next();a.length<1&&(a=jQuery("div.GridSlideChild:first",this));b.removeClass("active").hide();a.addClass("active").show()})},2E3)}); | ||
| Linia 970: | Linia 973: | ||
a=b.next();if(a.length<1||!a.hasClass("grid-input"))a=jQuery("span.grid-input:first",this);b.removeClass("active").hide();a.addClass("active").show();b=jQuery("span.grid-input-numbers.active",this);a=b.next();a.length<1&&(a=jQuery("span.grid-input-numbers:first",this));b.removeClass("active").hide();a.addClass("active").show()});jQuery("div.grid-output-slide").each(function(){var b=jQuery("span.grid-output.active",this),a=b.next();if(a.length<1||!a.hasClass("grid-output"))a=jQuery("span.grid-output:first", | a=b.next();if(a.length<1||!a.hasClass("grid-input"))a=jQuery("span.grid-input:first",this);b.removeClass("active").hide();a.addClass("active").show();b=jQuery("span.grid-input-numbers.active",this);a=b.next();a.length<1&&(a=jQuery("span.grid-input-numbers:first",this));b.removeClass("active").hide();a.addClass("active").show()});jQuery("div.grid-output-slide").each(function(){var b=jQuery("span.grid-output.active",this),a=b.next();if(a.length<1||!a.hasClass("grid-output"))a=jQuery("span.grid-output:first", | ||
this);b.removeClass("active").hide();a.addClass("active").show();b=jQuery("span.grid-output-numbers.active",this);a=b.next();a.length<1&&(a=jQuery("span.grid-output-numbers:first",this));b.removeClass("active").hide();a.addClass("active").show()})},2E3)}); | this);b.removeClass("active").hide();a.addClass("active").show();b=jQuery("span.grid-output-numbers.active",this);a=b.next();a.length<1&&(a=jQuery("span.grid-output-numbers:first",this));b.removeClass("active").hide();a.addClass("active").show()})},2E3)}); | ||
*/ | |||
/ | |||
/** | /** | ||
* | * Set unlicensed as the default license on file pages | ||
* | * | ||
* | * That way the file will be categorised so someone can find a license for the file | ||
*/ | */ | ||
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) { | |||
if ( $( '#wpLicense' ).val() === '' ) { | |||
$( '#wpLicense' ).val( i18n.defaultLicense ); | |||
} | |||
$ | /* mw.loader.using( 'mediawiki.special.upload', function() { | ||
var change = setInterval( function() { | |||
if ( licenseSelectorCheck ) { | |||
} | $( '#wpLicense' ).change(); | ||
clearInterval( change ); | |||
if ( $ | |||
} | } | ||
} ); | }, 500 ); | ||
} | } );*/ | ||
} | } | ||
/** | /** | ||
Wersja z 11:50, 30 sty 2017
/*
UWAGA! Ten JavaScript działa dla wszystkich skórek. Należy zachować szczególną ostrożność wprowadzając tutaj zmiany!
'''Wyłączenie poszczególnych możliwości/skryptów'''
* Oznaczanie artykułów medalowych i dobrych artykułów (dla interwiki)
window.LinkFADone = true;
* Przesunięcie linków [ edytuj ] przy sekcjach
var oldEditsectionLinks=true;
*/
( function() {
'use strict';
/* Variables for interface text used throughout the script, for ease of translating */
var i18n = {
// Collapsible elements and page loader
hideText: 'Ukryj',
showText: 'Pokaż',
// Page loader
loadErrorTitle: '"Błąd podczas ładowania danych',
// File upload
defaultLicense: 'License'
};
/**
* Instead of cluttering up the global scope with
* variables, they should instead be set as a
* property of this global variable
*
* E.g: Instead of
* myVar = 'blah';
* use
* mcw.myVar = 'blah';
*/
var mcw = window.mcw = {};
mw.hook( 'wikipage.content' ).add( function( $wikipageContent ) {
/**
* Collapsible elements
*
* Add the "collapsible" class to an element and the child element with class "collapsible-content"
* (or everything but the header row if a table) will be hidden when the element is collapsed.
*
* * Add the class "collapsed" to the element to make it start out collapsed.
* * Add either "collapsetoggle-left" or "collapsetoggle-inline" to the element to choose the collapse
* toggle alignment (defaults to right).
* * Add an ID in the format of "collapsible-<x>" to the element to make any element with the class
* "collapsetoggle-custom" and a matching class in the format of "collapsible-<x>-toggle" control
* the collapsing instead of the standard button.
* If the custom toggle contains an element with the "jslink" class, only that will be clickable.
*/
( function() {
var $collapsibles = $wikipageContent.find( '.collapsible' );
if ( !$collapsibles.length ) {
return;
}
var $toggleTemplate = $( '<span>' ).addClass( 'collapsetoggle' ).append(
'[', $( '<span>' ).addClass( 'jslink' ), ']'
);
$collapsibles.each( function() {
var $collapsible = $( this );
if ( $collapsible.data( 'made-collapsible' ) ) {
return true;
}
var $children = $collapsible.children();
var showText = $collapsible.data( 'expandtext' ) || i18n.showText;
var hideText = $collapsible.data( 'collapsetext' ) || i18n.hideText;
// If there is no content area, add it
if ( !$collapsible.is( 'table' ) && !$children.filter( '.collapsible-content' ).length ) {
if ( $collapsible.is( 'tr' ) ) {
$children.addClass( 'collapsible-content' );
} else {
$collapsible.wrapInner( '<div class="collapsible-content">' );
}
}
var $toggle;
var id = $collapsible.attr( 'id' );
if ( id && id.match( /^collapsible-./ ) ) {
$toggle = $( $wikipageContent[0].getElementsByClassName( id + '-toggle' ) )
.filter( '.collapsetoggle-custom' ).css( 'visibility', 'visible' );
}
// Create and insert the toggle button if there is no custom one
if ( !$toggle || !$toggle.length ) {
var $toggleContainer;
if ( $collapsible.is( 'table' ) ) {
var $rows = $children.filter( 'thead' ).children();
if ( !$rows.length ) {
$rows = $children.filter( 'tbody' ).first().children();
if ( !$rows.length ) {
$rows = $children.filter( 'tr' );
}
}
$toggleContainer = $rows.first().children().last();
} else {
$toggleContainer = $children.first();
if ( $toggleContainer.hasClass( 'collapsible-content' ) ) {
$toggleContainer = $collapsible;
}
}
$toggle = $toggleTemplate.clone();
if ( $collapsible.hasClass( 'collapsetoggle-inline' ) || $collapsible.hasClass( 'collapse-button-none' ) ) {
$toggleContainer.append( $toggle );
} else {
$toggleContainer.prepend( $toggle );
}
}
var $toggleLink = $toggle.find( '.jslink' );
if ( !$toggleLink.length ) {
$toggleLink = $toggle;
}
$toggleLink.attr( 'tabindex', 0 ).text( hideText );
// Find max toggle size, and set its min-width to it
var hideWidth = $toggle.width();
$toggleLink.text( showText );
var showWidth = $toggle.width();
if ( hideWidth !== showWidth ) {
$toggle.css( 'min-width', hideWidth > showWidth ? hideWidth : showWidth );
}
// Set the text back to hide if it's not collapsed to begin with
if ( !$collapsible.hasClass( 'collapsed' ) ) {
$toggleLink.text( hideText );
}
$toggleLink.on( 'click keydown', function( e ) {
// Only trigger on enter press
if ( e.keyCode && e.keyCode !== 13 ) {
return;
}
// Don't toggle when clicking buttons or links inside the toggle
var $target = $( e.target );
if ( $target.is( 'button' ) || $target.is( 'a' ) ) {
return;
}
$collapsible.toggleClass( 'collapsed' );
if ( $collapsible.hasClass( 'collapsed' ) ) {
$toggleLink.text( showText );
} else {
$toggleLink.text( hideText );
}
// Stop table sorting activating when clicking the link
e.stopPropagation();
} );
$collapsible.data( 'made-collapsible', true );
} );
}() );
// End Collapsible function
/**
* Element animator
*
* Will cycle the active class on any child elements
* within an element with the animated class.
*/
( function() {
if ( !mcw.animate ) {
mcw.animate = setInterval( function() {
$( '.animated' ).each( function() {
var $elem = $( this );
var $current = $elem.children( '.active' );
var $next = $current.nextAll( ':not(.skip):first' );
// Loop back to the start
if ( !$next.length ) {
$next = $elem.children( ':not(.skip):first' );
}
$current.removeClass( 'active' );
$next.addClass( 'active' );
} );
}, 2000 );
}
}() );
/**
* Page loader
*
* Allows a page to be downloaded and displayed on demand.
* Use with [[Template:LoadPage]] and [[Template:LoadBox]]
*/
( function() {
var $loadPage = $wikipageContent.find( '.load-page' );
if ( !$loadPage.length ) {
return;
}
// We need the spinner to show loading is happening, but we don't want
// to have a delay while the module downloads, so we'll load this now,
// regardless of if something is clicked
mw.loader.load( 'jquery.spinner' );
// Create button starting with hide text
// Will be changed to the show text while calculating the maximum button size
var $buttonTemplate = $( '<span>' ).addClass( 'mw-editsection-like load-page-button' )
.append( '[', $( '<span>' ).addClass( 'jslink' ).text( i18n.hideText ), ']' );
var extractList = function( $contentContainer, listClass ) {
var $content = $contentContainer.find( '> ul > li > ul' ).children( ':not(.nbttree-inherited)' );
if ( listClass ) {
$content.addClass( listClass );
}
return $content;
};
$loadPage.each( function() {
var $body = $( this );
var page = $body.data( 'page' );
if ( !page ) {
return;
}
var template = $body.data( 'template' );
var treeview = $body.data( 'treeview' );
var treeviewClass = $body.data( 'treeviewclass' );
var $heading;
var $contentContainer;
var $content;
var $button = $buttonTemplate.clone();
var $buttonLink = $button.find( '.jslink' );
if ( treeview ) {
$heading = $body;
$contentContainer = $( '<div>' );
} else {
$heading = $body.children().first();
$contentContainer = $body.find( '.load-page-content' );
}
// Add the button
$heading.append( $button );
// Move the edit button to the right spot
$contentContainer.find( '.mw-editsection, .mw-editsection-like' ).insertAfter( $button );
// Find max button width, and set its min-width to it
var hideWidth = $button.width();
$buttonLink.text( i18n.showText );
var showWidth = $button.width();
if ( hideWidth !== showWidth ) {
$button.css( 'min-width', hideWidth > showWidth ? hideWidth : showWidth );
}
$buttonLink.click( function() {
if ( $body.hasClass( 'pageloader-contentloaded' ) ) {
if ( $buttonLink.text() === i18n.showText ) {
if ( treeview ) {
$content.insertAfter( $body );
} else {
$contentContainer.show();
}
$buttonLink.text( i18n.hideText );
} else {
if ( treeview ) {
$content.detach();
} else {
$contentContainer.hide();
}
$buttonLink.text( i18n.showText );
}
return;
}
// See if this was loaded elsewhere before making a request
var gotContent;
$( '.pageloader-contentloaded' ).each( function() {
var $fLoader = $( this );
if ( $fLoader.data( 'page' ) === page && $fLoader.data( 'pageloader-content' ) ) {
$contentContainer.html( $fLoader.data( 'pageloader-content' ) ).removeClass( 'noscript' );
mw.hook( 'wikipage.content' ).fire( $contentContainer );
if ( treeview ) {
$body.find( '.noscript' ).remove();
$content = extractList( $contentContainer, treeviewClass );
$content.insertAfter( $body );
}
$buttonLink.text( i18n.hideText );
$body.addClass( 'pageloader-contentloaded' );
gotContent = true;
return false;
}
} );
if ( gotContent ) {
return;
}
// Just in-case the spinner module is still not ready yet
var $spinner = $();
mw.loader.using( 'jquery.spinner', function() {
// $spinner will be false if the content somehow loaded before the module did
if ( $spinner ) {
$spinner = $.createSpinner().addClass( 'mw-editsection-like' )
.css( 'min-width', $button.css( 'min-width' ) );
$button.hide().after( $spinner );
}
} );
var requestData = {
action: 'parse',
prop: 'text'
};
if ( template ) {
requestData.page = page;
} else {
requestData.title = mw.config.get( 'wgPageName' );
requestData.text = '{' + '{:' + page + '}}';
}
new mw.Api().get( requestData ).done( function( data ) {
var html = data.parse.text['*'];
$contentContainer.html( html ).removeClass( 'noscript' );
// Resolve self-links
if ( template ) {
var curPage = '/' + mw.config.get( 'wgPageName' );
$contentContainer.find( 'a' ).each( function() {
var $link = $( this );
if ( $link.attr( 'href' ) === curPage ) {
$link.replaceWith( $( '<strong>' ).addClass( 'selflink' ).append( $link.contents() ) );
}
} );
html = $contentContainer.html();
}
$body.data( 'pageloader-content', html );
// Fire content hook on the new content, running all this stuff again and more :)
mw.hook( 'wikipage.content' ).fire( $contentContainer );
if ( treeview ) {
$body.find( '.noscript' ).remove();
$content = extractList( $contentContainer, treeviewClass );
$content.insertAfter( $body );
}
$spinner.remove();
$spinner = false;
$buttonLink.text( i18n.hideText );
$button.show();
$body.addClass( 'pageloader-contentloaded' );
} ).fail( function( _, error ) {
$spinner.remove();
$spinner = false;
$button.show();
var errorText = '';
if ( error.textStatus ) {
errorText = error.textStatus;
} else if ( error.error ) {
errorText = error.error.info;
}
mw.notify( errorText, { title: i18n.loadErrorTitle, autoHide: false } );
} );
} );
} );
}() );
} );
/* End wiki content hook */
/*
Dodawanie ciasteczek wygasających po pewnym czasie
name - nazwa ciasteczka
value - wartość do ustawienia
// opcje (wszystkie opcjonalne)
options = {days:7, path:'/'} // defaults
*/
/* function addLongTermCookie(name, value, options)
{
// options
if (typeof(options)!='object')
{
options = new Object();
}
var days = (options.days) ? options.days : 7;
var path = (options.path) ? options.path : '/';
// setup date
var dt = new Date();
dt = new Date(dt.getTime()+days*24*3600000); //(ilość sekund * 1000)
// set
document.cookie = name+"="+value+"; path="+path+"; expires=" + dt.toGMTString();
}
*/
/*
==== funkcja insertTagsTo_ ====
; Author: phpBB Team, WikiMedia, Maciej Jaros [[:pl:User:Nux]]
; Licence: [http://opensource.org/licenses/gpl-license.php GNU General Public License v2]
; Description: Apply tagOpen/tagClose to selection in given textarea/input, use sampleText instead of selection if there is none. Copied and adapted from phpBB
*/
// outputid = 'some_id_of_a_textarea_or_a_text_input'
/* function insertTagsTo_(tagOpen, tagClose, sampleText, outputid) {
var txtarea = document.getElementById(outputid);
if (!txtarea)
return
;
// IE
if (document.selection && !is_gecko) {
var theSelection = document.selection.createRange().text;
if (!theSelection)
theSelection=sampleText;
txtarea.focus();
if (theSelection.charAt(theSelection.length - 1) == " ") { // exclude ending space char, if any
theSelection = theSelection.substring(0, theSelection.length - 1);
document.selection.createRange().text = tagOpen + theSelection + tagClose + " ";
} else {
document.selection.createRange().text = tagOpen + theSelection + tagClose;
}
// Mozilla
} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
var replaced = false;
var startPos = txtarea.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)
txtarea.caretPos = document.selection.createRange().duplicate();
}
*/
/*
==== Dodanie linka [edytuj] dla sekcji nagłówkowej ====
; Pomysł: [[:en:User:Pile0nades]]
; Wykonanie: Maciej Jaros [[:pl:User:Nux]]
; Licencja: [http://opensource.org/licenses/gpl-license.php GNU General Public License v2]
*/
// Liczba nagłówków drugiego, trzeciego i czwartego stopnia
// jakie muszą się pojawić w artykule, żeby pojawił się link
/* var addEditTopLinkNumHeaders = 2; dla 2 => dla dwóch i więcej się pojawi
function addEditTopLink() {
//
// somehow it gets run twice on some pages - stop that
if (window.addEditTopLinkDone)
return
;
window.addEditTopLinkDone = true;
//
// if this is preview page or there is no edit tab, stop
if (!wgIsArticle)
return
;
//
// if there are no edit-section links then stop
var spans = document.getElementById("bodyContent").getElementsByTagName("span");
var i;
for (i = 0; i < spans.length; i++) {
if (spans[i].className == 'editsection')
break
;
}
if (i>=spans.length)
return
;
//
// additional checkup to stop
var test = document.getElementById("bodyContent").getElementsByTagName("h2").length +
document.getElementById("bodyContent").getElementsByTagName("h3").length +
document.getElementById("bodyContent").getElementsByTagName("h4").length;
// note that there is always siteSub (h3)
if (test<=addEditTopLinkNumHeaders)
return
;
//
// get first header element
var fst_h1 = document.getElementById("content").getElementsByTagName("h1")[0];
//
// Creating elements
//
// create div
var div = document.createElement("DIV");
div.className = 'editsection';
// create link
var link = document.createElement("A");
link.href = document.getElementById("ca-edit").getElementsByTagName("a")[0].href + '§ion=0';
link.setAttribute('title', 'edytuj sekcję nagłówkową artykułu');
link.appendChild(document.createTextNode('edytuj'));
// append link and stuff to div
div.appendChild(document.createTextNode('['));
div.appendChild(link);
div.appendChild(document.createTextNode(']'));
//
// Styling
//
div.style.cssText = 'padding:.7em 0 0 1.0em; float:right; font-size:x-small;';
//
// Insert edit div into h1 and content of h1 to div (it has to be like that so that FF doesn't select the edit link on double click)
//
var div_h1 = document.createElement("div");
// move children
while(fst_h1.childNodes.length)
{
div_h1.appendChild(fst_h1.firstChild)
}
fst_h1.appendChild(div); // edit link
fst_h1.appendChild(div_h1); // previous h1 content
}
if (skin=='vector' || skin=='monobook')
{
addOnloadHook(addEditTopLink);
}
*/
/*
== Przesunięcie linków [ edytuj ] przy sekcjach ==
; Autor: Copyright 2006, Marc Mongenet
; Opis: Wyszukuje <span class="editsection"> i przesuwa na koniec ich rodzica (nagłówka sekcji) wyświetlając ''inline'' ze zmniejszoną czcionką.
; Licencja:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
http://www.gnu.org/licenses/gpl.html
*/
/* addOnloadHook(function() {
try {
if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return;
var spans = document.getElementsByTagName("span");
for (var s = 0; s < spans.length; ++s) {
var span = spans[s];
if (span.className == "editsection") {
span.style.cssText = 'float:none; font-size:x-small; font-weight: normal;';
span.parentNode.appendChild(document.createTextNode(" "));
span.parentNode.appendChild(span);
}
}
} catch (e) { /* błąd */ }
});
*/
/** 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 ( window.LinkFADone )
return;
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 = "Artykuł w tym języku jest na medal";
}
else if ( document.getElementById( InterwikiLinks[i].className + "-ga" ) ) {
InterwikiLinks[i].className += " GArt"
InterwikiLinks[i].title = "Artykuł w tym języku jest dobrym artykułem";
}
}
}
window.LinkFADone = true;
}
addOnloadHook( LinkFA );
*/
/* 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);
};
})();
*/
/**
* Skrypt dla Szablon:Galeria
*/
/*
function toggleImage(group, remindex, shwindex) {
document.getElementById("ImageGroupsGr"+group+"Im"+remindex).style.display="none";
document.getElementById("ImageGroupsGr"+group+"Im"+shwindex).style.display="inline";
}
function ImageGroup(){
if (document.URL.match(/printable/g)) return;
var divs=document.getElementsByTagName("div");
var i = 0, j = 0;
var units, search;
var currentimage;
var UnitNode;
for (i = 0; i < divs.length ; i++) {
if (divs[i].className != "ImageGroup") continue;
UnitNode=undefined;
search=divs[i].getElementsByTagName("div");
for (j = 0; j < search.length ; j++) {
if (search[j].className != "ImageGroupUnits") continue;
UnitNode=search[j];
break;
}
if (UnitNode==undefined) continue;
units=Array();
for (j = 0 ; j < UnitNode.childNodes.length ; j++ ) {
var temp = UnitNode.childNodes[j];
if (temp.className=="center") units.push(temp);
}
for (j = 0 ; j < units.length ; j++) {
currentimage=units[j];
currentimage.id="ImageGroupsGr"+i+"Im"+j;
var imghead = document.createElement("div");
var leftlink = document.createElement("a");
var rightlink = document.createElement("a");
if (j != 0) {
leftlink.href = "javascript:toggleImage("+i+","+j+","+(j-1)+");";
leftlink.innerHTML="◀";
}
if (j != units.length - 1) {
rightlink.href = "javascript:toggleImage("+i+","+j+","+(j+1)+");";
rightlink.innerHTML="▶";
}
var comment = document.createElement("tt");
comment.innerHTML = "("+ (j+1) + "/" + units.length + ")";
with(imghead) {
style.fontSize="110%";
style.fontweight="bold";
appendChild(leftlink);
appendChild(comment);
appendChild(rightlink);
}
if (units.length>1) currentimage.insertBefore(imghead,currentimage.childNodes[0]);
if (j != 0) currentimage.style.display="none";
}
}
}
addOnloadHook(ImageGroup);
*/
//
// "Focus the cursor in the search bar on loading the Main Page"
// Autor: [[:en:User:Nihiltres]]
// Zaimportowany z http://en.wikipedia.org/wiki/MediaWiki:Gadget-searchFocus.js wg stanu na 7 paź. 2008
//
// opis działania: skrypt ustawia automatycznie kursor w polu wyszukiwania.
/*
if (wgPageName == "Strona_główna") {
addOnloadHook(function() {
var searchInput = document.getElementById("searchInput");
if (searchInput)
searchInput.focus();
});
}
*/
//
// search box for anonimous users (styles in Common.css)
//
/*
if (
(wgPageName == "Strona_główna" && wgUserGroups == null)
|| (wgPageName == "Strona_główna/Nowa")
)
{
addOnloadHook(function()
{
var strFromHtml = ''
+'<form id="mp_search" action="/wiki/Specjalna:Szukaj">'
+'<div class="search_area">'
+'<div>'
+'<input type="text" onclick="this.value=\'\'; this.className=\'\'" class="wyszarz" value="Wpisz tutaj szukane pojęcie, hasło, artykuł" id="mp_sz_inp" name="search" />'
+'<a title="Pomoc:Przeszukiwanie" href="/wiki/Pomoc:Przeszukiwanie"><img alt="Pomoc" src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Ambox_blue_question.svg/30px-Ambox_blue_question.svg.png"></a>'
+'</div>'
+'</div>'
+'<div class="button_area"><input type="submit" value="Szukaj" name="fulltext" id="mp_sz_btn"></div>'
+'<div class="last_area"></div>'
+'</form>'
;
var el = document.getElementById('mp_searchbox_container');
if (el)
{
el.innerHTML=strFromHtml;
el.style.display="block";
}
});
}
*/
/////////////////////////////////////////
///// Skrypty zewnętrzne //////
/////////////////////////////////////////
// Importowanie funkcji działających podczas edycji. Patrz: [[MediaWiki:Common-edit.js]]
/*
if (wgAction == 'edit' || wgAction == 'submit')
{
if (wgNamespaceNumber > -1)
{
importScript( "MediaWiki:Common-edit.js" );
importScript( "MediaWiki:Gadget-edit-buttons.js" );
importScript( "MediaWiki:nuxedtoolkit.js" ); // tworzenie przycisków w toolbarach edycyjnych
importScript( "MediaWiki:NuxTBKeys.js" ); // Autokorekta
}
}
importScript( "MediaWiki:sel_t.js" ); // zaznaczenie tekstu
importScript( "MediaWiki:SftJSmsg.js" ); // klasa obsługi komunikatów JS-HTML
importScript( "MediaWiki:HeadingIcons.js"); // poprawa ikonek nagłówka
if (wgUserGroups == null) {
// Importowanie skryptów i stylów tylko dla anomimowych użytkowników.
importScript( "MediaWiki:Common-Anon.js" );
//importStylesheet( "MediaWiki:Common-Anon.css" );
appendCSS('.anon_hide_block{display:none}');
}
else
{
appendCSS('.nonanon_hide_block{display:none}');
}
var beau$userGroups = {};
if (wgUserGroups) {
for (var i = 0; i < wgUserGroups.length; i++) {
beau$userGroups[ wgUserGroups[i] ] = true;
}
}
if ( beau$userGroups["sysop"] ) {
// Importowanie skryptów tylko dla administratorów.
// Patrz: [[MediaWiki:Common-Sysop.js]]
importScript( "MediaWiki:Common-Sysop.js" )
}
else {
// Dla osób nie będących administratorami
// Popup do zgłaszania błędów. Patrz: [[MediaWiki:Wikibugs.js]]
importScript( "MediaWiki:Wikibugs.js" )
}
if (wgCanonicalSpecialPageName == 'Upload') {
// Skrypty na stronie przesyłania plików
importScript("MediaWiki:Common-Upload.js");
}
else if (wgCanonicalSpecialPageName == 'Search') {
// Skrypty na stronie wyszukiwania
importScript("MediaWiki:Common-Search.js");
}
else if ( wgPageName == "Wikipedia:CommonsTicker" ) {
// Pobieranie styli CSS dla [[Wikipedia:CommonsTicker]]
importStylesheet( "MediaWiki:CommonsTicker.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");
var wma_settings =
{
height : 400,
width : 700
}
*/
/** extract a URL parameter from the current URL **********
* From [[en:User:Lupin/autoedit.js]]
* Local Maintainer: [[User:Saper]]
*/
/* function getParamValue( paramName, url)
{
if (typeof (url) == 'undefined' ) url = document.location.href;
var cmdRe=RegExp( '[&?]' + paramName + '=([^&]*)' );
var m=cmdRe.exec(url);
if (m) {
try {
return decodeURIComponent(m[1]);
} catch (someError) {}
}
return null;
} */
/** Parametr &withJS= *******
* Spróbuj załadować dodatkowy skrypt z przestrzeni MediaWiki
* bez potrzeby edytowania [[Special:Mypage/monobook.js]]
*
* Maintainer: commons: [[User:Platonides]], plwiki: [[User:Saper]]
*/
/* {
var extraJS = getParamValue("withJS");
if (extraJS)
if (extraJS.match("^MediaWiki:[^&<>=%]*\.js$"))
importScript(extraJS);
else
alert("Plik " + extraJS + " nie powinien byc ladowany.");
}
*/
/*
== Drobne skrypty ==
; Author: Maciej Jaros [[:pl:User:Nux]]
; License: Public domain
*/
//
// Zaznacza wszystkie elementy typu "checkbox" na stronie - wywołanie javascript:ZaznaczWszystkie()
//
/* function ZaznaczWszystkie()
{
var inpt = document.getElementsByTagName('input');
for (var i=inpt.length-1; i>=0; i--)
if (inpt[i].type=='checkbox')
inpt[i].checked=true;
}*/
//
// RSS kategorii
//
/* if (wgNamespaceNumber == 14)
{
addOnloadHook(function()
{
var rsslink = 'http://toolserver.org/~cspurrier/rss/rss.php'
+'?lang=pl&family=wikipedia'
+'&desc=RSS%20kategorii%20Wikipedii'
+'&title='+encodeURIComponent(wgTitle)
+'&categories='+encodeURIComponent(wgTitle);
mw.util.addPortletLink('p-tb', rsslink, 'RSS kategorii', 't-katrss', 'RSS kategorii ' + wgTitle, null, null);
});
}*/
//
// Array.indexOf() dla kompatybilności różnych skryptów z IE
// (skrypt z Mozilli)
/* if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length;
var from = Number(arguments[1]) || 0;
from = (from < 0) ? Math.ceil(from) : Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this && this[from] === elt)
return from;
}
return -1;
};
}*/
//
// Ustawienie wysokości "Usunięcie" pustego elementu contentSub
//
/* addOnloadHook(function()
{
var el=document.getElementById('mw-revisiontag');
if (el && el.className.indexOf('flaggedrevs_short')!=-1)
{
if (el.parentNode.id=='contentSub') el.parentNode.style.height='17px';
}
});
addOnloadHook(function()
{
var fn = getElementsByClassName(document, 'table', 'navbox');
if (fn.length) fn[0].className+=' firstNavbox';
})
*/
/*
=== Link do brudnopisów w menu osobistym ===
; autor: [[Wikipedysta:Herr Kriss]]
*/
/*
var disableSandboxLink = 0; // ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność
addOnloadHook(function()
{
if (wgUserName != null && disableSandboxLink == 0)
{
var caption = 'Mój brudnopis'
if (wgUserLanguage != 'pl')
caption = 'My sandbox';
mw.util.addPortletLink('p-personal', wgServer + wgScript + '?title=Special:Mypage/brudnopis', caption, 'pt-sandbox', caption, '', document.getElementById('pt-preferences'));
}
});
*/
/*
* Description: Redirects from User:UserName/skin.js or .css to the user's actual skin page
* Maintainer: Nux
*/
/* if (wgNamespaceNumber==2 && wgArticleId==0 && wgAction=="view" // Nonexistent User:... page in view mode
&& wgUserName // Logged in User
&& wgTitle.indexOf(wgUserName+"/skin.")===0
&& wgTitle.search(/\/skin.(js|css)/)>0
)
{
window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.$1');
}
*/
//
// Import usergroup-specific stylesheet, only for admins atm
//
for( var key=0; wgUserGroups && key < wgUserGroups.length; key++ )
/* {
if (wgUserGroups[key] =="sysop")
{
importStylesheet("MediaWiki:Admin.css");
break;
}
}*/
/* START MINECRAFT WIKI SCRIPT */
/** Grid/slide **/
// this needs to be unminified; MediaWiki automatically minifies all CSS and JS before
// serving it to users, so minifying it here just makes it nigh-unmaintainable
/*
jQuery(function(){jQuery(".GridSlide").each(function(){jQuery("div.GridSlideChild:first",this).addClass("active").show()});setInterval(function(){jQuery(".GridSlide").each(function(){var b=jQuery("div.active",this),a=b.next();a.length<1&&(a=jQuery("div.GridSlideChild:first",this));b.removeClass("active").hide();a.addClass("active").show()})},2E3)});
jQuery(function(){jQuery("div.grid-input-slide").each(function(){jQuery("span.grid-input:first",this).addClass("active").show();jQuery("span.grid-input-numbers:first",this).addClass("active").show()});jQuery("div.grid-output-slide").each(function(){jQuery("span.grid-output:first",this).addClass("active").show();jQuery("span.grid-output-numbers:first",this).addClass("active").show()});setInterval(function(){jQuery("div.grid-input-slide").each(function(){var b=jQuery("span.grid-input.active",this),
a=b.next();if(a.length<1||!a.hasClass("grid-input"))a=jQuery("span.grid-input:first",this);b.removeClass("active").hide();a.addClass("active").show();b=jQuery("span.grid-input-numbers.active",this);a=b.next();a.length<1&&(a=jQuery("span.grid-input-numbers:first",this));b.removeClass("active").hide();a.addClass("active").show()});jQuery("div.grid-output-slide").each(function(){var b=jQuery("span.grid-output.active",this),a=b.next();if(a.length<1||!a.hasClass("grid-output"))a=jQuery("span.grid-output:first",
this);b.removeClass("active").hide();a.addClass("active").show();b=jQuery("span.grid-output-numbers.active",this);a=b.next();a.length<1&&(a=jQuery("span.grid-output-numbers:first",this));b.removeClass("active").hide();a.addClass("active").show()})},2E3)});
*/
/**
* Set unlicensed as the default license on file pages
*
* That way the file will be categorised so someone can find a license for the file
*/
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
if ( $( '#wpLicense' ).val() === '' ) {
$( '#wpLicense' ).val( i18n.defaultLicense );
}
/* mw.loader.using( 'mediawiki.special.upload', function() {
var change = setInterval( function() {
if ( licenseSelectorCheck ) {
$( '#wpLicense' ).change();
clearInterval( change );
}
}, 500 );
} );*/
}
/**
* Pause grid GUI templates (e.g. [[Template:Grid/Crafting Table]]) on mouseover
*
* This is so people have a chance to look at each image on the cell
* and click on pages they want to view.
*/
$( '#mw-content-text' ).on( {
'mouseenter': function() {
$( this ).find( '.animated' ).removeClass( 'animated' ).addClass( 'paused' );
},
'mouseleave': function() {
$( this ).find( '.paused' ).removeClass( 'paused' ).addClass( 'animated' );
}
}, '.grid-generic, .grid-Crafting_Table, .grid-Furnace, .grid-Brewing_Stand, .mcui' );
/* End DOM ready */
}() );