MediaWiki:Common.js: Różnice pomiędzy wersjami
Wygląd
Usunięta treść Dodana treść
Nie podano opisu zmian |
polskie cudzysłowy w rozszerzonym pasku edycji |
||
Linia 705: | Linia 705: | ||
{ |
{ |
||
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'); |
||
} |
|||
// Polskie cudzysłowy w rozszerzonym pasku edycji (do czasu dodania przycisku na stałe |
|||
if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) { |
|||
$j( function() { |
|||
$j( '#wpTextbox1' ).bind( 'wikiEditor-toolbar-buildSection-characters', function( event, section ) { |
|||
section.pages.symbols.characters[25] = { |
|||
'label': "\u201e\u201d", |
|||
'action': { |
|||
'type': 'encapsulate', 'options': { 'pre': "\u201e", 'post': "\u201d" } |
|||
} |
|||
}; |
|||
} ); |
|||
} ); |
|||
} |
} |
Wersja z 23:42, 4 kwi 2011
// <pre>
/*
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;
*/
/*
==== 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 (!mw.config.get('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')
{
$(document).ready(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
*/
function setModifySectionStyle(element) {
if (typeof oldEditsectionLinks !== 'undefined' && oldEditsectionLinks) {
return;
}
var racine = element ? element : document;
try {
var sections = ["h2", "h3", "h4", "h5", "h6"];
for (i = 0; i < sections.length; i++) {
var list = racine.getElementsByTagName(sections[i]);
for (var j = 0; j < list.length; j++) {
var parent = list[j];
var span = parent.firstChild;
if (span.className === "editsection") {
$(parent).addClass("modifiedSectionTitle");
parent.appendChild(span);
}
}
}
}
catch (e) { }
}
$(document).ready( function(){ setModifySectionStyle()} );
/** 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;
}
$(document).ready( 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);
};
})();
/** Collapsible tables *********************************************************
*
* Description: Allows tables to be collapsed, showing only the header. See
* [[en:Wikipedia:NavFrame]].
* Maintainers: [[User:R. Koot]]
*/
var autoCollapse = 2;
var collapseCaption = "ukryj";
var expandCaption = "pokaż";
function collapseTable( tableIndex )
{
var Button = document.getElementById( "collapseButton" + tableIndex );
var Table = document.getElementById( "collapsibleTable" + tableIndex );
if ( !Table || !Button ) {
return false;
}
var Rows = Table.rows;
if ( Button.firstChild.data == collapseCaption ) {
for ( var i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = "none";
}
Button.firstChild.data = expandCaption;
} else {
for ( var i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = Rows[0].style.display;
}
Button.firstChild.data = collapseCaption;
}
}
function createCollapseButtons()
{
var tableIndex = 0;
var NavigationBoxes = new Object();
var Tables = document.getElementsByTagName( "table" );
for ( var i = 0; i < Tables.length; i++ ) {
if ( hasClass( Tables[i], "collapsible" ) ) {
/* only add button and increment count if there is a header row to work with */
var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
if (!HeaderRow) continue;
var Header = HeaderRow.getElementsByTagName( "th" )[0];
if (!Header) continue;
NavigationBoxes[ tableIndex ] = Tables[i];
Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
var Button = document.createElement( "span" );
var ButtonLink = document.createElement( "a" );
var ButtonText = document.createTextNode( collapseCaption );
Button.style.styleFloat = "right";
Button.style.cssFloat = "right";
Button.style.fontWeight = "normal";
Button.style.textAlign = "right";
Button.style.width = "6em";
ButtonLink.style.color = Header.style.color;
ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
ButtonLink.appendChild( ButtonText );
Button.appendChild( document.createTextNode( "[" ) );
Button.appendChild( ButtonLink );
Button.appendChild( document.createTextNode( "]" ) );
Header.insertBefore( Button, Header.childNodes[0] );
tableIndex++;
}
}
for ( var i = 0; i < tableIndex; i++ ) {
if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
collapseTable( i );
}
else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
var element = NavigationBoxes[i];
while (element = element.parentNode) {
if ( hasClass( element, "outercollapse" ) ) {
collapseTable ( i );
break;
}
}
}
}
}
$(document).ready( createCollapseButtons );
/** Dynamic Navigation Bars (experimental) *************************************
*
* Description: See [[Wikipedia:NavFrame]].
* Maintainers: UNMAINTAINED
*/
// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';
// shows and hides content and picture (if available) of navigation bars
// Parameters:
// indexNavigationBar: the index of navigation bar to be toggled
function toggleNavigationBar(indexNavigationBar)
{
var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
if (!NavFrame || !NavToggle) {
return false;
}
// if shown now
if (NavToggle.firstChild.data == NavigationBarHide) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if ( hasClass( NavChild, 'NavPic' ) ) {
NavChild.style.display = 'none';
}
if ( hasClass( NavChild, 'NavContent') ) {
NavChild.style.display = 'none';
}
}
NavToggle.firstChild.data = NavigationBarShow;
// if hidden now
} else if (NavToggle.firstChild.data == NavigationBarShow) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if (hasClass(NavChild, 'NavPic')) {
NavChild.style.display = 'block';
}
if (hasClass(NavChild, 'NavContent')) {
NavChild.style.display = 'block';
}
}
NavToggle.firstChild.data = NavigationBarHide;
}
}
// adds show/hide-button to navigation bars
function createNavigationBarToggleButton()
{
var indexNavigationBar = 0;
// iterate over all < div >-elements
var divs = document.getElementsByTagName("div");
for (var i = 0; NavFrame = divs[i]; i++) {
// if found a navigation bar
if (hasClass(NavFrame, "NavFrame")) {
indexNavigationBar++;
var NavToggle = document.createElement("a");
NavToggle.className = 'NavToggle';
NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
var isCollapsed = hasClass( NavFrame, "collapsed" );
/*
* Check if any children are already hidden. This loop is here for backwards compatibility:
* the old way of making NavFrames start out collapsed was to manually add style="display:none"
* 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, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
if ( NavChild.style.display == 'none' ) {
isCollapsed = true;
}
}
}
if (isCollapsed) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
NavChild.style.display = 'none';
}
}
}
var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
NavToggle.appendChild(NavToggleText);
// Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
for(var j=0; j < NavFrame.childNodes.length; j++) {
if (hasClass(NavFrame.childNodes[j], "NavHead")) {
NavFrame.childNodes[j].appendChild(NavToggle);
}
}
NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
}
}
}
$(document).ready( createNavigationBarToggleButton );
/**
* 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";
}
}
}
$(document).ready(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 (mw.config.get('wgPageName') == "Strona_główna") {
$(document).ready(function() {
var searchInput = document.getElementById("searchInput");
if (searchInput)
searchInput.focus();
});
}
//
// search box for anonymous users (styles in Common.css)
//
if (mw.config.get('wgPageName') == "Strona_główna" && !mw.config.exists('wgUserGroups')) {
$(document).ready(function()
{
var strFromHtml = ''
+'<form id="mp_search" action="' + mw.util.wikiGetlink('Specjalna:Szukaj') + '">'
+'<div class="search_area">'
+'<div>'
+'<input type="text" onclick="this.value=\'\'; this.className=\'\'" class="wyszarz" value="Podaj szukane hasło, pojęcie lub nazwę artykułu" 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";
}
});
}
//
// kompletna lista języków
//
if (mw.config.get('wgNamespaceNumber') < 2 && mw.config.get('wgTitle') == "Strona główna") {
$(document).ready(function () {
addPortletLink('p-lang', 'http://pl.wikipedia.org/wiki/Wikipedia:Kompletna_lista_j%C4%99zyk%C3%B3w',
'Wszystkie języki', 'interwiki-all', 'Kompletna lista języków')
});
}
/////////////////////////////////////////
///// Skrypty zewnętrzne //////
/////////////////////////////////////////
// Mapy
importScript("MediaWiki:Maps.js");
// Importowanie funkcji działających podczas edycji. Patrz: [[MediaWiki:Common-edit.js]]
if (mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit')
{
if (mw.config.get('wgNamespaceNumber') > -1 && mw.config.get('wgPageName') != 'NO-EDIT-COMPONENTS')
{
importScript( "MediaWiki:Common-edit.js" );
importScript( "MediaWiki:Gadget-edit-buttons.js" );
importScript( "MediaWiki:NuxTBKeys.js" ); // Autokorekta
}
}
importScript( "MediaWiki:HeadingIcons.js"); // poprawa ikonek nagłówka
if (!mw.config.exists('wgUserGroups')) {
// 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}');
}
if ( jQuery.inArray( 'sysop', mw.config.get( 'wgUserGroups' ) ) != -1 ) {
// Importowanie skryptów tylko dla administratorów.
// Patrz: [[MediaWiki:Common-Sysop.js]]
importScript( "MediaWiki:Common-Sysop.js" )
importStylesheet("MediaWiki:Admin.css");
}
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 (mw.config.get('wgCanonicalSpecialPageName') == 'Upload') {
// Skrypty na stronie przesyłania plików
importScript("MediaWiki:Common-Upload.js");
}
else if (mw.config.get('wgCanonicalSpecialPageName') == 'Search') {
// Skrypty na stronie wyszukiwania
importScript("MediaWiki:Common-Search.js");
}
else if (mw.config.get('wgPageName') == "Wikipedia:CommonsTicker" ) {
// Pobieranie styli CSS dla [[Wikipedia:CommonsTicker]]
importStylesheet( "MediaWiki:CommonsTicker.css" );
}
else if (mw.config.get('wgCanonicalSpecialPageName') == 'Watchlist') {
// Watchlist scripts
//importScript('MediaWiki:Common.js/watchlist.js');
}
/** 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 = mw.util.getParamValue("withJS");
if (extraJS)
if (extraJS.match("^MediaWiki:[^&<>=%]*\.js$"))
importScript(extraJS);
else
alert("Plik " + extraJS + " nie powinien byc ladowany.");
}
//
// RSS kategorii
//
if (mw.config.get('wgNamespaceNumber') == 14)
{
$(document).ready(function()
{
var rsslink = 'http://toolserver.org/~cspurrier/rss/rss.php'
+'?lang=pl&family=wikipedia'
+'&desc=RSS%20kategorii%20Wikipedii'
+'&title='+encodeURIComponent(mw.config.get('wgTitle'))
+'&categories='+encodeURIComponent(mw.config.get('wgTitle'));
addPortletLink('p-tb', rsslink, 'RSS kategorii', 't-katrss', 'RSS kategorii ' + mw.config.get('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
//
$(document).ready(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';
}
});
$(document).ready(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]]
jQuery(document).ready(function() {
if (mw.config.get('wgUserName') != null) {
var caption = 'Mój brudnopis'
if (mw.config.get('wgUserLanguage') != 'pl')
caption = 'My sandbox';
mw.util.addPortletLink('p-personal', mw.util.wikiGetlink('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 (mw.config.get('wgNamespaceNumber') == 2 && mw.config.get('wgArticleId') == 0 && mw.config.get('wgAction') == "view" // Nonexistent User:... page in view mode
&& mw.config.get('wgUserName') // Logged in User
&& mw.config.get('wgTitle').indexOf(mw.config.get('wgUserName')+"/skin.")===0
&& mw.config.get('wgTitle').search(/\/skin.(js|css)/)>0
)
{
window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.$1');
}
// Polskie cudzysłowy w rozszerzonym pasku edycji (do czasu dodania przycisku na stałe
if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
$j( function() {
$j( '#wpTextbox1' ).bind( 'wikiEditor-toolbar-buildSection-characters', function( event, section ) {
section.pages.symbols.characters[25] = {
'label': "\u201e\u201d",
'action': {
'type': 'encapsulate', 'options': { 'pre': "\u201e", 'post': "\u201d" }
}
};
} );
} );
}