User:Sikon/monaco.js

var rcUpdateInterval = 10; var rcHideBots = true; var rcHideMinor = false; var rcHideAnons = false; var rcNS = null; var rcLimit = 50; var rcUpdater = null;

function RCHtmlUpdater(el) {   this.element = el; }

RCHtmlUpdater.prototype.initControl = function {   while(this.element.firstChild) this.element.removeChild(this.element.firstChild); }

RCHtmlUpdater.prototype.update = function(d) { }

function onPageLoad {   var rcRoot = document.getElementById('rcview'); rcUpdater = new RCHtmlUpdater(rcRoot); rcUpdater.initControl; rcRetrieveData; }

function rcStringize(str, value) {   return value ? '!' + str : str; }

function rcRetrieveData {   var limitString = '&rclimit=' + rcLimit; var nsString = (rcNS == null) ? '' : '&rcnamespace=' + rcNS; var showString = '&rcshow=' + rcStringize('bot', rcHideBots) + '|' + rcStringize('minor', rcHideMinor) + '|' + rcStringize('anon', rcHideAnons); var loader = new ContentLoader; loader.callback = rcOnDataArrival; loader.send('/api.php?action=query&list=recentchanges&rcprop=flags&format=json'       + limitString + showString + nsString); }

function rcOnDataArrival {   var d = eval('(' + this.text + ')'); alert(d); rcUpdater.update(d); }