Jump to content

User:Bsoyka/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.
// Enable caching for resource loads, see [[User:SD0001/Making_user_scripts_load_faster]], @revision 7
if(!/\bnocache=\b/.test(location.href)){let e=mw.config.values,t="text/javascript",r="text/css",n=(n,o,i)=>(n=n.replace(/special:mypage/i,"User:"+e.wgUserName),$.get("https://"+o+"/w/api.php?titles="+n+"&origin=*&format=json&formatversion=2&uselang=content&maxage=86400&smaxage=86400&action=query&prop=revisions|info&rvprop=content&rvlimit=1&inprop=protection").then(e=>{let a=e.query.pages[0];if(!a.missing){if(2!==a.ns&&8!==a.ns&&!a.protection.find(e=>"edit"===e.type&&"sysop"===e.level))return $.Deferred().reject('Refused to load "'+n+'"@'+o+": unprotected page");let l=a.revisions[0].content;if(i&&i!==t||"javascript"!==a.contentmodel){if(i!==r||"css"!==a.contentmodel)return $.Deferred().reject('Refused to load "'+n+'"@'+o+": content type mismatch");mw.loader.addStyleTag(l)}else document.head.appendChild(document.createElement("script")).innerHTML=l}})),o=e.wgServerName,i=e=>{let t=/^(?:(?:https:)?\/\/(.*))?\/w\/index.php/.exec(e),r=/\btitle=([^=?&]*)/.exec(e);return t&&r&&/\baction=raw\b/.test(e)&&/\bctype=/.test(e)?[r[1],t[1]||o]:null};window.importScript=e=>{n(encodeURIComponent(e),o,t)},window.importStyleSheet=e=>{n(encodeURIComponent(e),o,r)};let a=mw.loader.load;mw.loader.load=function(e,t){let r=i(e);r?n(r[0],r[1],t):a.apply(mw.loader,[...arguments])};let l=mw.loader.getScript;mw.loader.getScript=function(e){let r=i(e);return r?n(r[0],r[1],t):l.apply(mw.loader,[...arguments])}}

mw.util.addPortletLink("left-navigation", "//en.wikipedia.org/wiki/User:Bsoyka/Dashboard", "Dashboard", "p-dashboard", "Open dashboard");

window.GAN_helper_log_page = 'User:Bsoyka/GAN log';
window.GAN_helper_log_entry = '# [[$PAGE]] ~~' + '~~' + '~ {{Waiting}}';

$.when(mw.loader.using(['mediawiki.util']), $.ready).then(function() {
	const uname = mw.util.wikiUrlencode(mw.config.get('wgUserName'));
	const url = '/wiki/User:' + uname + '/Sandbox';
	$('#pt-sandbox a').attr('href', url).removeClass('new');
});

$(function() {
	$('a.new').each(function(i, el) {
		const match = $(el).attr('href').match(/(\/w\/index.php\?title=.+)&action=edit&redlink=1/);
		if (match !== null) {
			$(el).attr('href', match[1]);
		}
	});
});

window.markAdminCfg = {
	groups: {
		'abusefilter': { enabled: true },
		'abusefilter-helper': { enabled: true },
		'accountcreator': { enabled: true },
		'autoreviewer': { enabled: true },
		'extendedmover': { enabled: true },
		'filemover': { enabled: true },
		'massmessage-sender': { enabled: true },
		'templateeditor': { enabled: true },
		'vrt-permissions': { enabled: true },
		'patroller': { enabled: true },
		'reviewer': { enabled: true },
		'rollbacker': { enabled: true },
	}
};

// BOTS ==========
importScript('User:Enterprisey/easy-brfa.js'); // Backlink: [[User:Enterprisey/easy-brfa.js]]

// CATEGORIZATION AND TAGGING ==========
importScript('User:SD0001/StubSorter.js'); // Backlink: [[User:SD0001/StubSorter.js]]
importScript('User:DannyS712/deOrphan.js'); // Backlink: [[User:DannyS712/deOrphan.js]]
importScript('User:DannyS712/De-Stub.js'); // Backlink: [[User:DannyS712/De-Stub.js]]
importScript('User:Evad37/rater.js'); // Backlink: [[User:Evad37/rater.js]]

// COMMUNICATION AND DISCUSSIONS ==========
importScript('User:BrandonXLF/ShowUserGender.js'); // Backlink: [[User:BrandonXLF/ShowUserGender.js]]
importScript('User:GeneralNotability/ip-ext-info.js'); // Backlink: [[User:GeneralNotability/ip-ext-info.js]]
importScript('User:Amorymeltzer/userinfo.js'); // Backlink: [[User:Amorymeltzer/userinfo.js]]
importScript('User:Mdaniels5757/markAdmins.js'); // Backlink: [[User:Mdaniels5757/markAdmins.js]]
importScript('User:Novem Linguae/Scripts/UserRightsDiff.js'); // Backlink: [[User:Novem Linguae/Scripts/UserRightsDiff.js]]
importScript('User:Enterprisey/delsort.js'); // Backlink: [[User:Enterprisey/delsort.js]]
importScript('User:Awesome_Aasim/xfdvote.js'); // Backlink: [[User:Awesome_Aasim/xfdvote.js]]
importScript('User:Pythoncoder/Scripts/voteSymbols.js'); // Backlink: [[User:Pythoncoder/Scripts/voteSymbols.js]]
importScript('User:Enterprisey/archiver.js'); // Backlink: [[User:Enterprisey/archiver.js]]
importScript('User:Novem Linguae/Scripts/VoteCounter.js'); // Backlink: [[User:Novem Linguae/Scripts/VoteCounter.js]]

