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();
|
2007-09-16 03:30:43 +02:00
|
|
|
documentBody = new DocumentBody.initialize();
|
2007-09-15 03:08:25 +02:00
|
|
|
this.originalImageFile = imageFile;
|
|
|
|
this.tottalyOriginalImageFile = imageFile;
|
2007-09-15 22:53:26 +02:00
|
|
|
this.onSaveClick = ImageEditor.onSaveClick.bind(this);
|
|
|
|
this.onCloseClick = ImageEditor.onCloseClick.bind(this);
|
|
|
|
Event.observe($('saveButton'),'click',this.onSaveClick);
|
2007-09-16 03:30:43 +02:00
|
|
|
Event.observe($('closeButton'),'click',this.onCloseClick);
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
2007-09-15 22:53:26 +02:00
|
|
|
onSaveClick: function() {
|
2007-09-15 03:08:25 +02:00
|
|
|
if(this.tottalyOriginalImageFile != $('image').src) {
|
2007-09-15 22:53:26 +02:00
|
|
|
imageTransformation.save(this.tottalyOriginalImageFile,$('image').src,this.onCloseClick);
|
2007-09-15 03:08:25 +02:00
|
|
|
} else {
|
2007-09-15 22:53:26 +02:00
|
|
|
this.onCloseClick();
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2007-09-15 22:53:26 +02:00
|
|
|
onCloseClick: function() {
|
2007-09-15 22:54:37 +02:00
|
|
|
window.parent.frames[0].location.reload(1);
|
2007-09-15 03:08:25 +02:00
|
|
|
window.parent.frames[1].location.reload(1);
|
2007-09-15 22:53:26 +02:00
|
|
|
imageTransformation.close(ImageEditor.onCloseCallback.bind(this));
|
|
|
|
},
|
|
|
|
|
|
|
|
onCloseCallback: function() {
|
|
|
|
Element.hide(window.frameElement);
|
|
|
|
}
|
|
|
|
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|
2007-09-15 03:19:43 +02:00
|
|
|
|