web/static/res/js/incmosaic.js
changeset 45 f7bfdc49982b
parent 43 21a791340354
child 78 8c3f0b94d056
equal deleted inserted replaced
44:f905a56cc7e6 45:f7bfdc49982b
    87 
    87 
    88 		// Time
    88 		// Time
    89 		this.startTime = new Date().getTime();		
    89 		this.startTime = new Date().getTime();		
    90 	};
    90 	};
    91 
    91 
    92 	this.goEffect = function()
    92 	this.UnpauseEffect = function(go)
    93 	{
    93 	{
    94 		this.waitStartEffectGo = false;
    94 		this.waitStartEffectGo = !go;
    95 	};
    95 	};
    96 
    96 
    97 	this.init = function()
    97 	this.init = function()
    98 	{
    98 	{
    99 		// Init canvas objects
    99 		if (this.canvas === undefined || this.canvas === null) {
   100 		this.canvas = document.getElementById(this.canvasId );
   100 			// Init canvas objects
   101 		this.ctx = this.canvas.getContext('2d');
   101 			this.canvas = document.getElementById(this.canvasId );
   102 		this.ctx.fillStyle = "#000000";
   102 			this.ctx = this.canvas.getContext('2d');
   103 		this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
   103 			this.ctx.fillStyle = "#000000";
       
   104 			this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);			
       
   105 		}
   104 	};
   106 	};
   105 
   107 
   106 	this.registerPreNewCanvasSize = function(newCanvasWidth, newCanvasHeight)
   108 	this.registerPreNewCanvasSize = function(newCanvasWidth, newCanvasHeight)
   107 	{
   109 	{
   108 	};
   110 	};
   207 				}
   209 				}
   208 			}
   210 			}
   209 		}
   211 		}
   210 
   212 
   211 		if (!effectsContinue) {
   213 		if (!effectsContinue) {
       
   214 			if (this.endEffecFunc != undefined && this.endEffecFunc != null) {
       
   215 				// Call the end callback
       
   216 				var func = this.endEffecFunc;
       
   217 				if (!this.loop) {
       
   218 					this.endEffecFunc = null;
       
   219 				}
       
   220 				func();
       
   221 			}
   212 			if (this.loop) {
   222 			if (this.loop) {
   213 				// The effect loop
   223 				// The effect loop
   214 				this.setNewEffect();
   224 				this.setNewEffect();
   215 			} else if (this.endEffecFunc != undefined && this.endEffecFunc != null) {
       
   216 				// Call the end callback
       
   217 				this.endEffecFunc();
       
   218 				this.endEffecFunc = null;
       
   219 			}
   225 			}
   220 		}	
   226 		}	
   221 	};
   227 	};
   222 
   228 
   223 	this.drawSquare = function(fullEffect, image, effectInfo)
   229 	this.drawSquare = function(fullEffect, image, effectInfo)