silverstripe-cms/javascript/ImageEditor/ImageEditor.js
Ingo Schommer 31a9fbee3c mujma: Fixed various browser compatibility problems. Now should work on Safari 3.0.2 /Windows, FF 1.5/2.0 Windows/Linux.
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41891 467b73ca-7a2a-4603-9d3b-597d59a354a9
2007-09-15 01:19:43 +00:00

39 lines
1.1 KiB
JavaScript

/**
* @author Mateusz
*/
var ImageEditor = {
initialize: function(imageFile) {
imageFile += '1234';
crop = null;
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);
imageToResize.onImageLoad();
resize.imageContainerResize.placeClickBox();
},
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);
imageTransformation.close();
}
}