use Ox.Log

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

View file

@ -866,8 +866,8 @@ Ox.Calendar = function(options, self) {
value = unit.value(self.options.date), value = unit.value(self.options.date),
width = unit.seconds * getPixelsPerSecond(zoom), width = unit.seconds * getPixelsPerSecond(zoom),
n = Math.ceil(self.options.width * 1.5/* * 16*/ / width); n = Math.ceil(self.options.width * 1.5/* * 16*/ / width);
//Ox.print(zoom, getUnits(zoom).map(function(u) {return u.name(value)}).join('/')) //Ox.Log('Calendar', zoom, getUnits(zoom).map(function(u) {return u.name(value)}).join('/'))
//Ox.print('VALUE', value) //Ox.Log('Calendar', 'VALUE', value)
Ox.loop(-n, n + 1, function(i) { Ox.loop(-n, n + 1, function(i) {
$elements.push( $elements.push(
getEventElement({ getEventElement({
@ -921,7 +921,7 @@ Ox.Calendar = function(options, self) {
} }
function mousewheel(e, delta, deltaX, deltaY) { function mousewheel(e, delta, deltaX, deltaY) {
//Ox.print('mousewheel', delta, deltaX, deltaY); //Ox.Log('Calendar', 'mousewheel', delta, deltaX, deltaY);
var deltaZ = 0; var deltaZ = 0;
if (!self.mousewheel && deltaY && Math.abs(deltaY) > Math.abs(deltaX)) { if (!self.mousewheel && deltaY && Math.abs(deltaY) > Math.abs(deltaX)) {
if (deltaY < 0 && self.options.zoom > 0) { if (deltaY < 0 && self.options.zoom > 0) {
@ -1063,7 +1063,7 @@ Ox.Calendar = function(options, self) {
} }
function renderTimelines() { function renderTimelines() {
Ox.print(self.options.zoom, Math.max(self.options.zoom - 4, 0)) Ox.Log('Calendar', self.options.zoom, Math.max(self.options.zoom - 4, 0))
getTimelineElements(self.options.zoom).forEach(function($element) { getTimelineElements(self.options.zoom).forEach(function($element) {
$element.appendTo(self.$scalebar.$element); $element.appendTo(self.$scalebar.$element);
}); });
@ -1200,7 +1200,7 @@ Ox.Calendar = function(options, self) {
}; };
that.addEvent = function(event) { that.addEvent = function(event) {
Ox.print('CALENDAR ADD EVENT', event) Ox.Log('Calendar', 'CALENDAR ADD EVENT', event)
event = getEventData(event); event = getEventData(event);
self.options.events.push(event); self.options.events.push(event);
getLines(); getLines();
@ -1222,7 +1222,7 @@ Ox.Calendar = function(options, self) {
$element = getEventElementById(id); $element = getEventElementById(id);
Ox.forEach(data, function(value, key) { Ox.forEach(data, function(value, key) {
if ($element) { if ($element) {
Ox.print('ELEMENT', $element, id) Ox.Log('Calendar', 'ELEMENT', $element, id)
if (key == 'name') { if (key == 'name') {
$element && $element.html('&nbsp;' + value + '&nbsp;'); $element && $element.html('&nbsp;' + value + '&nbsp;');
} else if (key == 'type') { } else if (key == 'type') {
@ -1236,7 +1236,7 @@ Ox.Calendar = function(options, self) {
} }
event[key] = value; event[key] = value;
event = getEventData(event); event = getEventData(event);
Ox.print(key, value, 'EVENT:', event) Ox.Log('Calendar', key, value, 'EVENT:', event)
if ($element) { if ($element) {
getLines(); getLines();
renderCalendar(); renderCalendar();
@ -1257,7 +1257,7 @@ Ox.Calendar = function(options, self) {
}; };
that.removeEvent = function() { that.removeEvent = function() {
Ox.print('REMOVE ... SELF.OPTIONS', self.options) Ox.Log('Calendar', 'REMOVE ... SELF.OPTIONS', self.options)
var index = Ox.getPositionById(self.options.events, self.options.selected); var index = Ox.getPositionById(self.options.events, self.options.selected);
self.options.events.splice(index, 1); self.options.events.splice(index, 1);
getLines(); getLines();

View file

@ -29,7 +29,7 @@ Ox.ListCalendar = function(options, self) {
self.durationCache = {}; self.durationCache = {};
Ox.print('EVENT[0]', self.options.events[0]) Ox.Log('Calendar', 'EVENT[0]', self.options.events[0])
self.columns = [ self.columns = [
{ {
@ -330,7 +330,7 @@ Ox.ListCalendar = function(options, self) {
.hide() .hide()
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
Ox.print('CHANGE', data); Ox.Log('Calendar', 'CHANGE', data);
var exists = false, values var exists = false, values
if (['name', 'alternativeNames'].indexOf(data.id) > -1) { if (['name', 'alternativeNames'].indexOf(data.id) > -1) {
exists = ''; exists = '';
@ -459,7 +459,7 @@ Ox.ListCalendar = function(options, self) {
}); });
function addEvent() { function addEvent() {
Ox.print('ADD', self.$calendar.getBounds()) Ox.Log('Calendar', 'ADD', self.$calendar.getBounds())
var bounds = self.$calendar.getBounds(), var bounds = self.$calendar.getBounds(),
middle = +self.$calendar.options('date'), middle = +self.$calendar.options('date'),
startTime = +new Date((+bounds.startTime + middle) / 2), startTime = +new Date((+bounds.startTime + middle) / 2),
@ -474,14 +474,14 @@ Ox.ListCalendar = function(options, self) {
event.type = 'other'; event.type = 'other';
event.start = Ox.formatDate(startTime, '%Y-%m-%d %H:%M:%S', true); event.start = Ox.formatDate(startTime, '%Y-%m-%d %H:%M:%S', true);
event.end = Ox.formatDate(endTime, '%Y-%m-%d %H:%M:%S', true); event.end = Ox.formatDate(endTime, '%Y-%m-%d %H:%M:%S', true);
Ox.print(event); Ox.Log('Calendar', event);
self.options.addEvent(event, function(result) { self.options.addEvent(event, function(result) {
if (result.status.code == '200') { if (result.status.code == '200') {
event.id = result.data.id; event.id = result.data.id;
self.options.events.push(event); self.options.events.push(event);
var time0 = +new Date() var time0 = +new Date()
self.$list.options({items: Ox.clone(self.options.events, true)}); self.$list.options({items: Ox.clone(self.options.events, true)});
Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0); Ox.Log('Calendar', 'TIME TO SET LIST OPTIONS:', +new Date() - time0);
self.$calendar.addEvent(event); self.$calendar.addEvent(event);
selectEvent(event); selectEvent(event);
self.$nameInput.focusInput(); self.$nameInput.focusInput();
@ -556,7 +556,7 @@ Ox.ListCalendar = function(options, self) {
self.options.events.splice(index, 1); self.options.events.splice(index, 1);
var time0 = +new Date(); var time0 = +new Date();
self.$list.options({items: Ox.clone(self.options.events, true)}); self.$list.options({items: Ox.clone(self.options.events, true)});
Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0); Ox.Log('Calendar', 'TIME TO SET LIST OPTIONS:', +new Date() - time0);
self.$calendar.removeEvent(); self.$calendar.removeEvent();
selectEvent({}); selectEvent({});
} else { } else {

View file

@ -10,11 +10,11 @@ Ox.Clipboard = function() {
var clipboard = {}; var clipboard = {};
return { return {
_print: function() { _print: function() {
Ox.print(JSON.stringify(clipboard)); Ox.Log('Core', JSON.stringify(clipboard));
}, },
copy: function(data) { copy: function(data) {
clipboard = data; clipboard = data;
Ox.print('copy', JSON.stringify(clipboard)); Ox.Log('Core', 'copy', JSON.stringify(clipboard));
}, },
paste: function(type) { paste: function(type) {
return type ? clipboard.type : clipboard; return type ? clipboard.type : clipboard;

View file

@ -34,7 +34,7 @@ Ox.DocPage = function(options, self) {
}); });
function getItem(item, level, name) { function getItem(item, level, name) {
Ox.print('getItem', item, level, name) Ox.Log('Core', 'getItem', item, level, name)
var $elements = [$('<div>') var $elements = [$('<div>')
.css({paddingLeft: (level ? level * 32 - 16 : 0) + 'px'}) .css({paddingLeft: (level ? level * 32 - 16 : 0) + 'px'})
.html( .html(

View file

@ -253,7 +253,7 @@ Ox.Element = function(options, self) {
} }
function mousemove(e) { function mousemove(e) {
//Ox.print('mousemove!!') //Ox.Log('Core', 'mousemove!!')
that.$tooltip.options({ that.$tooltip.options({
title: self.options.tooltip(e) title: self.options.tooltip(e)
}).show(e); }).show(e);
@ -324,8 +324,8 @@ Ox.Element = function(options, self) {
that.$element.find('.OxElement').each(function() { that.$element.find('.OxElement').each(function() {
var oxid = $(this).data('oxid'), var oxid = $(this).data('oxid'),
element = Ox.UI.elements[oxid]; element = Ox.UI.elements[oxid];
//!element && Ox.print('NO ELEMENT FOR', oxid, this.className) //!element && Ox.Log('Core', 'NO ELEMENT FOR', oxid, this.className)
//element && Ox.print('OK', oxid, this.className) //element && Ox.Log('Core', 'OK', oxid, this.className)
element && element.removeElement(false); element && element.removeElement(false);
}); });
that.$element.empty(); that.$element.empty();
@ -388,8 +388,8 @@ Ox.Element = function(options, self) {
remove !== false && that.$element.find('.OxElement').each(function() { remove !== false && that.$element.find('.OxElement').each(function() {
var oxid = $(this).data('oxid'), var oxid = $(this).data('oxid'),
element = Ox.UI.elements[oxid]; element = Ox.UI.elements[oxid];
//!element && Ox.print('NO ELEMENT FOR', oxid, this.className) //!element && Ox.Log('Core', 'NO ELEMENT FOR', oxid, this.className)
//element && Ox.print('OK', oxid, this.className) //element && Ox.Log('Core', 'OK', oxid, this.className)
element && element.removeElement(false); element && element.removeElement(false);
}); });
//*/ //*/
@ -406,7 +406,7 @@ Ox.Element = function(options, self) {
orphaned++; orphaned++;
} }
}); });
Ox.print('LEN', len, '-->', Ox.len(Ox.UI.elements), 'orphaned:', orphaned); Ox.Log('Core', 'LEN', len, '-->', Ox.len(Ox.UI.elements), 'orphaned:', orphaned);
} }
*/ */
return that; return that;
@ -435,7 +435,7 @@ Ox.Element = function(options, self) {
'playing', 'position', 'progress' 'playing', 'position', 'progress'
].indexOf(event) == -1) { ].indexOf(event) == -1) {
if (!/^pandora_/.test(event)) { if (!/^pandora_/.test(event)) {
Ox.print(that.id, self.options.id, 'trigger', event, data); Ox.Log('Core', that.id, self.options.id, 'trigger', event, data);
} }
} }
// it is necessary to check if self.$eventHandler exists, // it is necessary to check if self.$eventHandler exists,

View file

@ -21,7 +21,7 @@ Ox.Event = (function() {
Ox.forEach(Ox.makeObject(arguments), function(callback, event) { Ox.forEach(Ox.makeObject(arguments), function(callback, event) {
var foo = event; var foo = event;
self.$eventHandler.bind('ox_' + event, function(event, data) { self.$eventHandler.bind('ox_' + event, function(event, data) {
Ox.print('CALLBACK', foo, data.value); Ox.Log('Core', 'CALLBACK', foo, data.value);
callback(data.value); callback(data.value);
}); });
}); });
@ -56,7 +56,7 @@ Ox.Event = (function() {
@*/ @*/
that.trigger = function() { that.trigger = function() {
Ox.forEach(Ox.makeObject(arguments), function(data, event) { Ox.forEach(Ox.makeObject(arguments), function(data, event) {
Ox.print('Ox.Event.trigger', event, data) Ox.Log('Core', 'Ox.Event.trigger', event, data)
self.$eventHandler.trigger('ox_' + event, {value: data}); self.$eventHandler.trigger('ox_' + event, {value: data});
}); });
return that; return that;

View file

@ -7,7 +7,7 @@ Ox.Focus = (function() {
var stack = []; var stack = [];
return { return {
_print: function() { _print: function() {
Ox.print(stack); Ox.Log('Core', stack);
}, },
_reset: function() { _reset: function() {
$('.OxFocus').removeClass('OxFocus'); $('.OxFocus').removeClass('OxFocus');
@ -26,7 +26,7 @@ Ox.Focus = (function() {
//$elements[id].removeClass('OxFocus'); //$elements[id].removeClass('OxFocus');
$('.OxFocus').removeClass('OxFocus'); // fixme: the above is better, and should work $('.OxFocus').removeClass('OxFocus'); // fixme: the above is better, and should work
stack.length && Ox.UI.elements[stack[stack.length - 1]].addClass('OxFocus'); stack.length && Ox.UI.elements[stack[stack.length - 1]].addClass('OxFocus');
Ox.print('blur', id, stack); Ox.Log('Core', 'blur', id, stack);
} }
}, },
/*@ /*@
@ -39,7 +39,7 @@ Ox.Focus = (function() {
index > -1 && stack.splice(index, 1); index > -1 && stack.splice(index, 1);
stack.push(id); stack.push(id);
$('.OxFocus').removeClass('OxFocus'); // fixme: see above $('.OxFocus').removeClass('OxFocus'); // fixme: see above
Ox.print('focus', id, stack); Ox.Log('Core', 'focus', id, stack);
Ox.UI.elements[id].addClass('OxFocus'); Ox.UI.elements[id].addClass('OxFocus');
} }
}, },

View file

@ -155,7 +155,7 @@ Ox.URL = function(options) {
views: {} views: {}
}, options); }, options);
Ox.print('Ox.URL options', self.options) Ox.Log('Core', 'Ox.URL options', self.options)
self.previousURL = ''; self.previousURL = '';
@ -281,7 +281,7 @@ Ox.URL = function(options) {
} }
function getSpanType(str, types) { function getSpanType(str, types) {
Ox.print('getSpanType', str, types) Ox.Log('Core', 'getSpanType', str, types)
var canBeDate = types.indexOf('date') > -1, var canBeDate = types.indexOf('date') > -1,
canBeDuration = types.indexOf('duration') > -1, canBeDuration = types.indexOf('duration') > -1,
canBeLocation = types.indexOf('location') > -1, canBeLocation = types.indexOf('location') > -1,
@ -296,7 +296,7 @@ Ox.URL = function(options) {
} }
function parseCondition(str) { function parseCondition(str) {
Ox.print('PARSE COND', str) Ox.Log('Core', 'PARSE COND', str)
var condition = {}, var condition = {},
operators = ['!==', '==', '!=', '=', '!<', '<', '!>', '>'], operators = ['!==', '==', '!=', '=', '!<', '<', '!>', '>'],
split; split;
@ -441,7 +441,7 @@ Ox.URL = function(options) {
state.type = self.options.types[0]; state.type = self.options.types[0];
} }
if (parts.length) { if (parts.length) {
Ox.print('ST', state.type, self.options.views) Ox.Log('Core', 'ST', state.type, self.options.views)
if (self.options.views[state.type].list.indexOf(parts[0]) > -1) { if (self.options.views[state.type].list.indexOf(parts[0]) > -1) {
// list view // list view
state.item = ''; state.item = '';
@ -463,7 +463,7 @@ Ox.URL = function(options) {
} }
} }
function parseBeyondItem() { function parseBeyondItem() {
Ox.print('pBI', state, parts.join('/')); Ox.Log('Core', 'pBI', state, parts.join('/'));
var span, spanType, spanTypes; var span, spanType, spanTypes;
if ( if (
parts.length && state.item parts.length && state.item
@ -484,7 +484,7 @@ Ox.URL = function(options) {
spanType = state.view spanType = state.view
? spanTypes[state.view] ? spanTypes[state.view]
: getSpanType(parts[0], Ox.unique(Ox.values(spanTypes))); : getSpanType(parts[0], Ox.unique(Ox.values(spanTypes)));
Ox.print('SPAN TYPE', spanType) Ox.Log('Core', 'SPAN TYPE', spanType)
if (spanType) { if (spanType) {
span = parseSpan(parts[0], spanType); span = parseSpan(parts[0], spanType);
if (span) { if (span) {
@ -533,7 +533,7 @@ Ox.URL = function(options) {
} }
} }
function parseBeyondSpan() { function parseBeyondSpan() {
Ox.print('pBS', state) Ox.Log('Core', 'pBS', state)
var sortKeyIds, sortParts; var sortKeyIds, sortParts;
if (parts.length) { if (parts.length) {
sortParts = parts[0].split(','); sortParts = parts[0].split(',');

View file

@ -36,14 +36,14 @@ Ox.ArrayInput = function(options, self) {
}); });
function addInput(i, value, focus) { function addInput(i, value, focus) {
Ox.print('add', i) Ox.Log('Form', 'add', i)
self.$element.splice(i, 0, Ox.Element() self.$element.splice(i, 0, Ox.Element()
.css({height: '16px', marginTop: self.options.label || i > 0 ? '8px' : 0}) .css({height: '16px', marginTop: self.options.label || i > 0 ? '8px' : 0})
.data({index: i})); .data({index: i}));
if (i == 0) { if (i == 0) {
self.$element[i].appendTo(that); self.$element[i].appendTo(that);
} else { } else {
Ox.print(i, self.$element) Ox.Log('Form', i, self.$element)
self.$element[i].insertAfter(self.$element[i - 1]); self.$element[i].insertAfter(self.$element[i - 1]);
} }
self.$input.splice(i, 0, Ox.Input({ self.$input.splice(i, 0, Ox.Input({
@ -99,7 +99,7 @@ Ox.ArrayInput = function(options, self) {
} }
function removeInput(i) { function removeInput(i) {
Ox.print('remove', i); Ox.Log('Form', 'remove', i);
['input', 'removeButton', 'addButton', 'element'].forEach(function(element) { ['input', 'removeButton', 'addButton', 'element'].forEach(function(element) {
var key = '$' + element; var key = '$' + element;
self[key][i].removeElement(); self[key][i].removeElement();
@ -133,7 +133,7 @@ Ox.ArrayInput = function(options, self) {
function updateIndices() { function updateIndices() {
self.$element.forEach(function($element, i) { self.$element.forEach(function($element, i) {
Ox.print(i, $element) Ox.Log('Form', i, $element)
$element.data({index: i}); $element.data({index: i});
}); });
/* /*

View file

@ -57,7 +57,7 @@ Ox.CheckboxGroup = function(options, self) {
function change(pos) { function change(pos) {
var toggled = self.optionGroup.toggle(pos); var toggled = self.optionGroup.toggle(pos);
//Ox.print('change', pos, 'toggled', toggled) //Ox.Log('Form', 'change', pos, 'toggled', toggled)
if (toggled.length) { if (toggled.length) {
toggled.forEach(function(pos, i) { toggled.forEach(function(pos, i) {
self.$checkboxes[pos].toggleChecked(); self.$checkboxes[pos].toggleChecked();

View file

@ -42,7 +42,7 @@ Ox.ColorInput = function(options, self) {
id: 'picker' id: 'picker'
}) })
.bindEvent('change', function(data) { .bindEvent('change', function(data) {
//Ox.print('change function called'); //Ox.Log('Form', 'change function called');
self.options.value = data.value; self.options.value = data.value;
self.values = data.value.split(', '); self.values = data.value.split(', ');
Ox.range(3).forEach(function(i) { Ox.range(3).forEach(function(i) {

View file

@ -22,7 +22,7 @@ Ox.ColorPicker = function(options, self) {
}) })
.options(options || {}); .options(options || {});
//Ox.print(self) //Ox.Log('Form', self)
self.$ranges = []; self.$ranges = [];
self.rgb = ['red', 'green', 'blue']; self.rgb = ['red', 'green', 'blue'];
self.values = self.options.value.split(', '); self.values = self.options.value.split(', ');

View file

@ -118,7 +118,7 @@ Ox.DateInput = function(options, self) {
width: 0 width: 0
}), self); }), self);
//Ox.print('SELF', self) //Ox.Log('Form', 'SELF', self)
function changeDay() { function changeDay() {
self.options.weekday && self.$input.weekday.options({ self.options.weekday && self.$input.weekday.options({
@ -137,7 +137,7 @@ Ox.DateInput = function(options, self) {
year = self.$input.year.options('value'), year = self.$input.year.options('value'),
days = Ox.getDaysInMonth(year, self.options.format == 'short' ? parseInt(month, 10) : month); days = Ox.getDaysInMonth(year, self.options.format == 'short' ? parseInt(month, 10) : month);
day = day <= days ? day : days; 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({ self.options.weekday && self.$input.weekday.options({
value: Ox.formatDate(new Date([month, day, year].join(' ')), self.formats.weekday) 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) { 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(' ')); var date = new Date([month, day, year].join(' '));
date = Ox.getDateInWeek(date, weekday); date = Ox.getDateInWeek(date, weekday);
return { return {

View file

@ -29,7 +29,7 @@ Ox.DateTimeInput = function(options, self) {
.options(options || {}); .options(options || {});
self.values = self.options.value.split(' '); self.values = self.options.value.split(' ');
//Ox.print(self.values) //Ox.Log('Form', self.values)
that = Ox.InputGroup({ that = Ox.InputGroup({
inputs: [ inputs: [

View file

@ -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 || Ox.limit(self.$test.height() + 2, self.minHeight, self.maxHeight);
height = self.options.height || Math.max(self.$test.height() + 2, self.minHeight); 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); 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') { if (self.options.type == 'input') {
self.$input.options({ self.$input.options({
width: width width: width
@ -116,7 +116,7 @@ Ox.Editable = function(options, self) {
height = self.options.height || self.$value.height(); height = self.options.height || self.$value.height();
width = self.options.width || self.$value.width(); width = self.options.width || self.$value.width();
self.$value.hide(); self.$value.hide();
Ox.print('H:::', self.options.height, height) Ox.Log('Form', 'H:::', self.options.height, height)
if (!self.$test) { if (!self.$test) {
self.$test = self.$value.$element.clone() self.$test = self.$value.$element.clone()
.css(Ox.extend({display: 'inline-block'}, self.css)) .css(Ox.extend({display: 'inline-block'}, self.css))

View file

@ -45,7 +45,7 @@ Ox.Filter = function(options, self) {
} else if (self.options.query.operator == '') { } else if (self.options.query.operator == '') {
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 = { self.conditionOperators = {
date: [ date: [
@ -271,7 +271,7 @@ Ox.Filter = function(options, self) {
operator: self.conditionOperators[key.type][0].id operator: self.conditionOperators[key.type][0].id
}; };
if (isGroup) { if (isGroup) {
Ox.print('isGroup', self.options.query.operator) Ox.Log('Form', 'isGroup', self.options.query.operator)
condition = { condition = {
conditions: [condition], conditions: [condition],
operator: self.options.query.operator == '&' ? '|' : '&' operator: self.options.query.operator == '&' ? '|' : '&'
@ -290,7 +290,7 @@ Ox.Filter = function(options, self) {
function changeConditionKey(pos, subpos, key) { function changeConditionKey(pos, subpos, key) {
subpos = Ox.isUndefined(subpos) ? -1 : subpos; subpos = Ox.isUndefined(subpos) ? -1 : subpos;
Ox.print('changeConditionKey', pos, subpos, key); Ox.Log('Form', 'changeConditionKey', pos, subpos, key);
var condition = subpos == -1 var condition = subpos == -1
? self.options.query.conditions[pos] ? self.options.query.conditions[pos]
: self.options.query.conditions[pos].conditions[subpos], : self.options.query.conditions[pos].conditions[subpos],
@ -301,7 +301,7 @@ Ox.Filter = function(options, self) {
newConditionType = getConditionType(newType), newConditionType = getConditionType(newType),
changeConditionType = oldConditionType != newConditionType, changeConditionType = oldConditionType != newConditionType,
wasUselessCondition = isUselessCondition(pos, subpos); wasUselessCondition = isUselessCondition(pos, subpos);
Ox.print('old new', oldConditionType, newConditionType) Ox.Log('Form', 'old new', oldConditionType, newConditionType)
condition.key = key; condition.key = key;
if (changeConditionType) { if (changeConditionType) {
renderConditions(); renderConditions();
@ -314,7 +314,7 @@ Ox.Filter = function(options, self) {
function changeConditionOperator(pos, subpos, operator) { function changeConditionOperator(pos, subpos, operator) {
subpos = Ox.isUndefined(subpos) ? -1 : subpos; subpos = Ox.isUndefined(subpos) ? -1 : subpos;
Ox.print('chCoOp', pos, subpos, operator) Ox.Log('Form', 'chCoOp', pos, subpos, operator)
var condition = subpos == -1 var condition = subpos == -1
? self.options.query.conditions[pos] ? self.options.query.conditions[pos]
: self.options.query.conditions[pos].conditions[subpos], : self.options.query.conditions[pos].conditions[subpos],
@ -382,7 +382,7 @@ Ox.Filter = function(options, self) {
&& condition.value === '' && condition.value === ''
return isUseless; return isUseless;
}); });
Ox.print('isUseless', isUseless); Ox.Log('Form', 'isUseless', isUseless);
return 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 .css({margin: '0 4px 0 ' + (isGroup ? '292px' : '8px')}) // fixme: 296 is probably correct, but labels seem to be too wide
.bindEvent({ .bindEvent({
click: function(data) { click: function(data) {
Ox.print('remove...', data) Ox.Log('Form', 'remove...', data)
if (data._element.parent().data('subposition') == -1) { if (data._element.parent().data('subposition') == -1) {
removeCondition(data._element.parent().data('position')); removeCondition(data._element.parent().data('position'));
} else { } else {
@ -432,7 +432,7 @@ Ox.Filter = function(options, self) {
.css({margin: '0 ' + (subpos == -1 ? '4px' : '0') + ' 0 4px'}) .css({margin: '0 ' + (subpos == -1 ? '4px' : '0') + ' 0 4px'})
.bindEvent({ .bindEvent({
click: function(data) { 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) { if (data._element.parent().data('subposition') == -1) {
addCondition(data._element.parent().data('position') + 1); addCondition(data._element.parent().data('position') + 1);
} else { } else {
@ -463,7 +463,7 @@ Ox.Filter = function(options, self) {
var condition = subpos == -1 var condition = subpos == -1
? self.options.query.conditions[pos] ? self.options.query.conditions[pos]
: self.options.query.conditions[pos].conditions[subpos]; : self.options.query.conditions[pos].conditions[subpos];
Ox.print('renderCondition', condition, pos, subpos) Ox.Log('Form', 'renderCondition', condition, pos, subpos)
return Ox.FormElementGroup({ return Ox.FormElementGroup({
elements: Ox.merge([ elements: Ox.merge([
renderConditionKey(condition), renderConditionKey(condition),
@ -501,7 +501,7 @@ Ox.Filter = function(options, self) {
} }
function renderConditionOperator(condition) { function renderConditionOperator(condition) {
Ox.print('rCO', condition) Ox.Log('Form', 'rCO', condition)
return Ox.Select({ return Ox.Select({
items: self.conditionOperators[getConditionType( items: self.conditionOperators[getConditionType(
Ox.getObjectById(self.options.findKeys, condition.key).type Ox.getObjectById(self.options.findKeys, condition.key).type
@ -552,7 +552,7 @@ Ox.Filter = function(options, self) {
} }
function renderConditions() { function renderConditions() {
Ox.print('renderConditions', self.options.query) Ox.Log('Form', 'renderConditions', self.options.query)
var $conditions = []; var $conditions = [];
while (self.$form.options('items').length > self.numberOfAdditionalFormItems) { while (self.$form.options('items').length > self.numberOfAdditionalFormItems) {
self.$form.removeItem(1); self.$form.removeItem(1);
@ -615,7 +615,7 @@ Ox.Filter = function(options, self) {
} }
function renderInput(condition, index) { function renderInput(condition, index) {
Ox.print('renderInput', condition) Ox.Log('Form', 'renderInput', condition)
var $input, var $input,
findKey = Ox.getObjectById(self.options.findKeys, condition.key), findKey = Ox.getObjectById(self.options.findKeys, condition.key),
isArray = Ox.isArray(condition.value), isArray = Ox.isArray(condition.value),
@ -623,7 +623,7 @@ Ox.Filter = function(options, self) {
type = findKey.type == 'integer' ? 'int' : findKey.type, type = findKey.type == 'integer' ? 'int' : findKey.type,
formatArgs, formatType, title; formatArgs, formatType, title;
if (findKey.format) { if (findKey.format) {
Ox.print('findKey.format', findKey.format) Ox.Log('Form', 'findKey.format', findKey.format)
formatArgs = findKey.format.args formatArgs = findKey.format.args
formatType = findKey.format.type; formatType = findKey.format.type;
if (formatType == 'color') { if (formatType == 'color') {

View file

@ -103,7 +103,7 @@ Ox.Form = function(options, self) {
function validateForm(pos, valid) { function validateForm(pos, valid) {
self.itemIsValid[pos] = valid; self.itemIsValid[pos] = valid;
Ox.print('VALID???', self.itemIsValid) Ox.Log('Form', 'VALID???', self.itemIsValid)
if (Ox.every(self.itemIsValid) != self.formIsValid) { if (Ox.every(self.itemIsValid) != self.formIsValid) {
self.formIsValid = !self.formIsValid; self.formIsValid = !self.formIsValid;
that.triggerEvent('validate', { that.triggerEvent('validate', {
@ -113,7 +113,7 @@ Ox.Form = function(options, self) {
} }
that.addItem = function(pos, item) { that.addItem = function(pos, item) {
Ox.print('addItem', pos) Ox.Log('Form', 'addItem', pos)
self.options.items.splice(pos, 0, item); self.options.items.splice(pos, 0, item);
self.$items.splice(pos, 0, Ox.FormItem({element: item})); self.$items.splice(pos, 0, Ox.FormItem({element: item}));
pos == 0 ? pos == 0 ?
@ -122,7 +122,7 @@ Ox.Form = function(options, self) {
} }
that.removeItem = function(pos) { that.removeItem = function(pos) {
Ox.print('removeItem', pos); Ox.Log('Form', 'removeItem', pos);
self.$items[pos].removeElement(); self.$items[pos].removeElement();
self.options.items.splice(pos, 1); self.options.items.splice(pos, 1);
self.$items.splice(pos, 1); self.$items.splice(pos, 1);
@ -130,7 +130,7 @@ Ox.Form = function(options, self) {
that.submit = function() { that.submit = function() {
// fixme: this seems to be unneeded // 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); self.options.submit(that.values(), submitCallback);
}; };
@ -147,13 +147,13 @@ Ox.Form = function(options, self) {
//fixme: make the following work //fixme: make the following work
//values[self.itemIds[i]] = self.$items[i].options('value'); //values[self.itemIds[i]] = self.$items[i].options('value');
}); });
//Ox.print('VALUES', values) //Ox.Log('Form', 'VALUES', values)
return values; return values;
} else { } else {
Ox.print('SET FORM VALUES', arguments[0]) Ox.Log('Form', 'SET FORM VALUES', arguments[0])
Ox.forEach(arguments[0], function(value, key) { Ox.forEach(arguments[0], function(value, key) {
var index = getItemIndexById(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}); index > -1 && self.options.items[index].options({value: value});
}); });
return that; return that;

View file

@ -70,7 +70,7 @@ Ox.FormElementGroup = function(options, self) {
}; };
that.replaceElement = function(pos, element) { 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].replaceWith(element.$element);
self.options.elements[pos] = element; self.options.elements[pos] = element;
}; };

View file

@ -234,7 +234,7 @@ Ox.Input = function(options, self) {
.appendTo(that.$element); .appendTo(that.$element);
if (self.options.type == 'textarea') { 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? // 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; oldValue = Ox.isUndefined(oldValue) ? self.options.value : oldValue;
oldCursor = Ox.isUndefined(oldCursor) ? cursor() : oldCursor; 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 (self.options.value || self.options.autocompleteReplaceCorrect) {
if (Ox.isFunction(self.options.autocomplete)) { if (Ox.isFunction(self.options.autocomplete)) {
@ -333,7 +333,7 @@ Ox.Input = function(options, self) {
function autocompleteCallback(values) { 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, var length = self.options.value.length,
newValue, newLength, newValue, newLength,
@ -357,7 +357,7 @@ Ox.Input = function(options, self) {
} }
newLength = newValue.length; newLength = newValue.length;
//Ox.print('selectEnd', selectEnd) //Ox.Log('Form', 'selectEnd', selectEnd)
if (self.options.autocompleteReplace) { if (self.options.autocompleteReplace) {
value = self.options.value; value = self.options.value;
@ -538,7 +538,7 @@ Ox.Input = function(options, self) {
} }
function autovalidateCallback(data) { function autovalidateCallback(data) {
//Ox.print('autovalidateCallback', newValue, oldCursor) //Ox.Log('Form', 'autovalidateCallback', newValue, oldCursor)
self.options.value = data.value; self.options.value = data.value;
self.$input.val(self.options.value); self.$input.val(self.options.value);
!blur && cursor( !blur && cursor(
@ -555,7 +555,7 @@ Ox.Input = function(options, self) {
/* /*
function autovalidate(blur) { 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.autocorrectBlur = blur || false;
self.autocorrectCursor = cursor(); self.autocorrectCursor = cursor();
Ox.isFunction(self.options.autocorrect) ? Ox.isFunction(self.options.autocorrect) ?
@ -643,7 +643,7 @@ Ox.Input = function(options, self) {
} }
function clickMenu(data) { function clickMenu(data) {
//Ox.print('clickMenu', data); //Ox.Log('Form', 'clickMenu', data);
self.options.value = data.title; self.options.value = data.title;
self.$input.val(self.options.value).focus(); self.$input.val(self.options.value).focus();
that.gainFocus(); that.gainFocus();
@ -669,7 +669,7 @@ Ox.Input = function(options, self) {
function deselectMenu() { function deselectMenu() {
return; return;
//Ox.print('deselectMenu') //Ox.Log('Form', 'deselectMenu')
self.options.value = self.oldValue; self.options.value = self.oldValue;
self.$input.val(self.options.value); self.$input.val(self.options.value);
cursor(self.oldCursor); cursor(self.oldCursor);
@ -718,7 +718,7 @@ Ox.Input = function(options, self) {
setTimeout(function() { // wait for val to be set setTimeout(function() { // wait for val to be set
var value = self.$input.val(); var value = self.$input.val();
if ((self.options.autocompleteReplace || self.options.decimals) && hasDeletedSelectedEnd) { 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; value = newValue;
self.$input.val(value); self.$input.val(value);
} }
@ -751,7 +751,7 @@ Ox.Input = function(options, self) {
function selectMenu(data) { function selectMenu(data) {
var pos = cursor(); var pos = cursor();
//if (self.options.value) { //if (self.options.value) {
//Ox.print('selectMenu', pos, data.title) //Ox.Log('Form', 'selectMenu', pos, data.title)
self.options.value = data.title self.options.value = data.title
self.$input.val(self.options.value); self.$input.val(self.options.value);
cursor(pos[0], self.options.value.length); cursor(pos[0], self.options.value.length);
@ -1043,8 +1043,8 @@ Ox.Input_ = function(options, self) {
(self.options.value.length - 1) * self.options.separatorWidth; (self.options.value.length - 1) * self.options.separatorWidth;
} }
*/ */
//Ox.print('self.hasMulVal', self.hasMultipleValues); //Ox.Log('Form', 'self.hasMulVal', self.hasMultipleValues);
//Ox.print('self.options.value', self.options.value) //Ox.Log('Form', 'self.options.value', self.options.value)
if (!self.hasMultipleValues) { if (!self.hasMultipleValues) {
if (self.options.type == 'select') { if (self.options.type == 'select') {
self.options.value = [{ 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; 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)) { if (Ox.isString(self.options.separator)) {
self.options.separator = $.map(new Array(self.values - 1), function(v, i) { 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) { if (self.keyName) {
that.$key = []; that.$key = [];
self.options[self.keyName].forEach(function(key, keyPos) { 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) { if (self.keyName == 'label' && key.label.length == 1) {
that.$key[keyPos] = Ox.Label({ that.$key[keyPos] = Ox.Label({
overlap: 'right', overlap: 'right',
@ -1116,10 +1116,10 @@ Ox.Input_ = function(options, self) {
}) })
.appendTo(that); .appendTo(that);
} else if (key.label.length > 1) { } 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.selectKeyId = self.options.id + Ox.toTitleCase(self.keyName) +
(self.options[self.keyName].length == 1 ? '' : keyPos); (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({ that.$key[keyPos] = Ox.Select({
id: self.selectKeyId, id: self.selectKeyId,
items: $.map(key.label, function(value, valuePos) { items: $.map(key.label, function(value, valuePos) {
@ -1174,7 +1174,7 @@ Ox.Input_ = function(options, self) {
that.$unit = Ox.Select({ that.$unit = Ox.Select({
id: self.selectUnitId, id: self.selectUnitId,
items: $.map(self.options.unit, function(unit, i) { items: $.map(self.options.unit, function(unit, i) {
//Ox.print('unit', unit) //Ox.Log('Form', 'unit', unit)
return { return {
checked: i == 0, checked: i == 0,
id: unit.id, id: unit.id,
@ -1215,12 +1215,12 @@ Ox.Input_ = function(options, self) {
that.$input = []; that.$input = [];
//self.margin = 0; //self.margin = 0;
self.options.value.forEach(function(v, i) { 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) { var id = self.keyName ? $.map(self.selectedKey, function(v, i) {
return self.options[self.keyName][i].id; return self.options[self.keyName][i].id;
}).join('.') : ''; }).join('.') : '';
//self.margin -= (i == 0 ? 16 : self.options.value[i - 1].width) //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') { if (self.options.type == 'select') {
that.$input[i] = Ox.Select({ that.$input[i] = Ox.Select({
id: v.id, id: v.id,
@ -1269,7 +1269,7 @@ Ox.Input_ = function(options, self) {
//width(self.options.width); //width(self.options.width);
function changeKey(data) { function changeKey(data) {
//Ox.print('changeKey', data); //Ox.Log('Form', 'changeKey', data);
if (data) { // fixme: necessary? if (data) { // fixme: necessary?
self.key = { self.key = {
id: data.id, id: data.id,
@ -1337,7 +1337,7 @@ Ox.Input_ = function(options, self) {
} }
function submit() { function submit() {
//Ox.print('submit') //Ox.Log('Form', 'submit')
var value = that.$input.val(); var value = that.$input.val();
that.$input.blur(); that.$input.blur();
that.triggerEvent('submit', self.options.key ? { that.triggerEvent('submit', self.options.key ? {
@ -1418,7 +1418,7 @@ Ox.InputElement_ = function(options, self) {
.change(change) .change(change)
.focus(focus); .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.bindKeyboard = self.options.autocomplete || self.options.autocorrect
|| self.options.autosuggest || self.options.autovalidate; || self.options.autosuggest || self.options.autovalidate;
@ -1509,7 +1509,7 @@ Ox.InputElement_ = function(options, self) {
self.options.key ? self.options.key ?
self.options.autosuggest[self.options.key] : self.options.autosuggest self.options.autosuggest[self.options.key] : self.options.autosuggest
).forEach(function(v, i) { ).forEach(function(v, i) {
//Ox.print('v...', v) //Ox.Log('Form', 'v...', v)
var index = v.toLowerCase().indexOf(value); var index = v.toLowerCase().indexOf(value);
index > -1 && values[index == 0 ? 0 : 1].push(v); index > -1 && values[index == 0 ? 0 : 1].push(v);
}); });
@ -1531,7 +1531,7 @@ Ox.InputElement_ = function(options, self) {
var values = values || [], var values = values || [],
selected = values.length == 1 ? 0 : -1, selected = values.length == 1 ? 0 : -1,
value = that.$element.val().toLowerCase(); value = that.$element.val().toLowerCase();
//Ox.print('values', values); //Ox.Log('Form', 'values', values);
if (values.length) { if (values.length) {
values = $.map(values, function(v, i) { values = $.map(values, function(v, i) {
if (value == v.toLowerCase()) { if (value == v.toLowerCase()) {
@ -1589,7 +1589,7 @@ Ox.InputElement_ = function(options, self) {
function blur() { function blur() {
if (!self.options.autosuggest || self.$autosuggestMenu.is(':hidden')) { if (!self.options.autosuggest || self.$autosuggestMenu.is(':hidden')) {
//Ox.print('losing focus...') //Ox.Log('Form', 'losing focus...')
that.loseFocus(); that.loseFocus();
self.options.parent.removeClass('OxFocus'); self.options.parent.removeClass('OxFocus');
self.options.autocorrect && autocorrectCall(true); self.options.autocorrect && autocorrectCall(true);
@ -1617,7 +1617,7 @@ Ox.InputElement_ = function(options, self) {
} }
function clickMenu(data) { function clickMenu(data) {
//Ox.print('clickMenu', data); //Ox.Log('Form', 'clickMenu', data);
that.$element.val(data.title); that.$element.val(data.title);
//self.$autosuggestMenu.hideMenu(); //self.$autosuggestMenu.hideMenu();
self.options.autosuggestSubmit && submit(); self.options.autosuggestSubmit && submit();
@ -1650,13 +1650,13 @@ Ox.InputElement_ = function(options, self) {
if (self.bindKeyboard) { if (self.bindKeyboard) {
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function // fixme: different in webkit and firefox (?), see keyboard handler, need generic function
Ox.UI.$document.keydown(keydown); 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? self.options.autosuggest && setTimeout(autosuggestCall, 0); // fixme: why is the timeout needed?
} }
} }
function keydown(event) { 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? 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 setTimeout(function() { // fixme: document what this timeout is for
var value = that.$element.val(); var value = that.$element.val();
@ -1782,7 +1782,7 @@ Ox.Range_ = function(options, self) {
var $thumb = Ox.Button({}) var $thumb = Ox.Button({})
.addClass('OxThumb') .addClass('OxThumb')
.appendTo($track); .appendTo($track);
//Ox.print('----') //Ox.Log('Form', '----')
if (self.options.arrows) { if (self.options.arrows) {
var $arrowInc = Ox.Button({ var $arrowInc = Ox.Button({
style: 'symbol', style: 'symbol',

View file

@ -38,7 +38,7 @@ Ox.InputGroup = function(options, self) {
self.$separator = []; self.$separator = [];
self.options.separators.forEach(function(v, i) { 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({ self.$separator[i] = Ox.Label({
textAlign: 'center', textAlign: 'center',
title: v.title, title: v.title,
@ -71,7 +71,7 @@ Ox.InputGroup = function(options, self) {
}); });
function change(data) { function change(data) {
//Ox.print('InputGroup change') //Ox.Log('Form', 'InputGroup change')
that.triggerEvent('change', { that.triggerEvent('change', {
value: self.options.inputs.map(function($input) { value: self.options.inputs.map(function($input) {
return $input.value(); return $input.value();
@ -108,7 +108,7 @@ Ox.InputGroup = function(options, self) {
} }
function validate(data) { function validate(data) {
//Ox.print('INPUTGROUP TRIGGER VALIDATE') //Ox.Log('Form', 'INPUTGROUP TRIGGER VALIDATE')
that.triggerEvent('validate', data); that.triggerEvent('validate', data);
} }
@ -116,7 +116,7 @@ Ox.InputGroup = function(options, self) {
that.getInputById = function(id) { that.getInputById = function(id) {
var input = null; var input = null;
Ox.forEach(self.options.inputs, function(v, i) { 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)) { if (v.options('id') == self.options.id + Ox.toTitleCase(id)) {
input = v; input = v;
return false; return false;

View file

@ -19,7 +19,7 @@ Ox.OptionGroup = function(items, min, max, property) {
function getLastBefore(pos) { function getLastBefore(pos) {
// returns the position of the last checked item before position pos // returns the position of the last checked item before position pos
var last = -1; 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 > 0 ? Ox.range(pos - 1, -1, -1) : [],
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -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 > 0 ? Ox.range(pos - 1, -1, -1) : [],
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : [] pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : []
), function(v) { ), function(v) {
//Ox.print(pos, v) //Ox.Log('Form', pos, v)
if (items[v][property]) { if (items[v][property]) {
last = v; last = v;
return false; return false;

View file

@ -98,7 +98,7 @@ Ox.PlacePicker = function(options, self) {
self.map = false; self.map = false;
function changeZoom(data) { function changeZoom(data) {
//Ox.print('changeZoom') //Ox.Log('Form', 'changeZoom')
self.$map.zoom(data.value); self.$map.zoom(data.value);
} }
@ -115,7 +115,7 @@ Ox.PlacePicker = function(options, self) {
} }
function findPlace(data) { function findPlace(data) {
//Ox.print('findPlace', data); //Ox.Log('Form', 'findPlace', data);
self.$map.find(data.value, function(place) { self.$map.find(data.value, function(place) {
place && that.$label.html(place.geoname); place && that.$label.html(place.geoname);
}); });

View file

@ -107,7 +107,7 @@ Ox.Range = function(options, self) {
}) })
.appendTo(self.$track.$element); .appendTo(self.$track.$element);
self.options.trackImages.forEach(function(v, i) { self.options.trackImages.forEach(function(v, i) {
//Ox.print(self.trackImageWidths[i]) //Ox.Log('Form', self.trackImageWidths[i])
$('<img>') $('<img>')
.attr({ .attr({
src: v src: v

View file

@ -64,7 +64,7 @@ Ox.Select = function(options, self) {
key_down: showMenu key_down: showMenu
}); });
//Ox.print('Ox.Select', self.options); //Ox.Log('Form', 'Ox.Select', self.options);
Ox.extend(self, { Ox.extend(self, {
buttonId: self.options.id + 'Button', buttonId: self.options.id + 'Button',
@ -147,7 +147,7 @@ Ox.Select = function(options, self) {
} }
function changeMenu(data) { function changeMenu(data) {
//Ox.print('clickMenu: ', self.options.id, data) //Ox.Log('Form', 'clickMenu: ', self.options.id, data)
if (self.options.selectable) { if (self.options.selectable) {
self.checked = self.optionGroup.checked(); self.checked = self.optionGroup.checked();
self.options.value = data.checked[0].id; self.options.value = data.checked[0].id;
@ -163,10 +163,10 @@ Ox.Select = function(options, self) {
} }
function hideMenu() { function hideMenu() {
//Ox.print('%% hideMenu that', that, 'self', self) //Ox.Log('Form', '%% hideMenu that', that, 'self', self)
that.removeClass('OxSelected'); that.removeClass('OxSelected');
// self.$button.removeClass('OxSelected'); // self.$button.removeClass('OxSelected');
//Ox.print('%% hideMenu end') //Ox.Log('Form', '%% hideMenu end')
} }
function loseFocus() { function loseFocus() {
@ -182,7 +182,7 @@ Ox.Select = function(options, self) {
self.setOption = function(key, value) { self.setOption = function(key, value) {
if (key == 'value') { if (key == 'value') {
Ox.print('SETTING VALUE OPTION', value) Ox.Log('Form', 'SETTING VALUE OPTION', value)
that.selectItem(value); that.selectItem(value);
} }
}; };
@ -216,7 +216,7 @@ Ox.Select = function(options, self) {
id <s> item id id <s> item id
@*/ @*/
that.selectItem = function(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( self.options.type == 'text' && self.$title.html(
Ox.getObjectById(self.options.items, id).title Ox.getObjectById(self.options.items, id).title
); );
@ -236,13 +236,13 @@ Ox.Select = function(options, self) {
that.value = function() { that.value = function() {
if (arguments.length == 0) { if (arguments.length == 0) {
//Ox.print('selected::', that.selected()) //Ox.Log('Form', 'selected::', that.selected())
return that.selected()[0].id; return that.selected()[0].id;
} else { } else {
that.selectItem(arguments[0]); that.selectItem(arguments[0]);
return that; return that;
/* /*
Ox.print('ELSE'); Ox.Log('Form', 'ELSE');
that.selectItem(arguments[0]); that.selectItem(arguments[0]);
return that; return that;
*/ */

View file

@ -154,7 +154,7 @@ Ox.TimeInput = function(options, self) {
].join(':') + (self.options.ampm ? ' ' + self.$input.ampm.options('value') : '')), ].join(':') + (self.options.ampm ? ' ' + self.$input.ampm.options('value') : '')),
(self.options.seconds? '%T' : '%H:%M')) + (self.options.seconds? '%T' : '%H:%M')) +
(self.options.milliseconds ? '.' + self.$input.milliseconds.options('value') : ''); (self.options.milliseconds ? '.' + self.$input.milliseconds.options('value') : '');
//Ox.print('SETVALUE', self.options.value); //Ox.Log('Form', 'SETVALUE', self.options.value);
} }
function setValues() { function setValues() {

View file

@ -21,7 +21,7 @@ Ox.IconItem <f:Ox.Element> IconItem Object
Ox.IconItem = function(options, self) { Ox.IconItem = function(options, self) {
//Ox.print('IconItem', options, self) //Ox.Log('List', 'IconItem', options, self)
self = self || {}; self = self || {};
var that = Ox.Element({}, self) var that = Ox.Element({}, self)

View file

@ -63,7 +63,7 @@ Ox.InfoList = function(options, self) {
}, },
info: {} info: {}
}; };
Ox.print('DATA -=-------', data) Ox.Log('List', 'DATA -=-------', data)
var $icon = Ox.Element() var $icon = Ox.Element()
.css({ .css({
@ -148,7 +148,7 @@ Ox.InfoList = function(options, self) {
if (key == 'items') { if (key == 'items') {
that.$element.options(key, value); that.$element.options(key, value);
} else if (key == 'selected') { } else if (key == 'selected') {
Ox.print('SELECTED', value) Ox.Log('List', 'SELECTED', value)
that.$element.options(key, value); that.$element.options(key, value);
} else if (key == 'sort') { } else if (key == 'sort') {
that.$element.options(key, value); that.$element.options(key, value);
@ -160,7 +160,7 @@ Ox.InfoList = function(options, self) {
$parent.css({width: width - 144}); $parent.css({width: width - 144});
$parent.parent().css({width: width - 144}); $parent.parent().css({width: width - 144});
$parent.parent().parent().css({width: width - 8}); $parent.parent().parent().css({width: width - 8});
Ox.print('@@@', this.className, id) Ox.Log('List', '@@@', this.className, id)
Ox.UI.elements[id].options({width: width - 152}); Ox.UI.elements[id].options({width: width - 152});
}); });
} }

View file

@ -44,7 +44,7 @@ Ox.ItemInput = function(options, self) {
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
self.options.height = data.value.split('\n').length * 13; self.options.height = data.value.split('\n').length * 13;
Ox.print('HEIGHT', self.options.height) Ox.Log('List', 'HEIGHT', self.options.height)
self.$input.options({ self.$input.options({
height: self.options.height height: self.options.height
}); });
@ -166,7 +166,7 @@ Ox.ItemInput = function(options, self) {
'text-align': 'right', 'text-align': 'right',
}) })
); );
Ox.print($input); Ox.Log('List', $input);
*/ */
return that; return that;

View file

@ -427,7 +427,7 @@ Ox.List = function(options, self) {
var height = getHeight(), var height = getHeight(),
lastItemHeight = height % self.options.itemHeight || self.options.itemHeight, lastItemHeight = height % self.options.itemHeight || self.options.itemHeight,
visibleItems = Math.ceil(height / self.options.itemHeight); visibleItems = Math.ceil(height / self.options.itemHeight);
//Ox.print('FILL', self.listLength, visibleItems); //Ox.Log('List', 'FILL', self.listLength, visibleItems);
if (self.listLength < visibleItems) { if (self.listLength < visibleItems) {
Ox.range(self.listLength, visibleItems).forEach(function(v) { Ox.range(self.listLength, visibleItems).forEach(function(v) {
var $item = Ox.ListItem({ var $item = Ox.ListItem({
@ -578,7 +578,7 @@ Ox.List = function(options, self) {
// fixme: is this really needed? // fixme: is this really needed?
var pos = -1; var pos = -1;
Ox.forEach(self.$items, function($item, i) { Ox.forEach(self.$items, function($item, i) {
//Ox.print('$item', i, self.options.unique, $item.options('data')[self.options.unique]) //Ox.Log('List', '$item', i, self.options.unique, $item.options('data')[self.options.unique])
if ($item.options('data')[self.options.unique] == id) { if ($item.options('data')[self.options.unique] == id) {
pos = i; pos = i;
return false; return false;
@ -588,10 +588,10 @@ Ox.List = function(options, self) {
} }
function getPositions(callback) { function getPositions(callback) {
//Ox.print('getPositions', self.options.selected); //Ox.Log('List', 'getPositions', self.options.selected);
// fixme: optimize: send non-selected ids if more than half of the items are selected // fixme: optimize: send non-selected ids if more than half of the items are selected
if (self.options.selected.length /*&& ids.length < self.listLength*/) { if (self.options.selected.length /*&& ids.length < self.listLength*/) {
/*Ox.print('-------- request', { /*Ox.Log('List', '-------- request', {
positions: ids, positions: ids,
sort: self.options.sort sort: self.options.sort
});*/ });*/
@ -607,7 +607,7 @@ Ox.List = function(options, self) {
} }
function getPositionsCallback(result, callback) { function getPositionsCallback(result, callback) {
//Ox.print('getPositionsCallback', result); //Ox.Log('List', 'getPositionsCallback', result);
var pos = 0; var pos = 0;
if (result) { if (result) {
self.options.selected = []; self.options.selected = [];
@ -672,7 +672,7 @@ Ox.List = function(options, self) {
} }
function getWidth() { function getWidth() {
//Ox.print('LIST THAT.WIDTH()', that.width()) //Ox.Log('List', 'LIST THAT.WIDTH()', that.width())
return that.width() - (that.$content.height() > that.height() ? Ox.UI.SCROLLBAR_SIZE : 0); return that.width() - (that.$content.height() > that.height() ? Ox.UI.SCROLLBAR_SIZE : 0);
} }
@ -719,7 +719,7 @@ Ox.List = function(options, self) {
}); });
fillFirstPage(); fillFirstPage();
self.selected.length && scrollToPosition(self.selected[0]); self.selected.length && scrollToPosition(self.selected[0]);
Ox.print('CONSTRUCT:', timeC, 'APPEND:', timeA); Ox.Log('List', 'CONSTRUCT:', timeC, 'APPEND:', timeA);
// that.triggerEvent('init', {items: self.options.items.length}); // that.triggerEvent('init', {items: self.options.items.length});
// fixme: do sync lists need to trigger init? // fixme: do sync lists need to trigger init?
// will this only be reached in sync lists? // will this only be reached in sync lists?
@ -730,7 +730,7 @@ Ox.List = function(options, self) {
!Ox.isUndefined(callback) && callback(); !Ox.isUndefined(callback) && callback();
return; return;
} }
Ox.print(that.id, 'loadPage', page); Ox.Log('List', that.id, 'loadPage', page);
var keys = Ox.merge( var keys = Ox.merge(
self.options.keys.indexOf(self.options.unique) == -1 self.options.keys.indexOf(self.options.unique) == -1
? [self.options.unique] : [], self.options.keys ? [self.options.unique] : [], self.options.keys
@ -762,19 +762,19 @@ Ox.List = function(options, self) {
}); });
page == 0 && fillFirstPage(); page == 0 && fillFirstPage();
// FIXME: why does emptyPage sometimes have no methods? // FIXME: why does emptyPage sometimes have no methods?
//Ox.print('emptyPage', $emptyPage) //Ox.Log('List', 'emptyPage', $emptyPage)
$emptyPage && $emptyPage.removeElement && $emptyPage.removeElement(); $emptyPage && $emptyPage.removeElement && $emptyPage.removeElement();
self.$pages[page].appendTo(that.$content); self.$pages[page].appendTo(that.$content);
!Ox.isUndefined(callback) && callback(); // fixme: callback necessary? why not bind to event? !Ox.isUndefined(callback) && callback(); // fixme: callback necessary? why not bind to event?
})); }));
} else { } else {
//Ox.print('loading a page from cache, this should probably not happen -----------') //Ox.Log('List', 'loading a page from cache, this should probably not happen -----------')
self.$pages[page].appendTo(that.$content); self.$pages[page].appendTo(that.$content);
} }
} }
function loadPages(page, callback) { function loadPages(page, callback) {
Ox.print('loadPages', page) Ox.Log('List', 'loadPages', page)
var counter = 0, var counter = 0,
fn = function() { fn = function() {
if (++counter == 3) { if (++counter == 3) {
@ -908,7 +908,7 @@ Ox.List = function(options, self) {
selectTimeout = false, selectTimeout = false,
$element, $element,
hadFocus = that.hasFocus(); hadFocus = that.hasFocus();
//Ox.print('mousedown', pos) //Ox.Log('List', 'mousedown', pos)
that.gainFocus(); that.gainFocus();
if (pos > -1) { if (pos > -1) {
if (!self.clickTimeout) { if (!self.clickTimeout) {
@ -924,7 +924,7 @@ Ox.List = function(options, self) {
addAllToSelection(pos); addAllToSelection(pos);
} }
} else if (!isSelected(pos)) { } else if (!isSelected(pos)) {
Ox.print('select', pos) Ox.Log('List', 'select', pos)
select(pos); select(pos);
} else if (self.selected.length > 1) { } else if (self.selected.length > 1) {
// this could be the first click // this could be the first click
@ -989,7 +989,7 @@ Ox.List = function(options, self) {
var $item = self.$items[startPos], var $item = self.$items[startPos],
insert = startPos < stopPos ? 'insertAfter' : 'insertBefore'; insert = startPos < stopPos ? 'insertAfter' : 'insertBefore';
$item.detach()[insert](self.$items[stopPos].$element); // fixme: why do we need .$element here? $item.detach()[insert](self.$items[stopPos].$element); // fixme: why do we need .$element here?
//Ox.print('moveItem', startPos, stopPos, insert, self.ids); //Ox.Log('List', 'moveItem', startPos, stopPos, insert, self.ids);
var $item = self.$items.splice(startPos, 1)[0]; var $item = self.$items.splice(startPos, 1)[0];
self.$items.splice(stopPos, 0, $item); self.$items.splice(stopPos, 0, $item);
self.$items.forEach(function($item, pos) { self.$items.forEach(function($item, pos) {
@ -1079,7 +1079,7 @@ Ox.List = function(options, self) {
} }
function scrollToPosition(pos, leftOrTopAlign) { function scrollToPosition(pos, leftOrTopAlign) {
//Ox.print('scrollToPosition', pos) //Ox.Log('List', 'scrollToPosition', pos)
var itemHeight = self.options.itemHeight + self.itemMargin, var itemHeight = self.options.itemHeight + self.itemMargin,
itemWidth = self.options.itemWidth + self.itemMargin, itemWidth = self.options.itemWidth + self.itemMargin,
positions = [], positions = [],
@ -1188,7 +1188,7 @@ Ox.List = function(options, self) {
// fixme: no case where callback is set // fixme: no case where callback is set
// note: can't use selectNone here, // note: can't use selectNone here,
// since it'd trigger a select event // since it'd trigger a select event
Ox.print('SET SELECTED', ids) Ox.Log('List', 'SET SELECTED', ids)
var counter = 0; var counter = 0;
self.$items.forEach(function($item, pos) { self.$items.forEach(function($item, pos) {
if (isSelected(pos)) { if (isSelected(pos)) {
@ -1242,7 +1242,7 @@ Ox.List = function(options, self) {
var ids = self.options.selected = getSelectedIds(); var ids = self.options.selected = getSelectedIds();
setTimeout(function() { setTimeout(function() {
var ids_ = self.options.selected = getSelectedIds(); var ids_ = self.options.selected = getSelectedIds();
// Ox.print('ids', ids, 'ids after 100 msec', ids_, Ox.isEqual(ids, ids_)) // Ox.Log('List', 'ids', ids, 'ids after 100 msec', ids_, Ox.isEqual(ids, ids_))
if (Ox.isEqual(ids, ids_)) { if (Ox.isEqual(ids, ids_)) {
that.triggerEvent('select', { that.triggerEvent('select', {
ids: ids ids: ids
@ -1251,7 +1251,7 @@ Ox.List = function(options, self) {
ids: ids ids: ids
}); });
} else { } else {
// Ox.print('select event not triggered after timeout'); // Ox.Log('List', 'select event not triggered after timeout');
} }
}, 100); }, 100);
} }
@ -1267,9 +1267,9 @@ Ox.List = function(options, self) {
if (page < 0 || page >= self.pages) { if (page < 0 || page >= self.pages) {
return; return;
} }
//Ox.print('unloadPage', page) //Ox.Log('List', 'unloadPage', page)
//Ox.print('self.$pages', self.$pages) //Ox.Log('List', 'self.$pages', self.$pages)
//Ox.print('page not undefined', !Ox.isUndefined(self.$pages[page])) //Ox.Log('List', 'page not undefined', !Ox.isUndefined(self.$pages[page]))
if (!Ox.isUndefined(self.$pages[page])) { if (!Ox.isUndefined(self.$pages[page])) {
self.$pages[page].removeElement(); self.$pages[page].removeElement();
delete self.$pages[page]; delete self.$pages[page];
@ -1310,11 +1310,11 @@ Ox.List = function(options, self) {
} }
function updateQuery(callback) { // fixme: shouldn't this be setQuery? function updateQuery(callback) { // fixme: shouldn't this be setQuery?
//Ox.print('updateQuery', self.options) //Ox.Log('List', 'updateQuery', self.options)
clear(); // fixme: bad function name ... clear what? clear(); // fixme: bad function name ... clear what?
self.requests.push(self.options.items({}, function(result) { self.requests.push(self.options.items({}, function(result) {
var keys = {}; var keys = {};
//Ox.print('INIT!!!', result.data) //Ox.Log('List', 'INIT!!!', result.data)
that.triggerEvent('init', result.data); that.triggerEvent('init', result.data);
self.rowLength = getRowLength(); self.rowLength = getRowLength();
self.pageLength = self.options.orientation == 'both' self.pageLength = self.options.orientation == 'both'
@ -1343,7 +1343,7 @@ Ox.List = function(options, self) {
} }
function updateSelected() { function updateSelected() {
//Ox.print('updateSelected') //Ox.Log('List', 'updateSelected')
var oldSelectedIds = getSelectedIds(), var oldSelectedIds = getSelectedIds(),
newSelectedIds = []; newSelectedIds = [];
Ox.forEach(self.options.items, function(item) { Ox.forEach(self.options.items, function(item) {
@ -1395,7 +1395,7 @@ Ox.List = function(options, self) {
} }
self.setOption = function(key, value) { self.setOption = function(key, value) {
//Ox.print('list setOption', key, value); //Ox.Log('List', 'list setOption', key, value);
var selectedIds; var selectedIds;
if (key == 'items') { if (key == 'items') {
// fixme: this could be used to change the list // fixme: this could be used to change the list
@ -1408,13 +1408,13 @@ Ox.List = function(options, self) {
updateQuery(); updateQuery();
} }
} else if (key == 'selected') { } else if (key == 'selected') {
//Ox.print('setOption selected', value) //Ox.Log('List', 'setOption selected', value)
setSelected(value); setSelected(value);
// fixme: next line added to make text list find-as-you-type work, // fixme: next line added to make text list find-as-you-type work,
// may break other things // may break other things
!self.isAsync && triggerSelectEvent(value); !self.isAsync && triggerSelectEvent(value);
} else if (key == 'sort') { } else if (key == 'sort') {
//Ox.print('---sort---') //Ox.Log('List', '---sort---')
updateSort(); updateSort();
} }
}; };
@ -1584,7 +1584,7 @@ Ox.List = function(options, self) {
length <n> number of items to remove length <n> number of items to remove
@*/ @*/
that.removeItems = function(pos, length) { that.removeItems = function(pos, length) {
Ox.print('removeItems', pos, length) Ox.Log('List', 'removeItems', pos, length)
if (Ox.isUndefined(length)) { // pos is list of ids if (Ox.isUndefined(length)) { // pos is list of ids
pos.forEach(function(id) { pos.forEach(function(id) {
var p = getPositionById(id); var p = getPositionById(id);
@ -1669,7 +1669,7 @@ Ox.List = function(options, self) {
// fixme: this (and others) should be deprecated, // fixme: this (and others) should be deprecated,
// one should set options instead // one should set options instead
that.sortList = function(key, operator, map) { that.sortList = function(key, operator, map) {
// Ox.print('sortList', key, operator, map) // Ox.Log('List', 'sortList', key, operator, map)
if (key != self.options.sort[0].key || operator != self.options.sort[0].operator) { if (key != self.options.sort[0].key || operator != self.options.sort[0].operator) {
self.options.sort[0] = {key: key, operator: operator, map: map}; self.options.sort[0] = {key: key, operator: operator, map: map};
updateSort(); updateSort();
@ -1689,7 +1689,7 @@ Ox.List = function(options, self) {
@*/ @*/
that.value = function(id, key, value) { that.value = function(id, key, value) {
// id can be a number and will then be interpreted as position // id can be a number and will then be interpreted as position
Ox.print('that.value id key value', id, key, value) Ox.Log('List', 'that.value id key value', id, key, value)
var pos = Ox.isNumber(id) ? id : getPositionById(id), var pos = Ox.isNumber(id) ? id : getPositionById(id),
$item = self.$items[pos], $item = self.$items[pos],
data = $item.options('data'); data = $item.options('data');

View file

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

View file

@ -133,7 +133,7 @@ Ox.TreeList = function(options, self) {
} }
function parseData(key, value) { function parseData(key, value) {
//Ox.print('parseData', key, value) //Ox.Log('List', 'parseData', key, value)
var ret = { var ret = {
expanded: false, expanded: false,
id: Ox.uid().toString(), id: Ox.uid().toString(),

View file

@ -326,7 +326,7 @@ Ox.ListMap = function(options, self) {
self.$areaKmInput.options({value: Ox.formatArea(data.area)}); self.$areaKmInput.options({value: Ox.formatArea(data.area)});
}, },
changeplaceend: function(data) { changeplaceend: function(data) {
//Ox.print('ssP', self.selectedPlace); //Ox.Log('Map', 'ssP', self.selectedPlace);
var isResult = self.selectedPlace[0] == '_'; var isResult = self.selectedPlace[0] == '_';
!isResult && editPlace([ !isResult && editPlace([
'lat', 'lng', 'south', 'west', 'north', 'east', 'area' 'lat', 'lng', 'south', 'west', 'north', 'east', 'area'
@ -766,7 +766,7 @@ Ox.ListMap = function(options, self) {
function removePlace() { function removePlace() {
var index; var index;
Ox.print('REMOVE PLACE', self.selectedPlace, index) Ox.Log('Map', 'REMOVE PLACE', self.selectedPlace, index)
if (!self.isAsync) { if (!self.isAsync) {
// fixme: doesn't call self.options.removePlace! // fixme: doesn't call self.options.removePlace!
index = Ox.getPositionById(self.options.places, self.selectedPlace); index = Ox.getPositionById(self.options.places, self.selectedPlace);
@ -893,7 +893,7 @@ Ox.ListMap = function(options, self) {
resizeMap <f> resizeMap resizeMap <f> resizeMap
@*/ @*/
that.resizeMap = function() { that.resizeMap = function() {
Ox.print('Ox.ListMap.resizeMap()') Ox.Log('Map', 'Ox.ListMap.resizeMap()')
self.$map.resizeMap(); self.$map.resizeMap();
return that; return that;
}; };

View file

@ -457,7 +457,7 @@ Ox.Map = function(options, self) {
function addPlaceToMap(place) { function addPlaceToMap(place) {
// via find, click, shift-click, or new place button // via find, click, shift-click, or new place button
Ox.print('addPlaceToMap', place) Ox.Log('Map', 'addPlaceToMap', place)
var exists = false; var exists = false;
if (!place) { if (!place) {
var bounds = self.map.getBounds(), var bounds = self.map.getBounds(),
@ -504,12 +504,12 @@ Ox.Map = function(options, self) {
Ox.extend(place, data); Ox.extend(place, data);
self.options.selected = place.id; self.options.selected = place.id;
place.countryCode = country ? country.code : ''; place.countryCode = country ? country.code : '';
Ox.print('addP2P', data, place); Ox.Log('Map', 'addP2P', data, place);
place.marker.update(); place.marker.update();
self.places.push(place); self.places.push(place);
self.resultPlace = null; self.resultPlace = null;
that.triggerEvent('addplace', place) that.triggerEvent('addplace', place)
//Ox.print('SSSS', self.options.selected) //Ox.Log('Map', 'SSSS', self.options.selected)
} }
function boundsChanged() { function boundsChanged() {
@ -528,7 +528,7 @@ Ox.Map = function(options, self) {
function centerChanged() { function centerChanged() {
var tooltip = $('.OxMapMarkerTooltip'); var tooltip = $('.OxMapMarkerTooltip');
if (tooltip.length) { if (tooltip.length) {
Ox.print('??', tooltip[0].className, $(tooltip[0]).data('oxid')); Ox.Log('Map', '??', tooltip[0].className, $(tooltip[0]).data('oxid'));
Ox.UI.elements[$(tooltip[0]).data('oxid')].hide(); Ox.UI.elements[$(tooltip[0]).data('oxid')].hide();
} }
self.center = self.map.getCenter(); self.center = self.map.getCenter();
@ -568,7 +568,7 @@ Ox.Map = function(options, self) {
} }
function constructZoomInput() { function constructZoomInput() {
//Ox.print('constructZoomInput', self.minZoom, self.maxZoom) //Ox.Log('Map', 'constructZoomInput', self.minZoom, self.maxZoom)
if (self.options.zoombar) { if (self.options.zoombar) {
self.$zoomInput && self.$zoomInput.removeElement(); self.$zoomInput && self.$zoomInput.removeElement();
self.$zoomInput = Ox.Range({ self.$zoomInput = Ox.Range({
@ -677,19 +677,19 @@ Ox.Map = function(options, self) {
if (!place && self.resultPlace && self.resultPlace.id == id) { if (!place && self.resultPlace && self.resultPlace.id == id) {
place = self.resultPlace; place = self.resultPlace;
} }
//Ox.print('getPlaceById', id, place) //Ox.Log('Map', 'getPlaceById', id, place)
return place; return place;
} }
function getPlaceByLatLng(latlng, bounds, callback) { function getPlaceByLatLng(latlng, bounds, callback) {
// gets the largest place at latlng that would fit in bounds // gets the largest place at latlng that would fit in bounds
//Ox.print('ll b', latlng, bounds) //Ox.Log('Map', 'll b', latlng, bounds)
var callback = arguments.length == 3 ? callback : bounds, var callback = arguments.length == 3 ? callback : bounds,
bounds = arguments.length == 3 ? bounds : null; bounds = arguments.length == 3 ? bounds : null;
self.geocoder.geocode({ self.geocoder.geocode({
latLng: latlng latLng: latlng
}, function(results, status) { }, function(results, status) {
//Ox.print('results', results) //Ox.Log('Map', 'results', results)
var length = results.length; var length = results.length;
if (status == google.maps.GeocoderStatus.OK) { if (status == google.maps.GeocoderStatus.OK) {
if (bounds) { if (bounds) {
@ -715,7 +715,7 @@ Ox.Map = function(options, self) {
results: results results: results
}); });
} else { } else {
Ox.print('geocode failed:', status); Ox.Log('Map', 'geocode failed:', status);
callback(null); callback(null);
} }
}); });
@ -737,7 +737,7 @@ Ox.Map = function(options, self) {
results: results results: results
}); });
} else { } else {
Ox.print('geocode failed:', status); Ox.Log('Map', 'geocode failed:', status);
callback(null); callback(null);
} }
}); });
@ -780,7 +780,7 @@ Ox.Map = function(options, self) {
getMapBounds(function(mapBounds) { getMapBounds(function(mapBounds) {
Ox.print('init', mapBounds.getSouthWest(), mapBounds.getNorthEast(), mapBounds.getCenter()) Ox.Log('Map', 'init', mapBounds.getSouthWest(), mapBounds.getNorthEast(), mapBounds.getCenter())
self.elevationService = new google.maps.ElevationService(); self.elevationService = new google.maps.ElevationService();
self.geocoder = new google.maps.Geocoder(); self.geocoder = new google.maps.Geocoder();
@ -871,7 +871,7 @@ Ox.Map = function(options, self) {
function mapChanged() { function mapChanged() {
// gets called after panning or zooming // gets called after panning or zooming
Ox.print('mapChanged'); Ox.Log('Map', 'mapChanged');
if (self.boundsChanged) { if (self.boundsChanged) {
var bounds = self.map.getBounds(), var bounds = self.map.getBounds(),
southWest = bounds.getSouthWest(), southWest = bounds.getSouthWest(),
@ -915,7 +915,7 @@ Ox.Map = function(options, self) {
range: [0, self.options.maxMarkers], range: [0, self.options.maxMarkers],
sort: [{key: 'area', operator: '-'}] sort: [{key: 'area', operator: '-'}]
}, function(result) { }, function(result) {
Ox.print('RESULT', result) Ox.Log('Map', 'RESULT', result)
var ids = []; var ids = [];
result.data.items.forEach(function(item, i) { result.data.items.forEach(function(item, i) {
var place = getPlaceById(item.id); var place = getPlaceById(item.id);
@ -1017,7 +1017,7 @@ Ox.Map = function(options, self) {
}).join(', '); }).join(', ');
} }
function getType(types) { function getType(types) {
Ox.print('getType', types) Ox.Log('Map', 'getType', types)
// see http://code.google.com/apis/maps/documentation/javascript/services.html#GeocodingAddressTypes // see http://code.google.com/apis/maps/documentation/javascript/services.html#GeocodingAddressTypes
var strings = { var strings = {
'country': ['country'], 'country': ['country'],
@ -1087,7 +1087,7 @@ Ox.Map = function(options, self) {
var place = getSelectedPlace(); var place = getSelectedPlace();
place.id = '_' + place.id; place.id = '_' + place.id;
self.options.selected = place.id; self.options.selected = place.id;
//Ox.print('removePlace', Ox.getObjectById(self.places, place.id)) //Ox.Log('Map', 'removePlace', Ox.getObjectById(self.places, place.id))
self.places.splice(Ox.getPositionById(self.places, place.id), 1); self.places.splice(Ox.getPositionById(self.places, place.id), 1);
self.resultPlace && self.resultPlace.remove(); self.resultPlace && self.resultPlace.remove();
self.resultPlace = place; self.resultPlace = place;
@ -1095,7 +1095,7 @@ Ox.Map = function(options, self) {
} }
function reset() { function reset() {
//Ox.print(self.map.getZoom(), self.zoom); //Ox.Log('Map', self.map.getZoom(), self.zoom);
self.map.getZoom() == self.zoom ? self.map.getZoom() == self.zoom ?
self.map.panTo(self.center) : self.map.panTo(self.center) :
self.map.fitBounds(self.bounds); self.map.fitBounds(self.bounds);
@ -1103,7 +1103,7 @@ Ox.Map = function(options, self) {
function resizeMap() { function resizeMap() {
/* /*
Ox.print('resizeMap', self.options.width, self.options.height); Ox.Log('Map', 'resizeMap', self.options.width, self.options.height);
var center = self.map.getCenter(); var center = self.map.getCenter();
self.mapHeight = getMapHeight(); self.mapHeight = getMapHeight();
self.minZoom = getMinZoom(); self.minZoom = getMinZoom();
@ -1124,7 +1124,7 @@ Ox.Map = function(options, self) {
// id can be null (deselect) // id can be null (deselect)
var place, var place,
selected = getSelectedMarker(); selected = getSelectedMarker();
Ox.print('Ox.Map selectPlace()', id, selected); Ox.Log('Map', 'Ox.Map selectPlace()', id, selected);
if (id != selected) { if (id != selected) {
place = getPlaceById(selected); place = getPlaceById(selected);
place && place.deselect(); place && place.deselect();
@ -1210,7 +1210,7 @@ Ox.Map = function(options, self) {
} }
function setStatus() { function setStatus() {
//Ox.print('setStatus()', self.options.selected) //Ox.Log('Map', 'setStatus()', self.options.selected)
var code, country, disabled, place, title; var code, country, disabled, place, title;
if (self.options.statusbar) { if (self.options.statusbar) {
place = getSelectedPlace(); place = getSelectedPlace();
@ -1238,7 +1238,7 @@ Ox.Map = function(options, self) {
title: title title: title
}); });
} }
//Ox.print('STATUS DONE'); //Ox.Log('Map', 'STATUS DONE');
} }
function spansGlobe() { function spansGlobe() {
@ -1319,7 +1319,7 @@ Ox.Map = function(options, self) {
} }
function undo() { function undo() {
Ox.print('Map undo') Ox.Log('Map', 'Map undo')
var place = getSelectedPlace(); var place = getSelectedPlace();
place.editing && place.undo(); place.editing && place.undo();
} }
@ -1440,7 +1440,7 @@ Ox.Map = function(options, self) {
that.resizeMap = function() { that.resizeMap = function() {
/* /*
Ox.print('resizeMap', self.options.width, self.options.height); Ox.Log('Map', 'resizeMap', self.options.width, self.options.height);
var center = self.map.getCenter(); var center = self.map.getCenter();
self.mapHeight = getMapHeight(); self.mapHeight = getMapHeight();
self.minZoom = getMinZoom(); self.minZoom = getMinZoom();
@ -1457,11 +1457,11 @@ Ox.Map = function(options, self) {
*/ */
/* /*
Ox.print('Ox.Map.resizeMap()'); Ox.Log('Map', 'Ox.Map.resizeMap()');
var center = self.map.getCenter(); var center = self.map.getCenter();
self.options.height = that.$element.height(); self.options.height = that.$element.height();
self.options.width = that.$element.width(); self.options.width = that.$element.width();
Ox.print(self.options.width, self.options.height) Ox.Log('Map', self.options.width, self.options.height)
self.$map.css({ self.$map.css({
height: self.mapHeight + 'px', height: self.mapHeight + 'px',
width: self.options.width + 'px' width: self.options.width + 'px'
@ -1494,7 +1494,7 @@ Ox.Map = function(options, self) {
that.value = function(id, key, value) { that.value = function(id, key, value) {
// fixme: should be like the corresponding List/TextList/etc value function // fixme: should be like the corresponding List/TextList/etc value function
Ox.print('Map.value', id, key, value) Ox.Log('Map', 'Map.value', id, key, value)
getPlaceById(id).options(key, value); getPlaceById(id).options(key, value);
} }

View file

@ -119,7 +119,7 @@ Ox.MapMarker = function(options) {
} else if (that.place.east > 180) { } else if (that.place.east > 180) {
that.place.east -= 360; that.place.east -= 360;
} }
Ox.print('west', that.place.west, 'east', that.place.east, 'span', span); Ox.Log('Map', 'west', that.place.west, 'east', that.place.east, 'span', span);
that.place.update(); that.place.update();
that.marker.setOptions({ that.marker.setOptions({
position: that.place.center position: that.place.center
@ -201,7 +201,7 @@ Ox.MapMarker = function(options) {
// workaround to prevent marker from appearing twice // workaround to prevent marker from appearing twice
// after setting draggable from true to false (google maps bug) // after setting draggable from true to false (google maps bug)
var fix = that.marker.getDraggable() && !that.place.editing; var fix = that.marker.getDraggable() && !that.place.editing;
//Ox.print('setOptions, that.map: ', that.map) //Ox.Log('Map', 'setOptions, that.map: ', that.map)
if (that.map.options('showTypes')) { if (that.map.options('showTypes')) {
that.color = typeColor[that.place.type]; that.color = typeColor[that.place.type];
that.size = 8; that.size = 8;

View file

@ -53,7 +53,7 @@ Ox.MapMarkerImage = (function() {
new google.maps.Point(0, 0), new google.maps.Point(0, 0),
new google.maps.Point(r, r) new google.maps.Point(r, r)
); );
//Ox.print(options, 'index', index) //Ox.Log('Map', options, 'index', index)
} }
return cache[index]; return cache[index];

View file

@ -155,7 +155,7 @@ Ox.MapPlace = function(options) {
options = Ox.makeObject(arguments); options = Ox.makeObject(arguments);
Ox.forEach(options, function(value, key) { Ox.forEach(options, function(value, key) {
that[key] = value; that[key] = value;
Ox.print('that.' + key, '=', value, '......') Ox.Log('Map', 'that.' + key, '=', value, '......')
}); });
update(true); update(true);
}; };

View file

@ -80,7 +80,7 @@ Ox.MapRectangle = function(options, self) {
@*/ @*/
that.deselect = function() { that.deselect = function() {
setOptions(); setOptions();
Ox.print('MARKERS', that.markers) Ox.Log('Map', 'MARKERS', that.markers)
Ox.forEach(that.markers, function(marker) { Ox.forEach(that.markers, function(marker) {
marker.remove(); marker.remove();
}); });
@ -109,7 +109,7 @@ Ox.MapRectangle = function(options, self) {
update <f> udpate update <f> udpate
@*/ @*/
that.update = function() { that.update = function() {
Ox.print('UPDATE...') Ox.Log('Map', 'UPDATE...')
that.rectangle.setOptions({ that.rectangle.setOptions({
bounds: that.place.bounds bounds: that.place.bounds
}); });

View file

@ -47,7 +47,7 @@ Ox.MapRectangleMarker = function(options, self) {
function drag(e) { function drag(e) {
// fixme: implement shift+drag (center stays the same) // fixme: implement shift+drag (center stays the same)
Ox.print(e.pixel.x, e.pixel.y) Ox.Log('Map', e.pixel.x, e.pixel.y)
var lat = Ox.limit(e.latLng.lat(), Ox.MIN_LATITUDE, Ox.MAX_LATITUDE), var lat = Ox.limit(e.latLng.lat(), Ox.MIN_LATITUDE, Ox.MAX_LATITUDE),
lng = e.latLng.lng(); lng = e.latLng.lng();
that.drag = { that.drag = {
@ -66,8 +66,8 @@ Ox.MapRectangleMarker = function(options, self) {
if (that.position.indexOf('e') > -1) { if (that.position.indexOf('e') > -1) {
that.place.east = lng; that.place.east = lng;
} }
//Ox.print('west', that.place.west, 'east', that.place.east); //Ox.Log('Map', 'west', that.place.west, 'east', that.place.east);
//Ox.print('south', that.place.south, 'north', that.place.north); //Ox.Log('Map', 'south', that.place.south, 'north', that.place.north);
that.place.update(); that.place.update();
that.place.marker.update(); that.place.marker.update();
that.place.rectangle.update(); that.place.rectangle.update();

View file

@ -173,7 +173,7 @@ Ox.MainMenu = function(options, self) {
} else { } else {
item = that.getMenu(ids.shift()).getItem(ids.join('_')); item = that.getMenu(ids.shift()).getItem(ids.join('_'));
} }
Ox.print('getItem', id, item); Ox.Log('Menu', 'getItem', id, item);
return item; return item;
}; };

View file

@ -402,7 +402,7 @@ Ox.Menu = function(options, self) {
function selectItem(position) { function selectItem(position) {
var item; var item;
if (self.options.selected > -1) { if (self.options.selected > -1) {
//Ox.print('s.o.s', self.options.selected, that.items) //Ox.Log('Menu', 's.o.s', self.options.selected, that.items)
item = that.items[self.options.selected] item = that.items[self.options.selected]
item && item.removeClass('OxSelected'); item && item.removeClass('OxSelected');
/* disabled /* disabled
@ -436,7 +436,7 @@ Ox.Menu = function(options, self) {
function selectNextItem() { function selectNextItem() {
var offset, var offset,
selected = self.options.selected; selected = self.options.selected;
//Ox.print('sNI', selected) //Ox.Log('Menu', 'sNI', selected)
if (!isLastEnabledItem()) { if (!isLastEnabledItem()) {
if (selected == -1) { if (selected == -1) {
scrollMenuUp(); scrollMenuUp();
@ -470,7 +470,7 @@ Ox.Menu = function(options, self) {
function selectPreviousItem() { function selectPreviousItem() {
var offset, var offset,
selected = self.options.selected; selected = self.options.selected;
//Ox.print('sPI', selected) //Ox.Log('Menu', 'sPI', selected)
if (selected > - 1) { if (selected > - 1) {
if (!isFirstEnabledItem()) { if (!isFirstEnabledItem()) {
that.items[selected].removeClass('OxSelected'); that.items[selected].removeClass('OxSelected');
@ -497,10 +497,10 @@ Ox.Menu = function(options, self) {
} }
function selectSubmenu() { function selectSubmenu() {
//Ox.print('selectSubmenu', self.options.selected) //Ox.Log('Menu', 'selectSubmenu', self.options.selected)
if (self.options.selected > -1) { if (self.options.selected > -1) {
var submenu = that.submenus[that.items[self.options.selected].options('id')]; var submenu = that.submenus[that.items[self.options.selected].options('id')];
//Ox.print('submenu', submenu, that.submenus); //Ox.Log('Menu', 'submenu', submenu, that.submenus);
if (submenu && submenu.hasEnabledItems()) { if (submenu && submenu.hasEnabledItems()) {
submenu.gainFocus(); submenu.gainFocus();
submenu.selectFirstItem(); submenu.selectFirstItem();
@ -513,7 +513,7 @@ Ox.Menu = function(options, self) {
} }
function selectSupermenu() { function selectSupermenu() {
//Ox.print('selectSupermenu', self.options.selected) //Ox.Log('Menu', 'selectSupermenu', self.options.selected)
if (self.options.parent) { if (self.options.parent) {
self.options.selected > -1 && that.items[self.options.selected].trigger('mouseleave'); self.options.selected > -1 && that.items[self.options.selected].trigger('mouseleave');
scrollMenuUp(); scrollMenuUp();
@ -557,12 +557,12 @@ Ox.Menu = function(options, self) {
checkItem <f> checkItem <f>
@*/ @*/
that.checkItem = function(id) { that.checkItem = function(id) {
Ox.print('checkItem id', id) Ox.Log('Menu', 'checkItem id', id)
var ids = id.split('_'), var ids = id.split('_'),
item; item;
if (ids.length == 1) { if (ids.length == 1) {
item = that.getItem(id); item = that.getItem(id);
Ox.print('checkItem', id, item, that.submenus) Ox.Log('Menu', 'checkItem', id, item, that.submenus)
if (item.options('group')) { if (item.options('group')) {
var position = getItemPositionById(id), var position = getItemPositionById(id),
toggled = self.optionGroups[item.options('group')].toggle(position); toggled = self.optionGroups[item.options('group')].toggle(position);
@ -585,7 +585,7 @@ Ox.Menu = function(options, self) {
getItem <f> getItem <f>
@*/ @*/
that.getItem = function(id) { that.getItem = function(id) {
//Ox.print('getItem id', id) //Ox.Log('Menu', 'getItem id', id)
var ids = id.split('_'), var ids = id.split('_'),
item; item;
if (ids.length == 1) { if (ids.length == 1) {
@ -618,7 +618,7 @@ Ox.Menu = function(options, self) {
} else { } else {
submenu = that.submenus[ids.shift()].getSubmenu(ids.join('_')); submenu = that.submenus[ids.shift()].getSubmenu(ids.join('_'));
} }
//Ox.print('getSubmenu', id, submenu); //Ox.Log('Menu', 'getSubmenu', id, submenu);
return submenu; return submenu;
} }

View file

@ -200,7 +200,7 @@ Ox.SplitPanel = function(options, self) {
//self.options.elements[pos].element.replaceWith(element.$element.$element || element.$element) //self.options.elements[pos].element.replaceWith(element.$element.$element || element.$element)
//self.options.elements[pos].element = element; //self.options.elements[pos].element = element;
///* ///*
Ox.print('REPLACE ELEMENT') Ox.Log('Panel', 'REPLACE ELEMENT')
self.options.elements[pos].element.replaceWith( self.options.elements[pos].element.replaceWith(
self.options.elements[pos].element = element self.options.elements[pos].element = element
); );

View file

@ -240,9 +240,9 @@ Ox.BlockTimeline = function(options, self) {
}) })
.load(function() { .load(function() {
context.drawImage($img[0], i * 3600, 0); context.drawImage($img[0], i * 3600, 0);
//Ox.print('loaded, images', loaded, images, $img[0]) //Ox.Log('Video', 'loaded, images', loaded, images, $img[0])
if (++loaded == images) { if (++loaded == images) {
//Ox.print('callback', canvas.toDataURL().length) //Ox.Log('Video', 'callback', canvas.toDataURL().length)
callback(canvas.toDataURL()); callback(canvas.toDataURL());
} }
}); });
@ -356,9 +356,9 @@ Ox.BlockTimeline = function(options, self) {
} }
self.setOption = function(key, value) { self.setOption = function(key, value) {
//Ox.print('onChange:', key, value) //Ox.Log('Video', 'onChange:', key, value)
if (key == 'points') { if (key == 'points') {
//Ox.print('key', key, 'value', value) //Ox.Log('Video', 'key', key, 'value', value)
setMarkerPoint(0); setMarkerPoint(0);
setMarkerPoint(1); setMarkerPoint(1);
updateSelection(); updateSelection();

View file

@ -142,7 +142,7 @@ Ox.BlockVideoTimeline = function(options, self) {
// fixme: check if this pattern is better // fixme: check if this pattern is better
// than the one used for list selection // than the one used for list selection
if (!self.triggered) { if (!self.triggered) {
Ox.print('trigger............') Ox.Log('Video', 'trigger............')
that.triggerEvent('position', { that.triggerEvent('position', {
position: self.options.position position: self.options.position
}); });

View file

@ -186,9 +186,9 @@ Ox.SmallTimeline = function(options, self) {
} }
self.setOption = function(key, value) { self.setOption = function(key, value) {
//Ox.print('onChange:', key, value) //Ox.Log('Video', 'onChange:', key, value)
if (key == 'points') { if (key == 'points') {
//Ox.print('key', key, 'value', value) //Ox.Log('Video', 'key', key, 'value', value)
setMarkerPoint(0); setMarkerPoint(0);
setMarkerPoint(1); setMarkerPoint(1);
} else if (key == 'position') { } else if (key == 'position') {

View file

@ -307,7 +307,7 @@ Ox.VideoEditor = function(options, self) {
self.resolutions = []; self.resolutions = [];
Ox.forEach(self.options.video, function(url, resolution) { Ox.forEach(self.options.video, function(url, resolution) {
Ox.print(url, resolution) Ox.Log('Video', url, resolution)
self.resolutions.push( self.resolutions.push(
{id: resolution + '', title: resolution + 'p'} {id: resolution + '', title: resolution + 'p'}
); );
@ -769,7 +769,7 @@ Ox.VideoEditor = function(options, self) {
} }
function getSizes(scrollbarIsVisible) { function getSizes(scrollbarIsVisible) {
//Ox.print('getSizes', scrollbarIsVisible) //Ox.Log('Video', 'getSizes', scrollbarIsVisible)
var scrollbarWidth = Ox.UI.SCROLLBAR_SIZE, var scrollbarWidth = Ox.UI.SCROLLBAR_SIZE,
contentWidth = self.options.width contentWidth = self.options.width
- (self.options.showAnnotations * self.options.annotationsSize) - 1 - (self.options.showAnnotations * self.options.annotationsSize) - 1
@ -829,7 +829,7 @@ Ox.VideoEditor = function(options, self) {
self.$editor.css({ self.$editor.css({
overflowY: (scrollbarIsVisible && height <= self.options.height - 16) ? 'scroll' : 'auto' overflowY: (scrollbarIsVisible && height <= self.options.height - 16) ? 'scroll' : 'auto'
}); });
//Ox.print('getSizes', scrollbarIsVisible, height, self.options.height, size) //Ox.Log('Video', 'getSizes', scrollbarIsVisible, height, self.options.height, size)
return (!scrollbarIsVisible && height > self.options.height - 16) ? getSizes(true) : size; return (!scrollbarIsVisible && height > self.options.height - 16) ? getSizes(true) : size;
function getHeight() { function getHeight() {
return size.player[0].height + self.controlsHeight + return size.player[0].height + self.controlsHeight +
@ -1022,7 +1022,7 @@ Ox.VideoEditor = function(options, self) {
self.setOption = function(key, value) { self.setOption = function(key, value) {
if (key == 'width' || key == 'height') { if (key == 'width' || key == 'height') {
Ox.print('XXXX setSizes', key, value, self.options.width, self.options.height) Ox.Log('Video', 'XXXX setSizes', key, value, self.options.width, self.options.height)
setSizes(); setSizes();
} else if (key == 'position') { } else if (key == 'position') {
setPosition(value); setPosition(value);

View file

@ -21,7 +21,7 @@ Ox.VideoElement = function(options, self) {
.options(options || {}) .options(options || {})
.css({width: '100%', height: '100%'}); .css({width: '100%', height: '100%'});
Ox.print('VIDEO ELEMENT OPTIONS', self.options) Ox.Log('Video', 'VIDEO ELEMENT OPTIONS', self.options)
self.items = []; self.items = [];
self.paused = true; self.paused = true;
@ -37,7 +37,7 @@ Ox.VideoElement = function(options, self) {
self.numberOfItems = items; self.numberOfItems = items;
self.numberOfPages = Math.ceil(self.numberOfItems / self.pageLength); self.numberOfPages = Math.ceil(self.numberOfItems / self.pageLength);
loadPages(function() { loadPages(function() {
Ox.print('VIDEO PAGES LOADED'); Ox.Log('Video', 'VIDEO PAGES LOADED');
setCurrentItem(0); setCurrentItem(0);
if (!self.loadedMedatata) { if (!self.loadedMedatata) {
self.loadedMetadata = true; self.loadedMetadata = true;
@ -71,7 +71,7 @@ Ox.VideoElement = function(options, self) {
} }
function loadPage(page, callback) { function loadPage(page, callback) {
Ox.print('VIDEO loadPage', page) Ox.Log('Video', 'VIDEO loadPage', page)
//page = Ox.mod(page, self.numberOfPages); //page = Ox.mod(page, self.numberOfPages);
var loadedmetadata = 0, var loadedmetadata = 0,
start = page * self.pageLength, start = page * self.pageLength,
@ -82,14 +82,14 @@ Ox.VideoElement = function(options, self) {
data.forEach(function(data, i) { data.forEach(function(data, i) {
self.items[start + i] = loadItem(data.parts, data.points, function(item) { self.items[start + i] = loadItem(data.parts, data.points, function(item) {
if (++loadedmetadata == pageLength) { if (++loadedmetadata == pageLength) {
Ox.print('VIDEO page', page, 'loaded') Ox.Log('Video', 'VIDEO page', page, 'loaded')
callback && callback(); callback && callback();
} }
}); });
}); });
}); });
} else { } else {
Ox.print('PAGE IN CACHE') Ox.Log('Video', 'PAGE IN CACHE')
callback && callback(); callback && callback();
} }
} }
@ -154,7 +154,7 @@ Ox.VideoElement = function(options, self) {
item.offsets = Ox.range(item.parts).map(function(i) { item.offsets = Ox.range(item.parts).map(function(i) {
return Ox.sum(Ox.sub(item.durations, 0, i)); return Ox.sum(Ox.sub(item.durations, 0, i));
}); });
//Ox.print('METADATA OF', src, 'LOADED', item) //Ox.Log('Video', 'METADATA OF', src, 'LOADED', item)
if (self.isPlaylist) { if (self.isPlaylist) {
callback && callback(); callback && callback();
} else { } else {
@ -202,7 +202,7 @@ Ox.VideoElement = function(options, self) {
} }
function setCurrentItem(item) { function setCurrentItem(item) {
Ox.print('scI', item); Ox.Log('Video', 'scI', item);
var interval; var interval;
item = Ox.mod(item, self.numberOfItems); item = Ox.mod(item, self.numberOfItems);
self.video && self.video.pause(); self.video && self.video.pause();
@ -211,7 +211,7 @@ Ox.VideoElement = function(options, self) {
} else { } else {
that.triggerEvent('seeking'); that.triggerEvent('seeking');
interval = setInterval(function() { interval = setInterval(function() {
Ox.print('ITEM', item, 'NOT AVAILABLE'); Ox.Log('Video', 'ITEM', item, 'NOT AVAILABLE');
if (self.items[item]) { if (self.items[item]) {
clearInterval(interval); clearInterval(interval);
that.triggerEvent('seeked'); that.triggerEvent('seeked');
@ -233,7 +233,7 @@ Ox.VideoElement = function(options, self) {
} }
function setCurrentPart(part) { function setCurrentPart(part) {
Ox.print('sCP', part); Ox.Log('Video', 'sCP', part);
var css = {}; var css = {};
['left', 'top', 'width', 'height'].forEach(function(key) { ['left', 'top', 'width', 'height'].forEach(function(key) {
css[key] = self.$video.css(key); css[key] = self.$video.css(key);
@ -247,11 +247,11 @@ Ox.VideoElement = function(options, self) {
self.video = self.$video[0]; self.video = self.$video[0];
!self.paused && self.video.play(); !self.paused && self.video.play();
self.currentPart = part; self.currentPart = part;
Ox.print('sCP', part, self.video.src) Ox.Log('Video', 'sCP', part, self.video.src)
} }
function setCurrentTime(time) { function setCurrentTime(time) {
Ox.print('sCT', time); Ox.Log('Video', 'sCT', time);
var currentPart, currentTime, var currentPart, currentTime,
item = self.items[self.currentItem]; item = self.items[self.currentItem];
Ox.loop(item.parts - 1, -1, -1, function(i) { Ox.loop(item.parts - 1, -1, -1, function(i) {
@ -261,7 +261,7 @@ Ox.VideoElement = function(options, self) {
return false; return false;
} }
}); });
Ox.print('sCT', time, currentPart, currentTime); Ox.Log('Video', 'sCT', time, currentPart, currentTime);
if (currentPart != self.currentPart) { if (currentPart != self.currentPart) {
setCurrentPart(currentPart); setCurrentPart(currentPart);
} }
@ -270,7 +270,7 @@ Ox.VideoElement = function(options, self) {
function unloadPage(page) { function unloadPage(page) {
//page = Ox.mod(page, self.numberOfPages); //page = Ox.mod(page, self.numberOfPages);
Ox.print('unloadPage', page) Ox.Log('Video', 'unloadPage', page)
var start = page * self.pageLength, var start = page * self.pageLength,
stop = Math.min(start + self.pageLength, self.numberOfItems); stop = Math.min(start + self.pageLength, self.numberOfItems);
Ox.range(start, stop).forEach(function(i) { Ox.range(start, stop).forEach(function(i) {
@ -337,7 +337,7 @@ Ox.VideoElement = function(options, self) {
self.$video.css.apply(self.$video, arguments); self.$video.css.apply(self.$video, arguments);
} else { } else {
interval = setInterval(function() { interval = setInterval(function() {
Ox.print('VIDEO NOT YET AVAILABLE'); Ox.Log('Video', 'VIDEO NOT YET AVAILABLE');
if (self.$video) { if (self.$video) {
clearInterval(interval); clearInterval(interval);
self.$video.css.apply(self.$video, arguments); self.$video.css.apply(self.$video, arguments);
@ -395,7 +395,7 @@ Ox.VideoElement = function(options, self) {
playNext <f> play next playNext <f> play next
@*/ @*/
that.playNext = function() { that.playNext = function() {
Ox.print('PLAY NEXT') Ox.Log('Video', 'PLAY NEXT')
setCurrentItem(self.currentItem + 1); setCurrentItem(self.currentItem + 1);
self.video.play(); self.video.play();
}; };

View file

@ -130,7 +130,7 @@ Ox.VideoPlayer = function(options, self) {
.options(options || {}) .options(options || {})
.addClass('OxVideoPlayer'); .addClass('OxVideoPlayer');
Ox.print('VIDEO PLAYER OPTIONS', self.options) Ox.Log('Video', 'VIDEO PLAYER OPTIONS', self.options)
Ox.UI.$window.bind({ Ox.UI.$window.bind({
resize: function() { resize: function() {
@ -252,12 +252,12 @@ Ox.VideoPlayer = function(options, self) {
mouseenter: function() { mouseenter: function() {
showControls(); showControls();
self.mouseHasLeft = false; self.mouseHasLeft = false;
//Ox.print('MOUSE HAS ENTERED') //Ox.Log('Video', 'MOUSE HAS ENTERED')
}, },
mouseleave: function() { mouseleave: function() {
hideControls(); hideControls();
self.mouseHasLeft = true; self.mouseHasLeft = true;
//Ox.print('MOUSE HAS LEFT') //Ox.Log('Video', 'MOUSE HAS LEFT')
} }
}); });
} }
@ -1228,13 +1228,13 @@ Ox.VideoPlayer = function(options, self) {
function getPosition(e) { function getPosition(e) {
// fixme: no offsetX in firefox??? // fixme: no offsetX in firefox???
if ($.browser.mozilla) { if ($.browser.mozilla) {
//Ox.print(e, e.layerX - 56) //Ox.Log('Video', e, e.layerX - 56)
return Ox.limit( return Ox.limit(
(e.layerX - 48 - self.barHeight / 2) / self.timelineImageWidth * self.$video.duration(), (e.layerX - 48 - self.barHeight / 2) / self.timelineImageWidth * self.$video.duration(),
0, self.$video.duration() 0, self.$video.duration()
); );
} else { } else {
/*Ox.print(e.offsetX, Ox.limit( /*Ox.Log('Video', e.offsetX, Ox.limit(
(e.offsetX - self.barHeight / 2) / self.timelineImageWidth * self.video.duration, (e.offsetX - self.barHeight / 2) / self.timelineImageWidth * self.video.duration,
0, self.video.duration 0, self.video.duration
))*/ ))*/
@ -1272,7 +1272,7 @@ Ox.VideoPlayer = function(options, self) {
} }
function getProgressImageURL() { function getProgressImageURL() {
//Ox.print('---', self.timelineImageWidth) //Ox.Log('Video', '---', self.timelineImageWidth)
if (!self.timelineImageWidth) return; if (!self.timelineImageWidth) return;
var width = self.timelineImageWidth, var width = self.timelineImageWidth,
height = self.barHeight, height = self.barHeight,
@ -1347,7 +1347,7 @@ Ox.VideoPlayer = function(options, self) {
}); });
} }
}); });
//Ox.print('??', $timeline.find('.OxInterface')) //Ox.Log('Video', '??', $timeline.find('.OxInterface'))
$timeline.children().css({ $timeline.children().css({
marginLeft: getTimelineLeft() + 'px' marginLeft: getTimelineLeft() + 'px'
}); });
@ -1472,7 +1472,7 @@ Ox.VideoPlayer = function(options, self) {
} }
function hideControls() { function hideControls() {
//Ox.print('hideControls'); //Ox.Log('Video', 'hideControls');
clearTimeout(self.interfaceTimeout); clearTimeout(self.interfaceTimeout);
self.interfaceTimeout = setTimeout(function() { self.interfaceTimeout = setTimeout(function() {
if (!self.exitFullscreen && !self.inputHasFocus && !self.mouseIsInControls) { if (!self.exitFullscreen && !self.inputHasFocus && !self.mouseIsInControls) {
@ -1546,7 +1546,7 @@ Ox.VideoPlayer = function(options, self) {
function loadedmetadata() { function loadedmetadata() {
Ox.print('LOADEDMETADATA') Ox.Log('Video', 'LOADEDMETADATA')
var hadDuration = !!self.options.duration; var hadDuration = !!self.options.duration;
@ -1565,7 +1565,7 @@ Ox.VideoPlayer = function(options, self) {
self.out = self.options.playInToOut && self.out < self.$video.duration() self.out = self.options.playInToOut && self.out < self.$video.duration()
? self.out : self.$video.duration(); ? self.out : self.$video.duration();
self.options.duration = self.out - self['in']; self.options.duration = self.out - self['in'];
Ox.print('---------------------------------------- POS', self.options.position) Ox.Log('Video', '---------------------------------------- POS', self.options.position)
//self.options.position = Ox.limit(self.options.position, self['in'], self.out); //self.options.position = Ox.limit(self.options.position, self['in'], self.out);
//self.$video.currentTime(self.options.position); //self.$video.currentTime(self.options.position);
@ -1667,7 +1667,7 @@ Ox.VideoPlayer = function(options, self) {
self.out = points[1]; self.out = points[1];
self.options.duration = self.out - self['in']; self.options.duration = self.out - self['in'];
setPosition(self['in']); setPosition(self['in']);
Ox.print('POINTSCHANGE', self['in'], self.out, self.options.position, self.options.duration) Ox.Log('Video', 'POINTSCHANGE', self['in'], self.out, self.options.position, self.options.duration)
} }
function progress() { function progress() {
@ -1691,34 +1691,34 @@ Ox.VideoPlayer = function(options, self) {
} }
function seeked() { function seeked() {
Ox.print('XX seeked') Ox.Log('Video', 'XX seeked')
clearTimeout(self.seekTimeout); clearTimeout(self.seekTimeout);
self.seekTimeout = 0; self.seekTimeout = 0;
Ox.print('XX hide') Ox.Log('Video', 'XX hide')
hideLoadingIcon(); hideLoadingIcon();
self.$playIcon && self.$playIcon.show(); self.$playIcon && self.$playIcon.show();
} }
function seeking() { function seeking() {
Ox.print('XX seeking') Ox.Log('Video', 'XX seeking')
if (!self.seekTimeout) { if (!self.seekTimeout) {
self.seekTimeout = setTimeout(function() { self.seekTimeout = setTimeout(function() {
self.$playIcon && self.$playIcon.hide(); self.$playIcon && self.$playIcon.hide();
Ox.print('XX show') Ox.Log('Video', 'XX show')
showLoadingIcon(); showLoadingIcon();
}, 250); }, 250);
} }
} }
function setMarkers() { function setMarkers() {
//Ox.print('SET MARKERS', self.options.position, self.options['in'], self.options.out, self.$pointMarker); //Ox.Log('Video', 'SET MARKERS', self.options.position, self.options['in'], self.options.out, self.$pointMarker);
Ox.forEach(self.$posterMarker, function(marker) { Ox.forEach(self.$posterMarker, function(marker) {
isEqual(self.options.position, self.options.posterFrame) ? isEqual(self.options.position, self.options.posterFrame) ?
marker.show() : marker.hide(); marker.show() : marker.hide();
}); });
Ox.forEach(self.$pointMarker, function(markers, point) { Ox.forEach(self.$pointMarker, function(markers, point) {
Ox.forEach(markers, function(marker) { Ox.forEach(markers, function(marker) {
//Ox.print(self.options.position, self.options[point], isEqual(self.options.position, self.options[point])) //Ox.Log('Video', self.options.position, self.options[point], isEqual(self.options.position, self.options[point]))
// fixme: there's a bug in jquery and/or webkit // fixme: there's a bug in jquery and/or webkit
// on load, show() doesn't work // on load, show() doesn't work
isEqual(self.options.position, self.options[point]) ? isEqual(self.options.position, self.options[point]) ?
@ -1863,14 +1863,14 @@ Ox.VideoPlayer = function(options, self) {
} }
function setSubtitleText() { function setSubtitleText() {
//Ox.print('setSubTx', self.subtitle, self.options.find) //Ox.Log('Video', 'setSubTx', self.subtitle, self.options.find)
self.$subtitle.html( self.$subtitle.html(
self.subtitle ? self.subtitle ?
Ox.highlight(self.subtitle, self.options.find, 'OxHighlight') Ox.highlight(self.subtitle, self.options.find, 'OxHighlight')
.replace(/\n/g, '<br/>') : '&nbsp;<br/>&nbsp;' .replace(/\n/g, '<br/>') : '&nbsp;<br/>&nbsp;'
// FIXME: weird bug, only in fullscreen, only in chrome // FIXME: weird bug, only in fullscreen, only in chrome
); );
//Ox.print('?!?', self.$subtitle.css('bottom'), self.$subtitle.height()) //Ox.Log('Video', '?!?', self.$subtitle.css('bottom'), self.$subtitle.height())
} }
function sizechange() { function sizechange() {
@ -1907,7 +1907,7 @@ Ox.VideoPlayer = function(options, self) {
} }
function showControls() { function showControls() {
//Ox.print('showControls'); //Ox.Log('Video', 'showControls');
clearTimeout(self.interfaceTimeout); clearTimeout(self.interfaceTimeout);
if (!self.interfaceIsVisible) { if (!self.interfaceIsVisible) {
self.interfaceIsVisible = true; self.interfaceIsVisible = true;
@ -1997,7 +1997,7 @@ Ox.VideoPlayer = function(options, self) {
function submitPositionInput() { function submitPositionInput() {
self.$positionInput.hide(); self.$positionInput.hide();
self.$position.html('').show(); self.$position.html('').show();
//Ox.print('###', parsePositionInput(self.$positionInput.options('value'))) //Ox.Log('Video', '###', parsePositionInput(self.$positionInput.options('value')))
setPosition(parsePositionInput(self.$positionInput.options('value'))); setPosition(parsePositionInput(self.$positionInput.options('value')));
if (self.playOnSubmit) { if (self.playOnSubmit) {
togglePaused(); togglePaused();

View file

@ -231,7 +231,7 @@ Ox.Dialog = function(options, self) {
} }
function drag(event) { function drag(event) {
Ox.print(document.body.scrollTop, '...') Ox.Log('Window', document.body.scrollTop, '...')
var left, top; var left, top;
if (!$(event.target).is('.OxButton')) { if (!$(event.target).is('.OxButton')) {
left = Ox.limit( left = Ox.limit(
@ -256,7 +256,7 @@ Ox.Dialog = function(options, self) {
function getButtonById(id) { function getButtonById(id) {
var ret = null; var ret = null;
Ox.forEach(self.options.buttons, function(button) { Ox.forEach(self.options.buttons, function(button) {
//Ox.print(button.options(), button.options('id')) //Ox.Log('Window', button.options(), button.options('id'))
if (button.options && button.options('id') == id) { if (button.options && button.options('id') == id) {
ret = button; ret = button;
return false; return false;
@ -267,7 +267,7 @@ Ox.Dialog = function(options, self) {
function keypress(key) { function keypress(key) {
var id = self.options.keys[key]; var id = self.options.keys[key];
Ox.print(id, getButtonById(id)); Ox.Log('Window', id, getButtonById(id));
id && getButtonById(id).$element.trigger('click'); id && getButtonById(id).$element.trigger('click');
} }
@ -620,7 +620,7 @@ Ox.Dialog = function(options, self) {
self.options.minHeight = Math.round(self.options.minWidth / ratio); self.options.minHeight = Math.round(self.options.minWidth / ratio);
} }
} }
Ox.print('sMM', self, window.innerHeight, maxRatio) Ox.Log('Window', 'sMM', self, window.innerHeight, maxRatio)
} }
self.setOption = function(key, value) { self.setOption = function(key, value) {

View file

@ -21,7 +21,7 @@ Ox.getDateInWeek <f> Get the date that falls on a given weekday in the same week
// fixme: why is this Monday first? shouldn't it then be "getDateInISOWeek"?? // fixme: why is this Monday first? shouldn't it then be "getDateInISOWeek"??
Ox.getDateInWeek = function(date, weekday, utc) { Ox.getDateInWeek = function(date, weekday, utc) {
date = Ox.makeDate(date); date = Ox.makeDate(date);
Ox.print(date, Ox.getDate(date, utc), Ox.formatDate(date, '%u', utc), date) //Ox.print(date, Ox.getDate(date, utc), Ox.formatDate(date, '%u', utc), date)
var sourceWeekday = Ox.getISODay(date, utc), var sourceWeekday = Ox.getISODay(date, utc),
targetWeekday = Ox.isNumber(weekday) ? weekday : targetWeekday = Ox.isNumber(weekday) ? weekday :
Ox.map(Ox.WEEKDAYS, function(v, i) { Ox.map(Ox.WEEKDAYS, function(v, i) {

View file

@ -403,7 +403,7 @@ Ox.test = function(file, callback) {
var tests = []; var tests = [];
items.forEach(function(item) { items.forEach(function(item) {
item.examples && item.examples.forEach(function(example) { item.examples && item.examples.forEach(function(example) {
Ox.print('TEST', example.statement) Ox.Log('TEST', example.statement)
var actual = eval(example.statement); var actual = eval(example.statement);
if (example.result) { if (example.result) {
tests.push({ tests.push({