mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
b0d78ea5bd
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42989 467b73ca-7a2a-4603-9d3b-597d59a354a9
44 lines
1.5 KiB
JavaScript
44 lines
1.5 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.frames[0].location.reload(1);
|
|
window.parent.frames[1].location.reload(1);
|
|
ImageEditor.imageTransformation.close(ImageEditor.Main.onCloseCallback.bind(this));
|
|
},
|
|
|
|
onCloseCallback: function() {
|
|
Element.hide(window.frameElement);
|
|
}
|
|
|
|
}
|
|
|