// EDITING ==========
importScript('User:Qwertyytrewqqwerty/DisamAssist.js'); // Backlink: [[User:Qwertyytrewqqwerty/DisamAssist.js]]
importScript('User:Opencooper/domainRedirect.js'); // Backlink: [[User:Opencooper/domainRedirect.js]]
importScript('User:Eejit43/scripts/redirect-helper.js'); // Backlink: [[User:Eejit43/scripts/redirect-helper.js]]

// IMAGES ==========
importScript('User:Alex 21/script-functions.js'); // Backlink: [[User:Alex 21/script-functions.js]]
importScript('User:Alex 21/script-imageres.js'); // Backlink: [[User:Alex 21/script-imageres.js]]
importScript('User:Novem Linguae/Scripts/MarkFreeUseRationale.js'); // Backlink: [[User:Novem Linguae/Scripts/MarkFreeUseRationale.js]]

// MENUS AND NAVIGATION ==========
importScript('User:Mvolz/displayContributions.js'); // Backlink: [[User:Mvolz/displayContributions.js]]
importScript('User:DannyS712/short-tabs.js'); // Backlink: [[User:DannyS712/short-tabs.js]]
importScript('User:Enterprisey/user-tabs-on-contribs.js'); // Backlink: [[User:Enterprisey/user-tabs-on-contribs.js]]
importScript('User:GhostInTheMachine/SortWhatLinksHere.js'); // Backlink: [[User:GhostInTheMachine/SortWhatLinksHere.js]]

// MODERATION ==========
importScript('User:RedWarn/.js'); // Backlink: [[User:RedWarn/.js]]
importScript('User:Enterprisey/cv-revdel.js'); // Backlink: [[User:Enterprisey/cv-revdel.js]]
importScript('User:MPGuy2824/MoveToDraft.js'); // Backlink: [[User:MPGuy2824/MoveToDraft.js]]
importScript('User:SD0001/deleted-metadata-link.js'); // Backlink: [[User:SD0001/deleted-metadata-link.js]]
importScript('User:Writ Keeper/Scripts/massRollback.js'); // Backlink: [[User:Writ Keeper/Scripts/massRollback.js]]
importScript('User:Novem Linguae/Scripts/UserTalkErasedSectionsDetector.js'); // Backlink: [[User:Novem Linguae/Scripts/UserTalkErasedSectionsDetector.js]]

// NOMINATIONS ==========
importScript('User:SD0001/DYK-helper.js'); // Backlink: [[User:SD0001/DYK-helper.js]]
importScript('User:SD0001/GAN-helper.js'); // Backlink: [[User:SD0001/GAN-helper.js]]

// READING ==========
importScript('User:Enterprisey/section-redir-note.js'); // Backlink: [[User:Enterprisey/section-redir-note.js]]
importScript('User:IagoQnsi/ipareader.js'); // Backlink: [[User:IagoQnsi/ipareader.js]]
importScript('User:Anomie/linkclassifier.js'); // Backlink: [[User:Anomie/linkclassifier.js]]
importScript('User:Writ_Keeper/Scripts/deletionFinder.js'); // Backlink: [[User:Writ_Keeper/Scripts/deletionFinder.js]]
importScript('User:Anomie/hide-images.js'); // Backlink: [[User:Anomie/hide-images.js]]
importScript('User:Novem Linguae/Scripts/ShowAdminMessages.js'); // Backlink: [[User:Novem Linguae/Scripts/ShowAdminMessages.js]]

// REFERENCES ==========
importScript('User:Novem_Linguae/Scripts/CiteHighlighter.js'); // Backlink: [[User:Novem_Linguae/Scripts/CiteHighlighter.js]]
importScript('User:SuperHamster/CiteUnseen.js'); // Backlink: [[User:SuperHamster/CiteUnseen.js]]
importScript('User:Trappist the monk/HarvErrors.js'); // Backlink: [[User:Trappist the monk/HarvErrors.js]]
importScript('User:Nardog/RefRenamer.js'); // Backlink: [[User:Nardog/RefRenamer.js]]
importScript('User:BrandonXLF/CitationStyleMarker.js'); // Backlink: [[User:BrandonXLF/CitationStyleMarker.js]]
importScript('User:BrandonXLF/FindSources.js'); // Backlink: [[User:BrandonXLF/FindSources.js]]

