User:Theleekycauldron/Scripts/PSHAW/dependencies/Prep.js: Difference between revisions

Content deleted Content added
+
Restored revision 1303816471 by Theleekycauldron (talk): Test over
 
(5 intermediate revisions by the same user not shown)
Line 26:
prep.loadHooks();
prep.loadFiles();
prep.loadDYKbotdo();
}
return prep
Line 43 ⟶ 44:
let hook = new Hook(h,hooktext[h].slice(2),[])
this.hooks.push(hook)
console.log(hook)
if (hook.articles.length > 0){
console.log(hook)
for (let credit of creditstext){
if (credit.used){
Line 78 ⟶ 79:
let filetext = this.content.match(/\{\{main page image\/DYK.*?}}/g);
this.file = new File(filetext[0])
}
loadDYKbotdo(){
let botdotext = this.content.match(/\{\{DYKbotdo\|(.*)\}\}/)
if (botdotext != null) {
this.botdo = botdotext[1]
} else {
if (this.title.includes("/Queue/")){
this.botdo = "~~~"
} else {
this.botdo = null
}
}
}
Line 112 ⟶ 126:
assemble(){
let res = []
res.push(`${this.title.includes("Queue")?"{{DYKbotdo|~~~"+this.botdo+"}}":""}
<noinclude>{{Did you know/Clear/header}}
==Hooks==
Line 146 ⟶ 160:
res.push(credit.content)
}
}
for (let credit of this.lost_credits){
res.push(credit.content)
}
res.push(`</div>