Difference between revisions of "User:Fbstj/gadget/history-test.js"
Jump to navigation
Jump to search
m (some debugging) |
m (try this) |
||
const api = new mw.Api()
const edit = document.querySelector('textarea')
const note = mw.notify('scanning for new files linking to '+ page_name)
api.get({
const pid = Object.keys(resp.query.pages)[0]
const new_files = []
note.close()
if (!resp.query.pages[pid].linkshere) {
const pages = resp.query.pages[pid].linkshere.map(function(page) { return page.title.split(':')[1] })
for (var i in pages) {
}
// don't change the page if there's nothing to change
if (new_files.length == 0) {
// TODO: make into a dropdown notice thing?
if (edit.value.includes('</gallery>')) {
|