Sha256: 2059cd6af83798c5867652249de2112c8e62a7a4080bf80b2e79073ad28641cc

Contents?: true

Size: 577 Bytes

Versions: 10

Compression:

Stored size: 577 Bytes

Contents

// console.log("Loading TopBar...")

Spontaneous.EventSource = (function($, S) {
	var EventSource = new JS.Singleton({
		eventSource: function() {
			if (!this._eventSource) {
				this._eventSource = new window.EventSource(S.Ajax.request_url('/events', true));
			}
			return this._eventSource;
		},

		addEventListener: function(event, callback) {
			this.eventSource().addEventListener(event, callback);
		},
		removeEventListener: function(event, callback) {
			this.eventSource().removeEventListener(event, callback);
		}
	});
	return EventSource;
})(jQuery, Spontaneous);

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 application/js/event_source.js
spontaneous-0.2.0.beta9 application/js/event_source.js
spontaneous-0.2.0.beta8 application/js/event_source.js
spontaneous-0.2.0.beta7 application/js/event_source.js
spontaneous-0.2.0.beta6 application/js/event_source.js
spontaneous-0.2.0.beta5 application/js/event_source.js
spontaneous-0.2.0.beta4 application/js/event_source.js
spontaneous-0.2.0.beta3 application/js/event_source.js
spontaneous-0.2.0.beta2 application/js/event_source.js
spontaneous-0.2.0.beta1 application/js/event_source.js