2007-09-15 03:08:25 +02:00
|
|
|
/**
|
|
|
|
* @author Mateusz
|
|
|
|
*/
|
|
|
|
|
|
|
|
var ImageEditor = {
|
|
|
|
initialize: function(imageFile) {
|
2007-09-15 03:19:43 +02:00
|
|
|
imageFile += '1234';
|
|
|
|
crop = null;
|
2007-09-15 03:08:25 +02:00
|
|
|
imageHistory = new ImageHistory.initialize();
|
|
|
|
environment = new Environment.initialize(imageFile);
|
|
|
|
imageTransformation = new ImageTransformation.initialize();
|
|
|
|
resize = new Resize.initialize($('imageContainer'));
|
|
|
|
effects = new Effects.initialize();
|
|
|
|
crop = new Crop.initialize();
|
|
|
|
this.originalImageFile = imageFile;
|
|
|
|
this.tottalyOriginalImageFile = imageFile;
|
|
|
|
this.onSave = ImageEditor.onSave.bind(this);
|
|
|
|
this.onClose = ImageEditor.onClose.bind(this);
|
|
|
|
Event.observe($('saveButton'),'click',this.onSave);
|
|
|
|
Event.observe($('closeButton'),'click',this.onClose);
|
2007-09-15 03:19:43 +02:00
|
|
|
imageToResize.onImageLoad();
|
|
|
|
resize.imageContainerResize.placeClickBox();
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
onSave: function() {
|
|
|
|
if(this.tottalyOriginalImageFile != $('image').src) {
|
|
|
|
imageTransformation.save(this.tottalyOriginalImageFile,$('image').src);
|
|
|
|
} else {
|
|
|
|
this.onClose();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onClose: function() {
|
|
|
|
window.parent.frames[1].location.reload(1);
|
|
|
|
Element.hide(window.frameElement);
|
2007-09-15 03:13:18 +02:00
|
|
|
imageTransformation.close();
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|
|
|
|
}
|
2007-09-15 03:19:43 +02:00
|
|
|
|