User:Pythoncoder/common.js

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

//Script installer
importScript('User:Enterprisey/script-installer.js'); //Linkback: [[User:Enterprisey/script-installer.js]] Added by Script installer
sciNoConfirm=true;

// Manually installed
importStylesheet('User:Anomie/untoclimit.css'); // Linkback: [[User:Anomie/untoclimit.css]]
importScript('User:Anomie/talklink.js'); // Linkback: [[User:Anomie/talklink.js]]
importStylesheet('User:Anomie/talklink.css'); // Linkback: [[User:Anomie/talklink.css]]
importScript('User:N8wilson/AQFetcher.js'); // Linkback: [[User:N8wilson/AQFetcher.js]]
// teahouse
importScript("User:Writ Keeper/Scripts/teahouseUtility.js"); // Gives one-click option to add Teahouse invitation or talkback to a user 
importScript("User:Writ Keeper/Scripts/teahouseTalkback.js"); // Adds Talkback reminder when you save an edit at the Teahouse
importScript("User:Writ Keeper/Scripts/teahouseTalkbackLink.js"); // Adds a talkback link to signatures on the Teahouse
//mw.loader.load( '/w/index.php?title=User:RedWarn/.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:RedWarn/.js]];

// Change Upload File button from the File Upload Wizard to Special:Upload
document.querySelector("#n-upload > a").href = "/wiki/Special:Upload";

// Comments in Local Time settings
LocalComments = {
	dateDifference: true,
	dateFormat: 'mdy',
	timeFirst: true,
	twentyFourHours: false,
	dayOfWeek: true,
	dropDays: 0,
	dropMonths: 0
}; 

// Popups config
window.popupImages = false;
// For watchlist
var unwatchLinksOnLoad = true; //add (x) links on page load

/* 
QuickLinks by [[User:Music1201]], customized:
 - removed some links that aren't relevant to me...
 - or are redundant with other scripts I use
 - changed links to go under "Contribute" menu
 - added dashboard 
*/
/* This script will add items to the toolbar for quick access to commonly used things */
mw.loader.using( 'mediawiki.util' ).done( function() {
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/Wikipedia:Dashboard', "Dashboard");
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/Wikipedia:Village pump/Proposals', "Village pump");
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/Wikipedia:Articles for deletion/Today', "Articles for deletion");
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/Special:PendingChanges', "Pending changes");
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/Special:NewPagesFeed', "New pages feed");
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/Wikipedia:Articles for creation/Redirects', "Redirects for creation");
	mw.util.addPortletLink('p-interaction', mw.config.get( 'wgServer' ) + '/wiki/User:Music1201/Things to do', "Things to do");
} );

// Custom Summary Presets
var customGeneralSummaries = [
"==== ARTICLES ====",
"Added reference(s)",
"Improved reference(s)",
"Added wikilink(s)",
"Fixed wikilink(s)",
"Removed duplicate wikilink(s)",
"Disambiguated wikilink(s)",
"Added external link(s)",
"Fixed external links(s)",
"Removed external link(s)",
"Added maintenance tag(s)",
"Removed unsourced content",
"==== MINOR ====",
"Cleanup",
"Copyedit",
"Fixed typo",
"Fixed spelling",
"Fixed grammar",
"Fixed punctuation",
"Fixed capitalization",
"Fixed spacing",
"Fixed reference spacing",
"Fixed paragraph spacing",
"Fixed style/layout errors",
"==== REVERTS ====",
"Reverted vandalism",
"Reverted test edit",
"Reverted spam",
"Reverted unexplained deletion",
"Reverted unsourced edit",
"==== DISCUSSION ====",
"Reply",
"Comment",
"Suggestion",
"Update",
"Added vote",
"Copyedited my comment",
"Signed my comment",
];

