From 376c3deb34df982d6a859ae7b39a03cbd55b64f3 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 18 Sep 2010 12:15:09 +0000 Subject: [PATCH] update large timeline tooltip while playing --- build/js/ox.ui.js | 91 ++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 908bdd8..35275cc 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -6111,30 +6111,32 @@ requires function emptyFirstPage() { Ox.print('emptyFirstPage', self.$pages); - self.$pages[0].find('.OxEmpty').remove(); + self.$pages[0] && self.$pages[0].find('.OxEmpty').remove(); } function fillFirstPage() { - var height = getHeight(), - lastItemHeight = height % self.options.itemHeight || self.options.itemHeight, - visibleItems = Math.ceil(height / self.options.itemHeight); - if (self.$items.length < visibleItems) { - $.each(Ox.range(self.$items.length, visibleItems), function(i, v) { - var $item = new Ox.ListItem({ - construct: self.options.construct, - data: {}, - id: '', - position: v - }); - $item.addClass('OxEmpty').removeClass('OxTarget'); - if (v == visibleItems - 1) { - $item.$element.css({ - height: lastItemHeight + 'px', - overflowY: 'hidden' - }); - } - $item.appendTo(self.$pages[0]); - }); + if (self.$pages[0]) { + var height = getHeight(), + lastItemHeight = height % self.options.itemHeight || self.options.itemHeight, + visibleItems = Math.ceil(height / self.options.itemHeight); + if (self.$items.length < visibleItems) { + $.each(Ox.range(self.$items.length, visibleItems), function(i, v) { + var $item = new Ox.ListItem({ + construct: self.options.construct, + data: {}, + id: '', + position: v + }); + $item.addClass('OxEmpty').removeClass('OxTarget'); + if (v == visibleItems - 1) { + $item.$element.css({ + height: lastItemHeight + 'px', + overflowY: 'hidden' + }); + } + $item.appendTo(self.$pages[0]); + }); + } } } @@ -9107,16 +9109,9 @@ requires } function mousemove(e) { - var position = self.options.position + (e.clientX - that.offset().left - self.center) / self.fps; - if (position >= 0 && position <= self.options.duration) { - self.$tooltip - .options({ - title: Ox.formatDuration(position, 3) - }) - .show(e.clientX, e.clientY); - } else { - self.$tooltip.hide(); - } + self.clientX = e.clientX; + self.clientY = e.clientY; + updateTooltip(); } function setMarkerPoint(i) { @@ -9149,6 +9144,7 @@ requires .appendTo(self.$timeline); } }); + updateTooltip(); } function setWidth() { @@ -9162,6 +9158,19 @@ requires setMarker(); } + function updateTooltip() { + var position = self.options.position + (self.clientX - that.offset().left - self.center) / self.fps; + if (position >= 0 && position <= self.options.duration) { + self.$tooltip + .options({ + title: Ox.formatDuration(position, 3) + }) + .show(self.clientX, self.clientY); + } else { + self.$tooltip.hide(); + } + } + self.onChange = function(key, value) { if (key == 'points') { setMarkerPoint(0); @@ -9303,7 +9312,7 @@ requires imageData = context.createImageData(width, height), data = imageData.data; $.each(self.options.subtitles, function(i, v) { - var color = matches.indexOf(i) > -1 ? [255, 255, 0] : [255, 255, 255] + var color = self.options.matches.indexOf(i) > -1 ? [255, 255, 0] : [255, 255, 255] $.each(Ox.range( Math.round(v['in']), Math.round(v['out']) + 1 @@ -9574,17 +9583,15 @@ requires that.addEvent({ key_alt_left: function() { - movePositionBy(-0.04); - }, - key_alt_right: function() { - movePositionBy(0.04); - }, - key_alt_shift_left: function() { movePositionTo('cut', -1); }, - key_alt_shift_right: function() { + key_alt_right: function() { movePositionTo('cut', 1); }, + key_alt_shift_left: function() { + }, + key_alt_shift_right: function() { + }, key_closebracket: function() { goToPoint('out'); }, @@ -9624,10 +9631,12 @@ requires movePositionBy(self.options.duration); }, key_shift_left: function() { - movePositionBy(-60); + movePositionBy(-0.04); + //movePositionBy(-60); }, key_shift_right: function() { - movePositionBy(60); + movePositionBy(0.04); + //movePositionBy(60); }, key_shift_up: function() { movePositionBy(-self.options.duration);