User:Guywan/Scripts/InsertShortcuts.js: Difference between revisions

Content deleted Content added
mNo edit summary
maintenance: more info wikitext is array. startsWith is a string method.
 
(2 intermediate revisions by the same user not shown)
Line 33:
this.getWikitext(page, wikitext =>
{
if(typeof wikitext === 'string' && wikitext.startsWith("!!REDIRECT"))
{
project = wikitext.split(" ")[1];
Line 98:
for(var id in data.query.pages)
{
wikitext.push(var revisions = data.query.pages[id].revisions || [0].slots.main['*']);
if(revisions.length) wikitext.push(revisions[0].slots.main['*']);
}