use Ox.Log
This commit is contained in:
parent
92d25b6776
commit
dce2843303
50 changed files with 276 additions and 276 deletions
|
|
@ -866,8 +866,8 @@ Ox.Calendar = function(options, self) {
|
|||
value = unit.value(self.options.date),
|
||||
width = unit.seconds * getPixelsPerSecond(zoom),
|
||||
n = Math.ceil(self.options.width * 1.5/* * 16*/ / width);
|
||||
//Ox.print(zoom, getUnits(zoom).map(function(u) {return u.name(value)}).join('/'))
|
||||
//Ox.print('VALUE', value)
|
||||
//Ox.Log('Calendar', zoom, getUnits(zoom).map(function(u) {return u.name(value)}).join('/'))
|
||||
//Ox.Log('Calendar', 'VALUE', value)
|
||||
Ox.loop(-n, n + 1, function(i) {
|
||||
$elements.push(
|
||||
getEventElement({
|
||||
|
|
@ -921,7 +921,7 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
|
||||
function mousewheel(e, delta, deltaX, deltaY) {
|
||||
//Ox.print('mousewheel', delta, deltaX, deltaY);
|
||||
//Ox.Log('Calendar', 'mousewheel', delta, deltaX, deltaY);
|
||||
var deltaZ = 0;
|
||||
if (!self.mousewheel && deltaY && Math.abs(deltaY) > Math.abs(deltaX)) {
|
||||
if (deltaY < 0 && self.options.zoom > 0) {
|
||||
|
|
@ -1063,7 +1063,7 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
|
||||
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) {
|
||||
$element.appendTo(self.$scalebar.$element);
|
||||
});
|
||||
|
|
@ -1200,7 +1200,7 @@ Ox.Calendar = function(options, self) {
|
|||
};
|
||||
|
||||
that.addEvent = function(event) {
|
||||
Ox.print('CALENDAR ADD EVENT', event)
|
||||
Ox.Log('Calendar', 'CALENDAR ADD EVENT', event)
|
||||
event = getEventData(event);
|
||||
self.options.events.push(event);
|
||||
getLines();
|
||||
|
|
@ -1222,7 +1222,7 @@ Ox.Calendar = function(options, self) {
|
|||
$element = getEventElementById(id);
|
||||
Ox.forEach(data, function(value, key) {
|
||||
if ($element) {
|
||||
Ox.print('ELEMENT', $element, id)
|
||||
Ox.Log('Calendar', 'ELEMENT', $element, id)
|
||||
if (key == 'name') {
|
||||
$element && $element.html(' ' + value + ' ');
|
||||
} else if (key == 'type') {
|
||||
|
|
@ -1236,7 +1236,7 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
event[key] = value;
|
||||
event = getEventData(event);
|
||||
Ox.print(key, value, 'EVENT:', event)
|
||||
Ox.Log('Calendar', key, value, 'EVENT:', event)
|
||||
if ($element) {
|
||||
getLines();
|
||||
renderCalendar();
|
||||
|
|
@ -1257,7 +1257,7 @@ Ox.Calendar = function(options, self) {
|
|||
};
|
||||
|
||||
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);
|
||||
self.options.events.splice(index, 1);
|
||||
getLines();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Ox.ListCalendar = function(options, self) {
|
|||
|
||||
self.durationCache = {};
|
||||
|
||||
Ox.print('EVENT[0]', self.options.events[0])
|
||||
Ox.Log('Calendar', 'EVENT[0]', self.options.events[0])
|
||||
|
||||
self.columns = [
|
||||
{
|
||||
|
|
@ -330,7 +330,7 @@ Ox.ListCalendar = function(options, self) {
|
|||
.hide()
|
||||
.bindEvent({
|
||||
change: function(data) {
|
||||
Ox.print('CHANGE', data);
|
||||
Ox.Log('Calendar', 'CHANGE', data);
|
||||
var exists = false, values
|
||||
if (['name', 'alternativeNames'].indexOf(data.id) > -1) {
|
||||
exists = '';
|
||||
|
|
@ -459,7 +459,7 @@ Ox.ListCalendar = function(options, self) {
|
|||
});
|
||||
|
||||
function addEvent() {
|
||||
Ox.print('ADD', self.$calendar.getBounds())
|
||||
Ox.Log('Calendar', 'ADD', self.$calendar.getBounds())
|
||||
var bounds = self.$calendar.getBounds(),
|
||||
middle = +self.$calendar.options('date'),
|
||||
startTime = +new Date((+bounds.startTime + middle) / 2),
|
||||
|
|
@ -474,14 +474,14 @@ Ox.ListCalendar = function(options, self) {
|
|||
event.type = 'other';
|
||||
event.start = Ox.formatDate(startTime, '%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) {
|
||||
if (result.status.code == '200') {
|
||||
event.id = result.data.id;
|
||||
self.options.events.push(event);
|
||||
var time0 = +new Date()
|
||||
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);
|
||||
selectEvent(event);
|
||||
self.$nameInput.focusInput();
|
||||
|
|
@ -556,7 +556,7 @@ Ox.ListCalendar = function(options, self) {
|
|||
self.options.events.splice(index, 1);
|
||||
var time0 = +new Date();
|
||||
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();
|
||||
selectEvent({});
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue