use Ox.Log
This commit is contained in:
parent
92d25b6776
commit
dce2843303
50 changed files with 276 additions and 276 deletions
|
|
@ -36,14 +36,14 @@ Ox.ArrayInput = function(options, self) {
|
|||
});
|
||||
|
||||
function addInput(i, value, focus) {
|
||||
Ox.print('add', i)
|
||||
Ox.Log('Form', 'add', i)
|
||||
self.$element.splice(i, 0, Ox.Element()
|
||||
.css({height: '16px', marginTop: self.options.label || i > 0 ? '8px' : 0})
|
||||
.data({index: i}));
|
||||
if (i == 0) {
|
||||
self.$element[i].appendTo(that);
|
||||
} else {
|
||||
Ox.print(i, self.$element)
|
||||
Ox.Log('Form', i, self.$element)
|
||||
self.$element[i].insertAfter(self.$element[i - 1]);
|
||||
}
|
||||
self.$input.splice(i, 0, Ox.Input({
|
||||
|
|
@ -99,7 +99,7 @@ Ox.ArrayInput = function(options, self) {
|
|||
}
|
||||
|
||||
function removeInput(i) {
|
||||
Ox.print('remove', i);
|
||||
Ox.Log('Form', 'remove', i);
|
||||
['input', 'removeButton', 'addButton', 'element'].forEach(function(element) {
|
||||
var key = '$' + element;
|
||||
self[key][i].removeElement();
|
||||
|
|
@ -133,7 +133,7 @@ Ox.ArrayInput = function(options, self) {
|
|||
|
||||
function updateIndices() {
|
||||
self.$element.forEach(function($element, i) {
|
||||
Ox.print(i, $element)
|
||||
Ox.Log('Form', i, $element)
|
||||
$element.data({index: i});
|
||||
});
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ Ox.CheckboxGroup = function(options, self) {
|
|||
|
||||
function change(pos) {
|
||||
var toggled = self.optionGroup.toggle(pos);
|
||||
//Ox.print('change', pos, 'toggled', toggled)
|
||||
//Ox.Log('Form', 'change', pos, 'toggled', toggled)
|
||||
if (toggled.length) {
|
||||
toggled.forEach(function(pos, i) {
|
||||
self.$checkboxes[pos].toggleChecked();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Ox.ColorInput = function(options, self) {
|
|||
id: 'picker'
|
||||
})
|
||||
.bindEvent('change', function(data) {
|
||||
//Ox.print('change function called');
|
||||
//Ox.Log('Form', 'change function called');
|
||||
self.options.value = data.value;
|
||||
self.values = data.value.split(', ');
|
||||
Ox.range(3).forEach(function(i) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Ox.ColorPicker = function(options, self) {
|
|||
})
|
||||
.options(options || {});
|
||||
|
||||
//Ox.print(self)
|
||||
//Ox.Log('Form', self)
|
||||
self.$ranges = [];
|
||||
self.rgb = ['red', 'green', 'blue'];
|
||||
self.values = self.options.value.split(', ');
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ Ox.DateInput = function(options, self) {
|
|||
width: 0
|
||||
}), self);
|
||||
|
||||
//Ox.print('SELF', self)
|
||||
//Ox.Log('Form', 'SELF', self)
|
||||
|
||||
function changeDay() {
|
||||
self.options.weekday && self.$input.weekday.options({
|
||||
|
|
@ -137,7 +137,7 @@ Ox.DateInput = function(options, self) {
|
|||
year = self.$input.year.options('value'),
|
||||
days = Ox.getDaysInMonth(year, self.options.format == 'short' ? parseInt(month, 10) : month);
|
||||
day = day <= days ? day : days;
|
||||
//Ox.print(year, month, 'day days', day, days)
|
||||
//Ox.Log('Form', year, month, 'day days', day, days)
|
||||
self.options.weekday && self.$input.weekday.options({
|
||||
value: Ox.formatDate(new Date([month, day, year].join(' ')), self.formats.weekday)
|
||||
});
|
||||
|
|
@ -169,7 +169,7 @@ Ox.DateInput = function(options, self) {
|
|||
}
|
||||
|
||||
function getDateInWeek(weekday, month, day, year) {
|
||||
//Ox.print([month, day, year].join(' '))
|
||||
//Ox.Log('Form', [month, day, year].join(' '))
|
||||
var date = new Date([month, day, year].join(' '));
|
||||
date = Ox.getDateInWeek(date, weekday);
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Ox.DateTimeInput = function(options, self) {
|
|||
.options(options || {});
|
||||
|
||||
self.values = self.options.value.split(' ');
|
||||
//Ox.print(self.values)
|
||||
//Ox.Log('Form', self.values)
|
||||
|
||||
that = Ox.InputGroup({
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ Ox.Editable = function(options, self) {
|
|||
//height = self.options.height || Ox.limit(self.$test.height() + 2, self.minHeight, self.maxHeight);
|
||||
height = self.options.height || Math.max(self.$test.height() + 2, self.minHeight);
|
||||
width = self.options.width || Ox.limit(self.$test.width() + 2, self.minWidth, self.maxWidth);
|
||||
Ox.print(self.options.width, self.$test.width(), 'wxh', width, height)
|
||||
Ox.Log('Form', self.options.width, self.$test.width(), 'wxh', width, height)
|
||||
if (self.options.type == 'input') {
|
||||
self.$input.options({
|
||||
width: width
|
||||
|
|
@ -116,7 +116,7 @@ Ox.Editable = function(options, self) {
|
|||
height = self.options.height || self.$value.height();
|
||||
width = self.options.width || self.$value.width();
|
||||
self.$value.hide();
|
||||
Ox.print('H:::', self.options.height, height)
|
||||
Ox.Log('Form', 'H:::', self.options.height, height)
|
||||
if (!self.$test) {
|
||||
self.$test = self.$value.$element.clone()
|
||||
.css(Ox.extend({display: 'inline-block'}, self.css))
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ Ox.Filter = function(options, self) {
|
|||
} else if (self.options.query.operator == '') {
|
||||
self.options.query.operator = '&';
|
||||
}
|
||||
Ox.print('Ox.Filter self.options', self.options)
|
||||
Ox.Log('Form', 'Ox.Filter self.options', self.options)
|
||||
|
||||
self.conditionOperators = {
|
||||
date: [
|
||||
|
|
@ -271,7 +271,7 @@ Ox.Filter = function(options, self) {
|
|||
operator: self.conditionOperators[key.type][0].id
|
||||
};
|
||||
if (isGroup) {
|
||||
Ox.print('isGroup', self.options.query.operator)
|
||||
Ox.Log('Form', 'isGroup', self.options.query.operator)
|
||||
condition = {
|
||||
conditions: [condition],
|
||||
operator: self.options.query.operator == '&' ? '|' : '&'
|
||||
|
|
@ -290,7 +290,7 @@ Ox.Filter = function(options, self) {
|
|||
|
||||
function changeConditionKey(pos, subpos, key) {
|
||||
subpos = Ox.isUndefined(subpos) ? -1 : subpos;
|
||||
Ox.print('changeConditionKey', pos, subpos, key);
|
||||
Ox.Log('Form', 'changeConditionKey', pos, subpos, key);
|
||||
var condition = subpos == -1
|
||||
? self.options.query.conditions[pos]
|
||||
: self.options.query.conditions[pos].conditions[subpos],
|
||||
|
|
@ -301,7 +301,7 @@ Ox.Filter = function(options, self) {
|
|||
newConditionType = getConditionType(newType),
|
||||
changeConditionType = oldConditionType != newConditionType,
|
||||
wasUselessCondition = isUselessCondition(pos, subpos);
|
||||
Ox.print('old new', oldConditionType, newConditionType)
|
||||
Ox.Log('Form', 'old new', oldConditionType, newConditionType)
|
||||
condition.key = key;
|
||||
if (changeConditionType) {
|
||||
renderConditions();
|
||||
|
|
@ -314,7 +314,7 @@ Ox.Filter = function(options, self) {
|
|||
|
||||
function changeConditionOperator(pos, subpos, operator) {
|
||||
subpos = Ox.isUndefined(subpos) ? -1 : subpos;
|
||||
Ox.print('chCoOp', pos, subpos, operator)
|
||||
Ox.Log('Form', 'chCoOp', pos, subpos, operator)
|
||||
var condition = subpos == -1
|
||||
? self.options.query.conditions[pos]
|
||||
: self.options.query.conditions[pos].conditions[subpos],
|
||||
|
|
@ -382,7 +382,7 @@ Ox.Filter = function(options, self) {
|
|||
&& condition.value === ''
|
||||
return isUseless;
|
||||
});
|
||||
Ox.print('isUseless', isUseless);
|
||||
Ox.Log('Form', 'isUseless', isUseless);
|
||||
return isUseless;
|
||||
}
|
||||
|
||||
|
|
@ -413,7 +413,7 @@ Ox.Filter = function(options, self) {
|
|||
.css({margin: '0 4px 0 ' + (isGroup ? '292px' : '8px')}) // fixme: 296 is probably correct, but labels seem to be too wide
|
||||
.bindEvent({
|
||||
click: function(data) {
|
||||
Ox.print('remove...', data)
|
||||
Ox.Log('Form', 'remove...', data)
|
||||
if (data._element.parent().data('subposition') == -1) {
|
||||
removeCondition(data._element.parent().data('position'));
|
||||
} else {
|
||||
|
|
@ -432,7 +432,7 @@ Ox.Filter = function(options, self) {
|
|||
.css({margin: '0 ' + (subpos == -1 ? '4px' : '0') + ' 0 4px'})
|
||||
.bindEvent({
|
||||
click: function(data) {
|
||||
Ox.print('add...', data, data._element.parent().data('position'), data._element.parent().data('subposition'))
|
||||
Ox.Log('Form', 'add...', data, data._element.parent().data('position'), data._element.parent().data('subposition'))
|
||||
if (data._element.parent().data('subposition') == -1) {
|
||||
addCondition(data._element.parent().data('position') + 1);
|
||||
} else {
|
||||
|
|
@ -463,7 +463,7 @@ Ox.Filter = function(options, self) {
|
|||
var condition = subpos == -1
|
||||
? self.options.query.conditions[pos]
|
||||
: self.options.query.conditions[pos].conditions[subpos];
|
||||
Ox.print('renderCondition', condition, pos, subpos)
|
||||
Ox.Log('Form', 'renderCondition', condition, pos, subpos)
|
||||
return Ox.FormElementGroup({
|
||||
elements: Ox.merge([
|
||||
renderConditionKey(condition),
|
||||
|
|
@ -501,7 +501,7 @@ Ox.Filter = function(options, self) {
|
|||
}
|
||||
|
||||
function renderConditionOperator(condition) {
|
||||
Ox.print('rCO', condition)
|
||||
Ox.Log('Form', 'rCO', condition)
|
||||
return Ox.Select({
|
||||
items: self.conditionOperators[getConditionType(
|
||||
Ox.getObjectById(self.options.findKeys, condition.key).type
|
||||
|
|
@ -552,7 +552,7 @@ Ox.Filter = function(options, self) {
|
|||
}
|
||||
|
||||
function renderConditions() {
|
||||
Ox.print('renderConditions', self.options.query)
|
||||
Ox.Log('Form', 'renderConditions', self.options.query)
|
||||
var $conditions = [];
|
||||
while (self.$form.options('items').length > self.numberOfAdditionalFormItems) {
|
||||
self.$form.removeItem(1);
|
||||
|
|
@ -615,7 +615,7 @@ Ox.Filter = function(options, self) {
|
|||
}
|
||||
|
||||
function renderInput(condition, index) {
|
||||
Ox.print('renderInput', condition)
|
||||
Ox.Log('Form', 'renderInput', condition)
|
||||
var $input,
|
||||
findKey = Ox.getObjectById(self.options.findKeys, condition.key),
|
||||
isArray = Ox.isArray(condition.value),
|
||||
|
|
@ -623,7 +623,7 @@ Ox.Filter = function(options, self) {
|
|||
type = findKey.type == 'integer' ? 'int' : findKey.type,
|
||||
formatArgs, formatType, title;
|
||||
if (findKey.format) {
|
||||
Ox.print('findKey.format', findKey.format)
|
||||
Ox.Log('Form', 'findKey.format', findKey.format)
|
||||
formatArgs = findKey.format.args
|
||||
formatType = findKey.format.type;
|
||||
if (formatType == 'color') {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ Ox.Form = function(options, self) {
|
|||
|
||||
function validateForm(pos, valid) {
|
||||
self.itemIsValid[pos] = valid;
|
||||
Ox.print('VALID???', self.itemIsValid)
|
||||
Ox.Log('Form', 'VALID???', self.itemIsValid)
|
||||
if (Ox.every(self.itemIsValid) != self.formIsValid) {
|
||||
self.formIsValid = !self.formIsValid;
|
||||
that.triggerEvent('validate', {
|
||||
|
|
@ -113,7 +113,7 @@ Ox.Form = function(options, self) {
|
|||
}
|
||||
|
||||
that.addItem = function(pos, item) {
|
||||
Ox.print('addItem', pos)
|
||||
Ox.Log('Form', 'addItem', pos)
|
||||
self.options.items.splice(pos, 0, item);
|
||||
self.$items.splice(pos, 0, Ox.FormItem({element: item}));
|
||||
pos == 0 ?
|
||||
|
|
@ -122,7 +122,7 @@ Ox.Form = function(options, self) {
|
|||
}
|
||||
|
||||
that.removeItem = function(pos) {
|
||||
Ox.print('removeItem', pos);
|
||||
Ox.Log('Form', 'removeItem', pos);
|
||||
self.$items[pos].removeElement();
|
||||
self.options.items.splice(pos, 1);
|
||||
self.$items.splice(pos, 1);
|
||||
|
|
@ -130,7 +130,7 @@ Ox.Form = function(options, self) {
|
|||
|
||||
that.submit = function() {
|
||||
// fixme: this seems to be unneeded
|
||||
//Ox.print('---- that.values()', that.values())
|
||||
//Ox.Log('Form', '---- that.values()', that.values())
|
||||
self.options.submit(that.values(), submitCallback);
|
||||
};
|
||||
|
||||
|
|
@ -147,13 +147,13 @@ Ox.Form = function(options, self) {
|
|||
//fixme: make the following work
|
||||
//values[self.itemIds[i]] = self.$items[i].options('value');
|
||||
});
|
||||
//Ox.print('VALUES', values)
|
||||
//Ox.Log('Form', 'VALUES', values)
|
||||
return values;
|
||||
} else {
|
||||
Ox.print('SET FORM VALUES', arguments[0])
|
||||
Ox.Log('Form', 'SET FORM VALUES', arguments[0])
|
||||
Ox.forEach(arguments[0], function(value, key) {
|
||||
var index = getItemIndexById(key);
|
||||
//index > -1 && Ox.print(':::::::', key, value)
|
||||
//index > -1 && Ox.Log('Form', ':::::::', key, value)
|
||||
index > -1 && self.options.items[index].options({value: value});
|
||||
});
|
||||
return that;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ Ox.FormElementGroup = function(options, self) {
|
|||
};
|
||||
|
||||
that.replaceElement = function(pos, element) {
|
||||
Ox.print('Ox.FormElementGroup replaceElement', pos, element)
|
||||
Ox.Log('Form', 'Ox.FormElementGroup replaceElement', pos, element)
|
||||
self.options.elements[pos].replaceWith(element.$element);
|
||||
self.options.elements[pos] = element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ Ox.Input = function(options, self) {
|
|||
.appendTo(that.$element);
|
||||
|
||||
if (self.options.type == 'textarea') {
|
||||
Ox.print('TEXTAREA', self.options.width, self.options.height, '...', that.css('width'), that.css('height'), '...', self.$input.css('width'), self.$input.css('height'), '...', self.$input.css('border'))
|
||||
Ox.Log('Form', 'TEXTAREA', self.options.width, self.options.height, '...', that.css('width'), that.css('height'), '...', self.$input.css('width'), self.$input.css('height'), '...', self.$input.css('border'))
|
||||
}
|
||||
|
||||
// fixme: is there a better way than this one?
|
||||
|
|
@ -299,7 +299,7 @@ Ox.Input = function(options, self) {
|
|||
oldValue = Ox.isUndefined(oldValue) ? self.options.value : oldValue;
|
||||
oldCursor = Ox.isUndefined(oldCursor) ? cursor() : oldCursor;
|
||||
|
||||
Ox.print('autocomplete', oldValue, oldCursor)
|
||||
Ox.Log('Form', 'autocomplete', oldValue, oldCursor)
|
||||
|
||||
if (self.options.value || self.options.autocompleteReplaceCorrect) {
|
||||
if (Ox.isFunction(self.options.autocomplete)) {
|
||||
|
|
@ -333,7 +333,7 @@ Ox.Input = function(options, self) {
|
|||
|
||||
function autocompleteCallback(values) {
|
||||
|
||||
//Ox.print('autocompleteCallback', values[0], self.options.value, self.options.value.length, oldValue, oldCursor)
|
||||
//Ox.Log('Form', 'autocompleteCallback', values[0], self.options.value, self.options.value.length, oldValue, oldCursor)
|
||||
|
||||
var length = self.options.value.length,
|
||||
newValue, newLength,
|
||||
|
|
@ -357,7 +357,7 @@ Ox.Input = function(options, self) {
|
|||
}
|
||||
newLength = newValue.length;
|
||||
|
||||
//Ox.print('selectEnd', selectEnd)
|
||||
//Ox.Log('Form', 'selectEnd', selectEnd)
|
||||
|
||||
if (self.options.autocompleteReplace) {
|
||||
value = self.options.value;
|
||||
|
|
@ -538,7 +538,7 @@ Ox.Input = function(options, self) {
|
|||
}
|
||||
|
||||
function autovalidateCallback(data) {
|
||||
//Ox.print('autovalidateCallback', newValue, oldCursor)
|
||||
//Ox.Log('Form', 'autovalidateCallback', newValue, oldCursor)
|
||||
self.options.value = data.value;
|
||||
self.$input.val(self.options.value);
|
||||
!blur && cursor(
|
||||
|
|
@ -555,7 +555,7 @@ Ox.Input = function(options, self) {
|
|||
/*
|
||||
|
||||
function autovalidate(blur) {
|
||||
Ox.print('autovalidate', self.options.value, blur || false)
|
||||
Ox.Log('Form', 'autovalidate', self.options.value, blur || false)
|
||||
self.autocorrectBlur = blur || false;
|
||||
self.autocorrectCursor = cursor();
|
||||
Ox.isFunction(self.options.autocorrect) ?
|
||||
|
|
@ -643,7 +643,7 @@ Ox.Input = function(options, self) {
|
|||
}
|
||||
|
||||
function clickMenu(data) {
|
||||
//Ox.print('clickMenu', data);
|
||||
//Ox.Log('Form', 'clickMenu', data);
|
||||
self.options.value = data.title;
|
||||
self.$input.val(self.options.value).focus();
|
||||
that.gainFocus();
|
||||
|
|
@ -669,7 +669,7 @@ Ox.Input = function(options, self) {
|
|||
|
||||
function deselectMenu() {
|
||||
return;
|
||||
//Ox.print('deselectMenu')
|
||||
//Ox.Log('Form', 'deselectMenu')
|
||||
self.options.value = self.oldValue;
|
||||
self.$input.val(self.options.value);
|
||||
cursor(self.oldCursor);
|
||||
|
|
@ -718,7 +718,7 @@ Ox.Input = function(options, self) {
|
|||
setTimeout(function() { // wait for val to be set
|
||||
var value = self.$input.val();
|
||||
if ((self.options.autocompleteReplace || self.options.decimals) && hasDeletedSelectedEnd) {
|
||||
//Ox.print('HAS DELETED SELECTED END', event.keyCode)
|
||||
//Ox.Log('Form', 'HAS DELETED SELECTED END', event.keyCode)
|
||||
value = newValue;
|
||||
self.$input.val(value);
|
||||
}
|
||||
|
|
@ -751,7 +751,7 @@ Ox.Input = function(options, self) {
|
|||
function selectMenu(data) {
|
||||
var pos = cursor();
|
||||
//if (self.options.value) {
|
||||
//Ox.print('selectMenu', pos, data.title)
|
||||
//Ox.Log('Form', 'selectMenu', pos, data.title)
|
||||
self.options.value = data.title
|
||||
self.$input.val(self.options.value);
|
||||
cursor(pos[0], self.options.value.length);
|
||||
|
|
@ -1043,8 +1043,8 @@ Ox.Input_ = function(options, self) {
|
|||
(self.options.value.length - 1) * self.options.separatorWidth;
|
||||
}
|
||||
*/
|
||||
//Ox.print('self.hasMulVal', self.hasMultipleValues);
|
||||
//Ox.print('self.options.value', self.options.value)
|
||||
//Ox.Log('Form', 'self.hasMulVal', self.hasMultipleValues);
|
||||
//Ox.Log('Form', 'self.options.value', self.options.value)
|
||||
if (!self.hasMultipleValues) {
|
||||
if (self.options.type == 'select') {
|
||||
self.options.value = [{
|
||||
|
|
@ -1065,9 +1065,9 @@ Ox.Input_ = function(options, self) {
|
|||
}]
|
||||
}
|
||||
}
|
||||
//Ox.print('self.options.value', self.options.value)
|
||||
//Ox.Log('Form', 'self.options.value', self.options.value)
|
||||
self.values = self.options.value.length;
|
||||
//Ox.print(self.options.id, 'self.values', self.values)
|
||||
//Ox.Log('Form', self.options.id, 'self.values', self.values)
|
||||
|
||||
if (Ox.isString(self.options.separator)) {
|
||||
self.options.separator = $.map(new Array(self.values - 1), function(v, i) {
|
||||
|
|
@ -1096,12 +1096,12 @@ Ox.Input_ = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
//Ox.print('self', self);
|
||||
//Ox.Log('Form', 'self', self);
|
||||
|
||||
if (self.keyName) {
|
||||
that.$key = [];
|
||||
self.options[self.keyName].forEach(function(key, keyPos) {
|
||||
//Ox.print('keyPos key', keyPos, key)
|
||||
//Ox.Log('Form', 'keyPos key', keyPos, key)
|
||||
if (self.keyName == 'label' && key.label.length == 1) {
|
||||
that.$key[keyPos] = Ox.Label({
|
||||
overlap: 'right',
|
||||
|
|
@ -1116,10 +1116,10 @@ Ox.Input_ = function(options, self) {
|
|||
})
|
||||
.appendTo(that);
|
||||
} else if (key.label.length > 1) {
|
||||
//Ox.print('key.length > 1')
|
||||
//Ox.Log('Form', 'key.length > 1')
|
||||
self.selectKeyId = self.options.id + Ox.toTitleCase(self.keyName) +
|
||||
(self.options[self.keyName].length == 1 ? '' : keyPos);
|
||||
//Ox.print('three', self.selectedKey, keyPos, self.selectedKey[keyPos]);
|
||||
//Ox.Log('Form', 'three', self.selectedKey, keyPos, self.selectedKey[keyPos]);
|
||||
that.$key[keyPos] = Ox.Select({
|
||||
id: self.selectKeyId,
|
||||
items: $.map(key.label, function(value, valuePos) {
|
||||
|
|
@ -1174,7 +1174,7 @@ Ox.Input_ = function(options, self) {
|
|||
that.$unit = Ox.Select({
|
||||
id: self.selectUnitId,
|
||||
items: $.map(self.options.unit, function(unit, i) {
|
||||
//Ox.print('unit', unit)
|
||||
//Ox.Log('Form', 'unit', unit)
|
||||
return {
|
||||
checked: i == 0,
|
||||
id: unit.id,
|
||||
|
|
@ -1215,12 +1215,12 @@ Ox.Input_ = function(options, self) {
|
|||
that.$input = [];
|
||||
//self.margin = 0;
|
||||
self.options.value.forEach(function(v, i) {
|
||||
//Ox.print('o k i', self.options, self.keyName, i);
|
||||
//Ox.Log('Form', 'o k i', self.options, self.keyName, i);
|
||||
var id = self.keyName ? $.map(self.selectedKey, function(v, i) {
|
||||
return self.options[self.keyName][i].id;
|
||||
}).join('.') : '';
|
||||
//self.margin -= (i == 0 ? 16 : self.options.value[i - 1].width)
|
||||
//Ox.print('v:', v, 'id:', id)
|
||||
//Ox.Log('Form', 'v:', v, 'id:', id)
|
||||
if (self.options.type == 'select') {
|
||||
that.$input[i] = Ox.Select({
|
||||
id: v.id,
|
||||
|
|
@ -1269,7 +1269,7 @@ Ox.Input_ = function(options, self) {
|
|||
//width(self.options.width);
|
||||
|
||||
function changeKey(data) {
|
||||
//Ox.print('changeKey', data);
|
||||
//Ox.Log('Form', 'changeKey', data);
|
||||
if (data) { // fixme: necessary?
|
||||
self.key = {
|
||||
id: data.id,
|
||||
|
|
@ -1337,7 +1337,7 @@ Ox.Input_ = function(options, self) {
|
|||
}
|
||||
|
||||
function submit() {
|
||||
//Ox.print('submit')
|
||||
//Ox.Log('Form', 'submit')
|
||||
var value = that.$input.val();
|
||||
that.$input.blur();
|
||||
that.triggerEvent('submit', self.options.key ? {
|
||||
|
|
@ -1418,7 +1418,7 @@ Ox.InputElement_ = function(options, self) {
|
|||
.change(change)
|
||||
.focus(focus);
|
||||
|
||||
//Ox.print('InputElement self.options', self.options)
|
||||
//Ox.Log('Form', 'InputElement self.options', self.options)
|
||||
|
||||
self.bindKeyboard = self.options.autocomplete || self.options.autocorrect
|
||||
|| self.options.autosuggest || self.options.autovalidate;
|
||||
|
|
@ -1509,7 +1509,7 @@ Ox.InputElement_ = function(options, self) {
|
|||
self.options.key ?
|
||||
self.options.autosuggest[self.options.key] : self.options.autosuggest
|
||||
).forEach(function(v, i) {
|
||||
//Ox.print('v...', v)
|
||||
//Ox.Log('Form', 'v...', v)
|
||||
var index = v.toLowerCase().indexOf(value);
|
||||
index > -1 && values[index == 0 ? 0 : 1].push(v);
|
||||
});
|
||||
|
|
@ -1531,7 +1531,7 @@ Ox.InputElement_ = function(options, self) {
|
|||
var values = values || [],
|
||||
selected = values.length == 1 ? 0 : -1,
|
||||
value = that.$element.val().toLowerCase();
|
||||
//Ox.print('values', values);
|
||||
//Ox.Log('Form', 'values', values);
|
||||
if (values.length) {
|
||||
values = $.map(values, function(v, i) {
|
||||
if (value == v.toLowerCase()) {
|
||||
|
|
@ -1589,7 +1589,7 @@ Ox.InputElement_ = function(options, self) {
|
|||
|
||||
function blur() {
|
||||
if (!self.options.autosuggest || self.$autosuggestMenu.is(':hidden')) {
|
||||
//Ox.print('losing focus...')
|
||||
//Ox.Log('Form', 'losing focus...')
|
||||
that.loseFocus();
|
||||
self.options.parent.removeClass('OxFocus');
|
||||
self.options.autocorrect && autocorrectCall(true);
|
||||
|
|
@ -1617,7 +1617,7 @@ Ox.InputElement_ = function(options, self) {
|
|||
}
|
||||
|
||||
function clickMenu(data) {
|
||||
//Ox.print('clickMenu', data);
|
||||
//Ox.Log('Form', 'clickMenu', data);
|
||||
that.$element.val(data.title);
|
||||
//self.$autosuggestMenu.hideMenu();
|
||||
self.options.autosuggestSubmit && submit();
|
||||
|
|
@ -1650,13 +1650,13 @@ Ox.InputElement_ = function(options, self) {
|
|||
if (self.bindKeyboard) {
|
||||
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function
|
||||
Ox.UI.$document.keydown(keydown);
|
||||
//Ox.print('calling autosuggest...')
|
||||
//Ox.Log('Form', 'calling autosuggest...')
|
||||
self.options.autosuggest && setTimeout(autosuggestCall, 0); // fixme: why is the timeout needed?
|
||||
}
|
||||
}
|
||||
|
||||
function keydown(event) {
|
||||
//Ox.print('keyCode', event.keyCode)
|
||||
//Ox.Log('Form', 'keyCode', event.keyCode)
|
||||
if (event.keyCode != 9 && event.keyCode != 13 && event.keyCode != 27) { // fixme: can't 13 and 27 return false?
|
||||
setTimeout(function() { // fixme: document what this timeout is for
|
||||
var value = that.$element.val();
|
||||
|
|
@ -1782,7 +1782,7 @@ Ox.Range_ = function(options, self) {
|
|||
var $thumb = Ox.Button({})
|
||||
.addClass('OxThumb')
|
||||
.appendTo($track);
|
||||
//Ox.print('----')
|
||||
//Ox.Log('Form', '----')
|
||||
if (self.options.arrows) {
|
||||
var $arrowInc = Ox.Button({
|
||||
style: 'symbol',
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ Ox.InputGroup = function(options, self) {
|
|||
self.$separator = [];
|
||||
|
||||
self.options.separators.forEach(function(v, i) {
|
||||
self.options.id == 'debug' && Ox.print('separator #' + i + ' ' + self.options.inputs[i].options('id') + ' ' + self.options.inputs[i].options('width'))
|
||||
self.options.id == 'debug' && Ox.Log('Form', 'separator #' + i + ' ' + self.options.inputs[i].options('id') + ' ' + self.options.inputs[i].options('width'))
|
||||
self.$separator[i] = Ox.Label({
|
||||
textAlign: 'center',
|
||||
title: v.title,
|
||||
|
|
@ -71,7 +71,7 @@ Ox.InputGroup = function(options, self) {
|
|||
});
|
||||
|
||||
function change(data) {
|
||||
//Ox.print('InputGroup change')
|
||||
//Ox.Log('Form', 'InputGroup change')
|
||||
that.triggerEvent('change', {
|
||||
value: self.options.inputs.map(function($input) {
|
||||
return $input.value();
|
||||
|
|
@ -108,7 +108,7 @@ Ox.InputGroup = function(options, self) {
|
|||
}
|
||||
|
||||
function validate(data) {
|
||||
//Ox.print('INPUTGROUP TRIGGER VALIDATE')
|
||||
//Ox.Log('Form', 'INPUTGROUP TRIGGER VALIDATE')
|
||||
that.triggerEvent('validate', data);
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ Ox.InputGroup = function(options, self) {
|
|||
that.getInputById = function(id) {
|
||||
var input = null;
|
||||
Ox.forEach(self.options.inputs, function(v, i) {
|
||||
//Ox.print(v, v.options('id'), id)
|
||||
//Ox.Log('Form', v, v.options('id'), id)
|
||||
if (v.options('id') == self.options.id + Ox.toTitleCase(id)) {
|
||||
input = v;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Ox.OptionGroup = function(items, min, max, property) {
|
|||
function getLastBefore(pos) {
|
||||
// returns the position of the last checked item before position pos
|
||||
var last = -1;
|
||||
/*Ox.print(items, items.length, length, Ox.merge(
|
||||
/*Ox.Log('Form', items, items.length, length, Ox.merge(
|
||||
pos > 0 ? Ox.range(pos - 1, -1, -1) : [],
|
||||
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : []
|
||||
))*/
|
||||
|
|
@ -28,7 +28,7 @@ Ox.OptionGroup = function(items, min, max, property) {
|
|||
pos > 0 ? Ox.range(pos - 1, -1, -1) : [],
|
||||
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : []
|
||||
), function(v) {
|
||||
//Ox.print(pos, v)
|
||||
//Ox.Log('Form', pos, v)
|
||||
if (items[v][property]) {
|
||||
last = v;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ Ox.PlacePicker = function(options, self) {
|
|||
self.map = false;
|
||||
|
||||
function changeZoom(data) {
|
||||
//Ox.print('changeZoom')
|
||||
//Ox.Log('Form', 'changeZoom')
|
||||
self.$map.zoom(data.value);
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ Ox.PlacePicker = function(options, self) {
|
|||
}
|
||||
|
||||
function findPlace(data) {
|
||||
//Ox.print('findPlace', data);
|
||||
//Ox.Log('Form', 'findPlace', data);
|
||||
self.$map.find(data.value, function(place) {
|
||||
place && that.$label.html(place.geoname);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ Ox.Range = function(options, self) {
|
|||
})
|
||||
.appendTo(self.$track.$element);
|
||||
self.options.trackImages.forEach(function(v, i) {
|
||||
//Ox.print(self.trackImageWidths[i])
|
||||
//Ox.Log('Form', self.trackImageWidths[i])
|
||||
$('<img>')
|
||||
.attr({
|
||||
src: v
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ Ox.Select = function(options, self) {
|
|||
key_down: showMenu
|
||||
});
|
||||
|
||||
//Ox.print('Ox.Select', self.options);
|
||||
//Ox.Log('Form', 'Ox.Select', self.options);
|
||||
|
||||
Ox.extend(self, {
|
||||
buttonId: self.options.id + 'Button',
|
||||
|
|
@ -147,7 +147,7 @@ Ox.Select = function(options, self) {
|
|||
}
|
||||
|
||||
function changeMenu(data) {
|
||||
//Ox.print('clickMenu: ', self.options.id, data)
|
||||
//Ox.Log('Form', 'clickMenu: ', self.options.id, data)
|
||||
if (self.options.selectable) {
|
||||
self.checked = self.optionGroup.checked();
|
||||
self.options.value = data.checked[0].id;
|
||||
|
|
@ -163,10 +163,10 @@ Ox.Select = function(options, self) {
|
|||
}
|
||||
|
||||
function hideMenu() {
|
||||
//Ox.print('%% hideMenu that', that, 'self', self)
|
||||
//Ox.Log('Form', '%% hideMenu that', that, 'self', self)
|
||||
that.removeClass('OxSelected');
|
||||
// self.$button.removeClass('OxSelected');
|
||||
//Ox.print('%% hideMenu end')
|
||||
//Ox.Log('Form', '%% hideMenu end')
|
||||
}
|
||||
|
||||
function loseFocus() {
|
||||
|
|
@ -182,7 +182,7 @@ Ox.Select = function(options, self) {
|
|||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'value') {
|
||||
Ox.print('SETTING VALUE OPTION', value)
|
||||
Ox.Log('Form', 'SETTING VALUE OPTION', value)
|
||||
that.selectItem(value);
|
||||
}
|
||||
};
|
||||
|
|
@ -216,7 +216,7 @@ Ox.Select = function(options, self) {
|
|||
id <s> item id
|
||||
@*/
|
||||
that.selectItem = function(id) {
|
||||
Ox.print('selectItem', id, self.options.items, self.options.items.length, Ox.getObjectById(self.options.items, id))
|
||||
Ox.Log('Form', 'selectItem', id, self.options.items, self.options.items.length, Ox.getObjectById(self.options.items, id))
|
||||
self.options.type == 'text' && self.$title.html(
|
||||
Ox.getObjectById(self.options.items, id).title
|
||||
);
|
||||
|
|
@ -236,13 +236,13 @@ Ox.Select = function(options, self) {
|
|||
|
||||
that.value = function() {
|
||||
if (arguments.length == 0) {
|
||||
//Ox.print('selected::', that.selected())
|
||||
//Ox.Log('Form', 'selected::', that.selected())
|
||||
return that.selected()[0].id;
|
||||
} else {
|
||||
that.selectItem(arguments[0]);
|
||||
return that;
|
||||
/*
|
||||
Ox.print('ELSE');
|
||||
Ox.Log('Form', 'ELSE');
|
||||
that.selectItem(arguments[0]);
|
||||
return that;
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ Ox.TimeInput = function(options, self) {
|
|||
].join(':') + (self.options.ampm ? ' ' + self.$input.ampm.options('value') : '')),
|
||||
(self.options.seconds? '%T' : '%H:%M')) +
|
||||
(self.options.milliseconds ? '.' + self.$input.milliseconds.options('value') : '');
|
||||
//Ox.print('SETVALUE', self.options.value);
|
||||
//Ox.Log('Form', 'SETVALUE', self.options.value);
|
||||
}
|
||||
|
||||
function setValues() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue