var StaffRoll = {};//namespace /** * Settings */ StaffRoll.net = 'staffroll.net'; /** * Classes */ StaffRoll.Credit = function(){ this.anchors = []; /* Fields */ this.user = ''; this.repo = ''; this.creators = []; this.loading = false; this.jsonp_ready = false; this.theme_ready = true; this.opened = false; /* Constructor */ this.initialize = function(){ return this; }; this.addAnchor = function(anchor){ var tmp = anchor.href.match(/^https?:\/\/github\.com\/([a-z0-9_\-]*)\/([a-z0-9_\-]*)\/contributors/); var user = tmp ? tmp[1] : ''; var repo = tmp ? tmp[2] : ''; if (this.user == ''){ this.user = user; this.repo = repo; } else return false; this.anchors.push(anchor); anchor.onclick = function(e){ StaffRoll.credit.showOrHide(); return false; }; return this; }; /* Methods */ this.callTheme = function(){ var script, link; var scripts = document.getElementsByTagName("script"); for (var i=0; i MSm) ms = MSm; var L = this.end - this.start; var x = (1-Math.cos(Math.PI*ms/MSm))*0.5*L; this.onUpdate(this.start+x); if (ms == MSm) { clearInterval(this.timer); this.timer = 0; this.onEndEffect(); } }; }; /** * Setups */ (function(){ var setup = function(){ StaffRoll.theme = (new StaffRoll.Theme()).initialize(); StaffRoll.credit = (new StaffRoll.Credit()).initialize(); var anchors = document.getElementsByTagName("a"); for (var i=0; i