update large timeline tooltip while playing
This commit is contained in:
parent
3d30983359
commit
50b92ebad5
1 changed files with 50 additions and 41 deletions
|
@ -6111,30 +6111,32 @@ requires
|
||||||
|
|
||||||
function emptyFirstPage() {
|
function emptyFirstPage() {
|
||||||
Ox.print('emptyFirstPage', self.$pages);
|
Ox.print('emptyFirstPage', self.$pages);
|
||||||
self.$pages[0].find('.OxEmpty').remove();
|
self.$pages[0] && self.$pages[0].find('.OxEmpty').remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillFirstPage() {
|
function fillFirstPage() {
|
||||||
var height = getHeight(),
|
if (self.$pages[0]) {
|
||||||
lastItemHeight = height % self.options.itemHeight || self.options.itemHeight,
|
var height = getHeight(),
|
||||||
visibleItems = Math.ceil(height / self.options.itemHeight);
|
lastItemHeight = height % self.options.itemHeight || self.options.itemHeight,
|
||||||
if (self.$items.length < visibleItems) {
|
visibleItems = Math.ceil(height / self.options.itemHeight);
|
||||||
$.each(Ox.range(self.$items.length, visibleItems), function(i, v) {
|
if (self.$items.length < visibleItems) {
|
||||||
var $item = new Ox.ListItem({
|
$.each(Ox.range(self.$items.length, visibleItems), function(i, v) {
|
||||||
construct: self.options.construct,
|
var $item = new Ox.ListItem({
|
||||||
data: {},
|
construct: self.options.construct,
|
||||||
id: '',
|
data: {},
|
||||||
position: v
|
id: '',
|
||||||
});
|
position: v
|
||||||
$item.addClass('OxEmpty').removeClass('OxTarget');
|
});
|
||||||
if (v == visibleItems - 1) {
|
$item.addClass('OxEmpty').removeClass('OxTarget');
|
||||||
$item.$element.css({
|
if (v == visibleItems - 1) {
|
||||||
height: lastItemHeight + 'px',
|
$item.$element.css({
|
||||||
overflowY: 'hidden'
|
height: lastItemHeight + 'px',
|
||||||
});
|
overflowY: 'hidden'
|
||||||
}
|
});
|
||||||
$item.appendTo(self.$pages[0]);
|
}
|
||||||
});
|
$item.appendTo(self.$pages[0]);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9107,16 +9109,9 @@ requires
|
||||||
}
|
}
|
||||||
|
|
||||||
function mousemove(e) {
|
function mousemove(e) {
|
||||||
var position = self.options.position + (e.clientX - that.offset().left - self.center) / self.fps;
|
self.clientX = e.clientX;
|
||||||
if (position >= 0 && position <= self.options.duration) {
|
self.clientY = e.clientY;
|
||||||
self.$tooltip
|
updateTooltip();
|
||||||
.options({
|
|
||||||
title: Ox.formatDuration(position, 3)
|
|
||||||
})
|
|
||||||
.show(e.clientX, e.clientY);
|
|
||||||
} else {
|
|
||||||
self.$tooltip.hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMarkerPoint(i) {
|
function setMarkerPoint(i) {
|
||||||
|
@ -9149,6 +9144,7 @@ requires
|
||||||
.appendTo(self.$timeline);
|
.appendTo(self.$timeline);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
updateTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWidth() {
|
function setWidth() {
|
||||||
|
@ -9162,6 +9158,19 @@ requires
|
||||||
setMarker();
|
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) {
|
self.onChange = function(key, value) {
|
||||||
if (key == 'points') {
|
if (key == 'points') {
|
||||||
setMarkerPoint(0);
|
setMarkerPoint(0);
|
||||||
|
@ -9303,7 +9312,7 @@ requires
|
||||||
imageData = context.createImageData(width, height),
|
imageData = context.createImageData(width, height),
|
||||||
data = imageData.data;
|
data = imageData.data;
|
||||||
$.each(self.options.subtitles, function(i, v) {
|
$.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(
|
$.each(Ox.range(
|
||||||
Math.round(v['in']),
|
Math.round(v['in']),
|
||||||
Math.round(v['out']) + 1
|
Math.round(v['out']) + 1
|
||||||
|
@ -9574,17 +9583,15 @@ requires
|
||||||
|
|
||||||
that.addEvent({
|
that.addEvent({
|
||||||
key_alt_left: function() {
|
key_alt_left: function() {
|
||||||
movePositionBy(-0.04);
|
|
||||||
},
|
|
||||||
key_alt_right: function() {
|
|
||||||
movePositionBy(0.04);
|
|
||||||
},
|
|
||||||
key_alt_shift_left: function() {
|
|
||||||
movePositionTo('cut', -1);
|
movePositionTo('cut', -1);
|
||||||
},
|
},
|
||||||
key_alt_shift_right: function() {
|
key_alt_right: function() {
|
||||||
movePositionTo('cut', 1);
|
movePositionTo('cut', 1);
|
||||||
},
|
},
|
||||||
|
key_alt_shift_left: function() {
|
||||||
|
},
|
||||||
|
key_alt_shift_right: function() {
|
||||||
|
},
|
||||||
key_closebracket: function() {
|
key_closebracket: function() {
|
||||||
goToPoint('out');
|
goToPoint('out');
|
||||||
},
|
},
|
||||||
|
@ -9624,10 +9631,12 @@ requires
|
||||||
movePositionBy(self.options.duration);
|
movePositionBy(self.options.duration);
|
||||||
},
|
},
|
||||||
key_shift_left: function() {
|
key_shift_left: function() {
|
||||||
movePositionBy(-60);
|
movePositionBy(-0.04);
|
||||||
|
//movePositionBy(-60);
|
||||||
},
|
},
|
||||||
key_shift_right: function() {
|
key_shift_right: function() {
|
||||||
movePositionBy(60);
|
movePositionBy(0.04);
|
||||||
|
//movePositionBy(60);
|
||||||
},
|
},
|
||||||
key_shift_up: function() {
|
key_shift_up: function() {
|
||||||
movePositionBy(-self.options.duration);
|
movePositionBy(-self.options.duration);
|
||||||
|
|
Loading…
Reference in a new issue