houston-core 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -22
- data/README.md +1 -1
- data/app/adapters/houston/adapters/version_control/git_adapter/repo.rb +6 -3
- data/app/assets/javascripts/app/boot.coffee +9 -0
- data/app/assets/javascripts/app/infinite_scroll.coffee +6 -3
- data/app/assets/javascripts/app/models/ticket.coffee +1 -1
- data/app/assets/javascripts/core/app.coffee +4 -1
- data/app/assets/javascripts/core/core_ext/array.coffee +11 -0
- data/app/assets/javascripts/core/core_ext/date.coffee +8 -0
- data/app/assets/javascripts/core/handlebars_helpers.coffee +12 -8
- data/app/assets/javascripts/vendor.js +2 -2
- data/app/assets/stylesheets/application/mobile.scss +96 -0
- data/app/assets/stylesheets/application/test.scss +58 -0
- data/app/assets/stylesheets/application/test_run.scss +14 -5
- data/app/assets/stylesheets/application/timeline.scss +2 -4
- data/app/concerns/commit_synchronizer.rb +38 -2
- data/app/controllers/application_controller.rb +3 -0
- data/app/controllers/hooks_controller.rb +18 -0
- data/app/controllers/project_tests_controller.rb +46 -0
- data/app/helpers/commit_helper.rb +7 -0
- data/app/helpers/test_run_helper.rb +16 -0
- data/app/models/commit.rb +4 -0
- data/app/models/github/pull_request.rb +7 -7
- data/app/models/milestone.rb +1 -1
- data/app/models/run_tests_on_post_receive.rb +2 -0
- data/app/models/test.rb +4 -0
- data/app/models/test_result.rb +1 -1
- data/app/models/test_run.rb +25 -2
- data/app/views/layouts/_mobile_navigation.html.erb +100 -0
- data/app/views/layouts/application.html.erb +20 -10
- data/app/views/layouts/dashboard.html.erb +1 -1
- data/app/views/layouts/minimal.html.erb +1 -1
- data/app/views/layouts/naked_dashboard.html.erb +1 -1
- data/app/views/project_notification/test_run.html.erb +97 -120
- data/app/views/project_tests/_commits.html.erb +14 -0
- data/app/views/project_tests/index.html.erb +39 -0
- data/app/views/projects/_form.html.erb +6 -2
- data/config/application.rb +1 -2
- data/config/routes.rb +2 -0
- data/db/migrate/20151108221505_convert_pull_request_labels_to_array.rb +22 -0
- data/db/migrate/20151108223154_sync_body_also_for_pull_requests.rb +5 -0
- data/db/migrate/20151108233510_add_props_to_pull_requests.rb +5 -0
- data/db/structure.sql +10 -1
- data/houston.gemspec +4 -5
- data/lib/houston/version.rb +1 -1
- data/test/integration/web_hook_test.rb +7 -1
- data/test/unit/concerns/commit_synchronizer_test.rb +13 -0
- data/test/unit/models/pull_request_test.rb +17 -0
- data/vendor/assets/javascripts/showdown.js +2489 -0
- data/vendor/assets/javascripts/slideout.js +493 -0
- metadata +25 -29
- data/lib/tasks/config.rake +0 -255
- data/vendor/assets/javascripts/Markdown.Converter.js +0 -1412
@@ -0,0 +1,493 @@
|
|
1
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Slideout=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Module dependencies
|
6
|
+
*/
|
7
|
+
var decouple = require('decouple');
|
8
|
+
var Emitter = require('emitter');
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Privates
|
12
|
+
*/
|
13
|
+
var scrollTimeout;
|
14
|
+
var scrolling = false;
|
15
|
+
var doc = window.document;
|
16
|
+
var html = doc.documentElement;
|
17
|
+
var msPointerSupported = window.navigator.msPointerEnabled;
|
18
|
+
var touch = {
|
19
|
+
'start': msPointerSupported ? 'MSPointerDown' : 'touchstart',
|
20
|
+
'move': msPointerSupported ? 'MSPointerMove' : 'touchmove',
|
21
|
+
'end': msPointerSupported ? 'MSPointerUp' : 'touchend'
|
22
|
+
};
|
23
|
+
var prefix = (function prefix() {
|
24
|
+
var regex = /^(Webkit|Khtml|Moz|ms|O)(?=[A-Z])/;
|
25
|
+
var styleDeclaration = doc.getElementsByTagName('script')[0].style;
|
26
|
+
for (var prop in styleDeclaration) {
|
27
|
+
if (regex.test(prop)) {
|
28
|
+
return '-' + prop.match(regex)[0].toLowerCase() + '-';
|
29
|
+
}
|
30
|
+
}
|
31
|
+
// Nothing found so far? Webkit does not enumerate over the CSS properties of the style object.
|
32
|
+
// However (prop in style) returns the correct value, so we'll have to test for
|
33
|
+
// the precence of a specific property
|
34
|
+
if ('WebkitOpacity' in styleDeclaration) { return '-webkit-'; }
|
35
|
+
if ('KhtmlOpacity' in styleDeclaration) { return '-khtml-'; }
|
36
|
+
return '';
|
37
|
+
}());
|
38
|
+
function extend(destination, from) {
|
39
|
+
for (var prop in from) {
|
40
|
+
if (from[prop]) {
|
41
|
+
destination[prop] = from[prop];
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return destination;
|
45
|
+
}
|
46
|
+
function inherits(child, uber) {
|
47
|
+
child.prototype = extend(child.prototype || {}, uber.prototype);
|
48
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Slideout constructor
|
52
|
+
*/
|
53
|
+
function Slideout(options) {
|
54
|
+
options = options || {};
|
55
|
+
|
56
|
+
// Sets default values
|
57
|
+
this._startOffsetX = 0;
|
58
|
+
this._currentOffsetX = 0;
|
59
|
+
this._opening = false;
|
60
|
+
this._moved = false;
|
61
|
+
this._opened = false;
|
62
|
+
this._preventOpen = false;
|
63
|
+
this._touch = options.touch === undefined ? true : options.touch && true;
|
64
|
+
|
65
|
+
// Sets panel
|
66
|
+
this.panel = options.panel;
|
67
|
+
this.menu = options.menu;
|
68
|
+
|
69
|
+
// Sets classnames
|
70
|
+
if(this.panel.className.search('slideout-panel') === -1) { this.panel.className += ' slideout-panel'; }
|
71
|
+
if(this.menu.className.search('slideout-menu') === -1) { this.menu.className += ' slideout-menu'; }
|
72
|
+
|
73
|
+
|
74
|
+
// Sets options
|
75
|
+
this._fx = options.fx || 'ease';
|
76
|
+
this._duration = parseInt(options.duration, 10) || 300;
|
77
|
+
this._tolerance = parseInt(options.tolerance, 10) || 70;
|
78
|
+
this._padding = this._translateTo = parseInt(options.padding, 10) || 256;
|
79
|
+
this._orientation = options.side === 'right' ? -1 : 1;
|
80
|
+
this._translateTo *= this._orientation;
|
81
|
+
|
82
|
+
// Init touch events
|
83
|
+
if (this._touch) {
|
84
|
+
this._initTouchEvents();
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Inherits from Emitter
|
90
|
+
*/
|
91
|
+
inherits(Slideout, Emitter);
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Opens the slideout menu.
|
95
|
+
*/
|
96
|
+
Slideout.prototype.open = function() {
|
97
|
+
var self = this;
|
98
|
+
this.emit('beforeopen');
|
99
|
+
if (html.className.search('slideout-open') === -1) { html.className += ' slideout-open'; }
|
100
|
+
this._setTransition();
|
101
|
+
this._translateXTo(this._translateTo);
|
102
|
+
this._opened = true;
|
103
|
+
setTimeout(function() {
|
104
|
+
self.panel.style.transition = self.panel.style['-webkit-transition'] = '';
|
105
|
+
self.emit('open');
|
106
|
+
}, this._duration + 50);
|
107
|
+
return this;
|
108
|
+
};
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Closes slideout menu.
|
112
|
+
*/
|
113
|
+
Slideout.prototype.close = function() {
|
114
|
+
var self = this;
|
115
|
+
if (!this.isOpen() && !this._opening) { return this; }
|
116
|
+
this.emit('beforeclose');
|
117
|
+
this._setTransition();
|
118
|
+
this._translateXTo(0);
|
119
|
+
this._opened = false;
|
120
|
+
setTimeout(function() {
|
121
|
+
html.className = html.className.replace(/ slideout-open/, '');
|
122
|
+
self.panel.style.transition = self.panel.style['-webkit-transition'] = self.panel.style[prefix + 'transform'] = self.panel.style.transform = '';
|
123
|
+
self.emit('close');
|
124
|
+
}, this._duration + 50);
|
125
|
+
return this;
|
126
|
+
};
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Toggles (open/close) slideout menu.
|
130
|
+
*/
|
131
|
+
Slideout.prototype.toggle = function() {
|
132
|
+
return this.isOpen() ? this.close() : this.open();
|
133
|
+
};
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Returns true if the slideout is currently open, and false if it is closed.
|
137
|
+
*/
|
138
|
+
Slideout.prototype.isOpen = function() {
|
139
|
+
return this._opened;
|
140
|
+
};
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Translates panel and updates currentOffset with a given X point
|
144
|
+
*/
|
145
|
+
Slideout.prototype._translateXTo = function(translateX) {
|
146
|
+
this._currentOffsetX = translateX;
|
147
|
+
this.panel.style[prefix + 'transform'] = this.panel.style.transform = 'translate3d(' + translateX + 'px, 0, 0)';
|
148
|
+
};
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Set transition properties
|
152
|
+
*/
|
153
|
+
Slideout.prototype._setTransition = function() {
|
154
|
+
this.panel.style[prefix + 'transition'] = this.panel.style.transition = prefix + 'transform ' + this._duration + 'ms ' + this._fx;
|
155
|
+
};
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Initializes touch event
|
159
|
+
*/
|
160
|
+
Slideout.prototype._initTouchEvents = function() {
|
161
|
+
var self = this;
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Decouple scroll event
|
165
|
+
*/
|
166
|
+
this._onScrollFn = decouple(doc, 'scroll', function() {
|
167
|
+
if (!self._moved) {
|
168
|
+
clearTimeout(scrollTimeout);
|
169
|
+
scrolling = true;
|
170
|
+
scrollTimeout = setTimeout(function() {
|
171
|
+
scrolling = false;
|
172
|
+
}, 250);
|
173
|
+
}
|
174
|
+
});
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Prevents touchmove event if slideout is moving
|
178
|
+
*/
|
179
|
+
this._preventMove = function(eve) {
|
180
|
+
if (self._moved) {
|
181
|
+
eve.preventDefault();
|
182
|
+
}
|
183
|
+
};
|
184
|
+
doc.addEventListener(touch.move, this._preventMove);
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Resets values on touchstart
|
188
|
+
*/
|
189
|
+
this._resetTouchFn = function(eve) {
|
190
|
+
if (typeof eve.touches === 'undefined') { return; }
|
191
|
+
|
192
|
+
self._moved = false;
|
193
|
+
self._opening = false;
|
194
|
+
self._startOffsetX = eve.touches[0].pageX;
|
195
|
+
self._preventOpen = (!self._touch || (!self.isOpen() && self.menu.clientWidth !== 0));
|
196
|
+
};
|
197
|
+
this.panel.addEventListener(touch.start, this._resetTouchFn);
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Resets values on touchcancel
|
201
|
+
*/
|
202
|
+
this._onTouchCancelFn = function() {
|
203
|
+
self._moved = false;
|
204
|
+
self._opening = false;
|
205
|
+
};
|
206
|
+
this.panel.addEventListener('touchcancel', this._onTouchCancelFn);
|
207
|
+
|
208
|
+
/**
|
209
|
+
* Toggles slideout on touchend
|
210
|
+
*/
|
211
|
+
this._onTouchEndFn = function() {
|
212
|
+
if (self._moved) {
|
213
|
+
(self._opening && Math.abs(self._currentOffsetX) > self._tolerance) ? self.open() : self.close();
|
214
|
+
}
|
215
|
+
self._moved = false;
|
216
|
+
};
|
217
|
+
this.panel.addEventListener(touch.end, this._onTouchEndFn);
|
218
|
+
|
219
|
+
/**
|
220
|
+
* Translates panel on touchmove
|
221
|
+
*/
|
222
|
+
this._onTouchMoveFn = function(eve) {
|
223
|
+
|
224
|
+
if (scrolling || self._preventOpen || typeof eve.touches === 'undefined') { return; }
|
225
|
+
|
226
|
+
var dif_x = eve.touches[0].clientX - self._startOffsetX;
|
227
|
+
var translateX = self._currentOffsetX = dif_x;
|
228
|
+
|
229
|
+
if (Math.abs(translateX) > self._padding) { return; }
|
230
|
+
|
231
|
+
if (Math.abs(dif_x) > 20) {
|
232
|
+
self._opening = true;
|
233
|
+
|
234
|
+
var oriented_dif_x = dif_x * self._orientation;
|
235
|
+
if (self._opened && oriented_dif_x > 0 || !self._opened && oriented_dif_x < 0) { return; }
|
236
|
+
if (oriented_dif_x <= 0) {
|
237
|
+
translateX = dif_x + self._padding * self._orientation;
|
238
|
+
self._opening = false;
|
239
|
+
}
|
240
|
+
|
241
|
+
if (!self._moved && html.className.search('slideout-open') === -1) {
|
242
|
+
html.className += ' slideout-open';
|
243
|
+
}
|
244
|
+
|
245
|
+
self.panel.style[prefix + 'transform'] = self.panel.style.transform = 'translate3d(' + translateX + 'px, 0, 0)';
|
246
|
+
self.emit('translate', translateX);
|
247
|
+
self._moved = true;
|
248
|
+
}
|
249
|
+
|
250
|
+
};
|
251
|
+
this.panel.addEventListener(touch.move, this._onTouchMoveFn);
|
252
|
+
};
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Enable opening the slideout via touch events.
|
256
|
+
*/
|
257
|
+
Slideout.prototype.enableTouch = function() {
|
258
|
+
this._touch = true;
|
259
|
+
return this;
|
260
|
+
};
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Disable opening the slideout via touch events.
|
264
|
+
*/
|
265
|
+
Slideout.prototype.disableTouch = function() {
|
266
|
+
this._touch = false;
|
267
|
+
return this;
|
268
|
+
};
|
269
|
+
|
270
|
+
/**
|
271
|
+
* Destroy an instance of slideout.
|
272
|
+
*/
|
273
|
+
Slideout.prototype.destroy = function() {
|
274
|
+
// Close before clean
|
275
|
+
this.close();
|
276
|
+
|
277
|
+
// Remove event listeners
|
278
|
+
doc.removeEventListener(touch.move, this._preventMove);
|
279
|
+
this.panel.removeEventListener(touch.start, this._resetTouchFn);
|
280
|
+
this.panel.removeEventListener('touchcancel', this._onTouchCancelFn);
|
281
|
+
this.panel.removeEventListener(touch.end, this._onTouchEndFn);
|
282
|
+
this.panel.removeEventListener(touch.move, this._onTouchMoveFn);
|
283
|
+
doc.removeEventListener('scroll', this._onScrollFn);
|
284
|
+
|
285
|
+
// Remove methods
|
286
|
+
this.open = this.close = function() {};
|
287
|
+
|
288
|
+
// Return the instance so it can be easily dereferenced
|
289
|
+
return this;
|
290
|
+
};
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Expose Slideout
|
294
|
+
*/
|
295
|
+
module.exports = Slideout;
|
296
|
+
|
297
|
+
},{"decouple":2,"emitter":3}],2:[function(require,module,exports){
|
298
|
+
'use strict';
|
299
|
+
|
300
|
+
var requestAnimFrame = (function() {
|
301
|
+
return window.requestAnimationFrame ||
|
302
|
+
window.webkitRequestAnimationFrame ||
|
303
|
+
function (callback) {
|
304
|
+
window.setTimeout(callback, 1000 / 60);
|
305
|
+
};
|
306
|
+
}());
|
307
|
+
|
308
|
+
function decouple(node, event, fn) {
|
309
|
+
var eve,
|
310
|
+
tracking = false;
|
311
|
+
|
312
|
+
function captureEvent(e) {
|
313
|
+
eve = e;
|
314
|
+
track();
|
315
|
+
}
|
316
|
+
|
317
|
+
function track() {
|
318
|
+
if (!tracking) {
|
319
|
+
requestAnimFrame(update);
|
320
|
+
tracking = true;
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
function update() {
|
325
|
+
fn.call(node, eve);
|
326
|
+
tracking = false;
|
327
|
+
}
|
328
|
+
|
329
|
+
node.addEventListener(event, captureEvent, false);
|
330
|
+
}
|
331
|
+
|
332
|
+
/**
|
333
|
+
* Expose decouple
|
334
|
+
*/
|
335
|
+
module.exports = decouple;
|
336
|
+
|
337
|
+
},{}],3:[function(require,module,exports){
|
338
|
+
"use strict";
|
339
|
+
|
340
|
+
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
341
|
+
|
342
|
+
exports.__esModule = true;
|
343
|
+
/**
|
344
|
+
* Creates a new instance of Emitter.
|
345
|
+
* @class
|
346
|
+
* @returns {Object} Returns a new instance of Emitter.
|
347
|
+
* @example
|
348
|
+
* // Creates a new instance of Emitter.
|
349
|
+
* var Emitter = require('emitter');
|
350
|
+
*
|
351
|
+
* var emitter = new Emitter();
|
352
|
+
*/
|
353
|
+
|
354
|
+
var Emitter = (function () {
|
355
|
+
function Emitter() {
|
356
|
+
_classCallCheck(this, Emitter);
|
357
|
+
}
|
358
|
+
|
359
|
+
/**
|
360
|
+
* Adds a listener to the collection for the specified event.
|
361
|
+
* @memberof! Emitter.prototype
|
362
|
+
* @function
|
363
|
+
* @param {String} event - The event name.
|
364
|
+
* @param {Function} listener - A listener function to add.
|
365
|
+
* @returns {Object} Returns an instance of Emitter.
|
366
|
+
* @example
|
367
|
+
* // Add an event listener to "foo" event.
|
368
|
+
* emitter.on('foo', listener);
|
369
|
+
*/
|
370
|
+
|
371
|
+
Emitter.prototype.on = function on(event, listener) {
|
372
|
+
// Use the current collection or create it.
|
373
|
+
this._eventCollection = this._eventCollection || {};
|
374
|
+
|
375
|
+
// Use the current collection of an event or create it.
|
376
|
+
this._eventCollection[event] = this._eventCollection[event] || [];
|
377
|
+
|
378
|
+
// Appends the listener into the collection of the given event
|
379
|
+
this._eventCollection[event].push(listener);
|
380
|
+
|
381
|
+
return this;
|
382
|
+
};
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Adds a listener to the collection for the specified event that will be called only once.
|
386
|
+
* @memberof! Emitter.prototype
|
387
|
+
* @function
|
388
|
+
* @param {String} event - The event name.
|
389
|
+
* @param {Function} listener - A listener function to add.
|
390
|
+
* @returns {Object} Returns an instance of Emitter.
|
391
|
+
* @example
|
392
|
+
* // Will add an event handler to "foo" event once.
|
393
|
+
* emitter.once('foo', listener);
|
394
|
+
*/
|
395
|
+
|
396
|
+
Emitter.prototype.once = function once(event, listener) {
|
397
|
+
var self = this;
|
398
|
+
|
399
|
+
function fn() {
|
400
|
+
self.off(event, fn);
|
401
|
+
listener.apply(this, arguments);
|
402
|
+
}
|
403
|
+
|
404
|
+
fn.listener = listener;
|
405
|
+
|
406
|
+
this.on(event, fn);
|
407
|
+
|
408
|
+
return this;
|
409
|
+
};
|
410
|
+
|
411
|
+
/**
|
412
|
+
* Removes a listener from the collection for the specified event.
|
413
|
+
* @memberof! Emitter.prototype
|
414
|
+
* @function
|
415
|
+
* @param {String} event - The event name.
|
416
|
+
* @param {Function} listener - A listener function to remove.
|
417
|
+
* @returns {Object} Returns an instance of Emitter.
|
418
|
+
* @example
|
419
|
+
* // Remove a given listener.
|
420
|
+
* emitter.off('foo', listener);
|
421
|
+
*/
|
422
|
+
|
423
|
+
Emitter.prototype.off = function off(event, listener) {
|
424
|
+
|
425
|
+
var listeners = undefined;
|
426
|
+
|
427
|
+
// Defines listeners value.
|
428
|
+
if (!this._eventCollection || !(listeners = this._eventCollection[event])) {
|
429
|
+
return this;
|
430
|
+
}
|
431
|
+
|
432
|
+
listeners.forEach(function (fn, i) {
|
433
|
+
if (fn === listener || fn.listener === listener) {
|
434
|
+
// Removes the given listener.
|
435
|
+
listeners.splice(i, 1);
|
436
|
+
}
|
437
|
+
});
|
438
|
+
|
439
|
+
// Removes an empty event collection.
|
440
|
+
if (listeners.length === 0) {
|
441
|
+
delete this._eventCollection[event];
|
442
|
+
}
|
443
|
+
|
444
|
+
return this;
|
445
|
+
};
|
446
|
+
|
447
|
+
/**
|
448
|
+
* Execute each item in the listener collection in order with the specified data.
|
449
|
+
* @memberof! Emitter.prototype
|
450
|
+
* @function
|
451
|
+
* @param {String} event - The name of the event you want to emit.
|
452
|
+
* @param {...Object} data - Data to pass to the listeners.
|
453
|
+
* @returns {Object} Returns an instance of Emitter.
|
454
|
+
* @example
|
455
|
+
* // Emits the "foo" event with 'param1' and 'param2' as arguments.
|
456
|
+
* emitter.emit('foo', 'param1', 'param2');
|
457
|
+
*/
|
458
|
+
|
459
|
+
Emitter.prototype.emit = function emit(event) {
|
460
|
+
var _this = this;
|
461
|
+
|
462
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
463
|
+
args[_key - 1] = arguments[_key];
|
464
|
+
}
|
465
|
+
|
466
|
+
var listeners = undefined;
|
467
|
+
|
468
|
+
// Defines listeners value.
|
469
|
+
if (!this._eventCollection || !(listeners = this._eventCollection[event])) {
|
470
|
+
return this;
|
471
|
+
}
|
472
|
+
|
473
|
+
// Clone listeners
|
474
|
+
listeners = listeners.slice(0);
|
475
|
+
|
476
|
+
listeners.forEach(function (fn) {
|
477
|
+
return fn.apply(_this, args);
|
478
|
+
});
|
479
|
+
|
480
|
+
return this;
|
481
|
+
};
|
482
|
+
|
483
|
+
return Emitter;
|
484
|
+
})();
|
485
|
+
|
486
|
+
/**
|
487
|
+
* Exports Emitter
|
488
|
+
*/
|
489
|
+
exports["default"] = Emitter;
|
490
|
+
module.exports = exports["default"];
|
491
|
+
},{}]},{},[1])(1)
|
492
|
+
});
|
493
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9kZWNvdXBsZS9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9lbWl0dGVyL2Rpc3QvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF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