MediaWiki:DYK-nomination-wizard.js: Difference between revisions
Content deleted Content added
sync from User:SD0001/DYK-helper/withJsMode2.js - requested on talk |
Per request on talk |
||
Line 448:
// Show number of QPQs required
mw.loader.using('ext.gadget.libLua').then(function() {
return mw.libs.lua.call({
module: 'NewDYKnomination',
func: 'getRequiredQpqCount',
});
var [numQpqsNeeded, numPriorNoms] = output.split('\t').map(num => parseInt(num));
▲ }).then(function(json) {
if (numQpqsNeeded === 2) {
$('#dyk-qpq-count').text('2, as DYK is currently in backlog mode and you have ' + numPriorNoms + ' past nominations');▼
▲ var numPriorNoms = nomCounts[mw.config.get('wgUserName')] || 0;
▲ $('#dyk-qpq-count').text('2, as DYK is currently in backlog mode and you have ' + numPriorNoms + ' past nominations')
▲ } else if (numPriorNoms >= 5) {
$('#dyk-qpq-count').text('1, as you have ' + numPriorNoms + ' past nominations');
} else if (numQpqsNeeded == 0) {
$('#dyk-qpq-count').text('0, as you have less than 5 past nominations');
} else {
$('#dyk-qpq-count').text('failed to calculate');
}
}).catch(function(err) {
$('#dyk-qpq-count').text('failed to calculate');
console.log(err);
});
};
|