Subversion Repositories SmartDukaan

Rev

Rev 1035 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1035 Rev 1254
Line 157... Line 157...
157
			// also need better passing values between functions - to FIX (remove _temp and _img at all)
157
			// also need better passing values between functions - to FIX (remove _temp and _img at all)
158
			this._temp = this._img;
158
			this._temp = this._img;
159
			this._BindEvents(img,this._parameters.bind);
159
			this._BindEvents(img,this._parameters.bind);
160
			this._rotate(this._parameters.angle);
160
			this._rotate(this._parameters.angle);
161
			if (this._parameters.angle!=this._parameters.animateAngle) this.rotateAnimation(this._parameters);
161
			if (this._parameters.angle!=this._parameters.animateAngle) this.rotateAnimation(this._parameters);
162
		}
162
		};
163
	} else {
163
	} else {
164
		return function(img,parameters) {
164
		return function(img,parameters) {
165
			setupParameters.call(this,img,parameters);			
165
			setupParameters.call(this,img,parameters);			
166
			// Make sure that class and id are also copied - just in case you would like to refeer to an newly created object
166
			// Make sure that class and id are also copied - just in case you would like to refeer to an newly created object
167
			this._parameters.className=img.className;
167
			this._parameters.className=img.className;
Line 183... Line 183...
183
				jQuery(this._img).bind("load", function()
183
				jQuery(this._img).bind("load", function()
184
				{
184
				{
185
					self._Loader();
185
					self._Loader();
186
				});
186
				});
187
			}
187
			}
188
		}
188
		};
189
	}
189
	}
190
})();
190
})();
191
 
191
 
192
Wilq32.PhotoEffect.prototype={
192
Wilq32.PhotoEffect.prototype={
193
 
193
 
Line 240... Line 240...
240
			this._temp.className=this._parameters.className;			
240
			this._temp.className=this._parameters.className;			
241
			
241
			
242
			this._BindEvents(this._temp,this._parameters.bind);
242
			this._BindEvents(this._temp,this._parameters.bind);
243
			_finally.call(this);
243
			_finally.call(this);
244
			
244
			
245
		}
245
		};
246
		else
246
		else
247
		return function ()
247
		return function ()
248
		{
248
		{
249
			this._temp.setAttribute('id',this._parameters.id);
249
			this._temp.setAttribute('id',this._parameters.id);
250
			this._temp.className=this._parameters.className;
250
			this._temp.className=this._parameters.className;
Line 276... Line 276...
276
			this._temp.style.height=this._height+"px";
276
			this._temp.style.height=this._height+"px";
277
			
277
			
278
			this._BindEvents(this._canvas,this._parameters.bind);
278
			this._BindEvents(this._canvas,this._parameters.bind);
279
			this._cnv=this._canvas.getContext('2d');
279
			this._cnv=this._canvas.getContext('2d');
280
			_finally.call(this);
280
			_finally.call(this);
281
		}
281
		};
282
		function _finally(){
282
		function _finally(){
283
			this._rotate(this._parameters.angle);
283
			this._rotate(this._parameters.angle);
284
			if (this._parameters.angle!=this._parameters.animateAngle) this.rotateAnimation(this._parameters);		
284
			if (this._parameters.angle!=this._parameters.animateAngle) this.rotateAnimation(this._parameters);		
285
		}
285
		}
286
 
286
 
Line 328... Line 328...
328
		var rad = Math.PI/180;
328
		var rad = Math.PI/180;
329
		if (IE)
329
		if (IE)
330
		return function(angle)
330
		return function(angle)
331
		{
331
		{
332
			this._container.style.rotation=angle+"deg";
332
			this._container.style.rotation=angle+"deg";
333
		}
333
		};
334
		else if (supportedCSS)
334
		else if (supportedCSS)
335
		return function(angle){
335
		return function(angle){
336
			this._img.style[supportedCSS]="rotate("+angle+"deg)";
336
			this._img.style[supportedCSS]="rotate("+angle+"deg)";
337
		}
337
		};
338
		else 
338
		else 
339
		return function(angle)
339
		return function(angle)
340
		{
340
		{
341
 
341
 
342
			if (!this._img.width||typeof angle!="number") return;
342
			if (!this._img.width||typeof angle!="number") return;
Line 352... Line 352...
352
			this._cnv.translate(this._widthAddHalf,this._heightAddHalf);	// at least center image on screen
352
			this._cnv.translate(this._widthAddHalf,this._heightAddHalf);	// at least center image on screen
353
			this._cnv.translate(this._widthHalf,this._heightHalf);			// we move image back to its orginal 
353
			this._cnv.translate(this._widthHalf,this._heightHalf);			// we move image back to its orginal 
354
			this._cnv.rotate(angle);										// rotate image
354
			this._cnv.rotate(angle);										// rotate image
355
			this._cnv.translate(-this._widthHalf,-this._heightHalf);		// move image to its center, so we can rotate around its center
355
			this._cnv.translate(-this._widthHalf,-this._heightHalf);		// move image to its center, so we can rotate around its center
356
			this._cnv.drawImage(this._img, 0, 0);							// First - we draw image
356
			this._cnv.drawImage(this._img, 0, 0);							// First - we draw image
357
		}
357
		};
358
 
358
 
359
	})()
359
	})()
360
}
360
};
361
 
361
 
362
if (IE)
362
if (IE)
363
{
363
{
364
Wilq32.PhotoEffect.prototype.createVMLNode=(function(){
364
Wilq32.PhotoEffect.prototype.createVMLNode=(function(){
365
document.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
365
document.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");