From 132695ceb1d7ab0e4bfbb141e9e9639111dd25b5 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Tue, 1 Mar 2011 23:20:16 +0100 Subject: Start of the refactoring. Commit is quite big because I forgot to use git right from the beginning. Sorry. --- js/lib_timer.js | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 js/lib_timer.js (limited to 'js/lib_timer.js') diff --git a/js/lib_timer.js b/js/lib_timer.js deleted file mode 100644 index aadea90ba27..00000000000 --- a/js/lib_timer.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * StarLight - A client side webpage framework - * - * @package StarLight - * @author Icewind - * @copyright 2009 - * @license http://www.gnu.org/licenses/gpl.html GNU Public License - * @url http://blacklight.metalwarp.com/starlight - * @version 0.1 - */ -OCTimer=function(callback,time,repeat,object){ - this.object=(object)?object:false; - this.repeat=(!(repeat===undefined))?repeat:true; - this.callback=callback; - this.time=time; - this.timer=0; - this.number=OCTimer.count; - OCTimer.count++; - OCTimer.timers[this.number]=this; - if(this.time){ - this.start(); - } -} - -OCTimer.count=0; -OCTimer.timers=Array(); - -OCTimer.prototype={ - start:function(){ - this.running=true; - eval('var func=function(){OCTimer.timers['+this.number+'].run();};'); - if(this.repeat){ - this.timer = setInterval(func, this.time); - }else{ - this.timer = setTimeout(func, this.time); - } - }, - run:function(){ - if (!this.repeat){ - this.stop(); - } - if (this.object){ - this.callback.call(this.object); - }else{ - this.callback.call(); - } - }, - stop:function(){ - clearInterval(this.timer); - this.running=false; - } -} \ No newline at end of file -- cgit v1.2.3