User:Mach61/common.js

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:Shubinator/DYKcheck.js'); //DYKcheck tool importScript('User:Novem Linguae/Scripts/DraftCleaner.js') $(document).ready(function {

/*** Start editing here ***/

// When you want to end your break? // no leading zeroes. (example: 9 - correct, 09 - incorrect)

var date = { year: 2024, month:3, day: 4}; var time = { hours: 0, minutes: 0, seconds: 0 };

/*** Stop editing here ***/ var currentDate = new Date; var enforcedBreakEnd = new Date(		date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds); if (currentDate <= enforcedBreakEnd) {		alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString			+ "\n(now is "+currentDate.toLocaleString+")\n\nBye!"); mw.loader.using(["mediawiki.api", "mediawiki.user"]).then(function 		{			new mw.Api.post( {				action: 'logout', token: mw.user.tokens.get('csrfToken') }).done(function (data) {				location = "//" + location.host + "/w/index.php?title=" + "Special:Userlogin&returnto=Main_Page"; }).fail(function {				console.log("logout failed") });		});	} }); if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) > -1 ) {	importScript('User:Mach61/js/smartLinkingLoader.js'); // User:V111P/js/smartLinkingLoader.js }

importScript( 'User:Enterprisey/cv-revdel.js' ); // Backlink: User:Enterprisey/cv-revdel.js importScript('DreamRimmer/copyvio-check.js'); // User:DreamRimmer/copyvio-check.js mw.loader.load( '/w/index.php?title=User:EnterpriseyBot/delsort.js&action=raw&ctype=text/javascript' ); // Backlink: User:EnterpriseyBot/delsort.js importScript( 'User:Novem Linguae/Scripts/CiteHighlighter.js' ); // Backlink: User:Novem Linguae/Scripts/CiteHighlighter.js $(function {   $("#n-upload > a").attr('href', '/wiki/Special:Upload'); }); importScript( 'User:Equazcion/SkipFileWizard.js' ); // Backlink: User:Equazcion/SkipFileWizard.js