// REVIEWING ==========
importScript('User:Shubinator/DYKcheck.js'); // Backlink: [[User:Shubinator/DYKcheck.js]]
importScript('User:The_Earwig/copyvios.js'); // Backlink: [[User:The_Earwig/copyvios.js]]
importScript('User:Theleekycauldron/DYK_promoter.js'); // Backlink: [[User:Theleekycauldron/DYK_promoter.js]]
importScript('User:Novem_Linguae/Scripts/GANReviewTool.js'); // Backlink: [[User:Novem_Linguae/Scripts/GANReviewTool.js]]
importScript('User:Novem Linguae/Scripts/DetectSNG.js'); // Backlink: [[User:Novem Linguae/Scripts/DetectSNG.js]]
importScript('User:Novem Linguae/Scripts/DetectPromo.js'); // Backlink: [[User:Novem Linguae/Scripts/DetectPromo.js]]
importScript('User:Novem Linguae/Scripts/DetectG4G5.js'); // Backlink: [[User:Novem Linguae/Scripts/DetectG4G5.js]]
importScript('User:Novem Linguae/Scripts/WatchlistAFD.js'); // Backlink: [[User:Novem Linguae/Scripts/WatchlistAFD.js]]

// WATCHLIST AND DIFFS ==========
importScript('User:Kephir/gadgets/hollis.js'); // Backlink: [[User:Kephir/gadgets/hollis.js]]
importScript('User:Anomie/unwatch.js'); // Backlink: [[User:Anomie/unwatch.js]]
importScript('User:Anomie/diffcur.js'); // Backlink: [[User:Anomie/diffcur.js]]
importScript('User:Enterprisey/fancy-diffs.js'); // Backlink: [[User:Enterprisey/fancy-diffs.js]]
importScript('User:Awesome_Aasim/quicknote.js'); // Backlink: [[User:Awesome_Aasim/quicknote.js]]
importScript('User:Enterprisey/diff-permalink.js'); // Backlink: [[User:Enterprisey/diff-permalink.js]]
importScript('User:SD0001/W-Ping.js'); // Backlink: [[User:SD0001/W-Ping.js]]

// Anything below this was likely added semi-automatically by me using the
// installer gadget rather than editing this file manually.
importScript('User:TheTechie/Help Me Tool.js'); // Backlink: [[User:TheTechie/Help Me Tool.js]]
importScript('User:Aaron_Liu/MoveTop.js'); // Backlink: [[User:Aaron_Liu/MoveTop.js]]
importScript('User:Andrybak/Scripts/Not_around.js'); // Backlink: [[User:Andrybak/Scripts/Not_around.js]]
importScript('User:DannyS712/SATG.js'); // Backlink: [[User:DannyS712/SATG.js]]
importScript('User:EpochFail/ArticleQuality.js'); // Backlink: [[User:EpochFail/ArticleQuality.js]]
importScript('User:Þjarkur/NeverUseMobileVersion.js'); // Backlink: [[User:Þjarkur/NeverUseMobileVersion.js]]
importScript('User:SD0001/draft-sort-burst.js'); // Backlink: [[User:SD0001/draft-sort-burst.js]]
importScript('User:SD0001/hide-reverted-edits.js'); // Backlink: [[User:SD0001/hide-reverted-edits.js]]
importScript('User:SD0001/watchlist-update-title.js'); // Backlink: [[User:SD0001/watchlist-update-title.js]]
importScript('User:SD0001/np-shortcuts.js'); // Backlink: [[User:SD0001/np-shortcuts.js]]
importScript('User:BrandonXLF/ParameterSpacing.js'); // Backlink: [[User:BrandonXLF/ParameterSpacing.js]]
importScript('User:BrandonXLF/UpdateNotifications.js'); // Backlink: [[User:BrandonXLF/UpdateNotifications.js]]
importScript('User:DannyS712/12Hours.js'); // Backlink: [[User:DannyS712/12Hours.js]]
importScript('User:DannyS712/hide.js'); // Backlink: [[User:DannyS712/hide.js]]
importScript('User:Nardog/Consecudiff.js'); // Backlink: [[User:Nardog/Consecudiff.js]]
importScript('User:Nardog/IPAInput.js'); // Backlink: [[User:Nardog/IPAInput.js]]
importScript('User:Nardog/SortCentralAuthByEditCount.js'); // Backlink: [[User:Nardog/SortCentralAuthByEditCount.js]]
importScript('User:Þjarkur/Highlight homographs in title.js'); // Backlink: [[User:Þjarkur/Highlight homographs in title.js]]
importScript('User:Terasail/Edit_Request_Tool.js'); // Backlink: [[User:Terasail/Edit_Request_Tool.js]]
importScript('User:Terasail/COI_Request_Tool.js'); // Backlink: [[User:Terasail/COI_Request_Tool.js]]
importScript('User:DaxServer/DiscussionCloser.js'); // Backlink: [[User:DaxServer/DiscussionCloser.js]]
importScript('User:Diegodlh/Web2Cit/script.js'); // Backlink: [[User:Diegodlh/Web2Cit/script.js]]