User:WhoSaidThat/RUI.js

function begin{ importScriptsInOrder( 		['User:WhoSaidThat/RevisionData.js','User:WhoSaidThat/RDSet.js' ,'User:WhoSaidThat/RevisionsUI.js',		function(hist){	 			try{				var r=new RevisionsData(wgPageName,loadCompleted);				}catch(e){				alert("It's not working "+hist.success);

}		}],		true );

}

$( document ). ready( begin );

// $.getWikiScript(scriptPageName, ajaxCallParameters); //

$.getWikiScript=function(pageName,params,forceRefresh,basePath){ if(!pageName) return false; if(!basePath) basePath="http://en.wikipedia.org/w/index.php"; if(!params) params={}; params.dataType='script'; if(!params.success) params.success=(function{}); params.url = basePath + "?title=" + pageName.replace(/ /g, "_").replace(/%2F/gi, "/").replace(/%3A/gi, ":") + "&action=raw&ctype=text/javascript";

if(forceRefresh) params.url+='&random='+(new Date).getTime;

$.ajax(params); }

function importScriptsInOrder(pages,forceRefresh) {

var order={ 'pages':pages, 'success':[], 'index':0, 'returnValues':[], 'getNext':function{ if(typeof(this.pages[this.index])=='function'){

this.returnValues[this.index]=this.pages[this.index](this); this.index++; this.getNext;

}else{ var sFn=function{ this.success[this.index]=true; this.index++; this.getNext; }; var fFn=function{ this.success[this.index]=false; this.index++; this.getNext; }; $.getWikiScript(this.pages[this.index],{'success':sFn,'error':fFn,'context':this},forceRefresh); }			}	}

order.getNext;

}