var viewMethods = { // // Objects inheriting these methods must implement the following properties/methods: // - title // - start // - end // - visStart // - visEnd // - eventEnd(event) // - visEventEnd(event) // // - render // - rerenderEvents // init: function(element, options) { this.element = element; this.options = options; this.cachedEvents = []; this.eventsByID = {}; this.eventElements = []; this.eventElementsByID = {}; }, trigger: function(name, thisObj) { if (this.options[name]) { return this.options[name].apply(thisObj, Array.prototype.slice.call(arguments, 2).concat([this])); } }, // event/element creation reporting reportEvents: function(events) { var i, len=events.length, event, fakeID = 0, eventsByID = this.eventsByID = {}, cachedEvents = this.cachedEvents = []; for (i=0; i this.visStart && event.start < this.visEnd) { res.push(event); } } return res; }, // event element manipulation clearEvents: function() { // just remove ELEMENTS $.each(this.eventElements, function() { this.remove(); }); this.eventElements = []; this.eventElementsByID = {}; }, showEvents: function(event, exceptElement) { this._eee(event, exceptElement, 'show'); }, hideEvents: function(event, exceptElement) { this._eee(event, exceptElement, 'hide'); // fadeOut }, _eee: function(event, exceptElement, funcName) { // event-element-each var elements = this.eventElementsByID[event._id]; for (var i=0; i