User:Sonia/common.js

From Simple English Wikipedia, the free encyclopedia

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
importScript('User:EhJJ/twinkle.js'); //twinkle; works sporadically for me.
importScript('User:Sonia/imagepopups.js'); //images pop up in hovering window when clicked
importScript('User:Sonia/titletruncate.js'); //shortens titles to make it easier to see in tabs
importScript ('User:Bsadowski1/mass rollback.js');
 
//epic quick preview, better than the built-in option in special:preferences because it leaves your usual preview intact as well
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Js/ajaxPreview.js&action=raw&ctype=text/javascript');
ajaxPreviewPos = 'bottom';

importScript('User:Bsadowski1/refToolbar.js'); 

//type Edit:Page into the search bar to instantly edit that page
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Manishearth/editns.js&action=raw&ctype=text/javascript');

//link to my dashboard [[User:Sonia/dashboard]] next to logout link
function addDash() {
loLogoutNode = document.getElementById("pt-logout");
loDashNode = mw.util.addPortletLink( "p-personal"
        , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?title=User:" + wgUserName + "/dashboard"
        , "my dashboard"
        , "pt-admindash"
        , "Link to dashboard"
        , "d"
        , loLogoutNode );
}
$(addDash);

//Written and maintained by [[User:Mike.lifeguard]]: clean delete reasons, hopefully
function deletemods(){
	if (wgAction == "delete") {
		var wpReason = document.getElementById("wpReason");
		if (!wpReason) return;
		var regexp = /(content was|page was empty|content before blanking was)/i;
		if (regexp.test(wpReason.value)){
			wpReason.value = "";
		}
	}
}
$(deletemods);