2007-09-15 03:08:25 +02:00
|
|
|
/**
|
|
|
|
* @author Mateusz
|
|
|
|
*/
|
2007-10-03 01:26:35 +02:00
|
|
|
ImageEditor.Effects = {
|
2007-09-15 03:08:25 +02:00
|
|
|
initialize: function() {
|
2007-10-03 01:26:35 +02:00
|
|
|
this.setListeners = ImageEditor.Effects.setListeners.bind(this);
|
|
|
|
this.rotate = ImageEditor.Effects.rotate.bind(this);
|
2007-09-15 03:31:31 +02:00
|
|
|
this.setListeners();
|
|
|
|
this.isRotateEnabled = true;
|
2007-10-03 01:26:35 +02:00
|
|
|
this.enableRotate = ImageEditor.Effects.enableRotate.bind(this);
|
|
|
|
this.disableRotate = ImageEditor.Effects.disableRotate.bind(this);
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
rotate: function() {
|
2007-09-15 03:31:31 +02:00
|
|
|
if(this.isRotateEnabled) {
|
2007-10-03 01:26:35 +02:00
|
|
|
ImageEditor.resize.imageContainerResize.disable();
|
|
|
|
ImageEditor.crop.disable();
|
|
|
|
ImageEditor.imageHistory.disable();
|
|
|
|
ImageEditor.imageTransformation.rotate(90,ImageEditor.Effects.rotateCallback.bind(this));
|
2007-09-16 03:30:43 +02:00
|
|
|
this.isRotateEnabled = false;
|
2007-09-15 03:31:31 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
rotateCallback: function() {
|
2007-10-03 01:26:35 +02:00
|
|
|
ImageEditor.resize.imageContainerResize.placeClickBox();
|
2007-09-15 03:31:31 +02:00
|
|
|
this.isRotateEnabled = true;
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
setListeners: function() {
|
2007-09-16 04:23:10 +02:00
|
|
|
Event.observe('RotateButton','click',this.rotate);
|
2007-09-15 03:31:31 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
disableRotate: function() {
|
|
|
|
this.isRotateEnabled = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
enableRotate: function() {
|
|
|
|
this.isRotateEnabled = true;
|
|
|
|
}
|
|
|
|
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|