1
0
Fork 0
forked from 0x2620/oxjs

more timelines

This commit is contained in:
rolux 2011-05-15 20:50:05 +02:00
commit 275dcbb356
5 changed files with 275 additions and 38 deletions

View file

@ -16,6 +16,7 @@ Ox.BlockVideoTimeline = function(options, self) {
.options(options || {})
.css({
position: 'absolute',
//background: 'rgba(192, 192, 192, 0.1)'
})
.bind({
mousedown: mousedown,
@ -89,7 +90,7 @@ Ox.BlockVideoTimeline = function(options, self) {
overflow: 'hidden'
})
.appendTo(that.$element);
self.$images[i] = Ox.SmallVideoTimelineImages({
self.$images[i] = Ox.SmallVideoTimelineImage({
duration: self.options.duration,
editing: self.options.editing,
getTimelineURL: self.options.getTimelineURL,
@ -105,13 +106,15 @@ Ox.BlockVideoTimeline = function(options, self) {
marginLeft: (-i * self.options.width) + 'px'
})
.appendTo(self.$lines[i]);
self.$interfaces[i] = $('<div>').addClass('OxInterface')
self.$interfaces[i] = $('<div>')
.addClass('OxInterface')
.css({
position: 'absolute',
top: '2px',
width: Math.ceil(self.options.duration) + 'px',
height: '20px',
marginLeft: (-i * self.options.width) + 'px',
//background: 'rgba(255, 0, 0, 0.1)',
zIndex: 11
})
.appendTo(self.$lines[i]);
@ -123,6 +126,7 @@ Ox.BlockVideoTimeline = function(options, self) {
function getPosition(e) {
//FIXME: this might still be broken in opera according to http://acko.net/blog/mouse-handling-and-absolute-positions-in-javascript
Ox.print('offsetX', e.offsetX)
return (e.offsetX ? e.offsetX : e.clientX - $(e.target).offset().left);
}
@ -171,7 +175,7 @@ Ox.BlockVideoTimeline = function(options, self) {
Ox.highlight(subtitle.text, self.options.find, 'OxHighlight').replace(/\n/g, '<br/>') +
'</span><br/>' +
Ox.formatDuration(subtitle['in'], 3) + ' - ' + Ox.formatDuration(subtitle['out'], 3) :
Ox.formatDuration(position, 3)
Ox.formatDuration(position)
})
.show(e.clientX, e.clientY);
@ -189,7 +193,6 @@ Ox.BlockVideoTimeline = function(options, self) {
function setPointMarker(point) {
var position = Math.round(self.options[point]);
Ox.print('$$ position', position)
self.$pointMarker[point].css({
left: (position % self.options.width) + 'px',
top: (parseInt(position / self.options.width) *