User:Veinor/Sandbox.js

//Written by User:GeorgeMoney, thanks to User:Where and User:Eagle_101 for help with this! //Modified by User:Betacommand // BEGIN Flickr LINK REMOVAL CODE //check if we are editing and we want to Flickr if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('Flickr=1') != -1) { function Flickr { document.getElementById('wpSummary').value = "Removing Flickr link against policy to link to Search Engines"; var contents = document.getElementById('wpTextbox1').value; var newcontents = contents.replace(/(\*\s*?)?\[http\:\/\/\w*\?Flickr\.com.*?\?/]/g, ""); document.getElementById('wpTextbox1').value = newcontents; document.getElementById('wpDiff').click; document.getElementById('wpWatchthis').checked = ""; }   addOnloadHook(function{ Flickr; }); } //Check if it's article to add the tab if(wgCanonicalNamespace == "") { addOnloadHook(function{   var taburl = "http://en.wikipedia.org/w/index.php?title="+wgPageName+"&action=edit&Flickr=1";   addTab(taburl, "Remove Flickr!", "ca-Flickr", "This is to kill Flickr Links");   }); } //END Flickr LINK REMOVAL CODE