1
0
Fork 0
forked from 0x2620/oxjs

- remove editItem from Ox.List

- use ArrayEditable for text too
This commit is contained in:
j 2012-01-04 22:57:32 +05:30
commit 093edd57d0
12 changed files with 180 additions and 403 deletions

View file

@ -6,11 +6,10 @@ Ox.SmallVideoTimelineImage = function(options, self) {
var that = Ox.Element({}, self)
.defaults({
duration: 0,
editing: false,
'in': 0,
out: 0,
results: [],
selected: false,
state: 'default',
subtitles: [],
timeline: '',
width: 256,
@ -102,8 +101,8 @@ Ox.SmallVideoTimelineImage = function(options, self) {
.appendTo(that.$element);
function getImageURL(image, callback) {
var width = image == 'results' || image == 'selection' ?
self.options.width : self.imageWidth,
var width = image == 'results' || image == 'selection'
? self.options.width : self.imageWidth,
height = self.imageHeight,
canvas = $('<canvas>')
.attr({
@ -125,9 +124,10 @@ Ox.SmallVideoTimelineImage = function(options, self) {
) + 1;
Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) {
var alpha = self.options.type == 'player' ? 128
: (y == top || y == bottom - 1) ? 255 : 64,
color = Ox.Theme[self.theme].timeline.result,
var alpha = self.options.type == 'editor'
&& (y == top || y == bottom - 1) ? 192 : 64,
color = [2, 3, 6].indexOf(x % 4 + y % 4) > -1
? [0, 0, 0] : [255, 255, 0],
index = x * 4 + y * 4 * width;
data[index] = color[0];
data[index + 1] = color[1];
@ -145,15 +145,14 @@ Ox.SmallVideoTimelineImage = function(options, self) {
) + 1,
top = 0,
bottom = height,
rgb = self.options.editing ? [128, 255, 255] : [255, 255, 255];
rgb = self.options.state == 'editing' ? [[0, 0, 128], [128, 128, 255]]
: self.options.state == 'selected' ? [[0, 128, 0], [128, 255, 128]]
: [[0, 0, 0], [255, 255, 255]];
Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) {
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'
],
var alpha = self.options.type == 'editor'
&& (y == top || y == bottom - 1) ? 192 : 64,
color = rgb[[2, 3, 6].indexOf(x % 4 + y % 4) > -1 ? 0 : 1],
index = x * 4 + y * 4 * width;
data[index] = color[0];
data[index + 1] = color[1];
@ -209,6 +208,10 @@ Ox.SmallVideoTimelineImage = function(options, self) {
self.$subtitles.attr({
src: getImageURL('subtitles')
});
} else if (key == 'state') {
self.$selection.attr({
src: getImageURL('selection')
});
} else if (key == 'width') {
that.css({width: value + 'px'});
self.$results