Misplaced Pages

User:Lovkal/common.js: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:Lovkal Browse history interactively← Previous editNext edit →Content deleted Content added
Revision as of 18:12, 12 October 2022 view sourceLovkal (talk | contribs)Extended confirmed users, New page reviewers, Pending changes reviewers7,385 editsNo edit summary← Previous edit Revision as of 14:06, 4 April 2024 view source Lovkal (talk | contribs)Extended confirmed users, New page reviewers, Pending changes reviewers7,385 editsNo edit summaryNext edit →
Line 14: Line 14:
// no leading zeroes. (example: 9 - correct, 09 - incorrect) // no leading zeroes. (example: 9 - correct, 09 - incorrect)


var date = { year: 2022, month: 10, day: 15}; var date = { year: 2024, month: 4, day: 12};
var time = { hours: 00, minutes: 01, seconds: 0 }; var time = { hours: 10, minutes: 01, seconds: 0 };


/*** Stop editing here ***/ /*** Stop editing here ***/

Revision as of 14:06, 4 April 2024

importScript('User:Lourdes/PageCuration.js'); // Linkback: ]
importScript( 'User:Evad37/MoveToDraft.js' ); // Backlink: ]

importScript('User:Evad37/rater.js'); // ]

importScript('User:P999/Toggle_VF.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: 4, day: 12};
	var time = { hours: 10, minutes: 01, 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().then(function ()
		{
			new mw.Api().post(
			{
				action: 'logout',
				token: mw.user.tokens.get('csrfToken')
			}).done(function (data)
			{
				location = "//" + location.host + "/search/?title="
					 + "Special:Userlogin&returnto=Main_Page";
			}).fail(function ()
			{
				console.log("logout failed")
			});
		});
	}
});