1
0
Fork 0
forked from 0x2620/oxjs

use [].concat, not Ox.merge

This commit is contained in:
rolux 2012-05-24 09:45:33 +02:00
commit 1c40fb007b
27 changed files with 87 additions and 90 deletions

View file

@ -256,7 +256,7 @@ Ox.AnnotationPanel = function(options, self) {
+ (isPlace ? 'Place' : isEvent ? 'Event' : 'Place or Event') + '...'
self.$editMenuButton && self.$editMenuButton.remove();
self.$editMenuButton = Ox.MenuButton({
items: Ox.merge(
items: [].concat(
[
{id: 'deselect', title: 'Deselect Annotation', disabled: !self.options.selected || self.editing, keyboard: 'escape'},
{id: 'edit', title: 'Edit Annotation', disabled: !self.options.selected || !isEditable || self.editing, keyboard: 'return'},
@ -330,7 +330,7 @@ Ox.AnnotationPanel = function(options, self) {
function renderOptionsMenu() {
self.$optionsMenuButton && self.$optionsMenuButton.remove();
self.$optionsMenuButton = Ox.MenuButton({
items: Ox.merge(
items: [].concat(
[
{id: 'showannotations', title: 'Show Annotations', disabled: true},
{group: 'range', min: 1, max: 1, items: [

View file

@ -392,7 +392,7 @@ Ox.VideoEditor = function(options, self) {
});
self.$keyboardShortcuts = $('<div>').css({margin: '16px'});
Ox.merge([
[
{key: Ox.UI.symbols.space, action: 'Play/Pause'},
{key: 'P', action: 'Play In to Out'},
{key: '0', action: 'Mute/Unmute'},
@ -425,11 +425,13 @@ Ox.VideoEditor = function(options, self) {
{key: 'G', action: 'Go to Next Result'},
{key: Ox.UI.symbols['return'], action: 'Edit/Submit'},
{key: Ox.UI.symbols.escape, action: 'Cancel/Deselect'}
], Ox.filter(self.options.layers.map(function(layer, i) {
return layer.editable
? {key: i + 1, action: 'Add ' + layer.item}
: null;
}))).forEach(function(shortcut) {
].concat(
Ox.filter(self.options.layers.map(function(layer, i) {
return layer.editable
? {key: i + 1, action: 'Add ' + layer.item}
: null;
}))
).forEach(function(shortcut) {
self.$keyboardShortcuts.append(
$('<div>').css({display: 'table-row'})
.append(
@ -450,7 +452,7 @@ Ox.VideoEditor = function(options, self) {
});
self.$menuButton = Ox.MenuButton({
items: Ox.merge(
items: [].concat(
[
{id: 'size', title: 'Large Player', checked: self.options.videoSize == 'large'},
{},
@ -852,9 +854,9 @@ Ox.VideoEditor = function(options, self) {
}
function getAnnotations() {
return Ox.flatten(Ox.merge(self.options.layers.map(function(layer) {
return Ox.flatten(self.options.layers.map(function(layer) {
return layer.items;
}))).sort(sortAnnotations);
})).sort(sortAnnotations);
}
function getAnnotationValue(annotationId) {
@ -903,7 +905,7 @@ Ox.VideoEditor = function(options, self) {
if (type == 'annotation') {
positions = self.positions;
} else if (type == 'cut') {
positions = Ox.merge(0, self.options.cuts, self.options.duration);
positions = [0].concat(self.options.cuts, self.options.duration);
} else if (type == 'result') {
positions = Ox.unique(self.results.map(function(result) {
return result['in'];

View file

@ -302,11 +302,11 @@ Ox.VideoPanel = function(options, self) {
}
function getAnnotations() {
return Ox.flatten(Ox.merge(self.options.layers.map(function(layer) {
return Ox.flatten(self.options.layers.map(function(layer) {
return layer.items.map(function(item) {
return {id: item.id, 'in': item['in'], out: item.out, text: item.value};
});
}))).sort(sortAnnotations);
})).sort(sortAnnotations);
}
function getPlayerHeight() {

View file

@ -1808,7 +1808,7 @@ Ox.VideoPlayer = function(options, self) {
}
}
}),
items = Ox.merge(
items = [].concat(
self.resolutions.map(function(resolution) {
return {
checked: resolution == self.options.resolution,