1
0
Fork 0
forked from 0x2620/oxjs

new-style find-as-you-type for video editor

This commit is contained in:
rolux 2011-05-19 19:58:00 +02:00
commit 9f4f9dfa39
135 changed files with 9182 additions and 44 deletions

View file

@ -149,7 +149,6 @@ Ox.BlockVideoTimeline = function(options, self) {
// fixme: check if this pattern is better
// than the one used for list selection
if (!self.triggered) {
Ox.print('$$$$$$$$$$$$$$$')
that.triggerEvent('position', {
position: self.options.position
});
@ -197,15 +196,7 @@ Ox.BlockVideoTimeline = function(options, self) {
function setPoint(point) {
setPointMarker(point);
self.$image.options(point, self.options[point]);
self.$lines.forEach(function($line, i) {
$($line.children()[0]).replaceWith(
self.$images[i] = self.$image.clone()
.css({
position: 'absolute',
marginLeft: (-i * self.options.width) + 'px'
})
);
});
updateTimelines();
}
function setPointMarker(point) {
@ -225,6 +216,11 @@ Ox.BlockVideoTimeline = function(options, self) {
});
}
function setResults() {
self.$image.options({results: self.options.results});
updateTimelines();
}
function setWidth() {
self.lines = getLines();
setCSS();
@ -253,11 +249,25 @@ Ox.BlockVideoTimeline = function(options, self) {
setPointMarker('out');
}
function updateTimelines() {
self.$lines.forEach(function($line, i) {
$($line.children()[0]).replaceWith(
self.$images[i] = self.$image.clone()
.css({
position: 'absolute',
marginLeft: (-i * self.options.width) + 'px'
})
);
});
}
self.setOption = function(key, value) {
if (key == 'in' || key == 'out') {
setPoint(key)
} else if (key == 'position') {
setPositionMarker();
} else if (key == 'results') {
setResults();
} else if (key == 'width') {
setWidth();
}