Choyoołʼįįhí:Tlustulimu/buttons.js

"Wikiibíídiiya" bitsʼą́ą́dę́ę́ʼ

Note: After saving, you may have to bypass your browser's cache to see the changes. Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Mac). Google Chrome: press Ctrl-Shift-R (Command-Shift-R on a Mac). Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5. Konqueror: click Reload or press F5. Opera: clear the cache in Tools → Preferences

//<source lang="javascript">

/* 
==== Вставка стандартных описаний изменений ====
Z pólskej wikipedije.
* Autor (Author): [[:pl:User:Adziura|Adam Dziura]]
* Poprawki (Fixes): [[:pl:User:Nux|Maciej Jaros]]
* Localized by: [[:ru:User:.:Ajvol:.]]
* Proofed by: [[:ru:User:ACrush]]
* Spoiled by: [[:ru:User:CodeMonk]]
* Zeserbšćinył / Translated into Upper Sorbian by: [[:hsb:Wužiwar:Tlustulimu]]
* Translated into English [[User:Tlustulimu]]
<pre>
*/
 
function przyciskiOpis()
{
// stop before starting
if (window.przyciskiOpisDone)
return;
 
//
// sprawdzenie, czy to jest pole edycji z opisem zmian (nie jest takie jako nagłówek)
var el = document.getElementById('wpSummaryLabel');
if (el)
{
if (el.innerHTML.indexOf('Summary')==-1)
return // stop
;
 
}
else
{
return; // stop
}
 
//
// dodanie elementu okalającego przyciski bezpośrednio za opisem zmian
// создание контейнера с кнопками стандартных описаний изменений
var el = document.getElementById('wpSummary').nextSibling;
var opisBtns = document.createElement('span');
opisBtns.id = 'userSummaryButtonsA'
el.parentNode.insertBefore(document.createElement('br'), el)
el.parentNode.insertBefore(opisBtns, el)
 
//
// dodawanie przycisków
// добавление 
//var kl = 'userButtonsStyle';
var kl = ''; // klasa jest niepotrzebna (wszystkie <a> w #userSummaryButtonsA ustawione poprzez CSS)
if (opisBtns)
{
// drobne różne
przyciskiDodaj(opisBtns, 'wikif.', 'dodajOpis("wikify")', kl,
'I have a little bit wikified');
przyciskiDodaj(opisBtns, 'format.', 'dodajOpis("formatting")', kl,
'Better formatting');
przyciskiDodaj(opisBtns, 'style', 'dodajOpis("better styling")', kl,
'Better styling');
przyciskiDodaj(opisBtns, 'orth.', 'dodajOpis("orthograpy")', kl,
'Better orthography and punctuation');
 
opisBtns.appendChild(document.createTextNode(' ')); // space
 
przyciskiDodaj(opisBtns, 'ilink', 'dodajOpis("internal link")', kl,
'Add internal link(s)');
przyciskiDodaj(opisBtns, 'iwiki', 'dodajOpis("interwiki")', kl,
'Add interwiki(s)');
przyciskiDodaj(opisBtns, 'cor-iwiki', 'dodajOpis("correction of interwiki")', kl,
'Correction of some interwikis');
przyciskiDodaj(opisBtns, 'cat.', 'dodajOpis("category")', kl,
'Better categorisation');
 
opisBtns.appendChild(document.createTextNode(' ')); // space
 
// techniske
przyciskiDodaj(opisBtns, 'templ.', 'dodajOpis("template")', kl,
'Add / change of a template');
przyciskiDodaj(opisBtns, 'del', 'dodajOpis("quick deletion")', kl,
'Page is proposed for quick deletion');
przyciskiDodaj(opisBtns, 'img.', 'dodajOpis("image")', kl,
'New image');
przyciskiDodaj(opisBtns, 'info.', 'dodajOpis("infobox")', kl,
'New infobox');
przyciskiDodaj(opisBtns, 'nawi.', 'dodajOpis("navigation box")', kl,
'New navigation box');
przyciskiDodaj(opisBtns, 'stub.', 'dodajOpis("stub")', kl,
'Marking like a stub');
przyciskiDodaj(opisBtns, 'red.', 'dodajOpis("redirect")', kl,
'Add/Change of redirect');
przyciskiDodaj(opisBtns, 'welc.', 'dodajOpis("welcome")', kl,
'Add of a template for welcome');
 
//opisBtns.appendChild(document.createTextNode(' ')); // space
opisBtns.appendChild(document.createElement('br')); // new line
 
// redakcija
przyciskiDodaj(opisBtns, 'add.', 'dodajOpis("addition")', kl,
'Add of new facts');
przyciskiDodaj(opisBtns, 'cor.', 'dodajOpis("correction")', kl,
'I have a little bit corrected');
przyciskiDodaj(opisBtns, 'trans.', 'dodajOpis("translation")', kl,
'I have a little bit translated');
 
przyciskiDodaj(opisBtns, 'ans.', 'dodajOpis("answer")', kl,
'I have answered in a discussion');
przyciskiDodaj(opisBtns, 'rev.', 'dodajOpis("revert")', kl,
'I made a revert to older version');
}
}
 
/*
Parametry:
* elUserBtns - element okalający, do którego dodać przycisk
* pTekst - tekst w środku przycisku
* pAkcja - akcja (w formie tekstowej) jaką wykonać przy naciśnięciu; może być ciągiem poleceń
* pKlasa - klasa jeśli konieczna
* pOpis - opis widoczny w dymku przy przycisku
*/
function przyciskiDodaj(elUserBtns, pTekst, pAkcja, pKlasa, pOpis) {
var nowyBtn = document.createElement('a');
 
// atrybuty
nowyBtn.appendChild(document.createTextNode(pTekst));
nowyBtn.title = pOpis;
if (pKlasa != '')
nowyBtn.className = pKlasa
;
nowyBtn.onclick = new Function(pAkcja);
 
// dodanie przycisku
elUserBtns.appendChild(nowyBtn);
}
 
function dodajOpis(opis) {
var wpS = document.editform.wpSummary;
if (wpS.value != '' && wpS.value.charAt(wpS.value.length-2) != '/')
{
wpS.value += ', ' + opis
}
else
{
wpS.value += opis
}
}
 
$(przyciskiOpis);


//</source>