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

Content deleted Content added
No edit summary
*let* me be done with this
Line 35:
loadHooks(){
let hooktext = this.content.split("\n");
let ip = [this.content.indexOf("<!--Hooks-->")+2,this.content.indexOf("<!--HooksEnd-->"),this.content.indexOf("-->")+2,this.content.indexOf("</div>")]; //important split points
hooktext = this.content.slice(ip[0],ip[1]);
let creditstext = this.content.slice(ip[2],ip[3]);
this.hooks = []
for (let h in hooktext){
let hook = new Hook(h,hooktext[h].slice(2),[])
this.hooks.push(hook)
if (hook.articles.length > 0){
for (c in creditstext){
let credit = new Credit(creditstext[c]);
if (credit.article in hook.articles){
hook.credits.push(credit)
Line 60:
loadFiles(){
let filetext = this.content.match(/\{\{main page image\/DYK.*?}}/g);
this.file = new File(filetext[0])
}