fix bugs in video editor

This commit is contained in:
rlx 2011-12-23 06:08:41 +00:00
parent e719b6d219
commit e2529916b3
3 changed files with 24 additions and 22 deletions

View file

@ -1338,7 +1338,7 @@ Ox.Input_ = function(options, self) {
that.$input.forEach(function(v, i) { that.$input.forEach(function(v, i) {
v.val(''); v.val('');
}); });
that.$input[0].focusInput(true); that.$input[0].focusInput();
} }
function height(value) { function height(value) {

View file

@ -318,9 +318,11 @@ Ox.VideoEditor = function(options, self) {
that.triggerEvent('removeannotations', data); that.triggerEvent('removeannotations', data);
}, },
select: function(data) { select: function(data) {
self.options.layers.forEach(function(l, j) { // fixme: l? j? self.options.layers.forEach(function(layer_, i_) {
if(l.id != layer.id) { if (i_ != i) {
self.$annotationPanel[j].deselectItems(); // FIXME: the way AnnotationPanel is set up,
// it does not actually have that method
// self.$annotationPanel[i_].deselectItems();
} }
}); });
selectAnnotation(data); selectAnnotation(data);
@ -562,7 +564,6 @@ Ox.VideoEditor = function(options, self) {
} }
}) })
.appendTo(self.$videobar); .appendTo(self.$videobar);
//self.$findInput.find('input').css({background: 'rgb(48, 48, 48)'});
self.$findButton = Ox.Button({ self.$findButton = Ox.Button({
//disabled: true, //disabled: true,
@ -618,17 +619,17 @@ Ox.VideoEditor = function(options, self) {
size: 16 size: 16
}).addClass('OxVideoPlayer'); }).addClass('OxVideoPlayer');
self.$annotationsMenuButton = Ox.Select({ self.$annotationsMenuButton = Ox.MenuButton({
items: [ items: [
{id: 'annotations', title: 'Show Annotations', disabled: true}, {id: 'annotations', title: 'Show Annotations', disabled: true},
{id: 'showAnnotationsAtPosition', title: 'At Current Position', checked: true, disabled: true}, {id: 'showAnnotationsAtPosition', title: 'At Current Position', checked: true},
{id: 'showAnnotationsInSelection', title: 'In Current Selection', disabled: true}, {id: 'showAnnotationsInSelection', title: 'In Current Selection'},
{id: 'showAllAnnotations', title: 'All', disabled: true}, {id: 'showAllAnnotations', title: 'All'},
{}, {},
{id: 'textSize', title: 'Font Size', disabled: true}, {id: 'textSize', title: 'Font Size', disabled: true},
{id: 'smallText', title: 'Small', checked: true, disabled: true}, {id: 'smallText', title: 'Small', checked: true},
{id: 'mediumText', title: 'Medium', disabled: true}, {id: 'mediumText', title: 'Medium'},
{id: 'largeText', title: 'Large', disabled: true} {id: 'largeText', title: 'Large'}
], ],
max: 2, max: 2,
title: 'set', title: 'set',
@ -989,7 +990,9 @@ Ox.VideoEditor = function(options, self) {
function submitFindInput(value, hasPressedEnter) { function submitFindInput(value, hasPressedEnter) {
self.options.find = value; self.options.find = value;
self.results = find(self.options.find); self.results = find(self.options.find);
self.$results.css({opacity: self.results.length ? 1 : 0.25}).html(self.results.length); self.$results
.css({opacity: self.results.length ? 1 : 0.25})
.html(self.results.length);
self.$previousButton.options({ self.$previousButton.options({
disabled: self.results.length <= 1 disabled: self.results.length <= 1
}); });
@ -999,16 +1002,13 @@ Ox.VideoEditor = function(options, self) {
self.$clearButton.options({ self.$clearButton.options({
disabled: !self.options.find disabled: !self.options.find
}); });
self.$timeline[0].options({ self.$player.forEach(function($player) {
find: self.options.find, $player.options({find: self.options.find});
}); });
self.$timeline[1].options({ self.$timeline.forEach(function($timeline) {
find: self.options.find, $timeline.options({find: self.options.find});
results: self.results
});
self.$findInput.find('input').css({
opacity: self.results.length ? 1 : 0.25
}); });
self.$timeline[1].options({results: self.results});
if (hasPressedEnter) { if (hasPressedEnter) {
that.triggerEvent('find', {find: self.options.find}); that.triggerEvent('find', {find: self.options.find});
if (self.results.length) { if (self.results.length) {

View file

@ -2265,7 +2265,9 @@ Ox.VideoPlayer = function(options, self) {
} }
self.setOption = function(key, value) { self.setOption = function(key, value) {
if (key == 'fullscreen') { if (key == 'find') {
setSubtitleText();
} else if (key == 'fullscreen') {
toggleFullscreen(); toggleFullscreen();
} else if (key == 'height' || key == 'width') { } else if (key == 'height' || key == 'width') {
setSizes(); setSizes();