// Code below this line automatically added by Script Installer
importScript('User:Pythoncoder/voteSymbols.js'); //Linkback: [[User:Pythoncoder/voteSymbols.js]] Added by Script installer
importScript('User:Anomie/linkclassifier.js'); //Linkback: [[User:Anomie/linkclassifier.js]] Added by Script installer
importScript('User:SoledadKabocha/copySectionLink.js'); //Linkback: [[User:SoledadKabocha/copySectionLink.js]] Added by Script installer
//importScript('User:Sam Sailor/Scripts/Sagittarius+.js'); //Linkback: [[User:Sam Sailor/Scripts/Sagittarius+.js]] Added by Script installer
importScript('User:Evad37/TextDiff.js'); //Linkback: [[User:Evad37/TextDiff.js]] Added by Script installer
importScript('User:Dschwen/MegapixelDisplay.js'); //Linkback: [[User:Dschwen/MegapixelDisplay.js]] Added by Script installer
importScript('User:Ais523/stubtagtab2.js'); //Linkback: [[User:Ais523/stubtagtab2.js]] Added by Script installer
importScript('User:Eizzen/LastEditor.js'); //Linkback: [[User:Eizzen/LastEditor.js]] Added by Script installer
importScript('User:Evad37/rater.js'); //Linkback: [[User:Evad37/rater.js]] Added by Script installer
importScript('User:Anomie/diffcur.js'); //Linkback: [[User:Anomie/diffcur.js]] Added by Script installer
//importScript('User:Anomie/unsignedhelper.js'); //Linkback: [[User:Anomie/unsignedhelper.js]] Added by Script installer
importScript('User:Evad37/duplinks-alt.js'); //Linkback: [[User:Evad37/duplinks-alt.js]] Added by Script installer
importScript('User:PleaseStand/userinfo.js'); //Linkback: [[User:PleaseStand/userinfo.js]] Added by Script installer
importScript('User:Amorymeltzer/oldafd.js'); //Linkback: [[User:Amorymeltzer/oldafd.js]] Added by Script installer
importScript('User:Pythoncoder/userHighlighter.js'); //Linkback: [[User:Pythoncoder/userHighlighter.js]] Added by Script installer
importScript('User:Galobtter/Shortdesc helper.js'); //Linkback: [[User:Galobtter/Shortdesc helper.js]] Added by Script installer
importScript('User:Σ/Testing facility/Archiver.js'); //Linkback: [[User:Σ/Testing facility/Archiver.js]] Added by Script installer
importScript('User:Danski454/UserLogToolbar.js'); //Linkback: [[User:Danski454/UserLogToolbar.js]] Added by Script installer
importScript('User:Enterprisey/cv-revdel.js'); //Linkback: [[User:Enterprisey/cv-revdel.js]] Added by Script installer
importScript('User:Enterprisey/quick-before.js'); //Linkback: [[User:Enterprisey/quick-before.js]] Added by Script installer
importScript('User:Fred Gandt/confirmLogout.js'); //Linkback: [[User:Fred Gandt/confirmLogout.js]] Added by Script installer
importScript('User:Enterprisey/user-tabs-on-contribs.js'); //Linkback: [[User:Enterprisey/user-tabs-on-contribs.js]] Added by Script installer
importScript('user:MPGuy2824/MoveToDraft.js'); // Replacing Evad37 [[user:MPGuy2824/MoveToDraft.js]] Added by Script installer
importScript('User:DannyS712/Draft no cat.js'); // Backlink: [[User:DannyS712/Draft no cat.js]]
importScript('User:DannyS712/De-Stub.js'); // Backlink: [[User:DannyS712/De-Stub.js]]
importScript('User:Suffusion of Yellow/filter-highlighter.js'); // Backlink: [[User:Suffusion of Yellow/filter-highlighter.js]]
importScript('User:DannyS712/DiscussionCloser.js'); // Backlink: [[User:DannyS712/DiscussionCloser.js]]
importScript('User:Enterprisey/orcp-helper.js'); // Backlink: [[User:Enterprisey/orcp-helper.js]]
importScript('User:Enterprisey/talk-tab-count.js'); // Backlink: [[User:Enterprisey/talk-tab-count.js]]
importScript('User:Gary/comments in local time.js'); // Backlink: [[User:Gary/comments in local time.js]]
importScript('User:Newslinger/Notifier.js'); // Backlink: [[User:Newslinger/Notifier.js]]
importScript('User:DannyS712/Subcategories.js'); // Backlink: [[User:DannyS712/Subcategories.js]]
importScript('User:SD0001/find-archived-section.js'); // Backlink: [[User:SD0001/find-archived-section.js]]
importScript('User:BrandonXLF/GlobalPrefs.js'); // Backlink: [[User:BrandonXLF/GlobalPrefs.js]]
importScript('User:Þjarkur/CleanDiffURLs.js'); // Backlink: [[User:Þjarkur/CleanDiffURLs.js]]
importScript('User:Enterprisey/fancy-diffs.js'); // Backlink: [[User:Enterprisey/fancy-diffs.js]]
//importScript('User:Esquivalience/mathjax.js'); // Backlink: [[User:Esquivalience/mathjax.js]]
importScript('User:Enterprisey/CustomSummaryPresets.js'); // Backlink: [[User:Enterprisey/CustomSummaryPresets.js]]
importScript('User:Awesome Aasim/rcpatrol.js'); // Backlink: [[User:Awesome Aasim/rcpatrol.js]]
importScript('User:TheTVExpert/submitRMTR.js'); // Backlink: [[User:TheTVExpert/submitRMTR.js]]
importScript('User:TheTVExpert/rmCloser.js'); // Backlink: [[User:TheTVExpert/rmCloser.js]]
importScript('User:Novem Linguae/Scripts/VisualEditorEverywhere.js'); // Backlink: [[User:Novem Linguae/Scripts/VisualEditorEverywhere.js]]
importScript('User:SuperHamster/CiteUnseen.js'); // Backlink: [[User:SuperHamster/CiteUnseen.js]]
importScript('User:Terasail/Edit Request Tool.js'); // Backlink: [[User:Terasail/Edit Request Tool]]
importScript('User:JJPMaster/wmcommons.js'); // Backlink: [[User:JJPMaster/wmcommons.js]]
importScript('User:Evad37/livenotifications.js'); // Backlink: [[User:Evad37/livenotifications.js]]
importScript('User:Awesome Aasim/DetectProtectionLevels.js'); // Backlink: [[User:Awesome Aasim/DetectProtectionLevels.js]]
importScript('User:The Transhumanist/SearchSuite.js'); // Backlink: [[User:The Transhumanist/SearchSuite.js]]
importScript('User:PrimeHunter/My subpages.js'); // Backlink: [[User:PrimeHunter/My subpages.js]]
importScript('User:RealFakeKim/Scripts/pageInfo.js'); // Backlink: [[User:RealFakeKim/Scripts/pageInfo.js]]
//importScript('User:BrandonXLF/PortletLinks.js'); // Backlink: [[User:BrandonXLF/PortletLinks.js]]
importScript('User:Ahecht/Scripts/TemplateSearch.js'); // Backlink: [[User:Ahecht/Scripts/TemplateSearch.js]]
importScript('User:Writ Keeper/Scripts/unmobilePlus.js'); // Backlink: [[User:Writ Keeper/Scripts/unmobilePlus.js]]
importScript('mw:MediaWiki:WikiEdit.js'); // Backlink: [[mw:MediaWiki:WikiEdit.js]]
importScript('User:Eejit43/scripts/redirect-helper.js'); // Backlink: [[User:Eejit43/scripts/redirect-helper.js]]
importScript('User:Eejit43/scripts/afcrc-helper.js'); // Backlink: [[User:Eejit43/scripts/afcrc-helper.js]]
importScript('User:SD0001/deleted-metadata-link.js'); // Backlink: [[User:SD0001/deleted-metadata-link.js]]