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) {
v.val('');
});
that.$input[0].focusInput(true);
that.$input[0].focusInput();
}
function height(value) {

View file

@ -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) {

View file

@ -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();