User:Theleekycauldron/Scripts/PSHAW/dependencies/Hook.js: Difference between revisions
Content deleted Content added
move to credit.js |
Undid revision 1175460558 by Theleekycauldron (talk) nvm |
||
Line 35:
}
return "<b>"+this.id+"</b>: "+t.slice()
}
give_credits(credit){
let res;
if (credit.make){
res = `{{subst:Template:DYKmake/DYKmakecredit
|article=${credit.article}
|optional=
|nompage=${credit.subpage}
|hook=${this.hook}
}} ~~~~`
} else {
res = `{{subst:DYKnom/DYKnomcredit
|article=${credit.article}
|optional=${credit.subpage}
|nompage=${this.hook}
}} ~~~~`
}
var params = {
action: 'edit',
title: this.title,
summary: `Giving credit for ${credit.article}`,
section: 'new',
sectiontitle: `DYK for ${credit.article}`,
text: res,
format: 'json'
}
api.postWithToken( 'csrf', params );
}
|