User:Manishearth/imports.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. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Manishearth/imports. |
/* My Imports, kept here for purger.js to work
*/
//Developing:
importScript("User:Manishearth/GadgetUS.js")
//Tabs etc
importScript("User:Manishearth/tabs.js")
//Right-click menus
var RightClickMenuKey = 'ctrl';
//importScript('User:Subh83/JavaScriptTools/RightclickMenus.js');
//My mini-toolbox containing useful functions (usually used when I potter about the JS console)
importScript('User:Manishearth/toolbox.js')
//ImgAnnotator
importScript("MediaWiki:Gadget-ImageAnnotator.js");
//Adds links in script boxes
importScript('User:Manishearth/scriptlinks.js')
//Sidebar translate links, really useful for research...
importScript('User:Manishearth/sidebartranslinks.js');
//Just a bit of code to spruce up the search box with some pseudo-namespaces(typing Edit:Example will go to the edit page)
importScript('User:Manishearth/editns.js')
//OrphanTabs (my de-orphaning script), I don't use it but anyways i've kept it here. I'm obsoleting the script anyways with an application
//importScript('User:Manishearth/orphantabs.js')
//Ambassador stuff
importScript('User:Sross_(Public_Policy)/ambassadorwikilove.js');
//Mark as patrolled tab
importScript('User:Manishearth/patroltab.js')
//RefTools for beta in beta
//importScript('User:Mr.Z-man/refToolbar 2.0.js');
//Tinyfy cleanup templates:
importScript('User:Gary King/smaller templates.js');
/*
for(k in _("collapseButton")){ _("collapseButton")[k].childNodes[1].onclick=function(evt){collapseTable(_("collapseButton")[k].childNodes[1].id.replace("collapseButton",""));return killEvt( evt );}}
*/
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
var _ = getElementsByClass
/*
$(function(){
//Hack for collapse buttons which don't work for some reason.....
var collapseHack=new Array();
for(k in getElementsByClass("collapseButton")){
collapseHack[k] =_("collapseButton")[k].childNodes[1];
collapseHack[k].onclick=function(evt){
collapseTable(this.id.replace("collapseButton",""));
return killEvt( evt );
}
}
});
*/
function intercept(e){
if(e.keyCode == 9) { // U+0009 CHARACTER TABULATION
insertTags("\t", "", "");
return false;
}
else return true;
}
function literal_tab_in_textarea() {
t = document.getElementById("wpTextbox1");
if(t) t.onkeydown = intercept;
}
$(literal_tab_in_textarea);