User:Dragon695/wikipageAfd.js

User:Dragon695/wikipageAfd.js - Extra AfD-related wikipage functionality.

Requires: User:Dragon695/datetime.js, User:Dragon695/wikipage.js

Taken from User:Quarl/wikipageAfd.js.

//

// // Return log page for given date (default today). // function afdLogPage(d) { d = d || new Date;

return (new WikiPage(null, 'Wikipedia:Articles for deletion/Log/' + datestampYYYYMonthD(d))); }

WikiPage.prototype.afdPage = function { //	// AFD only applies to main (ignoring Talk). //	if (!this.nsMainP) { return (null); }

return (new WikiPage(null, 'Wikipedia:Articles for deletion/' + this.article)); }

WikiPage.prototype.afdPageX = function { //	// Already an AFD page? //	if (this.afdTargetPage) { return (this); }

return (this.afdPage); }

WikiPage.prototype.afdTargetPage = function { if (!this.page.match(/^Wikipedia:Articles for deletion\/(.*?)(?: \([0-9]+|2nd nomination|3rd nomination|4th nomination\))?$/)) { return (null); }

var p = RegExp.$1; if (p.match(/^Log\//)) { return (null); }

return (new WikiPage(null, p)); }

WikiPage.prototype.afdLogDate = function { if (!this.page.match(/^Wikipedia:Articles for deletion\/Log\/(.*?)?$/)) { return (null); }

var d = RegExp.$1;

return (new Date(Date.parse(d))); }

function wikipageAfd_load { window.wpAfdTarget = wikiPage.afdTargetPage; window.wpAfd = wikiPage.afdPageX; window.wpAfdLogDate = wikiPage.afdLogDate; window.afdP = Boolean(wpAfdTarget); window.afdLogP = Boolean(wpAfdLogDate); }

$(wikipageAfd_load);

//