fix event handlers and split panel resize event
This commit is contained in:
parent
3f90e96c3a
commit
da9e5dbb29
27 changed files with 722 additions and 118 deletions
|
|
@ -39,7 +39,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
tooltip: 'Add',
|
||||
type: 'image'
|
||||
}).bindEvent({
|
||||
click: function(event, data) {
|
||||
click: function(data) {
|
||||
that.triggerEvent('add', {value: ''});
|
||||
}
|
||||
})
|
||||
|
|
@ -72,13 +72,13 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
//reset in/out points
|
||||
selectAnnotation({}, {ids: [item.id]});
|
||||
},
|
||||
open: function(event, data) {
|
||||
open: function(data) {
|
||||
if (data.ids.length == 1) {
|
||||
var pos = Ox.getPositionById(self.$annotations.options('items'), data.ids[0]);
|
||||
self.$annotations.editItem(pos);
|
||||
}
|
||||
},
|
||||
remove: function(event, data) {
|
||||
remove: function(data) {
|
||||
that.triggerEvent('remove', data);
|
||||
},
|
||||
select: selectAnnotation,
|
||||
|
|
@ -100,7 +100,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
.appendTo(self.$annotations);
|
||||
});
|
||||
*/
|
||||
function selectAnnotation(event, data) {
|
||||
function selectAnnotation(data) {
|
||||
var item = Ox.getObjectById(self.options.items, data.ids[0]);
|
||||
item && that.triggerEvent('select', {
|
||||
'in': item['in'],
|
||||
|
|
@ -108,7 +108,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
'layer': self.options.id
|
||||
});
|
||||
}
|
||||
function updateAnnotation(event, data) {
|
||||
function updateAnnotation(data) {
|
||||
var item = Ox.getObjectById(self.options.items, data.id);
|
||||
item.value = data.value;
|
||||
that.triggerEvent('submit', item);
|
||||
|
|
|
|||
|
|
@ -267,26 +267,26 @@ Ox.VideoEditor = function(options, self) {
|
|||
}, layer)
|
||||
)
|
||||
.bindEvent({
|
||||
add: function(event, data) {
|
||||
add: function(data) {
|
||||
data.layer = layer.id;
|
||||
data['in'] = self.options['in'];
|
||||
data.out = self.options.out;
|
||||
that.triggerEvent('addannotation', data);
|
||||
},
|
||||
remove: function(event, data) {
|
||||
remove: function(data) {
|
||||
data = {
|
||||
ids: [data],
|
||||
layer: layer.id
|
||||
};
|
||||
that.triggerEvent('removeannotations', data);
|
||||
},
|
||||
select: function(event, data) {
|
||||
select: function(data) {
|
||||
self.options.layers.forEach(function(l, j) { // fixme: l? j?
|
||||
if(l.id != layer.id) {
|
||||
self.$annotationPanel[j].deselectItems();
|
||||
}
|
||||
});
|
||||
selectAnnotation(event, data);
|
||||
selectAnnotation(data);
|
||||
},
|
||||
submit: updateAnnotation
|
||||
});
|
||||
|
|
@ -852,13 +852,13 @@ Ox.VideoEditor = function(options, self) {
|
|||
self.$player[0].playInToOut();
|
||||
}
|
||||
|
||||
function resizeAnnotations(event, data) {
|
||||
self.options.annotationsSize = data;
|
||||
function resizeAnnotations(data) {
|
||||
self.options.annotationsSize = data.size;
|
||||
setSizes();
|
||||
}
|
||||
|
||||
function resizeEditor(event, data) {
|
||||
var width = data - 2 * margin + 100;
|
||||
function resizeEditor(data) {
|
||||
var width = data.size - 2 * margin + 100;
|
||||
resizeVideoPlayers(width);
|
||||
$timelineLarge.options({
|
||||
width: width
|
||||
|
|
@ -881,12 +881,12 @@ Ox.VideoEditor = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function selectAnnotation(event, data) {
|
||||
function selectAnnotation(data) {
|
||||
setPosition(data['in']);
|
||||
setPoint('in', data['in']);
|
||||
setPoint('out', data.out);
|
||||
}
|
||||
function updateAnnotation(event, data) {
|
||||
function updateAnnotation(data) {
|
||||
data['in'] = self.options['in'];
|
||||
data.out = self.options.out;
|
||||
that.triggerEvent('updateannotation', data);
|
||||
|
|
@ -983,7 +983,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
function toggleAnnotations(event, data) {
|
||||
function toggleAnnotations(data) {
|
||||
self.options.showAnnotations = !data.collapsed;
|
||||
setSizes();
|
||||
that.triggerEvent('toggleannotations', {
|
||||
|
|
|
|||
|
|
@ -251,11 +251,11 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function paused(event, data) {
|
||||
function paused() {
|
||||
self.$playButton.toggleTitle();
|
||||
}
|
||||
|
||||
function playing(event, data) {
|
||||
function playing(data) {
|
||||
self.options.position = data.position;
|
||||
setMarkers();
|
||||
setSubtitle();
|
||||
|
|
@ -365,7 +365,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
self.video.paused ? that.play() : that.pause();
|
||||
}
|
||||
|
||||
function toggleSize(event, data) {
|
||||
function toggleSize(data) {
|
||||
self.options.size = data.id
|
||||
that.triggerEvent('togglesize', {
|
||||
size: self.options.size
|
||||
|
|
|
|||
|
|
@ -182,9 +182,9 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
self.options.annotationsSize - 16 - 1;
|
||||
}
|
||||
|
||||
function resizeAnnotations(event, data) {
|
||||
function resizeAnnotations(data) {
|
||||
// called on annotations resize
|
||||
self.options.annotationsSize = data;
|
||||
self.options.annotationsSize = data.size;
|
||||
self.$video.options({
|
||||
width: getPlayerWidth()
|
||||
});
|
||||
|
|
@ -193,22 +193,22 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function resizeendAnnotations(event, data) {
|
||||
self.options.annotationsSize = data;
|
||||
function resizeendAnnotations(data) {
|
||||
self.options.annotationsSize = data.size;
|
||||
that.triggerEvent('resizeannotations', {
|
||||
annotationsSize: self.options.annotationsSize
|
||||
});
|
||||
}
|
||||
|
||||
function resizeElement(event, data) {
|
||||
function resizeElement(data) {
|
||||
// called on browser toggle
|
||||
self.options.height = data;
|
||||
self.options.height = data.size;
|
||||
self.$video.options({
|
||||
height: getPlayerHeight()
|
||||
});
|
||||
}
|
||||
|
||||
function resizePanel(event, data) {
|
||||
function resizePanel(data) {
|
||||
// called on annotations toggle
|
||||
self.$video.options({
|
||||
width: getPlayerWidth()
|
||||
|
|
@ -218,7 +218,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function setPosition(event, data) {
|
||||
function setPosition(data) {
|
||||
self.options.position = data.position;
|
||||
//self.$video.position(self.options.position);
|
||||
self.$timeline.options({
|
||||
|
|
@ -226,7 +226,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function toggleAnnotations(event, data) {
|
||||
function toggleAnnotations(data) {
|
||||
self.options.showAnnotations = !data.collapsed;
|
||||
self.$video.options({
|
||||
height: getPlayerHeight()
|
||||
|
|
@ -236,7 +236,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function toggleControls(event, data) {
|
||||
function toggleControls(data) {
|
||||
self.options.showControls = !data.collapsed;
|
||||
self.$video.options({
|
||||
height: getPlayerHeight()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue