From 1c40fb007b06806f7c116f4b6e0309f3021625fc Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 24 May 2012 09:45:33 +0200 Subject: [PATCH] use [].concat, not Ox.merge --- source/Ox.Image/Ox.Image.js | 12 +++++------ source/Ox.UI/js/Code/Ox.DocPage.js | 3 +-- source/Ox.UI/js/Code/Ox.DocPanel.js | 2 +- source/Ox.UI/js/Form/Ox.DateInput.js | 10 +++++----- source/Ox.UI/js/Form/Ox.Filter.js | 10 +++++----- source/Ox.UI/js/Form/Ox.Input.js | 2 +- source/Ox.UI/js/Form/Ox.OptionGroup.js | 2 +- source/Ox.UI/js/Form/Ox.Spreadsheet.js | 4 ++-- source/Ox.UI/js/Form/Ox.TimeInput.js | 6 +++--- source/Ox.UI/js/List/Ox.IconList.js | 7 +++---- source/Ox.UI/js/List/Ox.InfoList.js | 7 +++---- source/Ox.UI/js/List/Ox.List.js | 12 +++++------ source/Ox.UI/js/List/Ox.TextList.js | 14 ++++++------- source/Ox.UI/js/List/Ox.TreeList.js | 4 +++- source/Ox.UI/js/Map/Ox.ListMap.js | 6 +++--- source/Ox.UI/js/Map/Ox.Map.js | 6 +++--- source/Ox.UI/js/Map/Ox.MapMarkerImage.js | 14 ++++++------- source/Ox.UI/js/Video/Ox.AnnotationPanel.js | 4 ++-- source/Ox.UI/js/Video/Ox.VideoEditor.js | 22 +++++++++++---------- source/Ox.UI/js/Video/Ox.VideoPanel.js | 4 ++-- source/Ox.UI/js/Video/Ox.VideoPlayer.js | 2 +- source/Ox/js/Array.js | 6 +++--- source/Ox/js/Core.js | 2 +- source/Ox/js/Function.js | 2 +- source/Ox/js/Geo.js | 2 +- source/Ox/js/JavaScript.js | 6 +++--- source/Ox/js/String.js | 6 +++--- 27 files changed, 87 insertions(+), 90 deletions(-) diff --git a/source/Ox.Image/Ox.Image.js b/source/Ox.Image/Ox.Image.js index ca065a63..2c95526c 100644 --- a/source/Ox.Image/Ox.Image.js +++ b/source/Ox.Image/Ox.Image.js @@ -96,10 +96,9 @@ Ox.load.Image = function(options, callback) { function setSL(sl, d) { var c = sl == 's' ? 1 : 2; 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; - rgb = Ox.rgb(hsl); - return Ox.merge(rgb, rgba[3]); + return Ox.rgb(hsl).concat(rgba[3]); }); } @@ -150,7 +149,7 @@ Ox.load.Image = function(options, callback) { : Ox.range(3).map(function() { 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) { 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; - rgb = Ox.rgb(hsl); - return Ox.merge(rgb, rgba[3]); + return Ox.rgb(hsl).concat(rgba[3]); }); }; diff --git a/source/Ox.UI/js/Code/Ox.DocPage.js b/source/Ox.UI/js/Code/Ox.DocPage.js index 74f40260..f1c6239b 100644 --- a/source/Ox.UI/js/Code/Ox.DocPage.js +++ b/source/Ox.UI/js/Code/Ox.DocPage.js @@ -204,8 +204,7 @@ Ox.DocPage = function(options, self) { item[section].forEach(function(v) { var name = section == 'usage' ? item.name + v.name + ' returns ' : null; - $elements = Ox.merge( - $elements, + $elements = $elements.concat( Ox.map(getItem(v, level + 1, name), function($element) { return $element.addClass(className); }) diff --git a/source/Ox.UI/js/Code/Ox.DocPanel.js b/source/Ox.UI/js/Code/Ox.DocPanel.js index bb0cbf44..118557f9 100644 --- a/source/Ox.UI/js/Code/Ox.DocPanel.js +++ b/source/Ox.UI/js/Code/Ox.DocPanel.js @@ -85,7 +85,7 @@ Ox.DocPanel = function(options, self) { length = self.options.files.length; self.options.files.forEach(function(file) { Ox.doc(self.options.path + file, function(fileItems) { - docItems = Ox.merge(docItems, fileItems); + docItems = docItems.concat(fileItems); ++counter == length && callback(docItems); }); }); diff --git a/source/Ox.UI/js/Form/Ox.DateInput.js b/source/Ox.UI/js/Form/Ox.DateInput.js index f8d4feb1..70856c20 100644 --- a/source/Ox.UI/js/Form/Ox.DateInput.js +++ b/source/Ox.UI/js/Form/Ox.DateInput.js @@ -78,7 +78,7 @@ Ox.DateInput = function(options, self) { }) .bindEvent('autocomplete', changeMonthOrYear), 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(); }), autocompleteReplace: true, @@ -92,7 +92,7 @@ Ox.DateInput = function(options, self) { that = Ox.InputGroup(Ox.extend(self.options, { id: self.options.id, - inputs: Ox.merge(self.options.weekday ? [ + inputs: [].concat(self.options.weekday ? [ self.$input.weekday ] : [], self.options.format == 'short' ? [ 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 ]), join: join, - separators: Ox.merge(self.options.weekday ? [ + separators: [].concat(self.options.weekday ? [ {title: self.options.format == 'short' ? '' : ',', width: 8}, ] : [], self.options.format == 'short' ? [ {title: '-', width: 8}, {title: '-', width: 8} @@ -202,13 +202,13 @@ Ox.DateInput = function(options, self) { function split() { var values = getValues(); - return Ox.merge(self.options.weekday ? [ + return [].concat(self.options.weekday ? [ values.weekday ] : [], self.options.format == 'short' ? [ values.year, values.month, values.day ] : [ values.month, values.day, values.year - ]) + ]); } return that; diff --git a/source/Ox.UI/js/Form/Ox.Filter.js b/source/Ox.UI/js/Form/Ox.Filter.js index d35b91f7..4a1770fa 100644 --- a/source/Ox.UI/js/Form/Ox.Filter.js +++ b/source/Ox.UI/js/Form/Ox.Filter.js @@ -449,7 +449,7 @@ Ox.Filter = function(options, self) { function renderButtons(pos, subpos) { subpos = Ox.isUndefined(subpos) ? -1 : subpos; var isGroup = subpos == -1 && self.options.query.conditions[pos].conditions; - return Ox.merge([ + return [].concat([ Ox.Button({ id: '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]; Ox.Log('Form', 'renderCondition', condition, pos, subpos) return Ox.FormElementGroup({ - elements: Ox.merge([ + elements: [ renderConditionKey(condition), renderConditionOperator(condition), renderConditionValue(condition) - ], renderButtons(pos, subpos)) + ].concat(renderButtons(pos, subpos)) }) .css({marginLeft: subpos == -1 ? 0 : '24px'}) .data({position: pos, subposition: subpos}); @@ -628,7 +628,7 @@ Ox.Filter = function(options, self) { function renderGroup(condition, pos) { var subpos = -1; var $condition = Ox.FormElementGroup({ - elements: Ox.merge([ + elements: [ Ox.Label({ title: self.options.query.operator == '&' ? (pos == 0 ? 'Both' : 'and') @@ -661,7 +661,7 @@ Ox.Filter = function(options, self) { float: 'right', width: 208 }), - ], renderButtons(pos, subpos, true)), + ].concat(renderButtons(pos, subpos, true)), float: 'left' }) .data({position: pos}); diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index fdd203af..b761d370 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -328,7 +328,7 @@ Ox.Input = function(options, self) { function autocompleteFunction() { var values = Ox.find(self.options.autocomplete, self.options.value); return self.options.autocompleteReplace - ? values[0] : Ox.merge(values[0], values[1]); + ? values[0] : values[0].concat(values[1]); } function autocompleteCallback(values) { diff --git a/source/Ox.UI/js/Form/Ox.OptionGroup.js b/source/Ox.UI/js/Form/Ox.OptionGroup.js index 7366e439..b9c47161 100644 --- a/source/Ox.UI/js/Form/Ox.OptionGroup.js +++ b/source/Ox.UI/js/Form/Ox.OptionGroup.js @@ -20,7 +20,7 @@ Ox.OptionGroup = function(items, min, max, property) { // returns the position of the last checked item before position pos var last = -1; // fixme: why is length not == items.length here? - Ox.forEach(Ox.merge( + Ox.forEach([].concat( pos > 0 ? Ox.range(pos - 1, -1, -1) : [], pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : [] ), function(v) { diff --git a/source/Ox.UI/js/Form/Ox.Spreadsheet.js b/source/Ox.UI/js/Form/Ox.Spreadsheet.js index 6ae5203a..13c13c40 100644 --- a/source/Ox.UI/js/Form/Ox.Spreadsheet.js +++ b/source/Ox.UI/js/Form/Ox.Spreadsheet.js @@ -105,9 +105,9 @@ Ox.Spreadsheet = function(options, self) { 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--; - 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--; if (r == -1) { if (c == -1 || c == self.columns) { diff --git a/source/Ox.UI/js/Form/Ox.TimeInput.js b/source/Ox.UI/js/Form/Ox.TimeInput.js index cf7b9730..6e6b0e02 100644 --- a/source/Ox.UI/js/Form/Ox.TimeInput.js +++ b/source/Ox.UI/js/Form/Ox.TimeInput.js @@ -91,7 +91,7 @@ Ox.TimeInput = function(options, self) { that = Ox.InputGroup(Ox.extend(self.options, { id: self.options.id, - inputs: Ox.merge([ + inputs: [].concat([ self.$input.hours, self.$input.minutes, ], self.options.seconds ? [ @@ -102,7 +102,7 @@ Ox.TimeInput = function(options, self) { self.$input.ampm ] : []), join: join, - separators: Ox.merge([ + separators: [].concat([ {title: ':', width: 8}, ], self.options.seconds ? [ {title: ':', width: 8} @@ -156,7 +156,7 @@ Ox.TimeInput = function(options, self) { function split(value) { var values = getValues(); - return Ox.merge([ + return [].concat([ values.hours, values.minutes, ], self.options.seconds ? [ diff --git a/source/Ox.UI/js/List/Ox.IconList.js b/source/Ox.UI/js/List/Ox.IconList.js index de9cf602..d5c3ded0 100644 --- a/source/Ox.UI/js/List/Ox.IconList.js +++ b/source/Ox.UI/js/List/Ox.IconList.js @@ -121,10 +121,9 @@ Ox.IconList = function(options, self) { function updateKeys() { that.$element.options({ - keys: Ox.unique(Ox.merge( - self.options.sort[0].key, - self.options.keys - )) + keys: Ox.unique( + [self.options.sort[0].key].concat(self.options.keys) + ); }); } diff --git a/source/Ox.UI/js/List/Ox.InfoList.js b/source/Ox.UI/js/List/Ox.InfoList.js index 672abeae..9baf9cc1 100644 --- a/source/Ox.UI/js/List/Ox.InfoList.js +++ b/source/Ox.UI/js/List/Ox.InfoList.js @@ -148,10 +148,9 @@ Ox.InfoList = function(options, self) { function updateKeys() { that.$element.options({ - keys: Ox.unique(Ox.merge( - self.options.sort[0].key, - self.options.keys - )) + keys: Ox.unique( + [self.options.sort[0].key].concat(self.options.keys) + ); }); } diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 54885f11..c7959c9f 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -784,10 +784,10 @@ Ox.List = function(options, self) { return; } Ox.Log('List', that.oxid, 'loadPage', page); - var keys = Ox.merge( - self.options.keys.indexOf(self.options.unique) == -1 - ? [self.options.unique] : [], self.options.keys - ), + var keys = ( + self.options.keys.indexOf(self.options.unique == -1) + ? [self.options.unique] : [] + ).concat(self.options.keys), offset = page * self.pageLength, range = [offset, offset + getPageLength(page)]; 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]); } }); - self.options.items.splice.apply(self.options.items, Ox.merge([pos, 0], items)); - self.$items.splice.apply(self.$items, Ox.merge([pos, 0], $items)); + self.options.items.splice.apply(self.options.items, [pos, 0].concat(items)); + self.$items.splice.apply(self.$items, [pos, 0].concat($items)); self.listLength = self.options.items.length; //loadItems(); updatePositions(); diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 255ea032..28b8663e 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -204,9 +204,9 @@ Ox.TextList = function(options, self) { items: self.options.items, itemWidth: getItemWidth(), 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; - }), self.options.keys), + }).concat(self.options.keys), max: self.options.max, min: self.options.min, pageLength: self.options.pageLength, @@ -268,9 +268,9 @@ Ox.TextList = function(options, self) { that.$head.$content.empty(); constructHead(); that.$body.options({ - keys: Ox.merge(self.visibleColumns.map(function(column) { + keys: self.visibleColumns.map(function(column) { return column.id; - }), self.options.keys) + }).concat(self.options.keys) }); that.$body.reloadPages(); } @@ -592,7 +592,7 @@ Ox.TextList = function(options, self) { value = ( /^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox )['format' + Ox.toTitleCase(format.type)].apply( - this, Ox.merge([value], format.args || []) + this, [value].concat(format.args || []) ); } else { value = format(value, data); @@ -719,9 +719,9 @@ Ox.TextList = function(options, self) { width: itemWidth + 'px' }); that.$body.options({ - keys: Ox.merge(self.visibleColumns.map(function(column) { + keys: self.visibleColumns.map(function(column) { return column.id; - }), self.options.keys) + }).concat(self.options.keys) }); //that.$body.clearCache(); } diff --git a/source/Ox.UI/js/List/Ox.TreeList.js b/source/Ox.UI/js/List/Ox.TreeList.js index 806f40e4..dde2ffa0 100644 --- a/source/Ox.UI/js/List/Ox.TreeList.js +++ b/source/Ox.UI/js/List/Ox.TreeList.js @@ -190,7 +190,9 @@ Ox.TreeList = function(options, self) { : {} ); ret.push(item_); - item.items && Ox.merge(ret, item_.items); + if (item.items) { + ret = ret.concat(item_.items); + } }); return ret; } diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 16c4db22..451dd10c 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -473,7 +473,7 @@ Ox.ListMap = function(options, self) { self.$placeData = Ox.Element(); self.$placeForm = Ox.Form({ - items: Ox.merge([ + items: [].concat([ self.$nameInput = Ox.Input({ id: 'name', label: 'Name', @@ -1043,7 +1043,7 @@ Ox.ListMap = function(options, self) { showForm(place); if (self.options.hasMatches) { 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 !== ''; }); self.options.getMatches(names, function(matches) { @@ -1100,7 +1100,7 @@ Ox.ListMap = function(options, self) { function updateList(key, value) { var query = { - conditions: Ox.merge( + conditions: [].concat( ['all', 'name'].indexOf(key) > -1 ? [{key: 'name', value: value, operator: '='}] : [], ['all', 'alternativeNames'].indexOf(key) > -1 diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 7e850212..6a01715a 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -221,11 +221,11 @@ Ox.Map = function(options, self) { self.mapHeight = getMapHeight(); self.metaKey = false; self.minZoom = getMinZoom(); - self.placeKeys = Ox.merge([ + self.placeKeys = [ 'id', 'name', 'alternativeNames', 'geoname', 'countryCode', 'type', 'lat', 'lng', 'south', 'west', 'north', 'east', 'area', 'editable' - ], self.options.keys); + ].concat(self.options.keys); self.resultPlace = null; self.scaleMeters = [ 50000000, 20000000, 10000000, @@ -937,7 +937,7 @@ Ox.Map = function(options, self) { self.options.places({ keys: self.placeKeys, query: { - conditions: Ox.merge([ + conditions: [].concat([ {key: 'lat', value: [south, north], operator: '='} ], spansGlobe() ? [ {key: 'lng', value: [-180, 180], operator: '='} diff --git a/source/Ox.UI/js/Map/Ox.MapMarkerImage.js b/source/Ox.UI/js/Map/Ox.MapMarkerImage.js index 72dbd4ec..18f80a6d 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarkerImage.js +++ b/source/Ox.UI/js/Map/Ox.MapMarkerImage.js @@ -30,16 +30,14 @@ Ox.MapMarkerImage = (function() { if (!cache[index]) { var color = options.rectangle ? [0, 0, 0, 0] - : Ox.merge( - Ox.clone(options.color), + : options.color.concat( [options.type == 'place' ? 0.75 : 0.25] ), - border = Ox.merge( - options.mode == 'normal' ? [0, 0, 0] - : options.mode == 'selected' ? [255, 255, 255] - : [128, 128, 255], - [options.type == 'result' ? 0.5 : 1] - ), + border = ( + options.mode == 'normal' ? [0, 0, 0] + : options.mode == 'selected' ? [255, 255, 255] + : [128, 128, 255] + ).concat([options.type == 'result' ? 0.5 : 1]), c = Ox.canvas(options.size, options.size), image, r = options.size / 2; diff --git a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index 1ddeaf79..4bba3994 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -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: [ diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index fcbaa857..eb81b5f5 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -392,7 +392,7 @@ Ox.VideoEditor = function(options, self) { }); self.$keyboardShortcuts = $('
').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( $('
').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']; diff --git a/source/Ox.UI/js/Video/Ox.VideoPanel.js b/source/Ox.UI/js/Video/Ox.VideoPanel.js index 35c28868..a05ecff7 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPanel.js +++ b/source/Ox.UI/js/Video/Ox.VideoPanel.js @@ -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() { diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index 236d5dfa..2ea76eba 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -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, diff --git a/source/Ox/js/Array.js b/source/Ox/js/Array.js index 1c96dfc4..fbd9bef8 100644 --- a/source/Ox/js/Array.js +++ b/source/Ox/js/Array.js @@ -140,7 +140,7 @@ Ox.api = function(items, options) { } if (options.sort && result.data.items.length > 1) { // 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) { var key = v.key; if (api.enums[key]) { @@ -417,7 +417,7 @@ Ox.range Python-style range @*/ Ox.range = function() { 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); })); return arr; @@ -433,7 +433,7 @@ Ox.range = function() { var match; if (Ox.isString(val)) { match = arr_[i].match(/\d+/g); - match && Ox.merge(matches, match); + match && matches.concat(match); } }); // get length of longest number diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index ed2b61cd..b176678f 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -193,7 +193,7 @@ Ox.Log = (function() { return log.filter; }; 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() { log.filterEnabled = false; diff --git a/source/Ox/js/Function.js b/source/Ox/js/Function.js index 5ed25724..037213a1 100644 --- a/source/Ox/js/Function.js +++ b/source/Ox/js/Function.js @@ -28,7 +28,7 @@ Ox.cache = function(fn, options) { if (options.async) { if (!(key in cache)) { // 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 { // call callback with cached arguments callback.apply(this, cache[key]) diff --git a/source/Ox/js/Geo.js b/source/Ox/js/Geo.js index 1c9e6b60..93c98ff1 100644 --- a/source/Ox/js/Geo.js +++ b/source/Ox/js/Geo.js @@ -321,7 +321,7 @@ // intersect each part of the intersection // with all parts of the next area 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 : Ox.joinAreas(intersections); diff --git a/source/Ox/js/JavaScript.js b/source/Ox/js/JavaScript.js index 4081d1ca..f6b760fb 100644 --- a/source/Ox/js/JavaScript.js +++ b/source/Ox/js/JavaScript.js @@ -172,8 +172,8 @@ Ox.doc = (function() { lastItem.properties = lastItem.properties || []; lastItem.properties.push(item); // include leading linebreaks and whitespace - lastItem.source = Ox.merge( - lastItem.source, parseTokens(tokens[i], true) + lastItem.source = lastItem.source.concat( + parseTokens(tokens[i], true) ); } } else { @@ -294,7 +294,7 @@ Ox.doc = (function() { counter = 0, items = []; files && files.forEach(function(file) { Ox.get(file, function(source) { - items = Ox.merge(items, parseSource(source, file)); + items = items.concat(parseSource(source, file)); ++counter == files.length && callback(items); }); }); diff --git a/source/Ox/js/String.js b/source/Ox/js/String.js index 083048ef..9d63b156 100644 --- a/source/Ox/js/String.js +++ b/source/Ox/js/String.js @@ -88,7 +88,7 @@ Ox.highlightHTML = function(html, str, classname, tags) { position, positions = []; //fixme: default tags should be same as in parseHTML - tags = Ox.merge(tags || [], [ + tags = (tags || []).concat([ // inline formatting 'b', 'code', 'i', 's', 'sub', 'sup', 'u', // block formatting @@ -401,8 +401,8 @@ Ox.repeat = function(val, num) { var ret; if (Ox.isArray(val)) { ret = []; - num >= 1 && Ox.loop(num, function() { - ret = Ox.merge(ret, val); + Ox.loop(num, function() { + ret = ret.concat(val); }); } else { ret = num >= 1 ? new Array(num + 1).join(val.toString()) : '';