MediaWiki:Gadget-edittop.js

z Kitakija

(rozdźěl mjez wersijomaj)
Dźi do: Nawigacija, Pytać
(nowa strona: // ********************************************************************** // ** ***WARNING! GLOBAL GADGET FILE*** ** // **********************************...)
S (dodawk esperantorěčneho přełožka)
Rjadka 5: Rjadka 5:
if ((wgAction == 'view' || wgAction == 'purge') && wgNamespaceNumber >=0)
if ((wgAction == 'view' || wgAction == 'purge') && wgNamespaceNumber >=0)
addOnloadHook(function edittop_hook(){
addOnloadHook(function edittop_hook(){
-
var localtitles = {
+
var localtitles = {
-
   dsb: 'Pśida wobźěłański wótkaz ku prědnej sekciji',
+
   dsb: 'Pśida wobźěłański wótkaz ku prědnej sekciji',   //  :hsb:Wužiwar:Tlustulimu
   en: 'Edit lead section',
   en: 'Edit lead section',
 +
  eo: 'Redakti la komencan sekcion',                    //  :hsb:Wužiwar:Tlustulimu
   fr: 'Modifier le résumé introductif',
   fr: 'Modifier le résumé introductif',
   it: 'Modifica della sezione iniziale',
   it: 'Modifica della sezione iniziale',
-
   hsb: 'Přida wobdźěłanski wotkaz ke prěnjej sekciji',
+
   hsb: 'Přida wobdźěłanski wotkaz ke prěnjej sekciji', //  :hsb:Wužiwar:Tlustulimu
   ja: '導入部を編集'
   ja: '導入部を編集'
-
};
+
};
-
var h2s = document.getElementsByTagName('H2');
+
var h2s = document.getElementsByTagName('H2');
-
var h2 = h2s[0];
+
var h2 = h2s[0];
-
if (!h2) return;
+
if (!h2) return;
-
if (h2.parentNode.id == 'toctitle') h2 = h2s[1];
+
if (h2.parentNode.id == 'toctitle') h2 = h2s[1];
-
if (!h2) return;
+
if (!h2) return;
-
var span = h2.firstChild;
+
var span = h2.firstChild;
-
if (!span || span.className != 'editsection') return;
+
if (!span || span.className != 'editsection') return;
-
var zero = span.cloneNode(true);
+
var zero = span.cloneNode(true);
-
if (document.getElementById('featured-star')) zero.style.marginRight = '25px';
+
if (document.getElementById('featured-star')) zero.style.marginRight = '25px';
-
if (document.getElementById('spoken-icon')) zero.style.marginRight = '45px';
+
if (document.getElementById('spoken-icon')) zero.style.marginRight = '45px';
-
if (document.getElementById('protected-icon') && zero.style.marginRight) zero.style.marginRight = '70px';
+
if (document.getElementById('protected-icon') && zero.style.marginRight) zero.style.marginRight = '70px';
-
var parent = document.getElementsByTagName('H1')[0];
+
var parent = document.getElementsByTagName('H1')[0];
-
parent.insertBefore(zero, parent.firstChild);
+
parent.insertBefore(zero, parent.firstChild);
-
var a = zero.getElementsByTagName('A')[0];
+
var a = zero.getElementsByTagName('A')[0];
-
if(localtitles[wgUserLanguage]) a.title = localtitles[wgUserLanguage];
+
if(localtitles[wgUserLanguage]) a.title = localtitles[wgUserLanguage];
-
// TODO check for content of header, to get a more precise replacement
+
// TODO check for content of header, to get a more precise replacement
-
else a.title = a.title.replace(/:.*$/,': 0');
+
else a.title = a.title.replace(/:.*$/,': 0');
-
a.setAttribute('href', a.href.replace(/&section=1/,'&section=0'));
+
a.setAttribute('href', a.href.replace(/&section=1/,'&section=0'));
})
})

Wersija z 15:07, 25. jun 2008

// **********************************************************************
// **                 ***WARNING! GLOBAL GADGET FILE***                **
// **********************************************************************
 
if ((wgAction == 'view' || wgAction == 'purge') && wgNamespaceNumber >=0)
addOnloadHook(function edittop_hook(){
var localtitles = {
   dsb: 'Pśida wobźěłański wótkaz ku prědnej sekciji',   //  :hsb:Wužiwar:Tlustulimu
   en: 'Edit lead section',
   eo: 'Redakti la komencan sekcion',                    //  :hsb:Wužiwar:Tlustulimu
   fr: 'Modifier le résumé introductif',
   it: 'Modifica della sezione iniziale',
   hsb: 'Přida wobdźěłanski wotkaz ke prěnjej sekciji',  //  :hsb:Wužiwar:Tlustulimu
   ja: '導入部を編集'
};
var h2s = document.getElementsByTagName('H2');
var h2 = h2s[0];
if (!h2) return;
if (h2.parentNode.id == 'toctitle') h2 = h2s[1];
if (!h2) return;
var span = h2.firstChild;
if (!span || span.className != 'editsection') return;
var zero = span.cloneNode(true);
if (document.getElementById('featured-star')) zero.style.marginRight = '25px';
if (document.getElementById('spoken-icon')) zero.style.marginRight = '45px';
if (document.getElementById('protected-icon') && zero.style.marginRight) zero.style.marginRight = '70px';
var parent = document.getElementsByTagName('H1')[0];
parent.insertBefore(zero, parent.firstChild);
var a = zero.getElementsByTagName('A')[0];
if(localtitles[wgUserLanguage]) a.title = localtitles[wgUserLanguage];
// TODO check for content of header, to get a more precise replacement
else a.title = a.title.replace(/:.*$/,': 0');
a.setAttribute('href', a.href.replace(/&section=1/,'&section=0'));
})
Wosobinske nastroje