diff --git a/source/Ox.UI/js/Form/Ox.ObjectInput.js b/source/Ox.UI/js/Form/Ox.ObjectInput.js index 4a9035c9..846881f4 100644 --- a/source/Ox.UI/js/Form/Ox.ObjectInput.js +++ b/source/Ox.UI/js/Form/Ox.ObjectInput.js @@ -23,6 +23,11 @@ Ox.ObjectInput = function(options, self) { labelWidth: self.options.labelWidth, width: self.options.width }) + .bindEvent({ + change: function(data) { + // ... + } + }) .appendTo(that); }); diff --git a/source/Ox.UI/js/Form/Ox.SelectInput.js b/source/Ox.UI/js/Form/Ox.SelectInput.js index 85fe0bbb..c1a81097 100644 --- a/source/Ox.UI/js/Form/Ox.SelectInput.js +++ b/source/Ox.UI/js/Form/Ox.SelectInput.js @@ -1,4 +1,4 @@ -'use strict' +'use strict'; Ox.SelectInput = function(options, self) { diff --git a/source/Ox/js/DOM.js b/source/Ox/js/DOM.js index bac0b2a3..893356ba 100644 --- a/source/Ox/js/DOM.js +++ b/source/Ox/js/DOM.js @@ -52,7 +52,7 @@ Ox.documentReady = (function() { callbacks.push(callback); return false; } - } + }; }()); /*@ diff --git a/source/Ox/js/Encoding.js b/source/Ox/js/Encoding.js index 81a7e256..b4d7fd95 100644 --- a/source/Ox/js/Encoding.js +++ b/source/Ox/js/Encoding.js @@ -42,26 +42,32 @@ } /*@ - Ox.encodeBase26 Encode a number as base26 - > Ox.encodeBase26(3758) + Ox.encodeBase26 Encode a number as bijective base26 + See + Bijective numeration. + > Ox.encodeBase26(4461) 'FOO' @*/ Ox.encodeBase26 = function(num) { - return Ox.map(num.toString(26), function(char) { - return Ox.char(65 + parseInt(char, 26)); - }).join(''); + var ret = ''; + while (num) { + ret = String.fromCharCode(64 + num % 26) + ret; + num = parseInt(num / 26); + } + return ret; }; /*@ - Ox.decodeBase26 Decodes a base26-encoded number - See Base 32. + Ox.decodeBase26 Decodes a bijective base26-encoded number + See + Bijective numeration. > Ox.decodeBase26('foo') - 3758 + 4461 @*/ Ox.decodeBase26 = function(str) { - return parseInt(Ox.map(str.toUpperCase(), function(char) { - return (char.charCodeAt(0) - 65).toString(26); - }).join(''), 26); + return str.toUpperCase().split('').reverse().reduce(function(p, v, i) { + return p + (v.charCodeAt(0) - 64) * Math.pow(26, i); + }, 0); }; /*@