Jump to content

User:Waldyrious/sinceContribs.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by 1997kB (talk | contribs) at 10:36, 1 July 2019 (1997kB moved page User:Waldir/sinceContribs.js to User:Waldyrious/sinceContribs.js: Automatically moved page while renaming the user "Waldir" to "Waldyrious"). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function addSinceLinks() {
  var ul = document.getElementById("contentSub").nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling;
  for(i=0; i<ul.children.length; i++) {
    h = ul.children[i].children[3].text ? ul.children[i].children[3] : ul.children[i].children[2];
    pipe = document.createTextNode("\u00a0| ");
    cur = ul.children[i].children[1].cloneNode(true);
    cur.href = cur.href.concat("&diff=cur");
    cur.text = "cur";
    ul.children[i].insertBefore(cur,h);
    ul.children[i].insertBefore(pipe,h);
  }
}

if (mw.config.get('wgCanonicalSpecialPageName') == 'Contributions' && mw.config.get('wgAction') == 'view')
  mw.util.addPortletLink('p-cactions', 'javascript: addSinceLinks()', '+cur', 'ca-addcur',
                 "Add links to see the changes since your laste edit", '');