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

m
move tag thing to Mediawiki: Group-keeper.js
m (fix the reason setting)
m (move tag thing to Mediawiki: Group-keeper.js)
first_edit_link.appendChild(patrols[0])
patrols[0].style['font-size'] = 'inherit'
}
 
// 2018-11-06 add status-change tags to pages with diffs that change the status
const diff = document.querySelector('.diff')
if (diff) {
diff.querySelectorAll('.diff-addedline').forEach(function (el) {
if (!/\{\{(stub|partial|complete)\}\}/.test(el.innerText)) return
const row = el.parentElement
const rem = row.querySelector('.diff-deletedline')
const add = row.querySelector('.diff-addedline')
const msg = rem.innerText.trim() +' => '+ add.innerText.trim()
;(new mw.Api).postWithToken('csrf', { action: 'tag', revid: mw.config.get('wgRevisionId'), add: 'status-change', reason: msg, })
})
}