MediaWiki:Common.js/User:Bawolff/sandbox/powerFlag

// "; table += 'Flag Changes Summary: '; table += '  ';

if (nextQ) { //this could break if user changes page. table += " Next 50 &gt;&gt;"; } //add to page document.getElementById('powerFlagRevs').innerHTML = table;

}

powerFlag.onchangeHandle = function (rev) { //var rev = this.id.replace(/^selRev(\d+)$/, "#rev$1"); if (rev === "") throw new Error("couldn't find revision number from onchange handler");

rev = '#rev' + rev;

$(rev + ' select')[0].className = 'modifiedFlag'; $(rev)[0].className = 'modifiedFlag'; $(rev + ' td').css('background-color', '#ccddff'); }

powerFlag.commit = function { //$('select.modifiedFlag')[2].value var comment = $('#FlagComment')[0].value; var selects = $('select.modifiedFlag'); var rev, level; var callback = function { powerFlag.outgoingReq--; if (powerFlag.outgoingReq === 0) { jsMsg(" All Requests completed successfully. The specific revisions should be flagged as appropriate now "); powerFlag.submit; //refresh table. } } for (var i = 0; i < selects.length; i++) { level = selects[i].value; rev = selects[i].id.substring(6); //FIXME, handle errors. powerFlag.outgoingReq++; Bawolff.mwapi.sight({comment: comment, level: level, revid: rev}, callback); } }

$(powerFlag.start); //