User:WhoSaidThat/MyScript.js

/*

October 2011 Coding Challenge http://creativecommons.org/licenses/by-sa/3.0/

Description: Launch Script Author: J Wyatt, Nov 2011



$.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 begin{ importScriptsInOrder( 		['User:WhoSaidThat/RevisionData.js','User:WhoSaidThat/RDSet.js' ,'User:WhoSaidThat/RevisionsUI.js',		function(hist){	 var r=new RevisionsData(wgPageName,loadCompleted,function(a,b,c,d){ alert(a+' '+b+' '+c+' 'd) });	}],		true	);

}

$( document ). ready( begin );

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;

}