You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
846 B
38 lines
846 B
(function() {
|
|
'use strict';
|
|
|
|
Darkroom.Transformation = Transformation;
|
|
|
|
function Transformation(options) {
|
|
this.options = options;
|
|
}
|
|
|
|
Transformation.prototype = {
|
|
applyTransformation: function(image) { /* no-op */ }
|
|
}
|
|
|
|
// Inspired by Backbone.js extend capability.
|
|
Transformation.extend = function(protoProps) {
|
|
var parent = this;
|
|
var child;
|
|
|
|
if (protoProps && protoProps.hasOwnProperty('constructor')) {
|
|
child = protoProps.constructor;
|
|
} else {
|
|
child = function(){ return parent.apply(this, arguments); };
|
|
}
|
|
|
|
Darkroom.Utils.extend(child, parent);
|
|
|
|
var Surrogate = function(){ this.constructor = child; };
|
|
Surrogate.prototype = parent.prototype;
|
|
child.prototype = new Surrogate;
|
|
|
|
if (protoProps) Darkroom.Utils.extend(child.prototype, protoProps);
|
|
|
|
child.__super__ = parent.prototype;
|
|
|
|
return child;
|
|
}
|
|
|
|
})();
|