משתמש:בונגולים/monobook.js: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
בונגולים (שיחה | תרומות)
אין תקציר עריכה
בונגולים (שיחה | תרומות)
הסרת כל התוכן מדף זה
 
שורה 1:
/*
<div align="left">Credit: [[commons:User:Alphax/monobook.js]]</div>
קרדיט: [[commons:User:Alphax/monobook.js]]
 
<pre dir="ltr"><nowiki> */
 
/**
* Initialises function loading on page load
*/
 
if (window.addEventListener) window.addEventListener("load",myLoadFuncs,false);
else if (window.attachEvent) window.attachEvent("onload",myLoadFuncs);
else
{
window.oldonload = window.onload;
window.onload = function()
{
window.oldonload();
myLoadFuncs();
}
}
 
/**
* Loads functions
*/
 
function myLoadFuncs()
{
addPurge();
}
 
/**
* Forces edit summary
*/
 
/**
* Adds a "purge" tab
*/
 
function addPurge()
{
ta['ca-purge'] = ['g', 'Purge the internal cache for this page'];
if(!document.getElementById) return;
var x = document.getElementById('ca-history');
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
if(!x) { return; }
if(x.children) { x = x.children[0]; }
else { x = x.childNodes[0]; }
addlilink(tabs, x.href.replace(/=history/, "=purge"), 'purge', 'ca-purge');
}
 
/**
* Adds tabs
*/
 
function addlilink(tabs, url, name, id)
{
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
li.id = id;
li.appendChild(na);
tabs.appendChild(li);
return li;
}
 
/* </nowiki></pre> */