From c1c4441b106e04b1cc935883d0d9d5084a7347ff Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 18 Dec 2011 15:14:11 +0530 Subject: [PATCH] update uses of focusInput() --- source/Ox.UI/js/Calendar/Ox.ListCalendar.js | 2 +- source/Ox.UI/js/Form/Ox.ArrayInput.js | 4 ++-- source/Ox.UI/js/Form/Ox.Input.js | 14 +++++++------- source/Ox.UI/js/Form/Ox.InputGroup.js | 2 +- source/Ox.UI/js/List/Ox.TextList.js | 2 +- source/Ox.UI/js/Video/Ox.VideoEditor.js | 4 ++-- source/Ox.UI/js/Video/Ox.VideoPlayer.js | 4 ++-- source/Ox/js/Collection.js | 2 ++ source/Ox/js/Encoding.js | 4 +++- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js index 8e440895..51326fff 100644 --- a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js +++ b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js @@ -486,7 +486,7 @@ Ox.ListCalendar = function(options, self) { Ox.Log('Calendar', 'TIME TO SET LIST OPTIONS:', +new Date() - time0); self.$calendar.addEvent(event); selectEvent(event); - self.$nameInput.focusInput(); + self.$nameInput.focusInput(true); } else { alert(result.status.text); } diff --git a/source/Ox.UI/js/Form/Ox.ArrayInput.js b/source/Ox.UI/js/Form/Ox.ArrayInput.js index 7c293719..0f464040 100644 --- a/source/Ox.UI/js/Form/Ox.ArrayInput.js +++ b/source/Ox.UI/js/Form/Ox.ArrayInput.js @@ -66,7 +66,7 @@ Ox.ArrayInput = function(options, self) { } }) .appendTo(self.$element[index])); - focus && self.$input[index].focusInput(); + focus && self.$input[index].focusInput(true); self.$removeButton.splice(index, 0, Ox.Button({ title: self.$input.length == 1 ? 'close' : 'remove', type: 'image' @@ -83,7 +83,7 @@ Ox.ArrayInput = function(options, self) { }); } if (self.$input.length == 1) { - self.$input[0].focusInput(); + self.$input[0].focusInput(true); } else { removeInput(index); } diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index fe474561..21574366 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -768,7 +768,7 @@ Ox.Input = function(options, self) { if (self.options.value === '') { if (self.options.type == 'password') { self.$placeholder.hide(); - self.$input.show().focusInput(); + self.$input.show().focusInput(true); } else { self.$input .removeClass('OxPlaceholder') @@ -1138,7 +1138,7 @@ Ox.Input_ = function(options, self) { float: 'left' }) .click(function() { - that.$input[0].focusInput(); + that.$input[0].focusInput(true); }) .appendTo(that); } else if (key.label.length > 1) { @@ -1192,7 +1192,7 @@ Ox.Input_ = function(options, self) { float: 'right' }) .click(function() { - that.$input[0].focusInput(); + that.$input[0].focusInput(true); }) .appendTo(that); } else if (self.options.unit.length > 1) { @@ -1232,7 +1232,7 @@ Ox.Input_ = function(options, self) { marginLeft: (v.width - (i == 0 ? 16 : 32)) + 'px' }) .click(function() { - that.$input[0].focusInput(); + that.$input[0].focusInput(true); }) .appendTo(that); } @@ -1307,7 +1307,7 @@ Ox.Input_ = function(options, self) { } if (self.options.label) { //that.$label.html(self.option.title); - that.$input[0].focusInput(); + that.$input[0].focusInput(true); //autocompleteCall(); } else { that.$input[0].options({ @@ -1326,14 +1326,14 @@ Ox.Input_ = function(options, self) { } function changeUnit() { - that.$input[0].focusInput(); + that.$input[0].focusInput(true); } function clear() { that.$input.forEach(function(v, i) { v.val(''); }); - that.$input[0].focusInput(); + that.$input[0].focusInput(true); } function height(value) { diff --git a/source/Ox.UI/js/Form/Ox.InputGroup.js b/source/Ox.UI/js/Form/Ox.InputGroup.js index c0b8ff80..c8f38163 100644 --- a/source/Ox.UI/js/Form/Ox.InputGroup.js +++ b/source/Ox.UI/js/Form/Ox.InputGroup.js @@ -89,7 +89,7 @@ Ox.InputGroup = function(options, self) { if ($(event.target).hasClass('OxSeparator')) { Ox.forEach(self.options.inputs, function($input) { if ($input.focusInput) { - $input.focusInput(); + $input.focusInput(true); return false; } }); diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 677c1c51..d44d45c2 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -857,7 +857,7 @@ Ox.TextList = function(options, self) { blur: submit, }) .appendTo($cell); - //.focusInput(); + //.focusInput(true); setTimeout($input.focusInput, 0); // fixme: strange function submit() { var value = $input.value(); diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 1f38ba9e..40c08a03 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -79,7 +79,7 @@ Ox.VideoEditor = function(options, self) { }, key_f: function() { setTimeout(function() { - self.$findInput.focusInput(); + self.$findInput.focusInput(true); }); }, key_g: function() { @@ -1004,7 +1004,7 @@ Ox.VideoEditor = function(options, self) { if (self.results.length) { setPosition(getNextPosition('result', 1)); } else { - self.$findInput.focusInput(); + self.$findInput.focusInput(true); } } } diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index 961733a5..84827d4d 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -1115,7 +1115,7 @@ Ox.VideoPlayer = function(options, self) { if (self.$find.is(':hidden')) { toggleFind(); } else { - self.$findInput.focusInput(); + self.$findInput.focusInput(true); } }, 0); } @@ -1999,7 +1999,7 @@ Ox.VideoPlayer = function(options, self) { results: self.results }); if (hasPressedEnter) { - self.results.length ? goToNextResult(1) : self.$findInput.focusInput(); + self.results.length ? goToNextResult(1) : self.$findInput.focusInput(true); } that.triggerEvent('find', {find: self.options.find}); } diff --git a/source/Ox/js/Collection.js b/source/Ox/js/Collection.js index 6d916974..9544e4a6 100644 --- a/source/Ox/js/Collection.js +++ b/source/Ox/js/Collection.js @@ -664,6 +664,8 @@ Ox.sub Returns a substring or sub-array "ooba" > Ox.sub('foobar', -5, -1) "ooba" + > Ox.sub('foo', -1, 0) + "" @*/ Ox.sub = function(col, start, stop) { stop = Ox.isUndefined(stop) ? col.length : stop; diff --git a/source/Ox/js/Encoding.js b/source/Ox/js/Encoding.js index 3a2faeb0..42cec791 100644 --- a/source/Ox/js/Encoding.js +++ b/source/Ox/js/Encoding.js @@ -96,7 +96,9 @@ @*/ Ox.decodeBase32 = function(str) { return parseInt(Ox.map(str.toUpperCase(), function(char) { - var index = Ox.BASE_32_DIGITS.indexOf(Ox.BASE_32_ALIASES[char] || char); + var index = Ox.BASE_32_DIGITS.indexOf( + Ox.BASE_32_ALIASES[char] || char + ); return (index == -1 ? ' ' : index).toString(32); }).join(''), 32); };