remove new for all Ox.Elements, dont declare arguments again, add some semicolons

This commit is contained in:
j 2011-06-19 19:48:32 +02:00
commit b27ed00356
69 changed files with 430 additions and 440 deletions

View file

@ -11,8 +11,8 @@ Ox.VideoEditor <f:Ox.Element> VideoEditor Object
Ox.VideoEditor = function(options, self) {
var self = self || {},
that = new Ox.Element({}, self)
self = self || {};
var that = Ox.Element({}, self)
.defaults({
annotationsSize: 0,
cuts: [],
@ -97,10 +97,10 @@ Ox.VideoEditor = function(options, self) {
// toggleSize
},
key_shift_comma: function() {
movePositionTo('match', -1)
movePositionTo('match', -1);
},
key_shift_dot: function() {
movePositionTo('match', 1)
movePositionTo('match', 1);
},
key_shift_down: function() {
movePositionBy(self.options.duration);
@ -143,7 +143,7 @@ Ox.VideoEditor = function(options, self) {
videoRatio: self.options.videoWidth / self.options.videoHeight
});
self.words = []
self.words = [];
Ox.forEach(Ox.count(Ox.words(self.options.subtitles.map(function(subtitle) {
return subtitle.text;
}).join(' '))), function(count, word) {
@ -155,7 +155,7 @@ Ox.VideoEditor = function(options, self) {
return obj.word;
});
self.$editor = new Ox.Element()
self.$editor = Ox.Element()
.addClass('OxVideoEditor')
.click(function(e) {
var $target = $(e.target);
@ -165,7 +165,7 @@ Ox.VideoEditor = function(options, self) {
self.sizes = getSizes();
['play', 'in', 'out'].forEach(function(type, i) {
self.$player[i] = new Ox.VideoPlayer({
self.$player[i] = Ox.VideoPlayer({
controlsBottom: type == 'play' ?
['play', 'playInToOut', 'volume', 'size', 'space', 'position'] :
['goto', 'set', 'space', 'position'],
@ -207,7 +207,7 @@ Ox.VideoEditor = function(options, self) {
.appendTo(self.$editor);
});
self.$timeline[0] = new Ox.LargeVideoTimeline({
self.$timeline[0] = Ox.LargeVideoTimeline({
cuts: self.options.cuts,
duration: self.options.duration,
find: self.options.find,
@ -228,7 +228,7 @@ Ox.VideoEditor = function(options, self) {
.bindEvent('position', changeTimelineLarge)
.appendTo(self.$editor);
self.$timeline[1] = new Ox.BlockVideoTimeline({
self.$timeline[1] = Ox.BlockVideoTimeline({
cuts: self.options.cuts,
duration: self.options.duration,
find: self.options.find,
@ -249,14 +249,14 @@ Ox.VideoEditor = function(options, self) {
.bindEvent('position', changeTimelineSmall)
.appendTo(self.$editor);
self.$annotations = new Ox.Element()
self.$annotations = Ox.Element()
.css({
overflowY: 'auto'
});
self.$annotationPanel = [];
self.options.layers.forEach(function(layer, i) {
self.$annotationPanel[i] = new Ox.AnnotationPanel(
self.$annotationPanel[i] = Ox.AnnotationPanel(
$.extend({
width: self.options.annotationSize
}, layer)
@ -352,7 +352,7 @@ Ox.VideoEditor = function(options, self) {
.html(shortcut.action)
)
);
})
});
self.$videoMenuButton = Ox.Select({
items: Ox.merge([
@ -401,7 +401,7 @@ Ox.VideoEditor = function(options, self) {
.appendTo(self.$videobar);
self.$videoMenuButton.find('input').attr({
src: Ox.UI.getImagePath('symbolSet.svg')
})
});
self.$selectButton = Ox.Button({
style: 'symbol',
@ -413,7 +413,7 @@ Ox.VideoEditor = function(options, self) {
click: function() {
self.$menuButton.find('input').trigger('click')
}
})
});
//.appendTo(self.$videobar);
@ -426,7 +426,7 @@ Ox.VideoEditor = function(options, self) {
change: function() {
}
})
});
//.appendTo(self.$videobar);
@ -441,7 +441,7 @@ Ox.VideoEditor = function(options, self) {
.css({float: 'left'})
.bindEvent({
click: function() {
setPosition(self.options.posterFrame)
setPosition(self.options.posterFrame);
}
})
.appendTo(self.$videobar);
@ -517,7 +517,7 @@ Ox.VideoEditor = function(options, self) {
}
})
.appendTo(self.$videobar);
self.$findInput.find('input').css({background: 'transparent'})
self.$findInput.find('input').css({background: 'transparent'});
self.$findButton = Ox.Button({
//disabled: true,
@ -531,7 +531,7 @@ Ox.VideoEditor = function(options, self) {
click: function() {
}
})
});
//.appendTo(self.$videobar);
self.$nextButton = Ox.Button({
@ -544,7 +544,7 @@ Ox.VideoEditor = function(options, self) {
.css({float: 'right'})
.bindEvent({
click: function() {
setPosition(getNextPosition('result', 1))
setPosition(getNextPosition('result', 1));
}
})
.appendTo(self.$videobar);
@ -559,7 +559,7 @@ Ox.VideoEditor = function(options, self) {
.css({float: 'right'})
.bindEvent({
click: function() {
setPosition(getNextPosition('result', -1))
setPosition(getNextPosition('result', -1));
}
})
.appendTo(self.$videobar);
@ -597,7 +597,7 @@ Ox.VideoEditor = function(options, self) {
.appendTo(self.$annotationsbar);
self.$annotationsMenuButton.find('input').attr({
src: Ox.UI.getImagePath('symbolSet.svg')
})
});
that.$element = Ox.SplitPanel({
@ -767,7 +767,7 @@ Ox.VideoEditor = function(options, self) {
top: self.margin / 2,
width: widths[i],
height: Math.round(widths[1] / self.videoRatio)
}
};
width += widths[i];
});
} else {
@ -775,32 +775,32 @@ Ox.VideoEditor = function(options, self) {
left: self.margin / 2,
top: self.margin / 2,
width: Math.round((contentWidth - 3 * self.margin + (self.controlsHeight + self.margin) / 2 * self.videoRatio) * 2/3),
}
};
size.player[0].height = Math.round(size.player[0].width / self.videoRatio);
size.player[1] = {
left: size.player[0].left + size.player[0].width + self.margin,
top: size.player[0].top,
width: contentWidth - 3 * self.margin - size.player[0].width
}
size.player[1].height = Math.ceil(size.player[1].width / self.videoRatio)
};
size.player[1].height = Math.ceil(size.player[1].width / self.videoRatio);
size.player[2] = {
left: size.player[1].left,
top: size.player[0].top + size.player[1].height + self.controlsHeight + self.margin,
width: size.player[1].width,
height: size.player[0].height - size.player[1].height - self.controlsHeight - self.margin
}
};
}
size.timeline[0] = {
left: self.margin / 2,
top: size.player[0].height + self.controlsHeight + 1.5 * self.margin,
width: contentWidth - 2 * self.margin,
height: 64
}
};
size.timeline[1] = {
left: size.timeline[0].left,
top: size.timeline[0].top + size.timeline[0].height + self.margin,
width: size.timeline[0].width
}
};
lines = Math.ceil(self.options.duration / size.timeline[1].width);
height = getHeight();
self.$editor.css({
@ -1000,12 +1000,12 @@ Ox.VideoEditor = function(options, self) {
that.addAnnotation = function(layer, item) {
var i = Ox.getPositionById(self.options.layers, layer);
self.$annotationPanel[i].addItem(item);
}
};
that.removeAnnotations = function(layer, ids) {
var i = Ox.getPositionById(self.options.layers, layer);
self.$annotationPanel[i].removeItems(ids);
}
};
return that;