reformat for readability, add new to Ox.Input instances

This commit is contained in:
j 2011-02-11 19:24:54 +05:30
parent d7fb9e3dad
commit 2ad5d1d9e7

View file

@ -2852,7 +2852,7 @@ requires
trackValues boolean trackValues boolean
serialize serialize
textAlign 'left', 'center' or 'right' textAlign 'left', 'center' or 'right'
type 'float', 'integer', 'password', 'text' type 'float', 'integer', 'password', 'text', 'textarea'
value string value string
validate function, remote validation validate function, remote validation
width integer, px width integer, px
@ -3070,15 +3070,18 @@ requires
Ox.print('autocomplete', oldValue, oldCursor) Ox.print('autocomplete', oldValue, oldCursor)
if (self.options.value || self.options.autocompleteReplaceCorrect) { if (self.options.value || self.options.autocompleteReplaceCorrect) {
Ox.isFunction(self.options.autocomplete) ? if(Ox.isFunction(self.options.autocomplete)) {
(self.options.key ? self.options.autocomplete( if(self.options.key) {
self.options.key, self.options.autocomplete(self.options.key,
self.options.value, self.options.value,
autocompleteCallback autocompleteCallback)
) : self.options.autocomplete( } else {
self.options.value, self.options.autocomplete(self.options.value,
autocompleteCallback autocompleteCallback)
)) : autocompleteCallback(autocompleteFunction(self.options.value)); }
} else {
autocompleteCallback(autocompleteFunction(self.options.value));
}
} }
if (!self.options.value) { if (!self.options.value) {
self.options.autocompleteSelect && self.$autocompleteMenu.hideMenu(); self.options.autocompleteSelect && self.$autocompleteMenu.hideMenu();
@ -3186,20 +3189,21 @@ requires
oldCursor = arguments[1]; oldCursor = arguments[1];
} }
Ox.isFunction(self.options.autovalidate) ? if(Ox.isFunction(self.options.autovalidate)) {
(self.options.key ? self.options.autovalidate( if(self.options.key) {
self.options.key, self.options.autovalidate(self.options.key, self.options.value,
self.options.value, blur, autovalidateCallback);
blur, } else {
autovalidateCallback self.options.autovalidate(self.options.value, blur,
) : self.options.autovalidate( autovalidateCallback);
self.options.value, }
blur, } else {
autovalidateCallback if(Ox.isRegExp(self.options.autovalidate)) {
)) : (Ox.isRegExp(self.options.autovalidate) ? autovalidateCallback(autovalidateFunction(self.options.value));
autovalidateCallback(autovalidateFunction(self.options.value)) : } else {
autovalidateTypeFunction(self.options.type, self.options.value) autovalidateTypeFunction(self.options.type, self.options.value);
); }
}
function autovalidateFunction(value) { function autovalidateFunction(value) {
var regexp = new RegExp(self.options.autovalidate); var regexp = new RegExp(self.options.autovalidate);
@ -4096,7 +4100,7 @@ requires
self.values = getValues(); self.values = getValues();
self.$input = { self.$input = {
hours: Ox.Input({ hours: new Ox.Input({
autocomplete: $.map(self.options.ampm ? Ox.range(1, 13) : Ox.range(0, 24), function(v) { autocomplete: $.map(self.options.ampm ? Ox.range(1, 13) : Ox.range(0, 24), function(v) {
return Ox.pad(v, 2); return Ox.pad(v, 2);
}), }),
@ -4107,7 +4111,7 @@ requires
value: self.values.hours, value: self.values.hours,
width: 32 width: 32
}), }),
minutes: Ox.Input({ minutes: new Ox.Input({
autocomplete: $.map(Ox.range(0, 60), function(v) { autocomplete: $.map(Ox.range(0, 60), function(v) {
return Ox.pad(v, 2); return Ox.pad(v, 2);
}), }),
@ -4118,7 +4122,7 @@ requires
value: self.values.minutes, value: self.values.minutes,
width: 32 width: 32
}), }),
seconds: Ox.Input({ seconds: new Ox.Input({
autocomplete: $.map(Ox.range(0, 60), function(v) { autocomplete: $.map(Ox.range(0, 60), function(v) {
return Ox.pad(v, 2); return Ox.pad(v, 2);
}), }),
@ -4129,7 +4133,7 @@ requires
value: self.values.seconds, value: self.values.seconds,
width: 32 width: 32
}), }),
milliseconds: Ox.Input({ milliseconds: new Ox.Input({
autocomplete: $.map(Ox.range(0, 1000), function(v) { autocomplete: $.map(Ox.range(0, 1000), function(v) {
return Ox.pad(v, 3); return Ox.pad(v, 3);
}), }),
@ -4140,7 +4144,7 @@ requires
value: self.values.milliseconds, value: self.values.milliseconds,
width: 40 width: 40
}), }),
ampm: Ox.Input({ ampm: new Ox.Input({
autocomplete: ['AM', 'PM'], autocomplete: ['AM', 'PM'],
autocompleteReplace: true, autocompleteReplace: true,
autocompleteReplaceCorrect: true, autocompleteReplaceCorrect: true,
@ -8498,7 +8502,7 @@ requires
.css({ .css({
width: width + 'px' width: width + 'px'
}); });
$input = Ox.Input({ $input = new Ox.Input({
autovalidate: column.input.autovalidate, autovalidate: column.input.autovalidate,
style: 'square', style: 'square',
value: html, value: html,