User:Az1568/monobook.js: Difference between revisions

From Wikimedia Foundation Governance Wiki
Content deleted Content added
Cbrown1023 (talk | contribs)
+ForceLinkstoDelete
Cbrown1023 (talk | contribs)
Hmm.
Line 1: Line 1:
function ForceLinksToEdit() {
// <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');
var links = document.getElementById('bodyContent').getElementsByTagName('a');
for(var i=0; i<links.length; i++) {
for(var i=0; i<links.length; i++) {
if(!links[i].href.match('/w/index.php')) {
if(!links[i].href.match('/w/index.php')) {
links[i].href = links[i].href.replace(/(#|$)/, "?action=delete&wpReason=Test+page;+Nolonger+needed$1");
links[i].href = links[i].href.replace(/(#|$)/, "?action=delete&wpReason=Test+page+tha+is+no+longer+needed");
}
}
}
}
}
}
addOnloadHook(function() {ForceLinksToDelete()});
addOnloadHook(function() {ForceLinksToEdit()});

Revision as of 21:03, 31 December 2009

function ForceLinksToEdit() {
    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+tha+is+no+longer+needed");
        }
    }
 }
addOnloadHook(function() {ForceLinksToEdit()});