From e2529916b3df66f2279e7dc2787acb14359bfd00 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 23 Dec 2011 06:08:41 +0000 Subject: [PATCH] fix bugs in video editor --- source/Ox.UI/js/Form/Ox.Input.js | 2 +- source/Ox.UI/js/Video/Ox.VideoEditor.js | 40 ++++++++++++------------- source/Ox.UI/js/Video/Ox.VideoPlayer.js | 4 ++- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index 3190c847..8d825eed 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -1338,7 +1338,7 @@ Ox.Input_ = function(options, self) { that.$input.forEach(function(v, i) { v.val(''); }); - that.$input[0].focusInput(true); + that.$input[0].focusInput(); } function height(value) { diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 5a97b031..683f76bf 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -318,9 +318,11 @@ Ox.VideoEditor = function(options, self) { that.triggerEvent('removeannotations', data); }, select: function(data) { - self.options.layers.forEach(function(l, j) { // fixme: l? j? - if(l.id != layer.id) { - self.$annotationPanel[j].deselectItems(); + self.options.layers.forEach(function(layer_, i_) { + if (i_ != i) { + // FIXME: the way AnnotationPanel is set up, + // it does not actually have that method + // self.$annotationPanel[i_].deselectItems(); } }); selectAnnotation(data); @@ -562,7 +564,6 @@ Ox.VideoEditor = function(options, self) { } }) .appendTo(self.$videobar); - //self.$findInput.find('input').css({background: 'rgb(48, 48, 48)'}); self.$findButton = Ox.Button({ //disabled: true, @@ -618,17 +619,17 @@ Ox.VideoEditor = function(options, self) { size: 16 }).addClass('OxVideoPlayer'); - self.$annotationsMenuButton = Ox.Select({ + self.$annotationsMenuButton = Ox.MenuButton({ items: [ {id: 'annotations', title: 'Show Annotations', disabled: true}, - {id: 'showAnnotationsAtPosition', title: 'At Current Position', checked: true, disabled: true}, - {id: 'showAnnotationsInSelection', title: 'In Current Selection', disabled: true}, - {id: 'showAllAnnotations', title: 'All', disabled: true}, + {id: 'showAnnotationsAtPosition', title: 'At Current Position', checked: true}, + {id: 'showAnnotationsInSelection', title: 'In Current Selection'}, + {id: 'showAllAnnotations', title: 'All'}, {}, {id: 'textSize', title: 'Font Size', disabled: true}, - {id: 'smallText', title: 'Small', checked: true, disabled: true}, - {id: 'mediumText', title: 'Medium', disabled: true}, - {id: 'largeText', title: 'Large', disabled: true} + {id: 'smallText', title: 'Small', checked: true}, + {id: 'mediumText', title: 'Medium'}, + {id: 'largeText', title: 'Large'} ], max: 2, title: 'set', @@ -989,7 +990,9 @@ Ox.VideoEditor = function(options, self) { function submitFindInput(value, hasPressedEnter) { self.options.find = value; 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({ disabled: self.results.length <= 1 }); @@ -999,16 +1002,13 @@ Ox.VideoEditor = function(options, self) { self.$clearButton.options({ disabled: !self.options.find }); - self.$timeline[0].options({ - find: self.options.find, + self.$player.forEach(function($player) { + $player.options({find: self.options.find}); }); - self.$timeline[1].options({ - find: self.options.find, - results: self.results - }); - self.$findInput.find('input').css({ - opacity: self.results.length ? 1 : 0.25 + self.$timeline.forEach(function($timeline) { + $timeline.options({find: self.options.find}); }); + self.$timeline[1].options({results: self.results}); if (hasPressedEnter) { that.triggerEvent('find', {find: self.options.find}); if (self.results.length) { diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index fd65181f..4171af0a 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -2265,7 +2265,9 @@ Ox.VideoPlayer = function(options, self) { } self.setOption = function(key, value) { - if (key == 'fullscreen') { + if (key == 'find') { + setSubtitleText(); + } else if (key == 'fullscreen') { toggleFullscreen(); } else if (key == 'height' || key == 'width') { setSizes();