1
0
Fork 0
forked from 0x2620/oxjs

theme.js -> theme.json; make timeline themed

This commit is contained in:
rolux 2012-01-04 15:20:07 +05:30
commit 66934d22a9
7 changed files with 61 additions and 29 deletions

View file

@ -10,6 +10,7 @@ Ox.SmallVideoTimelineImage = function(options, self) {
'in': 0,
out: 0,
results: [],
selected: false,
subtitles: [],
timeline: '',
width: 256,
@ -29,6 +30,7 @@ Ox.SmallVideoTimelineImage = function(options, self) {
self.imageHeight = self.options.type == 'player' ? 16 : 18;
self.imageTop = self.options.type == 'player' ? 0 : 3;
self.timelineTop = self.options.type == 'player' ? 0 : 4;
self.theme = Ox.Theme();
that.css({
height: self.height + 'px'
@ -123,15 +125,14 @@ Ox.SmallVideoTimelineImage = function(options, self) {
) + 1;
Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) {
var color = self.options.type == 'player' ?
[255, 255, 0, 128] :
(y == top || y == bottom - 1) ?
[255, 255, 0, 255] : [255, 255, 0, 64],
var alpha = self.options.type == 'player' ? 128
: (y == top || y == bottom - 1) ? 255 : 64,
color = Ox.Theme[self.theme].timeline.result,
index = x * 4 + y * 4 * width;
data[index] = color[0];
data[index + 1] = color[1];
data[index + 2] = color[2];
data[index + 3] = color[3];
data[index + 3] = alpha;
});
});
});
@ -147,14 +148,17 @@ Ox.SmallVideoTimelineImage = function(options, self) {
rgb = self.options.editing ? [128, 255, 255] : [255, 255, 255];
Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) {
var color = self.options.type == 'player' ?
[rgb[0], rgb[1], rgb[2], 128] :
[rgb[0], rgb[1], rgb[2], (y == top || y == bottom - 1) ? 255 : 64],
var alpha = self.options.type == 'player' ? 128
: (y == top || y == bottom - 1) ? 255 : 64,
color = Ox.Theme[self.theme].timeline[
self.options.editing ? 'editing'
: self.options.selected ? 'selected' : 'default'
],
index = x * 4 + y * 4 * width;
data[index] = color[0];
data[index + 1] = color[1];
data[index + 2] = color[2];
data[index + 3] = color[3];
data[index + 3] = alpha;
});
});
} else if (image == 'subtitles') {
@ -166,12 +170,11 @@ Ox.SmallVideoTimelineImage = function(options, self) {
right = Math.round(
subtitle.out / self.options.duration * self.imageWidth
) + 1,
top = bottom - subtitle.text.split('\n').length - 3;
top = bottom - subtitle.text.split('\n').length - 2;
Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) {
var color = y == top ? [0, 0, 0, 0] :
(y == top + 1 || y == bottom - 1) ?
[0, 0, 0, 128] : [255, 255, 255, 128],
var alpha = 128,
color = (y == top || y == bottom - 1) ? [0, 0, 0] : [255, 255, 255],
index = x * 4 + y * 4 * width;
data[index] = color[0];
data[index + 1] = color[1];