edit annotations

This commit is contained in:
j 2011-06-15 16:36:01 +02:00
parent e7b947c1ca
commit 218eeaf47a
4 changed files with 24 additions and 11 deletions

View file

@ -1390,6 +1390,7 @@ Ox.List = function(options, self) {
width: width
}).bindEvent({
cancel: cancel,
remove: remove,
save: submit
}).appendTo($item.$element);
/*
@ -1400,7 +1401,11 @@ Ox.List = function(options, self) {
*/
function cancel() {
$item.options('data', item);
//fixme: trigger event to reset i/o points
that.triggerEvent('cancel', item);
loadItems();
}
function remove() {
that.triggerEvent('remove', item.id);
}
function submit(event, data) {
item.value = data.value;
@ -1408,6 +1413,7 @@ Ox.List = function(options, self) {
// fixme: leaky, inputs remain in focus stack
$item.options('data', item);
that.triggerEvent('submit', item);
loadItems();
}
}

View file

@ -204,6 +204,9 @@ Ox.TextList = function(options, self) {
edit: function(data) {
that.editCell(data.id, data.key);
},
cancel: function(data) {
Ox.print('cancel edit', data);
},
init: function(data) {
// fixme: why does this never reach?
//Ox.print('INIT????')

View file

@ -68,8 +68,9 @@ Ox.AnnotationPanel = function(options, self) {
unique: 'id'
})
.bindEvent({
cancel: function() {
cancel: function(item) {
//reset in/out points
selectAnnotation({}, {ids: [item.id]});
},
open: function(event, data) {
if (data.ids.length == 1) {
@ -77,7 +78,7 @@ Ox.AnnotationPanel = function(options, self) {
self.$annotations.editItem(pos);
}
},
'remove': function(event, data) {
remove: function(event, data) {
that.triggerEvent('remove', data);
},
select: selectAnnotation,
@ -101,7 +102,7 @@ Ox.AnnotationPanel = function(options, self) {
*/
function selectAnnotation(event, data) {
var item = Ox.getObjectById(self.options.items, data.ids[0]);
that.triggerEvent('select', {
item && that.triggerEvent('select', {
'in': item['in'],
'out': item.out,
'layer': self.options.id
@ -125,14 +126,14 @@ Ox.AnnotationPanel = function(options, self) {
self.options.items.splice(pos, 0, item);
self.$annotations.addItems(pos, [item]);
self.$annotations.editItem(pos);
}
};
/*@
removeItems <f> removeItems
@*/
that.removeItems = function(ids) {
self.$annotations.removeItems(ids);
}
};
/*@
deselectItems <f> deselectItems

View file

@ -268,8 +268,11 @@ Ox.VideoEditor = function(options, self) {
data.out = self.options.out;
that.triggerEvent('addAnnotation', data);
},
'delete': function(event, data) {
data.layer = layer.id;
remove: function(event, data) {
data = {
ids: [data],
layer: layer.id
};
that.triggerEvent('removeAnnotations', data);
},
select: function(event, data) {
@ -872,8 +875,8 @@ Ox.VideoEditor = function(options, self) {
setPoint('out', data.out);
}
function updateAnnotation(event, data) {
data['in'] = self.options.points[0];
data.out = self.options.points[1];
data['in'] = self.options['in'];
data.out = self.options.out;
that.triggerEvent('updateAnnotation', data);
}