User:Aaron Liu/global.js

From Meta, a Wikimedia project coordination wiki

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.
// Enable caching for resource loads, see [[w: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])}}

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Aveaoz/AutoMobileRedirect.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Aveaoz/AutoMobileRedirect.js]]
mw.loader.load('https://en.wikipedia.org/wiki/User:Aaron_Liu/Watchlyst_Greybar_Unsin.js?action=raw&ctype=text/javascript'); // Backlink: [[w:User:Aaron Liu/Watchlyst Greybar Unsin.js]]
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Guycn2/UserInfoPopup.js&action=raw&ctype=text/javascript' ); // Backlink: [[w:User:Guycn2/UserInfoPopup.js]]
mw.loader.load( "//en.wikipedia.org/w/index.php?title=User:Ahecht/Scripts/TemplateSearch.js&action=raw&ctype=text/javascript" ); // Linkback: [[:en:User:Ahecht/Scripts/TemplateSearch.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Enterprisey/diff-permalink.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Enterprisey/diff-permalink.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Andrybak/user-tabs-on-contribs.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Andrybak/user-tabs-on-contribs.js]]
mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.markblocked');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Frostly/mark-rocked.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Frostly/mark-rocked.js]]
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:NguoiDungKhongDinhDanh/AjaxLoader.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:NguoiDungKhongDinhDanh/AjaxLoader.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/Consecudiff.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Nardog/Consecudiff.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:NguoiDungKhongDinhDanh/AceForLuaDebugConsole.js&action=raw&ctype=text/javascript'); // [[User:NguoiDungKhongDinhDanh/AceForLuaDebugConsole.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:SD0001/shortdescs-in-category.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:SD0001/shortdescs-in-category.js]]
mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.edittop'); // [[w:Wikipedia:Tools/Navigation popups]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/VitalTopicon.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Nardog/VitalTopicon.js]]
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:The_Voidwalker/alwaysEditSectionLink.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:The Voidwalker/alwaysEditSectionLink.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/CopySectLink.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Nardog/CopySectLink.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/CopyCodeBlock.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Nardog/CopyCodeBlock.js]]
mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.NewImageThumb');
mw.loader.load('https://en.wiktionary.org/w/load.php?modules=ext.gadget.CodeLinks');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Enterprisey/parent-cats.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Enterprisey/parent-cats.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Evad37/duplinks-alt.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Evad37/duplinks-alt.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Phlsph7/HighlightUnreferencedPassages.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Phlsph7/HighlightUnreferencedPassages.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Bellezzasolo/Scripts/subpages.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Bellezzasolo/Scripts/subpages.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Aaron Liu/What redirects here.js&action=raw&ctype=text/javascript'); // [[User:Aaron Liu/What redirects here.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/RefRenamer.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Nardog/RefRenamer.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/AutoTestcases.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Nardog/AutoTestcases.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Guarapiranga/accessKeysCheatSheet.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Guarapiranga/accessKeysCheatSheet.js]]
if(mw.config.get('wgWikiID')!=='commonswiki'){
	mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.imagelinks');
	mw.loader.load('//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-ImageAnnotator.js&action=raw&ctype=text/javascript'); // Backlink: [[w:MediaWiki:Gadget-ImageAnnotator.js]]
}
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Tol/RealSVG.js&action=raw&ctype=text/javascript' ); // Moved to Meta: [[:m:User:Tol/RealSVG.js]]
mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.Navigation_popups'); // [[w:Wikipedia:Tools/Navigation popups]]
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript'); // Backlink: [[w:User:Jack_who_built_the_house/convenientDiscussions.js]]
if(mw.config.get('wgContentLanguage')!=='zh'){
	window.LocalComments = {
		dateFormat: 'ymd',
		dayOfWeek: false,
		twentyFourHours: true,
    };
	mw.hook('convenientDiscussions.commentsReady').add(function () {
		mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Gary/comments in local time.js&action=raw&ctype=text/javascript' ); // [[w:en:User:Mxn/CommentsInLocalTime]]
	});
	if(mw.config.get('wgNamespaceNumber')%2!=1&&mw.config.get('wgNamespaceNumber')!=4){
		mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Gary/comments in local time.js&action=raw&ctype=text/javascript' ); // [[w:en:User:Mxn/CommentsInLocalTime]]
	}
}