User:Theleekycauldron/Scripts/PSHAW/dependencies/Nomination.js: Difference between revisions
Content deleted Content added
this is not working!! |
underscores |
||
(22 intermediate revisions by the same user not shown) | |||
Line 12:
copies or substantial portions of the Software.
*/
class Nomination {
constructor(title,page){
this.title = title
this.page = page
this.page = get_pages(this.title,"user|content",null,"older").then((res) => {▼
this.loadHooks();▼
this.loadFiles();▼
}
static async create(title){
title = title.replaceAll("_"," "); //MediaWiki stuff
let nom = new Nomination(title,page)
return nom
}
hasBeenEditedByUser(){
Line 58 ⟶ 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 66 ⟶ 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 );▼
}
}
}
}
|