User:Ratnahastin/common.js

// 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])}} importScript('User:DannyS712/Readonly.js'); // Backlink: User:DannyS712/Readonly.js importScript('User:Headbomb/unreliable.js'); // Backlink: User:Headbomb/unreliable.js importScript('User:Eizen/LastEditor.js'); // Backlink: User:Eizen/LastEditor.js importScript('User:BrandonXLF/QuickEdit.js'); // Backlink: User:BrandonXLF/QuickEdit.js importScript('User:Awesome Aasim/xfdvote.js'); // Backlink: User:Awesome Aasim/xfdvote.js // User:Caorongjin/wordcount importScript('User:Joeytje50/JWB.js/worker.js'); // Backlink: User:Joeytje50/JWB.js/worker.js importScript('User:Evad37/TimestampDiffs.js'); // Backlink: User:Evad37/TimestampDiffs.js importScript('User:Lourdes/PageCuration.js'); // Backlink: User:Lourdes/PageCuration.js importScript('User:MPGuy2824/MoveToDraft.js'); // Backlink: User:MPGuy2824/MoveToDraft.js importScript('User:Novem_Linguae/Scripts/SpeciesHelper.js'); // Backlink: User:Novem_Linguae/Scripts/SpeciesHelper.js importScript('User:GeneralNotability/ip-ext-info.js'); // Backlink: User:GeneralNotability/ip-ext-info.js importScript('User:Joeytje50/JWB.js/load.js'); // Backlink: User:Joeytje50/JWB.js/load.js mw.loader.load('//meta.wikimedia.org/w/index.php?title=User%3ASMcCandlish%2Fuserinfo.js&action=raw&ctype=text/javascript'); mw.loader.load('/w/index.php?title=User:Lupin/recent2.js&action=raw&ctype=text/javascript'); importScript('User:Evad37/rater.js'); // Backlink: User:Evad37/rater.js importScript('User:Bradv/Scripts/Superlinks.js'); // Backlink: User:Bradv/Scripts/Superlinks.js mw.loader.load('//meta.wikimedia.org/w/index.php?title=User%3ADragoniez%2FSuppressEnterInForm.js&action=raw&ctype=text/javascript'); // User:Caorongjin/wordcount importScript('User:Caorongjin/wordcount.js'); // Backlink: User:Caorongjin/wordcount.js importScript('User:Enterprisey/cv-revdel.js'); // Backlink: User:Enterprisey/cv-revdel.js if(mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Contributions' || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges'){ $('span.mw-rollback-link').remove; }