User:Tar Lócesilion/common.js
Note: After publishing, 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 (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
//
// Zakładki
//
if (wgNamespaceNumber!=-1)
{
var els = null;
switch (skin)
{
case 'vector':
case 'monobook':
els = document.getElementById('ca-talk').parentNode.getElementsByTagName('li');
break;
//els = document.getElementById('pt-mytalk').getElementsByTagName('li');
}
if (els!=null && els.length)
{
var tmp = encodeURIComponent(wgTitle);
var nn = (wgNamespaceNumber%2==1) ? wgNamespaceNumber-1 : wgNamespaceNumber;
var staticEls = [];
staticEls[0] = els[0];
staticEls[1] = els[1];
for (var i=0; i<staticEls.length; i++)
{
// tworzenie
nel = staticEls[i].cloneNode(false);
if (wgVersion.indexOf('1.16')==0)
nel.innerHTML = '<a href="/w/index.php?title=Special:Prefixindex&namespace='+(nn+i)+'&prefix='+tmp+'"><span>/</span></a>';
else
nel.innerHTML = '<span><a href="/w/index.php?title=Special:Prefixindex&namespace='+(nn+i)+'&prefix='+tmp+'">/</a></span>';
// przyklejanie
staticEls[i].style.marginRight = '0px'
staticEls[i].style.paddingRight = '0px'
staticEls[i].style.borderRight = '0px none'
// wstawianie
if (staticEls[i] == staticEls[i].parentNode.lastChild)
{
staticEls[i].parentNode.appendChild(nel);
}
else
{
staticEls[i].parentNode.insertBefore(nel, staticEls[i].nextSibling);
}
}
}
}