User:Cloud29371/common.js

/*** BEGIN WIKIBREAK ENFORCER ***/ /*** From en:Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer/script ***/ $(function {

/*** Edit here ***/ // where your wiki holiday ended // No leading zero: (Example : 7 is correct, 07 is not correct) var date = {year: 2022, month: 12, day: 21}; var time = {hours: 0, minutes: 0, seconds: 0};

/*** Do not edit following content ***/ var currentDate = new Date; var enforcedBreakEnd = new Date(date.year, date.month - 1, date.day, time.hours, time.minutes, time.seconds); if (currentDate > enforcedBreakEnd) return; mw.loader.using(['mediawiki.util']).done(function {		window.alert('Your wiki holiday will end on ' + enforcedBreakEnd.toString + '\n' + 'Today is：' + currentDate.toString + '\n\n' + 'Bye !');		new mw.Api.postWithEditToken({ action: 'logout' }).done(function { window.location = window.location.origin + '/w/index.php?title=Special:Userlogin&returnto=Wikipedia:Main_Page'; }).fail(function { console.log('logout failed'); });	}); }); /*** END WIKIBREAK ENFORCER ***/