Jump to content

User:Aidan9382/common.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//Some script importing has been moved to [[meta:User:Aidan9382/global.js]]. All scripts will continue to be managed on enwiki (See [[User:Aidan9382/scripts]])
//enwiki-specific scripts will still be imported from here

// Script imports
importScript('User:Andy M. Wang/pageswap.js');				// [[User:Andy M. Wang/pageswap.js]]
importScript('User:Anomie/useridentifier.js');				// [[User:Anomie/useridentifier.js]]
importScript('User:Suffusion of Yellow/abusecontribs.js');	// [[User:Suffusion of Yellow/abusecontribs.js]]
importScript('User:Frietjes/masspurge.js');					// [[User:Frietjes/masspurge.js]]
importScript('User:PerfektesChaos/js/lintHint/r.js');		// [[User:PerfektesChaos/js/lintHint/r.js]] / [[User:PerfektesChaos/js/lintHint/d.js]]
// My scripts
importScript('User:Aidan9382/scripts/defaultSummaries.js');	// [[User:Aidan9382/scripts/defaultSummaries.js]] - Default summaries, only ever used on enwiki
importScript('User:Aidan9382/scripts/IPBlockNotice.js');	// [[User:Aidan9382/scripts/IPBlockNotice.js]] - Small notice to inform you if your current IP is Anon/Hardblocked
//importScript('User:Aidan9382/scripts/noedit.js');			// [[User:Aidan9382/scripts/noedit.js]] - Stop editing

// [[User:Novem Linguae/Scripts/UserHighlighterSimple.js]]
function import_UHS(){importScript('User:Novem Linguae/Scripts/UserHighlighterSimple.js')}
mw.util.addPortletLink('p-tb', 'javascript:import_UHS()', 'Enable UHS');

mw.hook( "lintHint.config" ).fire( {rooms: "*", oldid: true} ); // Configure lintHint


//mw.notification.notify("Body Text",{autoHideSeconds:"short",title:"Title Text",type:"success"});
//for custom lengths, change mw.notification.autoHideSeconds
var replace = document.getElementById("pt-betafeatures"); // Replace beta features tab with my bookmark page for convenience
if (replace) {
	replace.innerHTML = '<a href="/wiki/User:Aidan9382/Bookmarks" title="Your bookmarks"><span>Bookmarks</span></a>';
}

// a really hacky way to add a button for subpages below the page information button
var tinfo = document.getElementById("t-info");
if (tinfo) {
	pagename = RegExp("\\?title=(.+?)&action=").exec(tinfo.children[0].href);
	tinfo.outerHTML += '<li id="t-subpages" class="mw-list-item"><a href="/wiki/Special:PrefixIndex/' + pagename[1] + '/" title="Subpages of this page"><span>Subpage list</span></a></li>';
}

var watchbutton = document.getElementById("wpWatchthis"); //Auto-watch all unwatched pages for a week when editing
if (watchbutton && !watchbutton.checked) {
	var expirylist = document.getElementById("wpWatchlistExpiry");
	if (expirylist) {
		watchbutton.checked = true;
		expirylist.value = "1 week";
	}
}

if (mw.util.getParamValue( 'withJS' ) === 'MediaWiki:Synchronizer.js') { //Synchronizer workaround - see [[Module talk:Excerpt#Synchronizer]]
	mw.loader.load('https://www.mediawiki.org/wiki/MediaWiki:Synchronizer.js?action=raw&ctype=text/javascript');
}

mw.loader.load('//en.wikipedia.org/wiki/User:Sophivorus/ExcerptHunter.js?action=raw&ctype=text/javascript');
mw.loader.load('http://127.0.0.1:5500'); //Local JS testing (aka Twinkle)