diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index 56e76ce3..b2372d65 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -748,7 +748,7 @@ Ox.Calendar = function(options, self) { function getEventLine(id) { var line = -1; Ox.forEach(self.lineEvents, function(events, line_) { - if (Ox.getPositionById(events, id) > -1) { + if (Ox.getIndexById(events, id) > -1) { line = line_; return false; } @@ -1261,7 +1261,7 @@ Ox.Calendar = function(options, self) { that.removeEvent = function() { Ox.Log('Calendar', 'REMOVE ... SELF.OPTIONS', self.options) - var index = Ox.getPositionById(self.options.events, self.options.selected); + var index = Ox.getIndexById(self.options.events, self.options.selected); self.options.events.splice(index, 1); getLines(); renderCalendar(); diff --git a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js index 65393053..e0d20855 100644 --- a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js +++ b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js @@ -495,7 +495,7 @@ Ox.ListCalendar = function(options, self) { function editEvent(key, value) { var id = self.selectedEvent, - index = Ox.getPositionById(self.options.events, id), + index = Ox.getIndexById(self.options.events, id), data = {id: id}; data[key] = value; self.options.editEvent(data, function(result) { @@ -552,7 +552,7 @@ Ox.ListCalendar = function(options, self) { function removeEvent() { var id = self.selectedEvent, - index = Ox.getPositionById(self.options.events, id); + index = Ox.getIndexById(self.options.events, id); self.options.removeEvent({id: id}, function(result) { if (result.status.code == '200') { self.options.events.splice(index, 1); diff --git a/source/Ox.UI/js/Core/Ox.DocPanel.js b/source/Ox.UI/js/Core/Ox.DocPanel.js index 53193e2f..b5b64263 100644 --- a/source/Ox.UI/js/Core/Ox.DocPanel.js +++ b/source/Ox.UI/js/Core/Ox.DocPanel.js @@ -83,7 +83,7 @@ Ox.DocPanel = function(options, self) { docItems.forEach(function(docItem) { var moduleIndex, sectionIndex; docItem.module = self.options.getModule(docItem); - moduleIndex = Ox.getPositionById(treeItems, '_' + docItem.module); + moduleIndex = Ox.getIndexById(treeItems, '_' + docItem.module); if (moduleIndex == -1) { treeItems.push({ id: '_' + docItem.module, @@ -94,7 +94,7 @@ Ox.DocPanel = function(options, self) { } docItem.section = self.options.getSection(docItem); if (docItem.section) { - sectionIndex = Ox.getPositionById( + sectionIndex = Ox.getIndexById( treeItems[moduleIndex].items, '_' + docItem.module + '_' + docItem.section ); diff --git a/source/Ox.UI/js/Core/Ox.URL.js b/source/Ox.UI/js/Core/Ox.URL.js index 2136fc73..0d47bd44 100644 --- a/source/Ox.UI/js/Core/Ox.URL.js +++ b/source/Ox.UI/js/Core/Ox.URL.js @@ -338,7 +338,7 @@ Ox.URL = function(options) { condition.key = condition.key || '*'; if ( !condition.operator - || Ox.getPositionById(self.options.findKeys, condition.key) == -1 + || Ox.getIndexById(self.options.findKeys, condition.key) == -1 ) { // missing operator or unknown key condition = {key: '*', value: str, operator: '='}; diff --git a/source/Ox.UI/js/Form/Ox.ArrayEditable.js b/source/Ox.UI/js/Form/Ox.ArrayEditable.js index b0df9034..d0c7711f 100644 --- a/source/Ox.UI/js/Form/Ox.ArrayEditable.js +++ b/source/Ox.UI/js/Form/Ox.ArrayEditable.js @@ -82,7 +82,7 @@ Ox.ArrayEditable = function(options, self) { } function getSelectedPosition() { - return Ox.getPositionById(self.options.items, self.options.selected); + return Ox.getIndexById(self.options.items, self.options.selected); } function renderItems() { diff --git a/source/Ox.UI/js/Form/Ox.Button.js b/source/Ox.UI/js/Form/Ox.Button.js index d9b30ec5..ee46380c 100644 --- a/source/Ox.UI/js/Form/Ox.Button.js +++ b/source/Ox.UI/js/Form/Ox.Button.js @@ -74,7 +74,7 @@ Ox.Button = function(options, self) { title: value.title || value }; }); - self.value = Ox.getPositionById(self.options.values, self.options.value); + self.value = Ox.getIndexById(self.options.values, self.options.value); if (self.value == -1) { self.value = 0; self.options.value = self.options.values[0].id; @@ -144,8 +144,7 @@ Ox.Button = function(options, self) { that.toggle = function() { if (self.options.values.length) { - self.value = 1 - Ox.getPositionById(self.options.values, self.options.value); - Ox.print('S:O:', self.options, self.value) + self.value = 1 - Ox.getIndexById(self.options.values, self.options.value); self.options.title = self.options.values[self.value].title; self.options.value = self.options.values[self.value].id; setTitle(); diff --git a/source/Ox.UI/js/Form/Ox.Filter.js b/source/Ox.UI/js/Form/Ox.Filter.js index 56a113e1..baad7f66 100644 --- a/source/Ox.UI/js/Form/Ox.Filter.js +++ b/source/Ox.UI/js/Form/Ox.Filter.js @@ -338,7 +338,7 @@ Ox.Filter = function(options, self) { Ox.Log('Form', 'old new', oldConditionType, newConditionType) condition.key = key; if (changeConditionType || changeConditionFormat) { - if (Ox.getPositionById(self.conditionOperators[newConditionType], condition.operator) == -1) { + if (Ox.getIndexById(self.conditionOperators[newConditionType], condition.operator) == -1) { condition.operator = self.conditionOperators[newConditionType][0].id; } if ( diff --git a/source/Ox.UI/js/Form/Ox.Form.js b/source/Ox.UI/js/Form/Ox.Form.js index fb7a5e21..f03424c4 100644 --- a/source/Ox.UI/js/Form/Ox.Form.js +++ b/source/Ox.UI/js/Form/Ox.Form.js @@ -164,7 +164,6 @@ Ox.Form = function(options, self) { var values = {}; if (arguments.length == 0) { self.$items.forEach(function($item, i) { - //Ox.print('??????-??', self.itemIds[i], self.$items[i].value(), Ox.typeOf(self.$items[i].value())) values[self.itemIds[i]] = self.$items[i].value(); }); //Ox.Log('Form', 'VALUES', values) diff --git a/source/Ox.UI/js/Form/Ox.FormPanel.js b/source/Ox.UI/js/Form/Ox.FormPanel.js index 28893e21..bf0181e1 100644 --- a/source/Ox.UI/js/Form/Ox.FormPanel.js +++ b/source/Ox.UI/js/Form/Ox.FormPanel.js @@ -115,7 +115,7 @@ Ox.FormPanel = function(options, self) { }); self.$forms.forEach(function($form, i) { - Ox.print(self.sections[i], 'valid', $form.valid()); + //Ox.print(self.sections[i], 'valid', $form.valid()); self.$list.value(self.sections[i], 'valid', $form.valid()); }); diff --git a/source/Ox.UI/js/Form/Ox.ObjectArrayInput.js b/source/Ox.UI/js/Form/Ox.ObjectArrayInput.js index 0f5664fc..4b5203eb 100644 --- a/source/Ox.UI/js/Form/Ox.ObjectArrayInput.js +++ b/source/Ox.UI/js/Form/Ox.ObjectArrayInput.js @@ -28,7 +28,6 @@ Ox.ObjectArrayInput = function(options, self) { setValue(self.options.value); function addInput(index, value) { - Ox.print('ADD INPUT', index, value) self.$element.splice(index, 0, Ox.Element() .css({ width: self.options.width + 'px', diff --git a/source/Ox.UI/js/Form/Ox.SelectInput.js b/source/Ox.UI/js/Form/Ox.SelectInput.js index 195dc31c..2efb4fef 100644 --- a/source/Ox.UI/js/Form/Ox.SelectInput.js +++ b/source/Ox.UI/js/Form/Ox.SelectInput.js @@ -81,7 +81,6 @@ Ox.SelectInput = function(options, self) { } function setValue(isOther) { - Ox.print('SET VALUE', isOther) if ( (!self.options.value && isOther !== true) || Ox.map(self.options.items, function(item) { @@ -120,7 +119,6 @@ Ox.SelectInput = function(options, self) { return getValue(); } else { self.options.value = arguments[0]; - Ox.print('SOV:::', self.options.value) setValue(); return that; } diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index eedb0f0f..f7dcf2e4 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -605,11 +605,11 @@ Ox.TextList = function(options, self) { } function getColumnIndexById(id) { - return Ox.getPositionById(self.options.columns, id); + return Ox.getIndexById(self.options.columns, id); } function getColumnPositionById(id) { - return Ox.getPositionById(self.visibleColumns, id); + return Ox.getIndexById(self.visibleColumns, id); } function getItem(id) { diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 51eb3f9f..c3f22db5 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -770,7 +770,7 @@ Ox.ListMap = function(options, self) { Ox.Log('Map', 'REMOVE PLACE', self.selectedPlace, index) if (!self.isAsync) { // fixme: doesn't call self.options.removePlace! - index = Ox.getPositionById(self.options.places, self.selectedPlace); + index = Ox.getIndexById(self.options.places, self.selectedPlace); self.options.places.splice(index, 1); self.$list.options({items: Ox.clone(self.options.places)}); //setStatus(); diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 5f06b562..a43c0b2a 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -1104,7 +1104,7 @@ Ox.Map = function(options, self) { place.id = '_' + place.id; self.options.selected = place.id; //Ox.Log('Map', 'removePlace', Ox.getObjectById(self.places, place.id)) - self.places.splice(Ox.getPositionById(self.places, place.id), 1); + self.places.splice(Ox.getIndexById(self.places, place.id), 1); self.resultPlace && self.resultPlace.remove(); self.resultPlace = place; place.marker.update(); diff --git a/source/Ox.UI/js/Menu/Ox.MainMenu.js b/source/Ox.UI/js/Menu/Ox.MainMenu.js index c8ab22ce..dd99a13f 100644 --- a/source/Ox.UI/js/Menu/Ox.MainMenu.js +++ b/source/Ox.UI/js/Menu/Ox.MainMenu.js @@ -205,7 +205,7 @@ Ox.MainMenu = function(options, self) { }; that.replaceMenu = function(id, menu) { - var position = Ox.getPositionById(self.options.menus, id); + var position = Ox.getIndexById(self.options.menus, id); self.options.menus[position] = menu; removeMenu(position); addMenu(menu, position); diff --git a/source/Ox.UI/js/Panel/Ox.TabPanel.js b/source/Ox.UI/js/Panel/Ox.TabPanel.js index 2b6e746f..f952be05 100644 --- a/source/Ox.UI/js/Panel/Ox.TabPanel.js +++ b/source/Ox.UI/js/Panel/Ox.TabPanel.js @@ -56,7 +56,7 @@ Ox.TabPanel = function(options, self) { } that.select = function(id) { - if (Ox.getPositionById(self.options.tabs, id) > -1) { + if (Ox.getIndexById(self.options.tabs, id) > -1) { self.$tabs.select(id); } }; diff --git a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index f62c615d..04b35fb5 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -142,7 +142,7 @@ Ox.AnnotationPanel = function(options, self) { open: function(data) { return; if (data.ids.length == 1) { - var pos = Ox.getPositionById(self.$annotations.options('items'), data.ids[0]); + var pos = Ox.getIndexById(self.$annotations.options('items'), data.ids[0]); self.$annotations.editItem(pos); } }, @@ -194,7 +194,6 @@ Ox.AnnotationPanel = function(options, self) { } function updateAnnotation(data) { - Ox.print('updateAnnotation', data); var item = Ox.getObjectById(self.options.items, data.id); item.value = data.value; that.triggerEvent('submit', item); @@ -251,7 +250,7 @@ Ox.AnnotationPanel = function(options, self) { removeItems removeItems @*/ that.removeItem = function(id) { - var pos = Ox.getPositionById(self.options.items, id); + var pos = Ox.getIndexById(self.options.items, id); self.options.items.splice(pos, 1); self.$annotations.removeItems && self.$annotations.removeItems([id]); }; diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 9ac65862..badefb99 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -1079,7 +1079,7 @@ Ox.VideoEditor = function(options, self) { item annotation to add @*/ that.addAnnotation = function(layer, item) { - var i = Ox.getPositionById(self.options.layers, layer); + var i = Ox.getIndexById(self.options.layers, layer); self.$annotationPanel[i].addItem(item); }; @@ -1090,7 +1090,7 @@ Ox.VideoEditor = function(options, self) { ids array of item ids to remove @*/ that.removeAnnotation = function(layer, id) { - var i = Ox.getPositionById(self.options.layers, layer); + var i = Ox.getIndexById(self.options.layers, layer); self.$annotationPanel[i].removeItem(id); }; diff --git a/source/Ox/js/Collection.js b/source/Ox/js/Collection.js index 9a8c4ed8..41265cfe 100644 --- a/source/Ox/js/Collection.js +++ b/source/Ox/js/Collection.js @@ -212,8 +212,7 @@ Ox.getIndexById Returns the first array index of an object with a given id > Ox.getIndexById([{id: 'foo', str: 'Foo'}, {id: 'bar', str: 'Bar'}], 'foo') 0 @*/ -// FIXME: this should be getIndexById() only -Ox.getIndexById = Ox.getPositionById = function(arr, id) { +Ox.getIndexById = function(arr, id) { return Ox.getIndex(arr, 'id', id); };