update video editor / annotation panel

This commit is contained in:
rlx 2012-01-03 15:56:15 +05:30
commit 815ae5d253
4 changed files with 35 additions and 25 deletions

View file

@ -323,11 +323,10 @@ Ox.VideoEditor = function(options, self) {
that.triggerEvent('addannotation', data);
},
remove: function(data) {
data = {
ids: [data],
that.triggerEvent('removeannotation', {
id: data.id,
layer: layer.id
};
that.triggerEvent('removeannotations', data);
});
},
select: function(data) {
self.options.layers.forEach(function(layer_, i_) {
@ -339,7 +338,7 @@ Ox.VideoEditor = function(options, self) {
});
selectAnnotation(data);
},
submit: updateAnnotation
submit: editAnnotation
})
.appendTo(self.$annotations);
});
@ -714,6 +713,12 @@ Ox.VideoEditor = function(options, self) {
submitFindInput(self.options.find, true);
}, 0);
function editAnnotation(data) {
data['in'] = self.options['in'];
data.out = self.options.out;
that.triggerEvent('editannotation', data);
}
function find(query) {
var results = [];
if (query.length) {
@ -910,11 +915,6 @@ Ox.VideoEditor = function(options, self) {
setPoint('in', data['in']);
setPoint('out', data.out);
}
function updateAnnotation(data) {
data['in'] = self.options['in'];
data.out = self.options.out;
that.triggerEvent('updateannotation', data);
}
function select(type) {
self.options.points = getPoints(type);
@ -1075,14 +1075,14 @@ Ox.VideoEditor = function(options, self) {
};
/*@
removeAnnotations <f> add annotation
removeAnnotation <f> remove annotation
(layer, ids) -> <o> remove annotation from layer
layer <s> layer id
ids <a> array of item ids to remove
@*/
that.removeAnnotations = function(layer, ids) {
that.removeAnnotation = function(layer, id) {
var i = Ox.getPositionById(self.options.layers, layer);
self.$annotationPanel[i].removeItems(ids);
self.$annotationPanel[i].removeItem(id);
};
return that;