MediaWiki:Gadget-ForceEditLinks.js: Difference between revisions
Content deleted Content added
Cbrown1023 (talk | contribs) hmm |
Cbrown1023 (talk | contribs) Done. |
||
Line 3: | Line 3: | ||
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=edit |
links[i].href = links[i].href.replace(/(#|$)/, "?action=edit$1"); |
||
} |
} |
||
} |
} |
Revision as of 22:44, 8 October 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=edit$1");
}
}
}
addOnloadHook(function() {ForceLinksToEdit()});