Gebruiker:Zanaq/Zeusmode/watchlist.js
Uiterlijk
< Gebruiker:Zanaq | Zeusmode
Opmerking: nadat u de wijzigingen hebt gepubliceerd is het wellicht nodig uw browsercache te legen.
- Firefox / Safari: houd Shift ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5 of Ctrl-R (⌘-Shift-R op een Mac)
- Google Chrome: druk op Ctrl-Shift-R (⌘-Shift-R op een Mac)
- Internet Explorer / Edge: houd Ctrl ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5
- Opera: druk op Ctrl-F5.
//<nowiki><pre>
//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510
//Modified by Zanaq, 2006-2008
//Provides extra links in the watchlist, and extra tabs on articles
function addSinceTab() {
if (window.location.href.indexOf("&action=history&gotosince=true")!=-1)
{
do_since_I_last_edited()
} else
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
if (window.location.href.indexOf("&action=history&gotosince=true")!=-1) {
do_since_I_last_edited()
}
else if (!/wiki\/Special:|w\/index.php?title=Special:/.test(window.location.href)) {
if (zmUseSinceTab)
{
var l=addlilink(tabs, "/w/index.php?title="+encodeURIComponent(mw.config.get('wgPageName'))+"&action=history&gotosince=true", txtSince, '');
l.lastChild.title=txtChangesSinceILastEdited;
}
//}
//function addLastTaba()
//{
if (zmUseLastTab)
{
var l=addlilink(tabs, "/w/index.php?title="+encodeURIComponent(mw.config.get('wgPageName'))+"&diff=cur&oldid=prev", txtLast, '');
l.lastChild.title=txtShowMostRecentDiff;
}
}
//}
}
function processWatchlist(startfrom)
{
c=document.getElementById('bodyContent');
if (!c) {
t=setTimeout('processWatchlist(0);',2);
return(0);
}
l = c.getElementsByTagName('ul')[1].getElementsByTagName('li');
if (!l) {
t=setTimeout('processWatchlist(0);',2);
return(0);
}
stopat=startfrom+25;
if (stopat > l.length) stopat=l.length;
for (i = startfrom; i < stopat; i++)
{
var t = l[i].innerHTML
article = l[i].getElementsByTagName('a')[0].href.split('&')[0].replace(/[^\/]*\/\/[^\/]*/, '');
l[i].innerHTML = ' (<a href="' + article + '&limit=250&action=history&gotosince=true">' + txtSince + '</a>) ' + l[i].innerHTML;
// /w/index.php?title="+article+"&action=history&gotosince=true
}
if (stopat < l.length)
t=setTimeout('processWatchlist(' + stopat +');',2);
}
/*if (zmUseWatchlist)
{
if (mw.config.get('wgCanonicalSpecialPageName') == 'Watchlist') processWatchlist(1750);
}*/
function do_since_I_last_edited() {
var csub=document.getElementById("contentSub");
var msg=document.createElement("p");
msg.appendChild(document.createTextNode
("Parsing history... please wait..."));
msg.className="error";
csub.insertBefore(msg, csub.firstChild)
var hists=document.getElementById("pagehistory").getElementsByTagName('li');
if (hists[0].getElementsByTagName("span")[0].getElementsByTagName('a')[0].textContent==mw.config.get('wgUserName')) {
msg.replaceChild(document.createTextNode
(txtLastEdited),
msg.firstChild);
return;
}
// alert(hists.length);
for (n=1;n<hists.length;n++) {
//alert(hists[n].getElementsByTagName("span")[0].getElementsByTagName('a')[0].textContent);
if (hists[n].getElementsByTagName("span")[0].getElementsByTagName('a')[0].textContent==mw.config.get('wgUserName')) {
document.location=hists[n].childNodes[1].href;
return;
}
}
msg.replaceChild(document.createTextNode
(txtNotEdited),
msg.firstChild);
}
/*if (!mw.config.get('wgCanonicalSpecialPageName'))
addSinceTab();
*/
//</nowiki></pre>