Jump to content

User:JJPMaster/Scripts/AfC time logger.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JJPMaster (talk | contribs) at 01:27, 24 May 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
(() => {
	let ns = mw.config.get("wgCanonicalNamespace");
	let name = mw.config.get("wgPageName");
	var startTime = new Date().getTime();
	var spent = 0;
	
	function getTime() {
		var time = new Date().getTime();
		spent = (time - startTime) / 1000;
		return spent;
	}
	
	$(document).ready(function() {
		if(ns == "Draft") {
			$("#afchSubmitForm").on("click", () => {
				console.log("Spent " + getTime() + " before reviewing " + name); 
			});
		}
	});
})();