Difference between revisions of "User:Fbstj/gadget/history-test.js"

Jump to navigation Jump to search
m (fix that)
m (try this)
}).then(function(resp) {
const pid = Object.keys(resp.query.pages)[0]
const new_files = []
var gal = "\n\n<gallery>\n"
const pages = resp.query.pages[pid].linkshere.map(function(page) { return page.title.split(':')[1] })
for (var i in pages) {
const page = pages[i]
if (edit.value.includes(page)) { continue; }
gal += new_files.push(pages[i] +" ' | \n"')
}
galedit.value += "\n\n<gallery>\n"+ new_files.join("\n") +"\n</gallery>\n"
edit.value += gal
})