User:Rusty Cat/common.js

// 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])}}

// Automatically purge pages if (mw.config.get('wgAction') === 'purge') { $('form[action*="action=purge"]').submit; }

// portlets $.when(mw.loader.using('mediawiki.util'), $.ready).then(function {   mw.util.addPortletLink('p-interaction', '//typos.toolforge.org/', 'Correct typos in one click', 'p-typo', 'Correct typos in one click tool');    mw.util.addPortletLink('p-interaction', '/wiki/Wikipedia:Edit_filter/False_positives/Reports', 'WP:EFFPR', 'p-effpr', 'Wikipedia edit filter false positive reports'); });

// general purpose importScript('User:PleaseStand/userinfo.js'); // Backlink: User:PleaseStand/userinfo.js

// antivandalism importScript('User:10nm/beta.js'); // Backlink: User:10nm/beta.js importScript('User:Ingenuity/AntiVandal.js'); // Backlink: User:Ingenuity/AntiVandal.js

// mainspace editing mw.loader.load('/w/index.php?title=User:Evad37/rater.js&action=raw&ctype=text/javascript'); // Backlink: User:Evad37/rater.js mw.loader.load('/w/index.php?title=User:Enterprisey/cv-revdel.js&action=raw&ctype=text/javascript'); // Backlink: User:Enterprisey/cv-revdel.js mw.loader.load('/w/index.php?title=User:Qwertyytrewqqwerty/DisamAssist.js&action=raw&ctype=text/javascript'); // Backlink: User:Qwertyytrewqqwerty/DisamAssist.js mw.loader.load('/w/index.php?title=User:MPGuy2824/MoveToDraft.js&action=raw&ctype=text/javascript'); // Backlink: User:Evad37/rater.js mw.loader.load('/w/index.php?title=User:PerfektesChaos/js/lintHint/r.js&action=raw&maxage=86400&ctype=text/javascript'); // Backlink: User:PerfektesChaos/js/lintHint/r.js mw.loader.load('/w/index.php?title=User:Wugapodes/Capricorn.js&action=raw&ctype=text/javascript'); // Backlink: User:Wugapodes/Capricorn.js importScript('User:Ohconfucius/script/EngvarB.js'); // Backlink: User:Ohconfucius/script/EngvarB.js // mw.loader.load('/w/index.php?title=User:Uziel302/typo.js&action=raw&ctype=text/javascript'); // Backlink: User:Uziel302/typo.js

// jwb mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');

// management and noticeboards / admin tools importScript('User:Elli/OneClickArchiver.js'); // Backlink: User:Elli/OneClickArchiver.js mw.loader.load('/w/index.php?title=User:DannyS712/EFFPRH.js&action=raw&ctype=text/javascript'); // Backlink: User:DannyS712/EFFPRH.js mw.loader.load('/w/index.php?title=User:Suffusion_of_Yellow/effp-helper.js&action=raw&ctype=text/javascript'); // Backlink: User:Suffusion of Yellow/effp-helper.js mw.loader.load('/w/index.php?title=User:Suffusion_of_Yellow/FilterDebugger.js&action=raw&ctype=text/javascript'); // Backlink: User:Suffusion of Yellow/FilterDebugger.js mw.loader.load('/w/index.php?title=User:GeneralNotability/spihelper.js&action=raw&ctype=text/javascript'); // Backlink: User:GeneralNotability/spihelper.js importScript('User:MusikAnimal/responseHelper.js'); // Backlink: User:MusikAnimal/responseHelper.js mw.loader.load('/w/index.php?title=User:MusikAnimal/userRightsManager.js&action=raw&ctype=text/javascript'); // Backlink: User:MusikAnimal/userRightsManager.js mw.loader.load('/w/index.php?title=User:Writ Keeper/Scripts/massRollback.js&action=raw&ctype=text/javascript'); // Backlink: User:Writ Keeper/Scripts/massRollback.js importScript('User:Jackmcbarn/editProtectedHelper.js'); // Backlink: User:Jackmcbarn/editProtectedHelper.js importScript('User:DannyS712/SectionRemover.js'); // Backlink: User:DannyS712/SectionRemover.js importScript('User:DannyS712/SectionMover.js'); // Backlink: User:DannyS712/SectionMover.js importScript('User:Terasail/COI_Request_Tool.js'); // Backlink: User:Terasail/COI_Request_Tool.js

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript'); importScript('User:SD0001/BDCS.js'); // Backlink: User:SD0001/BDCS.js

importScript( 'User:DannyS712/Draft no cat.js' ); // Backlink: User:DannyS712/Draft no cat.js importScript( 'User:DannyS712/Draft re cat.js' ); // Backlink: User:DannyS712/Draft re cat.js mw.loader.load("//pl.wikipedia.org/w/index.php?title=Wikipedysta:Msz2001/abusefilter-analyzer-primer.js&action=raw&ctype=text/javascript"); importScript('User:Enterprisey/unblock-review.js'); // Backlink: User:Enterprisey/unblock-review.js importScript('User:Andrybak/Archiver.js'); // Backlink: User:Andrybak/Archiver.js importScript('User:Epicgenius/ArticleQuality.js'); // Backlink: User:Epicgenius/ArticleQuality.js importScript('User:Headbomb/unreliable.js'); // Backlink: User:Headbomb/unreliable.js importScript('User:Fred Gandt/confirmLogout.js'); // Backlink: User:Fred Gandt/confirmLogout.js