User:Technical 13/SandBox/ACCHelp.js/Special:Userlogin.js

/* var api = new mw.Api;// leave on top api.get( {// Check to see if page is watched	   action: 'query',	    prop: 'info',	    inprop: 'watched',	    titles: mw.config.get('wgPageName')	} ).done( function ( data ) {		var pid = $.map(data.query.pages, function (v, k) {return k;})[0];		if(typeof(data.query.pages[pid].watched) === undefined){			var isPageWatched = false;		} else {			var isPageWatched = true;		}	}); $( '#ca-nstab-user:first("a")').on('click', function (e) { 	e.preventDefault;	 if(isPageWatched === false){		/// If page is not watched, watch it		api.watch( mw.config.get('wgPageName') ).done( function { $( '#ca-nstab-user:first("a")').text('watched'); });		isPageWatched = true;	} else {		/// Otherwise, unwatch it		api.unwatch( mw.config.get('wgPageName') ).done( function { $( '#ca-nstab-user:first("a")').text('unwatched'); });		isPageWatched = false;	} }); /* Notes: // Notable configuration settings on successful creation mw.config.set({"wgCanonicalNamespace":"Special","wgCanonicalSpecialPageName":"Userlogin","wgNamespaceNumber":-1,"wgPageName":"Special:UserLogin","wgTitle":"UserLogin","wgCurRevisionId":0,"wgRevisionId":0,"wgArticleId":0,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"view","wgUserName":"Technical 13","wgUserGroups":["accountcreator","massmessage-sender","reviewer","templateeditor","*","user","autoconfirmed"],"wgCategories":[], ...

// API call to get a list of user created by me (will need a continue if over 500) https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&list=logevents&format=json&leprop=title|timestamp|comment|parsedcomment&letype=newusers&leuser=Technical_13&lelimit=500

// Section to change on successful creation A randomly generated password for RON J has been sent to Email@ISP.com. It can be changed on the change password page upon logging in. Return to Main Page.

if(mw.config.get( 'wgCanonicalSpecialPageName' ) === "Userlogin"){ /// INITIALIZE VARIABLES // Get new user's username var userNameCreated = $("div#mw-content-text").find("a:first").text; // Get watchlist token var watchtoken = mw.user.tokens.get( 'watchToken' ); watchtoken = "&token=" + watchtoken.substr(0, watchtoken.length -2) + "%2B%5C"; // define destination for "watch" link (to do it the old fashioned way until I figure out ajax method) var hrefURL = 'https://en.wikipedia.org/w/index.php?title=User:' + userNameCreated + '&action=watch' + watchtoken; /// Function to warn that tb-override or spoof-overide boxes are checked function warnSpoofTB{ var tbChecked = $("#wpIgnoreTitleBlacklist").is(":checked"); var spoofChecked = $("#wpIgnoreAntiSpoof").is(":checked"); var buttonWarnTB = ""; var buttonWarnSpoof = ""; var buttonWarn = ""; if(tbChecked === true){ $("#wpIgnoreTitleBlacklist").parent("label").css({"background-color": "#FAA", "font-weight": "bold"}); buttonWarnTB = "\nIgnoring blacklist!" buttonWarn = "Create another account\n\nWarning:" + buttonWarnTB + buttonWarnSpoof; $("#wpCreateaccount").val(buttonWarn) } else { $("#wpIgnoreTitleBlacklist").parent("label").css({"background-color": "", "font-weight": ""}); buttonWarnTB = "" buttonWarn = "Create another account\n\nWarning:" + buttonWarnTB + buttonWarnSpoof; $("#wpCreateaccount").val(buttonWarn); }		if(spoofChecked === true){ $("#wpIgnoreAntiSpoof").parent("label").css({"background-color": "#FAA", "font-weight": "bold"}); buttonWarnSpoof = "\nIgnoring spoofing checks!"; buttonWarn = "Create another account\n\nWarning:" + buttonWarnTB + buttonWarnSpoof; $("#wpCreateaccount").val(buttonWarn); } else { $("#wpIgnoreAntiSpoof").parent("label").css({"background-color": "", "font-weight": ""}); buttonWarnSpoof = ""; buttonWarn = "Create another account\n\nWarning:" + buttonWarnTB + buttonWarnSpoof; $("#wpCreateaccount").val(buttonWarn); }		if(tbChecked === true || spoofChecked === true){ $("#wpCreateaccount").css("background-image", "linear-gradient(rgb(255, 100, 100) 0px, rgb(105, 50, 50) 100%)"); } else { $("#wpCreateaccount").css("background-image", ""); $("#wpCreateaccount").val("Create another account") }	}	/// onload, do all these things warnSpoofTB; $("#wpReason").replaceWith("" + $("#wpReason").attr("value") + " "); $("#wpIgnoreTitleBlacklist").attr("onClick", "warnSpoofTB;"); $("#wpIgnoreAntiSpoof").attr("onClick", "warnSpoofTB;"); // Create initial links after account created //	$("div#mw-content-text").find("a:first").after(''); //	$("#nu-tb").html("watch"); }