1
0
Fork 0
forked from 0x2620/oxjs

self.setOption ~> that.update

This commit is contained in:
j 2012-05-28 19:35:41 +00:00
commit 005d50c389
56 changed files with 919 additions and 933 deletions

View file

@ -65,6 +65,34 @@ Ox.VideoEditor = function(options, self) {
width: 0
})
.options(options || {})
.update({
height: setSizes,
'in': function() {
setPoint('in', self.options['in']);
},
out: function() {
setPoint('out', self.options.out);
},
paused: function() {
self.$player[0].options({
paused: self.options.paused
});
},
position: function() {
setPosition(self.options.position);
},
selected: function() {
selectAnnotation(
self.options.selected
? Ox.getObjectById(self.annotations, self.options.selected)
: {id: ''}
);
},
showAnnotations: function() {
that.$element.toggle(1);
},
width: setSizes
})
.bindEvent({
key_0: toggleMuted,
key_alt_left: function() {
@ -1389,26 +1417,6 @@ Ox.VideoEditor = function(options, self) {
});
}
self.setOption = function(key, value) {
if (key == 'height' || key == 'width') {
setSizes();
} else if (key == 'in' || key == 'out') {
setPoint(key, value);
} else if (key == 'paused') {
self.$player[0].options({
paused: value
});
} else if (key == 'position') {
setPosition(value);
} else if (key == 'selected') {
selectAnnotation(
value ? Ox.getObjectById(self.annotations, value) : {id: ''}
);
} else if (key == 'showAnnotations') {
that.$element.toggle(1);
}
};
/*@
addAnnotation <f> add annotation
(layer, item) -> <o> add annotation to layer