User:JJPMaster/Scripts/AfC time logger.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
(() => {
let namens = mw.config.get("wgCanonicalNamespace");
let name = mw.config.get("wgPageName");
alert (name);
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);
});
}
});
})();