mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
3d7342bc4c
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@44445 467b73ca-7a2a-4603-9d3b-597d59a354a9
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
/**
|
|
* @author Mateusz
|
|
*/
|
|
ImageEditor.Main = {
|
|
initialize: function(imageFile) {
|
|
imageFile += '1234';
|
|
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();
|
|
this.originalImageFile = imageFile;
|
|
this.tottalyOriginalImageFile = imageFile;
|
|
this.onSaveClick = ImageEditor.Main.onSaveClick.bind(this);
|
|
this.onCloseClick = ImageEditor.Main.onCloseClick.bind(this);
|
|
Event.observe($('SaveButton'),'click',this.onSaveClick);
|
|
Event.observe($('ExitButton'),'click',this.onCloseClick);
|
|
Element.hide($('CurrentAction'));
|
|
},
|
|
|
|
onSaveClick: function() {
|
|
if(this.tottalyOriginalImageFile != $('image').src) {
|
|
ImageEditor.imageTransformation.save(this.tottalyOriginalImageFile,$('image').src,this.onCloseClick);
|
|
} else {
|
|
this.onCloseClick();
|
|
}
|
|
},
|
|
|
|
onCloseClick: function() {
|
|
window.parent.imageEditorClosed();
|
|
ImageEditor.imageTransformation.close(ImageEditor.Main.onCloseCallback.bind(this));
|
|
},
|
|
|
|
onCloseCallback: function() {
|
|
Element.hide(window.frameElement);
|
|
}
|
|
|
|
}
|
|
|