User:Theleekycauldron/Scripts/PSHAW/dependencies/Nomination.js: Difference between revisions
Content deleted Content added
Undid revision 1236147196 by Theleekycauldron (talk) aaaaa |
underscores |
||
(15 intermediate revisions by the same user not shown) | |||
Line 18:
constructor(title,page){
this.title = title; //MediaWiki stuff
this.page = page
this.content = this.page[0].revisions[0].slots.main.content;
this.isHatted = this.content.includes("'''No further edits should be made to this page'''.")
this.isApproved = this.content.includes("[[File:Symbol_voting_keep.svg|16px]]") || this.content.includes("[[File:Symbol voting keep.svg|16px]]") || this.content.includes("[[File:Symbol_confirmed.svg|16px]]") || this.content.includes("[[File:Symbol confirmed.svg|16px]]") || this.content.match(/\|.*?status.*?=.*?y/g) != undefined
this.alphanumericals="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
}
Line 26 ⟶ 27:
static async create(title){
title = title.replaceAll("_"," "); //MediaWiki stuff
let page = await get_pages(title,"user|content",null,"older");
let nom = new Nomination(title,page)▼
▲ nom = new Nomination(title,page)
nom.loadHooks();
nom.loadFiles();
Line 66:
console.log(this.page[0])
for (let revision of this.page[0].revisions){
let revtext = revision.slots.main.content;
if (revtext.includes("{{DYKsubpage")){
this.content = revtext;
Line 74:
}
async retransclude(){
let res = await get_pages("Template talk:Did you know","user|content",null,"older")
for (var i=0; i<dykn.length; i++){
dykn.splice(i+2,0,`{{${this.title}}}`)
▲ if (line.includes("===Articles created/expanded on")){
▲ title: "Template talk:Did you know",
text: dykn,
▲ summary: `Retranscluding [[${this.title}]]`,
return api.postWithToken( 'csrf', params );▼
}
}
}
}
|