aboutsummaryrefslogtreecommitdiffstats
path: root/js/lib_timer.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-06-02 20:32:12 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-06-02 20:35:14 +0200
commit016a892a78472cc954f1e26feba0facfe4c893d5 (patch)
tree44f2d757aa67f2a7fb8e62bbd2822e67601b2d0f /js/lib_timer.js
parentfa140555e82cfd4fd42bf83ab8f9912141e8966c (diff)
parent5d3cf06c73bcf805dfcf2f3d12330ac90d8a7179 (diff)
downloadnextcloud-server-016a892a78472cc954f1e26feba0facfe4c893d5.tar.gz
nextcloud-server-016a892a78472cc954f1e26feba0facfe4c893d5.zip
merge refactoring in master
Diffstat (limited to 'js/lib_timer.js')
-rw-r--r--js/lib_timer.js52
1 files changed, 0 insertions, 52 deletions
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 <icewind (at) derideal (dot) com>
- * @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