2007-09-15 03:08:25 +02:00
|
|
|
/**
|
|
|
|
* @author Mateusz
|
|
|
|
*/
|
2007-10-03 01:26:35 +02:00
|
|
|
ImageEditor.Main = {
|
2007-09-15 03:08:25 +02:00
|
|
|
initialize: function(imageFile) {
|
2007-09-15 03:19:43 +02:00
|
|
|
imageFile += '1234';
|
2007-10-03 01:26:35 +02:00
|
|
|
ImageEditor.crop = null;
|
|
|
|
ImageEditor.imageHistory = new ImageEditor.ImageHistory.initialize();
|
|
|
|
ImageEditor.environment = new ImageEditor.Environment.initialize(imageFile);
|
|
|
|
ImageEditor.imageTransformation = new ImageEditor.ImageTransformation.initialize();
|
|
|
|
ImageEditor.resize = new ImageEditor.Resize.initialize($('imageContainer'));
|
|
|
|
ImageEditor.effects = new ImageEditor.Effects.initialize();
|
|
|
|
ImageEditor.crop = new ImageEditor.Crop.initialize();
|
|
|
|
ImageEditor.documentBody = new ImageEditor.DocumentBody.initialize();
|
2007-09-15 03:08:25 +02:00
|
|
|
this.originalImageFile = imageFile;
|
|
|
|
this.tottalyOriginalImageFile = imageFile;
|
2007-10-03 01:26:35 +02:00
|
|
|
this.onSaveClick = ImageEditor.Main.onSaveClick.bind(this);
|
|
|
|
this.onCloseClick = ImageEditor.Main.onCloseClick.bind(this);
|
2007-09-16 04:23:10 +02:00
|
|
|
Event.observe($('SaveButton'),'click',this.onSaveClick);
|
|
|
|
Event.observe($('ExitButton'),'click',this.onCloseClick);
|
|
|
|
Element.hide($('CurrentAction'));
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
2007-10-03 01:26:35 +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-10-03 01:26:35 +02:00
|
|
|
ImageEditor.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-11-07 05:50:09 +01:00
|
|
|
window.parent.imageEditorClosed();
|
2007-10-03 01:26:35 +02:00
|
|
|
ImageEditor.imageTransformation.close(ImageEditor.Main.onCloseCallback.bind(this));
|
2007-09-15 22:53:26 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
onCloseCallback: function() {
|
|
|
|
Element.hide(window.frameElement);
|
|
|
|
}
|
|
|
|
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|
2007-09-15 03:19:43 +02:00
|
|
|
|