Jump to content

User:Technical 13/Scripts/WikiBreak.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if(mw.config.get( 'wgTitle' ) !== mw.config.get( 'wgUserName' ) + '/common.js' && mw.config.get( 'wgAction' ) !== 'edit'){
	$( 'div#content' ).css( 'display', 'none' );
	var stillOnBreak = confirm( 'You are still on a WikiBreak because you need to get your school work done.' );
	if(stillOnBreak === false){
		stillOnBreak = confirm( 'Are you sure you are done with your break?' );
		if(stillOnBreak === false){
			setTimeout(function(){location = 'https://en.wikipedia.org/w/index.php?title=User:' + mw.config.get( 'wgUserName' ).replace(' ', '_') + '/common.js&action=edit#editform'},1);
		} else {
			stillOnBreak = alert( 'Fine, but hurry up and get back to doing your school work!' );
			$( 'div#content' ).css("display", "");
		}
	} else {
		alert( 'Reloading the page...' );
		setTimeout(function(){location = ''},1);
	}
}