User:Manishearth/editns.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. User:Manishearth/editns. |
/*
This script allows you to use the "Edit:" namespace
Type Edit:''pagename'' in the search box and you will be redirected to the edit page of the page entered. For example, typing "Edit:Example" will take you [http://en.wikipedia.org/w/index.php?title=Example&action=edit here] instead of [http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=Edit%3AExample&go=Go here]
*/
if(document.location.toString().indexOf("index.php?title=Special:Search&search=")!=-1){
var search=document.location.toString().split("index.php?title=Special:Search&search=")[1].split("&go=Go")[0]
if(search.toLowerCase().indexOf("edit:")!= -1){
document.location=mw.config.get('wgServer') + "/w/index.php?title="+ search.toLowerCase().split("edit:")[1]+ "&action=edit"
}
}
if(document.location.toString().indexOf("index.php?title=Special%3ASearch&search=")!=-1){
var search=document.location.toString().split("index.php?title=Special%3ASearch&search=")[1].split("&go=Go")[0]
if(search.toLowerCase().indexOf("edit%3a")!= -1){
document.location=mw.config.get('wgServer') + "/w/index.php?title="+ search.toLowerCase().split("edit%3a")[1]+ "&action=edit"
}
}