silverstripe-cms/javascript/ImageEditor/Effects.js
Will Rossiter 0ef452c524 FEATURE: merged back patch for image editor. Currently completely broken on trunk this patch does nothing to fix it sadly. I think its a prototype thing
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65351 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 02:04:03 +00:00

35 lines
1.4 KiB
JavaScript

/**
* @author Mateusz
*/
ImageEditor.Effects.Main = {
initialize: function() {
this.enable = ImageEditor.Effects.Main.enable.bind(this);
this.disable = ImageEditor.Effects.Main.disable.bind(this);
this.effects = Array();
this.effects['rotate'] = new ImageEditor.Effects.Base.initialize('rotate');
this.effects['greyscale'] = new ImageEditor.Effects.Base.initialize('greyscale');
this.effects['sepia'] = new ImageEditor.Effects.Base.initialize('sepia');
this.effects['blur'] = new ImageEditor.Effects.Base.initialize('blur');
this.effects['adjust-contrast'] = new ImageEditor.Effects.AdjustBase.initialize('adjust-contrast',$R(-100, 100),0.1,62);
this.effects['adjust-brightness'] = new ImageEditor.Effects.AdjustBase.initialize('adjust-brightness',$R(-255, 255),0.1,160);
this.effects['adjust-gamma'] = new ImageEditor.Effects.AdjustBase.initialize('adjust-gamma',$R(0, 5),1.2,4);
this.getEffect = ImageEditor.Effects.Main.getEffect.bind(this);
},
enable: function() {
for (var name in this.effects) {
if(this.effects.hasOwnProperty(name)) this.effects[name].enable();
}
},
disable: function() {
for (var name in this.effects) {
if(this.effects.hasOwnProperty(name)) this.effects[name].disable();
}
},
getEffect: function(name) {
return this.effects[name];
}
}