var viewMethods = { // // Objects inheriting these methods must implement the following properties/methods: // - title // - start // - end // - visStart // - visEnd // - defaultEventEnd(event) // - visEventEnd(event) // // - render // - rerenderEvents // init: function(element, options) { this.element = element; this.options = options; this.cachedEvents = []; this.eventsByID = {}; this.eventElements = []; this.eventElementsByID = {}; }, // trigger event handlers, always append view as last arg trigger: function(name, thisObj) { if (this.options[name]) { return this.options[name].apply(thisObj || this, Array.prototype.slice.call(arguments, 2).concat([this])); } }, // eventEnd: function(event) { return event.end || this.defaultEventEnd(event); }, // 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