40 275
ediciones
m (guard combo diffs from tagging wrong revision) |
m (+fn names) |
||
mw.hook('wikipage.diff').add(function tag_status_change() {
// 2018-11-06 add status-change tags to pages with diffs that change the status
if (!diff) return;
diff.querySelectorAll('.diff-addedline').forEach(function find_status_change(el) {
if (!/\{\{(stub|partial|complete)\}\}/.test(el.innerText)) return
const row = el.parentElement
// send the notification
;(new mw.Api).postWithToken('csrf',
action: 'tag',
revid: mw.config.get('wgRevisionId'),
add: 'status-change',
reason: msg,
}).then(function notify_success() {
mw.notify('revision tagged with '+ msg)
})
|