Jump to content

User:Technical 13/Scripts/ACCHelp/User talk.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("wgNamespaceNumber") === 3 && (mw.config.get("wgRelevantUserName") === null || typeof($('b:contains("No messages")').html()) !== 'undefined')){
	$("h1#firstHeading").html(tickGood + " " + $("h1#firstHeading").html());
	document.title = Ucheck + document.title;
	var requestLastCreated = {
		action: "query",
		list: "logevents",
		format: "json",
		letype: "newusers",
		lelimit: 1,
		leprop: "title|timestamp",
		leuser: "Technical 13"
	}
	$.get(mw.config.get( 'wgScriptPath' )+"/api.php", requestLastCreated, function(responseLastCreated){
		var date = new Date();
		var created = new Date(responseLastCreated.query.logevents[0].timestamp);
		if(Math.floor((date.valueOf()-created.valueOf())/60000) <= 5){
			if(responseLastCreated.query.logevents[0].title === "User:" + mw.config.get('wgTitle')){
				$('#ca-wikilove span a:first').click();
				$('span:contains("ACC Welcomes")').parent('a').click();
				$('#mw-wikilove-button-preview').click();
				$('#mw-wikilove-button-send').focus();
			}
		} else {
			setTimeout(function(){location = "#mw-head"},10000);
		}
	});
}
if(mw.config.get("wgNamespaceNumber") === 3){
	if(typeof($('div#lastRevInfo').html()) !== 'undefined'){
		alert("Please update warning box to use 'class=\"lastRevInfo floatright\"' with an id set to the name of the template.");
		$('div#lastRevInfo').css('display', 'inherit');
	}
	if(typeof($('div.lastRevInfo').html()) !== 'undefined') {
		$('div.lastRevInfo').css('display', 'inherit');
	}
}