User:Novem Linguae/Scripts/NotSoFast.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | This user script seems to have a documentation page at User:Novem Linguae/Scripts/NotSoFast. |
// <nowiki>
/*
In [[Special:NewPagesFeed]], alert you if an article was created within the last 15 minutes. This is so while new page patrolling, you can comply with the rule that you're not supposed to mess with people's articles until 15 minutes after they are created, as those folks may still be working on them.
*/
mw.loader.using('mediawiki.storage').then(function () {
mw.storage.session.set( 'client-error-opt-out', '1' );
});
$(function() {
function getArticleName() {
// returns the pagename, including the namespace name, but with spaces replaced by underscores
return mw.config.get('wgPageName');
}
let title = getArticleName();
if ( title != 'Special:NewPagesFeed' ) return;
// TODO: if drafts rather than articles selected as filter, return
console.log('Activated');
let currentTimestampInSeconds = Math.floor(Date.now() / 1000);
console.log("currentTimestampInSeconds: "+currentTimestampInSeconds;
$('.mwe-pt-list-item .mwe-pt-creation-date').each(function(i) {
let dateTimeString = $(this).html().trim();
console.log("dateTimeString: "+dateTimeString);
let timestampInSeconds = Math.round(new Date("2013/09/05 15:34:00").getTime()/1000);
console.log("timestampInSeconds: "+timestampInSeconds);
});
});
// </nowiki>