use [].concat, not Ox.merge

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

View file

@ -96,10 +96,9 @@ Ox.load.Image = function(options, callback) {
function setSL(sl, d) { function setSL(sl, d) {
var c = sl == 's' ? 1 : 2; var c = sl == 's' ? 1 : 2;
return that.map(function(rgba) { return that.map(function(rgba) {
var hsl = Ox.hsl([rgba[0], rgba[1], rgba[2]]), rgb; var hsl = Ox.hsl([rgba[0], rgba[1], rgba[2]]);
hsl[c] = d < 0 ? hsl[c] * (d + 1) : hsl[c] + (1 - hsl[c]) * d; hsl[c] = d < 0 ? hsl[c] * (d + 1) : hsl[c] + (1 - hsl[c]) * d;
rgb = Ox.rgb(hsl); return Ox.rgb(hsl).concat(rgba[3]);
return Ox.merge(rgb, rgba[3]);
}); });
} }
@ -150,7 +149,7 @@ Ox.load.Image = function(options, callback) {
: Ox.range(3).map(function() { : Ox.range(3).map(function() {
return parseInt(val * 255); return parseInt(val * 255);
}); });
return Ox.merge(rgb, rgba[3]); return rgb.concat(rgba[3]);
} }
}); });
} }
@ -553,10 +552,9 @@ Ox.load.Image = function(options, callback) {
@*/ @*/
that.hue = function(val) { that.hue = function(val) {
return that.map(function(rgba) { return that.map(function(rgba) {
var hsl = Ox.hsl([rgba[0], rgba[1], rgba[2]]), rgb; var hsl = Ox.hsl([rgba[0], rgba[1], rgba[2]]);
hsl[0] = (hsl[0] + val) % 360; hsl[0] = (hsl[0] + val) % 360;
rgb = Ox.rgb(hsl); return Ox.rgb(hsl).concat(rgba[3]);
return Ox.merge(rgb, rgba[3]);
}); });
}; };

View file

@ -204,8 +204,7 @@ Ox.DocPage = function(options, self) {
item[section].forEach(function(v) { item[section].forEach(function(v) {
var name = section == 'usage' ? var name = section == 'usage' ?
item.name + v.name + ' </b></code>returns<code> <b>' : null; item.name + v.name + ' </b></code>returns<code> <b>' : null;
$elements = Ox.merge( $elements = $elements.concat(
$elements,
Ox.map(getItem(v, level + 1, name), function($element) { Ox.map(getItem(v, level + 1, name), function($element) {
return $element.addClass(className); return $element.addClass(className);
}) })

View file

@ -85,7 +85,7 @@ Ox.DocPanel = function(options, self) {
length = self.options.files.length; length = self.options.files.length;
self.options.files.forEach(function(file) { self.options.files.forEach(function(file) {
Ox.doc(self.options.path + file, function(fileItems) { Ox.doc(self.options.path + file, function(fileItems) {
docItems = Ox.merge(docItems, fileItems); docItems = docItems.concat(fileItems);
++counter == length && callback(docItems); ++counter == length && callback(docItems);
}); });
}); });

View file

@ -78,7 +78,7 @@ Ox.DateInput = function(options, self) {
}) })
.bindEvent('autocomplete', changeMonthOrYear), .bindEvent('autocomplete', changeMonthOrYear),
year: Ox.Input({ year: Ox.Input({
autocomplete: Ox.merge(Ox.range(1900, 3000), Ox.range(1000, 1900)).map(function(i) { autocomplete: Ox.range(1900, 3000).concat(Ox.range(1000, 1900)).map(function(i) {
return i.toString(); return i.toString();
}), }),
autocompleteReplace: true, autocompleteReplace: true,
@ -92,7 +92,7 @@ Ox.DateInput = function(options, self) {
that = Ox.InputGroup(Ox.extend(self.options, { that = Ox.InputGroup(Ox.extend(self.options, {
id: self.options.id, id: self.options.id,
inputs: Ox.merge(self.options.weekday ? [ inputs: [].concat(self.options.weekday ? [
self.$input.weekday self.$input.weekday
] : [], self.options.format == 'short' ? [ ] : [], self.options.format == 'short' ? [
self.$input.year, self.$input.month, self.$input.day self.$input.year, self.$input.month, self.$input.day
@ -100,7 +100,7 @@ Ox.DateInput = function(options, self) {
self.$input.month, self.$input.day, self.$input.year self.$input.month, self.$input.day, self.$input.year
]), ]),
join: join, join: join,
separators: Ox.merge(self.options.weekday ? [ separators: [].concat(self.options.weekday ? [
{title: self.options.format == 'short' ? '' : ',', width: 8}, {title: self.options.format == 'short' ? '' : ',', width: 8},
] : [], self.options.format == 'short' ? [ ] : [], self.options.format == 'short' ? [
{title: '-', width: 8}, {title: '-', width: 8} {title: '-', width: 8}, {title: '-', width: 8}
@ -202,13 +202,13 @@ Ox.DateInput = function(options, self) {
function split() { function split() {
var values = getValues(); var values = getValues();
return Ox.merge(self.options.weekday ? [ return [].concat(self.options.weekday ? [
values.weekday values.weekday
] : [], self.options.format == 'short' ? [ ] : [], self.options.format == 'short' ? [
values.year, values.month, values.day values.year, values.month, values.day
] : [ ] : [
values.month, values.day, values.year values.month, values.day, values.year
]) ]);
} }
return that; return that;

View file

@ -449,7 +449,7 @@ Ox.Filter = function(options, self) {
function renderButtons(pos, subpos) { function renderButtons(pos, subpos) {
subpos = Ox.isUndefined(subpos) ? -1 : subpos; subpos = Ox.isUndefined(subpos) ? -1 : subpos;
var isGroup = subpos == -1 && self.options.query.conditions[pos].conditions; var isGroup = subpos == -1 && self.options.query.conditions[pos].conditions;
return Ox.merge([ return [].concat([
Ox.Button({ Ox.Button({
id: 'remove', id: 'remove',
title: self.options.query.conditions.length == 1 ? 'close' : 'remove', title: self.options.query.conditions.length == 1 ? 'close' : 'remove',
@ -524,11 +524,11 @@ Ox.Filter = function(options, self) {
: self.options.query.conditions[pos].conditions[subpos]; : self.options.query.conditions[pos].conditions[subpos];
Ox.Log('Form', 'renderCondition', condition, pos, subpos) Ox.Log('Form', 'renderCondition', condition, pos, subpos)
return Ox.FormElementGroup({ return Ox.FormElementGroup({
elements: Ox.merge([ elements: [
renderConditionKey(condition), renderConditionKey(condition),
renderConditionOperator(condition), renderConditionOperator(condition),
renderConditionValue(condition) renderConditionValue(condition)
], renderButtons(pos, subpos)) ].concat(renderButtons(pos, subpos))
}) })
.css({marginLeft: subpos == -1 ? 0 : '24px'}) .css({marginLeft: subpos == -1 ? 0 : '24px'})
.data({position: pos, subposition: subpos}); .data({position: pos, subposition: subpos});
@ -628,7 +628,7 @@ Ox.Filter = function(options, self) {
function renderGroup(condition, pos) { function renderGroup(condition, pos) {
var subpos = -1; var subpos = -1;
var $condition = Ox.FormElementGroup({ var $condition = Ox.FormElementGroup({
elements: Ox.merge([ elements: [
Ox.Label({ Ox.Label({
title: self.options.query.operator == '&' title: self.options.query.operator == '&'
? (pos == 0 ? 'Both' : 'and') ? (pos == 0 ? 'Both' : 'and')
@ -661,7 +661,7 @@ Ox.Filter = function(options, self) {
float: 'right', float: 'right',
width: 208 width: 208
}), }),
], renderButtons(pos, subpos, true)), ].concat(renderButtons(pos, subpos, true)),
float: 'left' float: 'left'
}) })
.data({position: pos}); .data({position: pos});

View file

@ -328,7 +328,7 @@ Ox.Input = function(options, self) {
function autocompleteFunction() { function autocompleteFunction() {
var values = Ox.find(self.options.autocomplete, self.options.value); var values = Ox.find(self.options.autocomplete, self.options.value);
return self.options.autocompleteReplace return self.options.autocompleteReplace
? values[0] : Ox.merge(values[0], values[1]); ? values[0] : values[0].concat(values[1]);
} }
function autocompleteCallback(values) { function autocompleteCallback(values) {

View file

@ -20,7 +20,7 @@ Ox.OptionGroup = function(items, min, max, property) {
// returns the position of the last checked item before position pos // returns the position of the last checked item before position pos
var last = -1; var last = -1;
// fixme: why is length not == items.length here? // fixme: why is length not == items.length here?
Ox.forEach(Ox.merge( Ox.forEach([].concat(
pos > 0 ? Ox.range(pos - 1, -1, -1) : [], pos > 0 ? Ox.range(pos - 1, -1, -1) : [],
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : [] pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : []
), function(v) { ), function(v) {

View file

@ -105,9 +105,9 @@ Ox.Spreadsheet = function(options, self) {
height: 16 * (self.rows + 2) + 'px' height: 16 * (self.rows + 2) + 'px'
}); });
Ox.merge([self.options.title], Ox.clone(self.options.value.rows), ['Total']).forEach(function(row, r) { [self.options.title].concat(Ox.clone(self.options.value.rows), ['Total']).forEach(function(row, r) {
r--; r--;
Ox.merge([''], Ox.clone(self.options.value.columns), ['Total']).forEach(function(column, c) { [''].concat(Ox.clone(self.options.value.columns), ['Total']).forEach(function(column, c) {
c--; c--;
if (r == -1) { if (r == -1) {
if (c == -1 || c == self.columns) { if (c == -1 || c == self.columns) {

View file

@ -91,7 +91,7 @@ Ox.TimeInput = function(options, self) {
that = Ox.InputGroup(Ox.extend(self.options, { that = Ox.InputGroup(Ox.extend(self.options, {
id: self.options.id, id: self.options.id,
inputs: Ox.merge([ inputs: [].concat([
self.$input.hours, self.$input.hours,
self.$input.minutes, self.$input.minutes,
], self.options.seconds ? [ ], self.options.seconds ? [
@ -102,7 +102,7 @@ Ox.TimeInput = function(options, self) {
self.$input.ampm self.$input.ampm
] : []), ] : []),
join: join, join: join,
separators: Ox.merge([ separators: [].concat([
{title: ':', width: 8}, {title: ':', width: 8},
], self.options.seconds ? [ ], self.options.seconds ? [
{title: ':', width: 8} {title: ':', width: 8}
@ -156,7 +156,7 @@ Ox.TimeInput = function(options, self) {
function split(value) { function split(value) {
var values = getValues(); var values = getValues();
return Ox.merge([ return [].concat([
values.hours, values.hours,
values.minutes, values.minutes,
], self.options.seconds ? [ ], self.options.seconds ? [

View file

@ -121,10 +121,9 @@ Ox.IconList = function(options, self) {
function updateKeys() { function updateKeys() {
that.$element.options({ that.$element.options({
keys: Ox.unique(Ox.merge( keys: Ox.unique(
self.options.sort[0].key, [self.options.sort[0].key].concat(self.options.keys)
self.options.keys );
))
}); });
} }

View file

@ -148,10 +148,9 @@ Ox.InfoList = function(options, self) {
function updateKeys() { function updateKeys() {
that.$element.options({ that.$element.options({
keys: Ox.unique(Ox.merge( keys: Ox.unique(
self.options.sort[0].key, [self.options.sort[0].key].concat(self.options.keys)
self.options.keys );
))
}); });
} }

View file

@ -784,10 +784,10 @@ Ox.List = function(options, self) {
return; return;
} }
Ox.Log('List', that.oxid, 'loadPage', page); Ox.Log('List', that.oxid, 'loadPage', page);
var keys = Ox.merge( var keys = (
self.options.keys.indexOf(self.options.unique) == -1 self.options.keys.indexOf(self.options.unique == -1)
? [self.options.unique] : [], self.options.keys ? [self.options.unique] : []
), ).concat(self.options.keys),
offset = page * self.pageLength, offset = page * self.pageLength,
range = [offset, offset + getPageLength(page)]; range = [offset, offset + getPageLength(page)];
if (Ox.isUndefined(self.$pages[page])) { // fixme: unload will have made this undefined already if (Ox.isUndefined(self.$pages[page])) { // fixme: unload will have made this undefined already
@ -1459,8 +1459,8 @@ Ox.List = function(options, self) {
$item.insertAfter($items[i - 1]); $item.insertAfter($items[i - 1]);
} }
}); });
self.options.items.splice.apply(self.options.items, Ox.merge([pos, 0], items)); self.options.items.splice.apply(self.options.items, [pos, 0].concat(items));
self.$items.splice.apply(self.$items, Ox.merge([pos, 0], $items)); self.$items.splice.apply(self.$items, [pos, 0].concat($items));
self.listLength = self.options.items.length; self.listLength = self.options.items.length;
//loadItems(); //loadItems();
updatePositions(); updatePositions();

View file

@ -204,9 +204,9 @@ Ox.TextList = function(options, self) {
items: self.options.items, items: self.options.items,
itemWidth: getItemWidth(), itemWidth: getItemWidth(),
format: self.format, // fixme: not needed, happens in TextList format: self.format, // fixme: not needed, happens in TextList
keys: Ox.merge(self.visibleColumns.map(function(column) { keys: self.visibleColumns.map(function(column) {
return column.id; return column.id;
}), self.options.keys), }).concat(self.options.keys),
max: self.options.max, max: self.options.max,
min: self.options.min, min: self.options.min,
pageLength: self.options.pageLength, pageLength: self.options.pageLength,
@ -268,9 +268,9 @@ Ox.TextList = function(options, self) {
that.$head.$content.empty(); that.$head.$content.empty();
constructHead(); constructHead();
that.$body.options({ that.$body.options({
keys: Ox.merge(self.visibleColumns.map(function(column) { keys: self.visibleColumns.map(function(column) {
return column.id; return column.id;
}), self.options.keys) }).concat(self.options.keys)
}); });
that.$body.reloadPages(); that.$body.reloadPages();
} }
@ -592,7 +592,7 @@ Ox.TextList = function(options, self) {
value = ( value = (
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox /^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
)['format' + Ox.toTitleCase(format.type)].apply( )['format' + Ox.toTitleCase(format.type)].apply(
this, Ox.merge([value], format.args || []) this, [value].concat(format.args || [])
); );
} else { } else {
value = format(value, data); value = format(value, data);
@ -719,9 +719,9 @@ Ox.TextList = function(options, self) {
width: itemWidth + 'px' width: itemWidth + 'px'
}); });
that.$body.options({ that.$body.options({
keys: Ox.merge(self.visibleColumns.map(function(column) { keys: self.visibleColumns.map(function(column) {
return column.id; return column.id;
}), self.options.keys) }).concat(self.options.keys)
}); });
//that.$body.clearCache(); //that.$body.clearCache();
} }

View file

@ -190,7 +190,9 @@ Ox.TreeList = function(options, self) {
: {} : {}
); );
ret.push(item_); ret.push(item_);
item.items && Ox.merge(ret, item_.items); if (item.items) {
ret = ret.concat(item_.items);
}
}); });
return ret; return ret;
} }

View file

@ -473,7 +473,7 @@ Ox.ListMap = function(options, self) {
self.$placeData = Ox.Element(); self.$placeData = Ox.Element();
self.$placeForm = Ox.Form({ self.$placeForm = Ox.Form({
items: Ox.merge([ items: [].concat([
self.$nameInput = Ox.Input({ self.$nameInput = Ox.Input({
id: 'name', id: 'name',
label: 'Name', label: 'Name',
@ -1043,7 +1043,7 @@ Ox.ListMap = function(options, self) {
showForm(place); showForm(place);
if (self.options.hasMatches) { if (self.options.hasMatches) {
self.$matchesInput.value('').show(); self.$matchesInput.value('').show();
names = Ox.filter(Ox.merge([place.name], place.alternativeNames), function(name) { names = Ox.filter([place.name].concat(place.alternativeNames), function(name) {
return name !== ''; return name !== '';
}); });
self.options.getMatches(names, function(matches) { self.options.getMatches(names, function(matches) {
@ -1100,7 +1100,7 @@ Ox.ListMap = function(options, self) {
function updateList(key, value) { function updateList(key, value) {
var query = { var query = {
conditions: Ox.merge( conditions: [].concat(
['all', 'name'].indexOf(key) > -1 ['all', 'name'].indexOf(key) > -1
? [{key: 'name', value: value, operator: '='}] : [], ? [{key: 'name', value: value, operator: '='}] : [],
['all', 'alternativeNames'].indexOf(key) > -1 ['all', 'alternativeNames'].indexOf(key) > -1

View file

@ -221,11 +221,11 @@ Ox.Map = function(options, self) {
self.mapHeight = getMapHeight(); self.mapHeight = getMapHeight();
self.metaKey = false; self.metaKey = false;
self.minZoom = getMinZoom(); self.minZoom = getMinZoom();
self.placeKeys = Ox.merge([ self.placeKeys = [
'id', 'name', 'alternativeNames', 'geoname', 'countryCode', 'type', 'id', 'name', 'alternativeNames', 'geoname', 'countryCode', 'type',
'lat', 'lng', 'south', 'west', 'north', 'east', 'area', 'lat', 'lng', 'south', 'west', 'north', 'east', 'area',
'editable' 'editable'
], self.options.keys); ].concat(self.options.keys);
self.resultPlace = null; self.resultPlace = null;
self.scaleMeters = [ self.scaleMeters = [
50000000, 20000000, 10000000, 50000000, 20000000, 10000000,
@ -937,7 +937,7 @@ Ox.Map = function(options, self) {
self.options.places({ self.options.places({
keys: self.placeKeys, keys: self.placeKeys,
query: { query: {
conditions: Ox.merge([ conditions: [].concat([
{key: 'lat', value: [south, north], operator: '='} {key: 'lat', value: [south, north], operator: '='}
], spansGlobe() ? [ ], spansGlobe() ? [
{key: 'lng', value: [-180, 180], operator: '='} {key: 'lng', value: [-180, 180], operator: '='}

View file

@ -30,16 +30,14 @@ Ox.MapMarkerImage = (function() {
if (!cache[index]) { if (!cache[index]) {
var color = options.rectangle ? [0, 0, 0, 0] var color = options.rectangle ? [0, 0, 0, 0]
: Ox.merge( : options.color.concat(
Ox.clone(options.color),
[options.type == 'place' ? 0.75 : 0.25] [options.type == 'place' ? 0.75 : 0.25]
), ),
border = Ox.merge( border = (
options.mode == 'normal' ? [0, 0, 0] options.mode == 'normal' ? [0, 0, 0]
: options.mode == 'selected' ? [255, 255, 255] : options.mode == 'selected' ? [255, 255, 255]
: [128, 128, 255], : [128, 128, 255]
[options.type == 'result' ? 0.5 : 1] ).concat([options.type == 'result' ? 0.5 : 1]),
),
c = Ox.canvas(options.size, options.size), c = Ox.canvas(options.size, options.size),
image, image,
r = options.size / 2; r = options.size / 2;

View file

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

View file

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

View file

@ -302,11 +302,11 @@ Ox.VideoPanel = function(options, self) {
} }
function getAnnotations() { 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 layer.items.map(function(item) {
return {id: item.id, 'in': item['in'], out: item.out, text: item.value}; return {id: item.id, 'in': item['in'], out: item.out, text: item.value};
}); });
}))).sort(sortAnnotations); })).sort(sortAnnotations);
} }
function getPlayerHeight() { function getPlayerHeight() {

View file

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

View file

@ -140,7 +140,7 @@ Ox.api = function(items, options) {
} }
if (options.sort && result.data.items.length > 1) { if (options.sort && result.data.items.length > 1) {
// sort // sort
options.sort = parseSort(Ox.merge(Ox.clone(options.sort), api.sort)); options.sort = parseSort(options.sort.concat(api.sort));
options.sort.forEach(function(v) { options.sort.forEach(function(v) {
var key = v.key; var key = v.key;
if (api.enums[key]) { if (api.enums[key]) {
@ -417,7 +417,7 @@ Ox.range <f> Python-style range
@*/ @*/
Ox.range = function() { Ox.range = function() {
var arr = []; var arr = [];
Ox.loop.apply(null, Ox.merge(Ox.toArray(arguments), function(i) { Ox.loop.apply(null, Ox.toArray(arguments).concat(function(i) {
arr.push(i); arr.push(i);
})); }));
return arr; return arr;
@ -433,7 +433,7 @@ Ox.range = function() {
var match; var match;
if (Ox.isString(val)) { if (Ox.isString(val)) {
match = arr_[i].match(/\d+/g); match = arr_[i].match(/\d+/g);
match && Ox.merge(matches, match); match && matches.concat(match);
} }
}); });
// get length of longest number // get length of longest number

View file

@ -193,7 +193,7 @@ Ox.Log = (function() {
return log.filter; return log.filter;
}; };
that.filter.add = function(val) { that.filter.add = function(val) {
return that.filter(Ox.unique(Ox.merge(log.filter, Ox.makeArray(val)))); return that.filter(Ox.unique(log.filter.concat(Ox.makeArray(val))));
}; };
that.filter.disable = function() { that.filter.disable = function() {
log.filterEnabled = false; log.filterEnabled = false;

View file

@ -28,7 +28,7 @@ Ox.cache = function(fn, options) {
if (options.async) { if (options.async) {
if (!(key in cache)) { if (!(key in cache)) {
// call function with patched callback // call function with patched callback
fn.apply(this, Ox.merge(Ox.sub(args, 0, -1), callback)); fn.apply(this, args.slice(0, -1).concat(callback));
} else { } else {
// call callback with cached arguments // call callback with cached arguments
callback.apply(this, cache[key]) callback.apply(this, cache[key])

View file

@ -321,7 +321,7 @@
// intersect each part of the intersection // intersect each part of the intersection
// with all parts of the next area // with all parts of the next area
intersections = Ox.compact(ret.map(function(part) { intersections = Ox.compact(ret.map(function(part) {
return Ox.intersectAreas(Ox.merge(part, parts)); return Ox.intersectAreas(parts.concat(part));
})); }));
ret = intersections.length == 0 ? null ret = intersections.length == 0 ? null
: Ox.joinAreas(intersections); : Ox.joinAreas(intersections);

View file

@ -172,8 +172,8 @@ Ox.doc = (function() {
lastItem.properties = lastItem.properties || []; lastItem.properties = lastItem.properties || [];
lastItem.properties.push(item); lastItem.properties.push(item);
// include leading linebreaks and whitespace // include leading linebreaks and whitespace
lastItem.source = Ox.merge( lastItem.source = lastItem.source.concat(
lastItem.source, parseTokens(tokens[i], true) parseTokens(tokens[i], true)
); );
} }
} else { } else {
@ -294,7 +294,7 @@ Ox.doc = (function() {
counter = 0, items = []; counter = 0, items = [];
files && files.forEach(function(file) { files && files.forEach(function(file) {
Ox.get(file, function(source) { Ox.get(file, function(source) {
items = Ox.merge(items, parseSource(source, file)); items = items.concat(parseSource(source, file));
++counter == files.length && callback(items); ++counter == files.length && callback(items);
}); });
}); });

View file

@ -88,7 +88,7 @@ Ox.highlightHTML = function(html, str, classname, tags) {
position, position,
positions = []; positions = [];
//fixme: default tags should be same as in parseHTML //fixme: default tags should be same as in parseHTML
tags = Ox.merge(tags || [], [ tags = (tags || []).concat([
// inline formatting // inline formatting
'b', 'code', 'i', 's', 'sub', 'sup', 'u', 'b', 'code', 'i', 's', 'sub', 'sup', 'u',
// block formatting // block formatting
@ -401,8 +401,8 @@ Ox.repeat = function(val, num) {
var ret; var ret;
if (Ox.isArray(val)) { if (Ox.isArray(val)) {
ret = []; ret = [];
num >= 1 && Ox.loop(num, function() { Ox.loop(num, function() {
ret = Ox.merge(ret, val); ret = ret.concat(val);
}); });
} else { } else {
ret = num >= 1 ? new Array(num + 1).join(val.toString()) : ''; ret = num >= 1 ? new Array(num + 1).join(val.toString()) : '';