User:Omegatron/monobook.js/addsincetab.js: Difference between revisions

Content deleted Content added
m Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879)
 
(4 intermediate revisions by one other user not shown)
Line 1:
// <pre><nowiki>
 
//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510
function addSinceTab() {
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
if (window.___location.href.indexOf("&action=history&gotosince=true")!=-1) {
do_since_I_last_edited()
Line 9 ⟶ 5:
else if (!/wiki\/Special:|w\/index.php?title=Special:/.test(window.___location.href)) {
var thetitle=document.title.slice(0, String(document.title).indexOf(" - "));
var l=addlilinkaddPortletLink(tabs'p-cactions', "/w/index.php?title="+thetitle+"&action=history&gotosince=true", 'since', 'ca-since', 'View diff from last edit by me', '', 'ca-history');
l.lastChild.title="Changes since I last edited";
}
Line 35 ⟶ 31:
}
 
addOnloadHook$(addSinceTab);
 
// </nowiki></pre>