User:Az1568/monobook.js: Difference between revisions

From Wikimedia Foundation Governance Wiki
Content deleted Content added
Az1568 (talk | contribs)
No edit summary
Cbrown1023 (talk | contribs)
+ForceLinkstoDelete
Line 2: Line 2:
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Az1568/global.js&action=raw&ctype=text/javascript')
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Az1568/global.js&action=raw&ctype=text/javascript')
// </source>
// </source>

function ForceLinksToDelete() {
var links = document.getElementById('bodyContent').getElementsByTagName('a');
for(var i=0; i<links.length; i++) {
if(!links[i].href.match('/w/index.php')) {
links[i].href = links[i].href.replace(/(#|$)/, "?action=delete&wpReason=Test+page;+Nolonger+needed$1");
}
}
}
addOnloadHook(function() {ForceLinksToDelete()});

Revision as of 21:01, 31 December 2009

// <source lang="javascript">
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Az1568/global.js&action=raw&ctype=text/javascript')
// </source>

function ForceLinksToDelete() {
    var links = document.getElementById('bodyContent').getElementsByTagName('a');
    for(var i=0; i<links.length; i++) {
        if(!links[i].href.match('/w/index.php')) {
            links[i].href = links[i].href.replace(/(#|$)/, "?action=delete&wpReason=Test+page;+Nolonger+needed$1");
        }
    }
 }
addOnloadHook(function() {ForceLinksToDelete()});