use Ox.Log

This commit is contained in:
j 2011-11-04 16:54:28 +01:00
commit dce2843303
50 changed files with 276 additions and 276 deletions

View file

@ -213,14 +213,14 @@ Ox.TextList = function(options, self) {
})
.bindEvent({
cancel: function(data) {
Ox.print('cancel edit', data);
Ox.Log('List', 'cancel edit', data);
},
edit: function(data) {
that.editCell(data.id, data.key);
},
init: function(data) {
// fixme: why does this never reach?
//Ox.print('INIT????')
//Ox.Log('List', 'INIT????')
//that.triggerEvent('init', data);
},
select: function() {
@ -233,10 +233,10 @@ Ox.TextList = function(options, self) {
width: getItemWidth() + 'px'
});
//Ox.print('s.vC', self.visibleColumns)
//Ox.Log('List', 's.vC', self.visibleColumns)
function addColumn(id) {
//Ox.print('addColumn', id);
//Ox.Log('List', 'addColumn', id);
var column, ids,
index = 0;
Ox.forEach(self.options.columns, function(v) {
@ -284,7 +284,7 @@ Ox.TextList = function(options, self) {
}
function clickColumn(id) {
Ox.print('clickColumn', id);
Ox.Log('List', 'clickColumn', id);
var i = getColumnIndexById(id),
isSelected = self.options.sort[0].key == self.options.columns[i].id;
self.options.sort = [{
@ -549,14 +549,14 @@ Ox.TextList = function(options, self) {
// fixme: works only if items are an array
var query = data.keys,
sort = self.options.sort[0];
Ox.print('QUERY', query)
Ox.Log('List', 'QUERY', query)
Ox.forEach(self.options.items, function(item, i) {
var value = (
sort.map ? sort.map(item[sort.key]) : item[sort.key]
).toString().toLowerCase();
if (Ox.startsWith(value, query)) {
that.$body.options({selected: [item[self.unique]]});
Ox.print('QUERY', query, 'VALUE', value)
Ox.Log('List', 'QUERY', query, 'VALUE', value)
return false;
}
});
@ -586,7 +586,7 @@ Ox.TextList = function(options, self) {
}
function getCell(id, key) {
Ox.print('getCell', id, key)
Ox.Log('List', 'getCell', id, key)
var $item = getItem(id);
key = key || '';
return $($item.find('.OxCell.OxColumn' + Ox.toTitleCase(key))[0]);
@ -609,7 +609,7 @@ Ox.TextList = function(options, self) {
}
function getItem(id) {
//Ox.print('getItem', id)
//Ox.Log('List', 'getItem', id)
var $item = null;
that.find('.OxItem').each(function() {
$this = $(this);
@ -641,7 +641,7 @@ Ox.TextList = function(options, self) {
}
function moveColumn(id, pos) {
//Ox.print('moveColumn', id, pos)
//Ox.Log('List', 'moveColumn', id, pos)
var startPos = getColumnPositionById(id),
stopPos = pos,
startSelector = '.OxColumn' + Ox.toTitleCase(id),
@ -649,7 +649,7 @@ Ox.TextList = function(options, self) {
insert = startPos < stopPos ? 'insertAfter' : 'insertBefore'
$column = $('.OxHeadCell' + startSelector),
$resize = $column.next();
//Ox.print(startSelector, insert, stopSelector)
//Ox.Log('List', startSelector, insert, stopSelector)
$column.detach()[insert](insert == 'insertAfter'
? $('.OxHeadCell' + stopSelector).next()
: $('.OxHeadCell' + stopSelector));
@ -679,7 +679,7 @@ Ox.TextList = function(options, self) {
}
function removeColumn(id) {
//Ox.print('removeColumn', id);
//Ox.Log('List', 'removeColumn', id);
var index = getColumnIndexById(id),
itemWidth,
position = getColumnPositionById(id),
@ -800,7 +800,7 @@ Ox.TextList = function(options, self) {
}
self.setOption = function(key, value) {
//Ox.print('---------------------------- TextList setOption', key, value)
//Ox.Log('List', '---------------------------- TextList setOption', key, value)
if (key == 'items') {
that.$body.options(key, value);
} else if (key == 'paste') {
@ -827,7 +827,7 @@ Ox.TextList = function(options, self) {
}
that.editCell = function(id, key) {
Ox.print('editCell', id, key)
Ox.Log('List', 'editCell', id, key)
var $item = getItem(id),
$cell = getCell(id, key),
$input,
@ -901,14 +901,14 @@ Ox.TextList = function(options, self) {
}
that.size = function() {
Ox.print('SIZE FUNCTION CALLED')
Ox.Log('List', 'SIZE FUNCTION CALLED')
setWidth();
that.$body.size();
}
// fixme: deprecated
that.sortList = function(key, operator) {
Ox.print('$$$$ DEPRECATED $$$$')
Ox.Log('List', '$$$$ DEPRECATED $$$$')
var isSelected = key == self.options.sort[0].key;
self.options.sort = [{
key: key,
@ -941,7 +941,7 @@ Ox.TextList = function(options, self) {
that.value = function(id, key, value) {
// fixme: make this accept id, {k: v, ...}
//Ox.print('value', id, key, value)
//Ox.Log('List', 'value', id, key, value)
var $cell,
$item = getItem(id);
//column = self.options.columns[getColumnIndexById(key)];