-
Notifications
You must be signed in to change notification settings - Fork 1
/
event-custom.js.html
882 lines (759 loc) · 85.3 KB
/
event-custom.js.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>API: event-custom event-custom.js (YUI Library)</title>
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
<link rel="stylesheet" type="text/css" href="assets/api.css" />
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
<h3>event-custom <span class="subtitle">3.0.0</span></h3>
<a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a>
> <a href="./module_event-custom.html" title="event-custom">event-custom</a>
> event-custom.js (source view)
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
</div>
</div>
</form>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
<fieldset>
<legend>Filters</legend>
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
</fieldset>
</form>
<div id="srcout">
<style>
#doc3 .classopts { display:none; }
</style>
<div class="highlight"><pre><span class="cm">/**</span>
<span class="cm"> * Custom event engine, DOM event listener abstraction layer, synthetic DOM </span>
<span class="cm"> * events.</span>
<span class="cm"> * @module event-custom</span>
<span class="cm"> * @submodule event-custom-base</span>
<span class="cm"> */</span>
<span class="cm">/**</span>
<span class="cm"> * Return value from all subscribe operations</span>
<span class="cm"> * @class EventHandle</span>
<span class="cm"> * @constructor</span>
<span class="cm"> * @param evt {CustomEvent} the custom event</span>
<span class="cm"> * @param sub {Subscriber} the subscriber</span>
<span class="cm"> */</span>
<span class="c1">// var onsubscribeType = "_event:onsub",</span>
<span class="kd">var</span> <span class="nx">AFTER</span> <span class="o">=</span> <span class="s1">'after'</span><span class="p">,</span>
<span class="nx">CONFIGS</span> <span class="o">=</span> <span class="p">[</span>
<span class="s1">'broadcast'</span><span class="p">,</span>
<span class="s1">'monitor'</span><span class="p">,</span>
<span class="s1">'bubbles'</span><span class="p">,</span>
<span class="s1">'context'</span><span class="p">,</span>
<span class="s1">'contextFn'</span><span class="p">,</span>
<span class="s1">'currentTarget'</span><span class="p">,</span>
<span class="s1">'defaultFn'</span><span class="p">,</span>
<span class="s1">'details'</span><span class="p">,</span>
<span class="s1">'emitFacade'</span><span class="p">,</span>
<span class="s1">'fireOnce'</span><span class="p">,</span>
<span class="s1">'host'</span><span class="p">,</span>
<span class="s1">'preventable'</span><span class="p">,</span>
<span class="s1">'preventedFn'</span><span class="p">,</span>
<span class="s1">'queuable'</span><span class="p">,</span>
<span class="s1">'silent'</span><span class="p">,</span>
<span class="s1">'stoppedFn'</span><span class="p">,</span>
<span class="s1">'target'</span><span class="p">,</span>
<span class="s1">'type'</span>
<span class="p">],</span>
<span class="nx">YUI3_SIGNATURE</span> <span class="o">=</span> <span class="mi">9</span><span class="p">,</span>
<span class="nx">YUI_LOG</span> <span class="o">=</span> <span class="s1">'yui:log'</span><span class="p">;</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">EventHandle</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">evt</span><span class="p">,</span> <span class="nx">sub</span><span class="p">)</span> <span class="p">{</span>
<span class="cm">/**</span>
<span class="cm"> * The custom event</span>
<span class="cm"> * @type CustomEvent</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">evt</span> <span class="o">=</span> <span class="nx">evt</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The subscriber object</span>
<span class="cm"> * @type Subscriber</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">sub</span> <span class="o">=</span> <span class="nx">sub</span><span class="p">;</span>
<span class="p">};</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">EventHandle</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>
<span class="cm">/**</span>
<span class="cm"> * Detaches this subscriber</span>
<span class="cm"> * @method detach</span>
<span class="cm"> */</span>
<span class="nx">detach</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">evt</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">evt</span><span class="p">,</span> <span class="nx">detached</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">i</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">evt</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Y.log('EventHandle.detach: ' + this.sub, 'info', 'Event');</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">evt</span><span class="p">))</span> <span class="p">{</span>
<span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o"><</span><span class="nx">evt</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">detached</span> <span class="o">+=</span> <span class="nx">evt</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">detach</span><span class="p">();</span>
<span class="p">}</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="nx">evt</span><span class="p">.</span><span class="nx">_delete</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">sub</span><span class="p">);</span>
<span class="nx">detached</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nx">detached</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="cm">/**</span>
<span class="cm"> * The CustomEvent class lets you define events for your application</span>
<span class="cm"> * that can be subscribed to by one or more independent component.</span>
<span class="cm"> *</span>
<span class="cm"> * @param {String} type The type of event, which is passed to the callback</span>
<span class="cm"> * when the event fires</span>
<span class="cm"> * @param o configuration object</span>
<span class="cm"> * @class CustomEvent</span>
<span class="cm"> * @constructor</span>
<span class="cm"> */</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">CustomEvent</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">type</span><span class="p">,</span> <span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// if (arguments.length > 2) {</span>
<span class="c1">// this.log('CustomEvent context and silent are now in the config', 'warn', 'Event');</span>
<span class="c1">// }</span>
<span class="nx">o</span> <span class="o">=</span> <span class="nx">o</span> <span class="o">||</span> <span class="p">{};</span>
<span class="k">this</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">stamp</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * The type of event, returned to subscribers when the event fires</span>
<span class="cm"> * @property type</span>
<span class="cm"> * @type string</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">type</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The context the the event will fire from by default. Defaults to the YUI</span>
<span class="cm"> * instance.</span>
<span class="cm"> * @property context</span>
<span class="cm"> * @type object</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">context</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Monitor when an event is attached or detached.</span>
<span class="cm"> * </span>
<span class="cm"> * @property monitor</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> */</span>
<span class="c1">// this.monitor = false;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">logSystem</span> <span class="o">=</span> <span class="p">(</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">YUI_LOG</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * If 0, this event does not broadcast. If 1, the YUI instance is notified</span>
<span class="cm"> * every time this event fires. If 2, the YUI instance and the YUI global</span>
<span class="cm"> * (if event is enabled on the global) are notified every time this event</span>
<span class="cm"> * fires.</span>
<span class="cm"> * @property broadcast</span>
<span class="cm"> * @type int</span>
<span class="cm"> */</span>
<span class="c1">// this.broadcast = 0;</span>
<span class="cm">/**</span>
<span class="cm"> * By default all custom events are logged in the debug build, set silent</span>
<span class="cm"> * to true to disable debug outpu for this event.</span>
<span class="cm"> * @property silent</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">silent</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">logSystem</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Specifies whether this event should be queued when the host is actively</span>
<span class="cm"> * processing an event. This will effect exectution order of the callbacks</span>
<span class="cm"> * for the various events.</span>
<span class="cm"> * @property queuable</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> * @default false</span>
<span class="cm"> */</span>
<span class="c1">// this.queuable = false;</span>
<span class="cm">/**</span>
<span class="cm"> * The subscribers to this event</span>
<span class="cm"> * @property subscribers</span>
<span class="cm"> * @type Subscriber{}</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span> <span class="o">=</span> <span class="p">{};</span>
<span class="cm">/**</span>
<span class="cm"> * 'After' subscribers</span>
<span class="cm"> * @property afters</span>
<span class="cm"> * @type Subscriber{}</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">afters</span> <span class="o">=</span> <span class="p">{};</span>
<span class="cm">/**</span>
<span class="cm"> * This event has fired if true</span>
<span class="cm"> *</span>
<span class="cm"> * @property fired</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> * @default false;</span>
<span class="cm"> */</span>
<span class="c1">// this.fired = false;</span>
<span class="cm">/**</span>
<span class="cm"> * An array containing the arguments the custom event</span>
<span class="cm"> * was last fired with.</span>
<span class="cm"> * @property firedWith</span>
<span class="cm"> * @type Array</span>
<span class="cm"> */</span>
<span class="c1">// this.firedWith;</span>
<span class="cm">/**</span>
<span class="cm"> * This event should only fire one time if true, and if</span>
<span class="cm"> * it has fired, any new subscribers should be notified</span>
<span class="cm"> * immediately.</span>
<span class="cm"> *</span>
<span class="cm"> * @property fireOnce</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> * @default false;</span>
<span class="cm"> */</span>
<span class="c1">// this.fireOnce = false;</span>
<span class="cm">/**</span>
<span class="cm"> * Flag for stopPropagation that is modified during fire()</span>
<span class="cm"> * 1 means to stop propagation to bubble targets. 2 means</span>
<span class="cm"> * to also stop additional subscribers on this target.</span>
<span class="cm"> * @property stopped</span>
<span class="cm"> * @type int</span>
<span class="cm"> */</span>
<span class="c1">// this.stopped = 0;</span>
<span class="cm">/**</span>
<span class="cm"> * Flag for preventDefault that is modified during fire().</span>
<span class="cm"> * if it is not 0, the default behavior for this event</span>
<span class="cm"> * @property prevented</span>
<span class="cm"> * @type int</span>
<span class="cm"> */</span>
<span class="c1">// this.prevented = 0;</span>
<span class="cm">/**</span>
<span class="cm"> * Specifies the host for this custom event. This is used</span>
<span class="cm"> * to enable event bubbling</span>
<span class="cm"> * @property host</span>
<span class="cm"> * @type EventTarget</span>
<span class="cm"> */</span>
<span class="c1">// this.host = null;</span>
<span class="cm">/**</span>
<span class="cm"> * The default function to execute after event listeners</span>
<span class="cm"> * have fire, but only if the default action was not</span>
<span class="cm"> * prevented.</span>
<span class="cm"> * @property defaultFn</span>
<span class="cm"> * @type Function</span>
<span class="cm"> */</span>
<span class="c1">// this.defaultFn = null;</span>
<span class="cm">/**</span>
<span class="cm"> * The function to execute if a subscriber calls</span>
<span class="cm"> * stopPropagation or stopImmediatePropagation</span>
<span class="cm"> * @property stoppedFn</span>
<span class="cm"> * @type Function</span>
<span class="cm"> */</span>
<span class="c1">// this.stoppedFn = null;</span>
<span class="cm">/**</span>
<span class="cm"> * The function to execute if a subscriber calls</span>
<span class="cm"> * preventDefault</span>
<span class="cm"> * @property preventedFn</span>
<span class="cm"> * @type Function</span>
<span class="cm"> */</span>
<span class="c1">// this.preventedFn = null;</span>
<span class="cm">/**</span>
<span class="cm"> * Specifies whether or not this event's default function</span>
<span class="cm"> * can be cancelled by a subscriber by executing preventDefault() </span>
<span class="cm"> * on the event facade </span>
<span class="cm"> * @property preventable </span>
<span class="cm"> * @type boolean </span>
<span class="cm"> * @default true</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">preventable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Specifies whether or not a subscriber can stop the event propagation</span>
<span class="cm"> * via stopPropagation(), stopImmediatePropagation(), or halt()</span>
<span class="cm"> *</span>
<span class="cm"> * Events can only bubble if emitFacade is true.</span>
<span class="cm"> *</span>
<span class="cm"> * @property bubbles</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> * @default true</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">bubbles</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Supports multiple options for listener signatures in order to</span>
<span class="cm"> * port YUI 2 apps.</span>
<span class="cm"> * @property signature</span>
<span class="cm"> * @type int</span>
<span class="cm"> * @default 9</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">signature</span> <span class="o">=</span> <span class="nx">YUI3_SIGNATURE</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">subCount</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">afterCount</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="c1">// this.hasSubscribers = false;</span>
<span class="c1">// this.hasAfters = false;</span>
<span class="cm">/**</span>
<span class="cm"> * If set to true, the custom event will deliver an EventFacade object</span>
<span class="cm"> * that is similar to a DOM event object.</span>
<span class="cm"> * @property emitFacade</span>
<span class="cm"> * @type boolean</span>
<span class="cm"> * @default false</span>
<span class="cm"> */</span>
<span class="c1">// this.emitFacade = false;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">applyConfig</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="c1">// this.log("Creating " + this.type);</span>
<span class="p">};</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>
<span class="nx">hasSubs</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">when</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">subCount</span><span class="p">,</span> <span class="nx">a</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">afterCount</span><span class="p">,</span> <span class="nx">sib</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">sibling</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">sib</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">s</span> <span class="o">+=</span> <span class="nx">sib</span><span class="p">.</span><span class="nx">subCount</span><span class="p">;</span>
<span class="nx">a</span> <span class="o">+=</span> <span class="nx">sib</span><span class="p">.</span><span class="nx">afterCount</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">when</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="p">(</span><span class="nx">when</span> <span class="o">==</span> <span class="s1">'after'</span><span class="p">)</span> <span class="o">?</span> <span class="nx">a</span> <span class="o">:</span> <span class="nx">s</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span> <span class="p">(</span><span class="nx">s</span> <span class="o">+</span> <span class="nx">a</span><span class="p">);</span>
<span class="p">},</span>
<span class="nx">getSubs</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">when</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">),</span> <span class="nx">a</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">afters</span><span class="p">),</span> <span class="nx">sib</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">sibling</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">sib</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">mix</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">sib</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">);</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">mix</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">sib</span><span class="p">.</span><span class="nx">afters</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">return</span> <span class="p">[</span><span class="nx">s</span><span class="p">,</span> <span class="nx">a</span><span class="p">];</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Apply configuration properties. Only applies the CONFIG whitelist</span>
<span class="cm"> * @method applyConfig</span>
<span class="cm"> * @param o hash of properties to apply</span>
<span class="cm"> * @param force {boolean} if true, properties that exist on the event </span>
<span class="cm"> * will be overwritten.</span>
<span class="cm"> */</span>
<span class="nx">applyConfig</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">force</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">mix</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">o</span><span class="p">,</span> <span class="nx">force</span><span class="p">,</span> <span class="nx">CONFIGS</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nx">_on</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">when</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">fn</span><span class="p">)</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Invalid callback for CE: "</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span><span class="p">);</span>
<span class="p">}</span>
<span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">Subscriber</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">when</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fireOnce</span> <span class="o">&&</span> <span class="k">this</span><span class="p">.</span><span class="nx">fired</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Y.later(0, this, Y.bind(this._notify, this, s, this.firedWith));</span>
<span class="nx">setTimeout</span><span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">bind</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_notify</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">firedWith</span><span class="p">),</span> <span class="mi">0</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">when</span> <span class="o">==</span> <span class="nx">AFTER</span><span class="p">)</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">afters</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">id</span><span class="p">]</span> <span class="o">=</span> <span class="nx">s</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">afterCount</span><span class="o">++</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">id</span><span class="p">]</span> <span class="o">=</span> <span class="nx">s</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">subCount</span><span class="o">++</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span> <span class="k">new</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">EventHandle</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">s</span><span class="p">);</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Listen for this event</span>
<span class="cm"> * @method subscribe</span>
<span class="cm"> * @param {Function} fn The function to execute</span>
<span class="cm"> * @return {EventHandle} handle Unsubscribe handle</span>
<span class="cm"> * @deprecated use on</span>
<span class="cm"> */</span>
<span class="nx">subscribe</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'ce.subscribe deprecated, use "on"'</span><span class="p">,</span> <span class="s1">'warn'</span><span class="p">,</span> <span class="s1">'deprecated'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="p">(</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span> <span class="o">></span> <span class="mi">2</span><span class="p">)</span> <span class="o">?</span> <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span><span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_on</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">a</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Listen for this event</span>
<span class="cm"> * @method on</span>
<span class="cm"> * @param {Function} fn The function to execute</span>
<span class="cm"> * @return {EventHandle} handle Unsubscribe handle</span>
<span class="cm"> */</span>
<span class="nx">on</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="p">(</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span> <span class="o">></span> <span class="mi">2</span><span class="p">)</span> <span class="o">?</span> <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span><span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_on</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">a</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Listen for this event after the normal subscribers have been notified and</span>
<span class="cm"> * the default behavior has been applied. If a normal subscriber prevents the </span>
<span class="cm"> * default behavior, it also prevents after listeners from firing.</span>
<span class="cm"> * @method after</span>
<span class="cm"> * @param {Function} fn The function to execute</span>
<span class="cm"> * @return {EventHandle} handle Unsubscribe handle</span>
<span class="cm"> */</span>
<span class="nx">after</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="p">(</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span> <span class="o">></span> <span class="mi">2</span><span class="p">)</span> <span class="o">?</span> <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span><span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_on</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">a</span><span class="p">,</span> <span class="nx">AFTER</span><span class="p">);</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Detach listeners.</span>
<span class="cm"> * @method detach </span>
<span class="cm"> * @param {Function} fn The subscribed function to remove, if not supplied</span>
<span class="cm"> * all will be removed</span>
<span class="cm"> * @param {Object} context The context object passed to subscribe.</span>
<span class="cm"> * @return {int} returns the number of subscribers unsubscribed</span>
<span class="cm"> */</span>
<span class="nx">detach</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// unsubscribe handle</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">fn</span> <span class="o">&&</span> <span class="nx">fn</span><span class="p">.</span><span class="nx">detach</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">fn</span><span class="p">.</span><span class="nx">detach</span><span class="p">();</span>
<span class="p">}</span>
<span class="kd">var</span> <span class="nx">found</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">subs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">s</span><span class="p">;</span>
<span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">subs</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">subs</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
<span class="nx">s</span> <span class="o">=</span> <span class="nx">subs</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">s</span> <span class="o">&&</span> <span class="p">(</span><span class="o">!</span><span class="nx">fn</span> <span class="o">||</span> <span class="nx">fn</span> <span class="o">===</span> <span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">))</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_delete</span><span class="p">(</span><span class="nx">s</span><span class="p">);</span>
<span class="nx">found</span><span class="o">++</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nx">found</span><span class="p">;</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Detach listeners.</span>
<span class="cm"> * @method unsubscribe</span>
<span class="cm"> * @param {Function} fn The subscribed function to remove, if not supplied</span>
<span class="cm"> * all will be removed</span>
<span class="cm"> * @param {Object} context The context object passed to subscribe.</span>
<span class="cm"> * @return {int|undefined} returns the number of subscribers unsubscribed</span>
<span class="cm"> * @deprecated use detach</span>
<span class="cm"> */</span>
<span class="nx">unsubscribe</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">detach</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Notify a single subscriber</span>
<span class="cm"> * @method _notify</span>
<span class="cm"> * @param s {Subscriber} the subscriber</span>
<span class="cm"> * @param args {Array} the arguments array to apply to the listener</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_notify</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">ef</span><span class="p">)</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s2">"->"</span> <span class="o">+</span> <span class="s2">"sub: "</span> <span class="o">+</span> <span class="nx">s</span><span class="p">.</span><span class="nx">id</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">ret</span><span class="p">;</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="nx">args</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="kc">false</span> <span class="o">===</span> <span class="nx">ret</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">stopped</span> <span class="o">></span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s2">" cancelled by subscriber"</span><span class="p">);</span>
<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Logger abstraction to centralize the application of the silent flag</span>
<span class="cm"> * @method log</span>
<span class="cm"> * @param msg {string} message to log</span>
<span class="cm"> * @param cat {string} log category</span>
<span class="cm"> */</span>
<span class="nx">log</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">msg</span><span class="p">,</span> <span class="nx">cat</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">silent</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">': '</span> <span class="o">+</span> <span class="nx">msg</span><span class="p">,</span> <span class="nx">cat</span> <span class="o">||</span> <span class="s2">"info"</span><span class="p">,</span> <span class="s2">"event"</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Notifies the subscribers. The callback functions will be executed</span>
<span class="cm"> * from the context specified when the event was created, and with the </span>
<span class="cm"> * following parameters:</span>
<span class="cm"> * <ul></span>
<span class="cm"> * <li>The type of event</li></span>
<span class="cm"> * <li>All of the arguments fire() was executed with as an array</li></span>
<span class="cm"> * <li>The custom object (if any) that was passed into the subscribe() </span>
<span class="cm"> * method</li></span>
<span class="cm"> * </ul></span>
<span class="cm"> * @method fire </span>
<span class="cm"> * @param {Object*} arguments an arbitrary set of parameters to pass to </span>
<span class="cm"> * the handler.</span>
<span class="cm"> * @return {boolean} false if one of the subscribers returned false, </span>
<span class="cm"> * true otherwise</span>
<span class="cm"> * </span>
<span class="cm"> */</span>
<span class="nx">fire</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fireOnce</span> <span class="o">&&</span> <span class="k">this</span><span class="p">.</span><span class="nx">fired</span><span class="p">)</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'fireOnce event: '</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s1">' already fired'</span><span class="p">);</span>
<span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">fired</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">firedWith</span> <span class="o">=</span> <span class="nx">args</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">emitFacade</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireComplex</span><span class="p">(</span><span class="nx">args</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireSimple</span><span class="p">(</span><span class="nx">args</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nx">fireSimple</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">hasSubs</span><span class="p">())</span> <span class="p">{</span>
<span class="c1">// this._procSubs(Y.merge(this.subscribers, this.afters), args);</span>
<span class="kd">var</span> <span class="nx">subs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getSubs</span><span class="p">();</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_procSubs</span><span class="p">(</span><span class="nx">subs</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">args</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_procSubs</span><span class="p">(</span><span class="nx">subs</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">args</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_broadcast</span><span class="p">(</span><span class="nx">args</span><span class="p">);</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">stopped</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>
<span class="c1">// Requires the event-custom-complex module for full funcitonality.</span>
<span class="nx">fireComplex</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Missing event-custom-complex needed to emit a facade for: '</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span><span class="p">);</span>
<span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">||</span> <span class="p">{};</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireSimple</span><span class="p">(</span><span class="nx">args</span><span class="p">);</span>
<span class="p">},</span>
<span class="nx">_procSubs</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">subs</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">ef</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">i</span><span class="p">;</span>
<span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">subs</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">subs</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
<span class="nx">s</span> <span class="o">=</span> <span class="nx">subs</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">s</span> <span class="o">&&</span> <span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="kc">false</span> <span class="o">===</span> <span class="k">this</span><span class="p">.</span><span class="nx">_notify</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">ef</span><span class="p">))</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">stopped</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">stopped</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>
<span class="nx">_broadcast</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">stopped</span> <span class="o">&&</span> <span class="k">this</span><span class="p">.</span><span class="nx">broadcast</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">(</span><span class="nx">args</span><span class="p">);</span>
<span class="nx">a</span><span class="p">.</span><span class="nx">unshift</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">type</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">host</span> <span class="o">!==</span> <span class="nx">Y</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">fire</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">Y</span><span class="p">,</span> <span class="nx">a</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">broadcast</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">Global</span><span class="p">.</span><span class="nx">fire</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">Global</span><span class="p">,</span> <span class="nx">a</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Removes all listeners</span>
<span class="cm"> * @method unsubscribeAll</span>
<span class="cm"> * @return {int} The number of listeners unsubscribed</span>
<span class="cm"> * @deprecated use detachAll</span>
<span class="cm"> */</span>
<span class="nx">unsubscribeAll</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">detachAll</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Removes all listeners</span>
<span class="cm"> * @method detachAll</span>
<span class="cm"> * @return {int} The number of listeners unsubscribed</span>
<span class="cm"> */</span>
<span class="nx">detachAll</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">detach</span><span class="p">();</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * @method _delete</span>
<span class="cm"> * @param subscriber object</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_delete</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
<span class="k">delete</span> <span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">;</span>
<span class="k">delete</span> <span class="nx">s</span><span class="p">.</span><span class="nx">context</span><span class="p">;</span>
<span class="k">delete</span> <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">id</span><span class="p">];</span>
<span class="k">delete</span> <span class="k">this</span><span class="p">.</span><span class="nx">afters</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">id</span><span class="p">];</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="c1">/////////////////////////////////////////////////////////////////////</span>
<span class="cm">/**</span>
<span class="cm"> * Stores the subscriber information to be used when the event fires.</span>
<span class="cm"> * @param {Function} fn The wrapped function to execute</span>
<span class="cm"> * @param {Object} context The value of the keyword 'this' in the listener</span>
<span class="cm"> * @param {Array} args* 0..n additional arguments to supply the listener</span>
<span class="cm"> *</span>
<span class="cm"> * @class Subscriber</span>
<span class="cm"> * @constructor</span>
<span class="cm"> */</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">Subscriber</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="cm">/**</span>
<span class="cm"> * The callback that will be execute when the event fires</span>
<span class="cm"> * This is wrapped by Y.rbind if obj was supplied.</span>
<span class="cm"> * @property fn</span>
<span class="cm"> * @type Function</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">fn</span> <span class="o">=</span> <span class="nx">fn</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Optional 'this' keyword for the listener</span>
<span class="cm"> * @property context</span>
<span class="cm"> * @type Object</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">context</span> <span class="o">=</span> <span class="nx">context</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Unique subscriber id</span>
<span class="cm"> * @property id</span>
<span class="cm"> * @type String</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">stamp</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * Additional arguments to propagate to the subscriber</span>
<span class="cm"> * @property args</span>
<span class="cm"> * @type Array</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">args</span> <span class="o">=</span> <span class="nx">args</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Custom events for a given fire transaction.</span>
<span class="cm"> * @property events</span>
<span class="cm"> * @type {EventTarget}</span>
<span class="cm"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">events</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">};</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">Subscriber</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>
<span class="nx">_notify</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">ce</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">args</span><span class="p">,</span> <span class="nx">ret</span><span class="p">;</span>
<span class="k">switch</span> <span class="p">(</span><span class="nx">ce</span><span class="p">.</span><span class="nx">signature</span><span class="p">)</span> <span class="p">{</span>
<span class="k">case</span> <span class="mi">0</span><span class="o">:</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">ce</span><span class="p">.</span><span class="nx">type</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">c</span><span class="p">);</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">case</span> <span class="mi">1</span><span class="o">:</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">c</span><span class="p">);</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">default</span><span class="o">:</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">a</span> <span class="o">||</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">args</span> <span class="o">=</span> <span class="nx">args</span> <span class="o">||</span> <span class="p">[];</span>
<span class="nx">a</span> <span class="o">=</span> <span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="o">?</span> <span class="nx">args</span><span class="p">.</span><span class="nx">concat</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="o">:</span> <span class="nx">args</span><span class="p">;</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">a</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">c</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Executes the subscriber.</span>
<span class="cm"> * @method notify</span>
<span class="cm"> * @param args {Array} Arguments array for the subscriber</span>
<span class="cm"> * @param ce {CustomEvent} The custom event that sent the notification</span>
<span class="cm"> */</span>
<span class="nx">notify</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">args</span><span class="p">,</span> <span class="nx">ce</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">c</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">context</span><span class="p">,</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">c</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">c</span> <span class="o">=</span> <span class="p">(</span><span class="nx">ce</span><span class="p">.</span><span class="nx">contextFn</span><span class="p">)</span> <span class="o">?</span> <span class="nx">ce</span><span class="p">.</span><span class="nx">contextFn</span><span class="p">()</span> <span class="o">:</span> <span class="nx">ce</span><span class="p">.</span><span class="nx">context</span><span class="p">;</span>
<span class="p">}</span>
<span class="c1">// only catch errors if we will not re-throw them.</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">throwFail</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_notify</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">ce</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">try</span> <span class="p">{</span>
<span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_notify</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">ce</span><span class="p">);</span>
<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Y</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="k">this</span> <span class="o">+</span> <span class="s1">' failed: '</span> <span class="o">+</span> <span class="nx">e</span><span class="p">.</span><span class="nx">message</span><span class="p">,</span> <span class="nx">e</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Returns true if the fn and obj match this objects properties.</span>
<span class="cm"> * Used by the unsubscribe method to match the right subscriber.</span>
<span class="cm"> *</span>
<span class="cm"> * @method contains</span>
<span class="cm"> * @param {Function} fn the function to execute</span>
<span class="cm"> * @param {Object} context optional 'this' keyword for the listener</span>
<span class="cm"> * @return {boolean} true if the supplied arguments match this </span>
<span class="cm"> * subscriber's signature.</span>
<span class="cm"> */</span>
<span class="nx">contains</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">fn</span> <span class="o">==</span> <span class="nx">fn</span><span class="p">)</span> <span class="o">&&</span> <span class="k">this</span><span class="p">.</span><span class="nx">context</span> <span class="o">==</span> <span class="nx">context</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fn</span> <span class="o">==</span> <span class="nx">fn</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">};</span>
</pre></div>
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div id="moduleList" class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_align-plugin.html" title="align-plugin">align-plugin</a></li>
<li class=""><a href="module_anim.html" title="anim">anim</a></li>
<li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li>
<li class=""><a href="module_attribute.html" title="attribute">attribute</a></li>
<li class=""><a href="module_base.html" title="base">base</a></li>
<li class=""><a href="module_cache.html" title="cache">cache</a></li>
<li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
<li class=""><a href="module_collection.html" title="collection">collection</a></li>
<li class=""><a href="module_console.html" title="console">console</a></li>
<li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li>
<li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
<li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li>
<li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
<li class=""><a href="module_datatype.html" title="datatype">datatype</a></li>
<li class=""><a href="module_dd.html" title="dd">dd</a></li>
<li class=""><a href="module_dom.html" title="dom">dom</a></li>
<li class=""><a href="module_dump.html" title="dump">dump</a></li>
<li class=""><a href="module_event.html" title="event">event</a></li>
<li class="selected"><a href="module_event-custom.html" title="event-custom">event-custom</a></li>
<li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
<li class=""><a href="module_history.html" title="history">history</a></li>
<li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
<li class=""><a href="module_io.html" title="io">io</a></li>
<li class=""><a href="module_json.html" title="json">json</a></li>
<li class=""><a href="module_loader.html" title="loader">loader</a></li>
<li class=""><a href="module_node.html" title="node">node</a></li>
<li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
<li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li>
<li class=""><a href="module_oop.html" title="oop">oop</a></li>
<li class=""><a href="module_overlay.html" title="overlay">overlay</a></li>
<li class=""><a href="module_plugin.html" title="plugin">plugin</a></li>
<li class=""><a href="module_pluginhost.html" title="pluginhost">pluginhost</a></li>
<li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
<li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li>
<li class=""><a href="module_shim-plugin.html" title="shim-plugin">shim-plugin</a></li>
<li class=""><a href="module_slider.html" title="slider">slider</a></li>
<li class=""><a href="module_sortable.html" title="sortable">sortable</a></li>
<li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
<li class=""><a href="module_substitute.html" title="substitute">substitute</a></li>
<li class=""><a href="module_test.html" title="test">test</a></li>
<li class=""><a href="module_widget.html" title="widget">widget</a></li>
<li class=""><a href="module_widget-child.html" title="widget-child">widget-child</a></li>
<li class=""><a href="module_widget-parent.html" title="widget-parent">widget-parent</a></li>
<li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li>
<li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li>
<li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li>
<li class=""><a href="module_yui.html" title="yui">yui</a></li>
</ul>
</div>
<div id="classList" class="module">
<h4>Classes</h4>
<ul class="content">
<li class=""><a href="CustomEvent.html" title="CustomEvent">CustomEvent</a></li>
<li class=""><a href="Do.html" title="Do">Do</a></li>
<li class=""><a href="Do.AlterArgs.html" title="Do.AlterArgs">Do.AlterArgs</a></li>
<li class=""><a href="Do.AlterReturn.html" title="Do.AlterReturn">Do.AlterReturn</a></li>
<li class=""><a href="Do.Error.html" title="Do.Error">Do.Error</a></li>
<li class=""><a href="Do.Halt.html" title="Do.Halt">Do.Halt</a></li>
<li class=""><a href="Do.Method.html" title="Do.Method">Do.Method</a></li>
<li class=""><a href="Do.Prevent.html" title="Do.Prevent">Do.Prevent</a></li>
<li class=""><a href="EventFacade.html" title="EventFacade">EventFacade</a></li>
<li class=""><a href="EventHandle.html" title="EventHandle">EventHandle</a></li>
<li class=""><a href="EventTarget.html" title="EventTarget">EventTarget</a></li>
<li class=""><a href="Subscriber.html" title="Subscriber">Subscriber</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class="selected"><a href="event-custom.js.html" title="event-custom.js">event-custom.js</a></li>
<li class=""><a href="event-do.js.html" title="event-do.js">event-do.js</a></li>
<li class=""><a href="event-facade.js.html" title="event-facade.js">event-facade.js</a></li>
<li class=""><a href="event-target.js.html" title="event-target.js">event-target.js</a></li>
<li class=""><a href="event.js.html" title="event.js">event.js</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright © 2010 Yahoo! Inc. All rights reserved.
</div>
</div>
<script type="text/javascript">
var ALL_YUI_PROPS = [{"access": "", "host": "EventTarget", "name": "addTarget", "url": "EventTarget.html#method_addTarget", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "after", "url": "CustomEvent.html#method_after", "type": "method"}, {"access": "", "host": "Do", "name": "after", "url": "Do.html#method_after", "type": "method"}, {"access": "", "host": "EventTarget", "name": "after", "url": "EventTarget.html#method_after", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "afters", "url": "CustomEvent.html#property_afters", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "applyConfig", "url": "CustomEvent.html#method_applyConfig", "type": "method"}, {"access": "", "host": "Subscriber", "name": "args", "url": "Subscriber.html#property_args", "type": "property"}, {"access": "", "host": "Do", "name": "before", "url": "Do.html#method_before", "type": "method"}, {"access": "", "host": "EventTarget", "name": "before", "url": "EventTarget.html#method_before", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "broadcast", "url": "CustomEvent.html#property_broadcast", "type": "property"}, {"access": "", "host": "EventTarget", "name": "bubble", "url": "EventTarget.html#method_bubble", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "bubbles", "url": "CustomEvent.html#property_bubbles", "type": "property"}, {"access": "", "host": "Subscriber", "name": "contains", "url": "Subscriber.html#method_contains", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "context", "url": "CustomEvent.html#property_context", "type": "property"}, {"access": "", "host": "Subscriber", "name": "context", "url": "Subscriber.html#property_context", "type": "property"}, {"access": "", "host": "EventFacade", "name": "currentTarget", "url": "EventFacade.html#property_currentTarget", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "defaultFn", "url": "CustomEvent.html#property_defaultFn", "type": "property"}, {"access": "private", "host": "CustomEvent", "name": "_delete", "url": "CustomEvent.html#method__delete", "type": "method"}, {"access": "", "host": "Do.Method", "name": "delete", "url": "Do.Method.html#method_delete", "type": "method"}, {"access": "", "host": "EventHandle", "name": "detach", "url": "EventHandle.html#method_detach", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "detach", "url": "CustomEvent.html#method_detach", "type": "method"}, {"access": "", "host": "Do", "name": "detach", "url": "Do.html#method_detach", "type": "method"}, {"access": "", "host": "EventTarget", "name": "detach", "url": "EventTarget.html#method_detach", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "detachAll", "url": "CustomEvent.html#method_detachAll", "type": "method"}, {"access": "", "host": "EventTarget", "name": "detachAll", "url": "EventTarget.html#method_detachAll", "type": "method"}, {"access": "", "host": "EventFacade", "name": "details", "url": "EventFacade.html#property_details", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "emitFacade", "url": "CustomEvent.html#property_emitFacade", "type": "property"}, {"access": "", "host": "Subscriber", "name": "events", "url": "Subscriber.html#property_events", "type": "property"}, {"access": "", "host": "EventHandle", "name": "evt", "url": "EventHandle.html#property_evt", "type": "property"}, {"access": "", "host": "Do.Method", "name": "exec", "url": "Do.Method.html#method_exec", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "fire", "url": "CustomEvent.html#method_fire", "type": "method"}, {"access": "", "host": "EventTarget", "name": "fire", "url": "EventTarget.html#method_fire", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "fired", "url": "CustomEvent.html#property_fired", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "firedWith", "url": "CustomEvent.html#property_firedWith", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "fireOnce", "url": "CustomEvent.html#property_fireOnce", "type": "property"}, {"access": "", "host": "Subscriber", "name": "fn", "url": "Subscriber.html#property_fn", "type": "property"}, {"access": "", "host": "EventTarget", "name": "getEvent", "url": "EventTarget.html#method_getEvent", "type": "method"}, {"access": "private", "host": "EventTarget", "name": "_getType", "url": "EventTarget.html#method__getType", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "halt", "url": "CustomEvent.html#method_halt", "type": "method"}, {"access": "", "host": "EventFacade", "name": "halt", "url": "EventFacade.html#method_halt", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "host", "url": "CustomEvent.html#property_host", "type": "property"}, {"access": "", "host": "Subscriber", "name": "id", "url": "Subscriber.html#property_id", "type": "property"}, {"access": "private", "host": "Do", "name": "_inject", "url": "Do.html#method__inject", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "log", "url": "CustomEvent.html#method_log", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "monitor", "url": "CustomEvent.html#property_monitor", "type": "property"}, {"access": "private", "host": "CustomEvent", "name": "_notify", "url": "CustomEvent.html#method__notify", "type": "method"}, {"access": "", "host": "Subscriber", "name": "notify", "url": "Subscriber.html#method_notify", "type": "method"}, {"access": "", "host": "Do", "name": "objs", "url": "Do.html#property_objs", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "on", "url": "CustomEvent.html#method_on", "type": "method"}, {"access": "", "host": "EventTarget", "name": "on", "url": "EventTarget.html#method_on", "type": "method"}, {"access": "private", "host": "EventTarget", "name": "_parseType", "url": "EventTarget.html#method__parseType", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "preventable", "url": "CustomEvent.html#property_preventable", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "preventDefault", "url": "CustomEvent.html#method_preventDefault", "type": "method"}, {"access": "", "host": "EventFacade", "name": "preventDefault", "url": "EventFacade.html#method_preventDefault", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "prevented", "url": "CustomEvent.html#property_prevented", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "preventedFn", "url": "CustomEvent.html#property_preventedFn", "type": "property"}, {"access": "", "host": "EventTarget", "name": "publish", "url": "EventTarget.html#method_publish", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "queuable", "url": "CustomEvent.html#property_queuable", "type": "property"}, {"access": "", "host": "Do.Method", "name": "register", "url": "Do.Method.html#method_register", "type": "method"}, {"access": "", "host": "EventFacade", "name": "relatedTarget", "url": "EventFacade.html#property_relatedTarget", "type": "property"}, {"access": "", "host": "EventTarget", "name": "removeTarget", "url": "EventTarget.html#method_removeTarget", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "signature", "url": "CustomEvent.html#property_signature", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "silent", "url": "CustomEvent.html#property_silent", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "stopImmediatePropagation", "url": "CustomEvent.html#method_stopImmediatePropagation", "type": "method"}, {"access": "", "host": "EventFacade", "name": "stopImmediatePropagation", "url": "EventFacade.html#method_stopImmediatePropagation", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "stopped", "url": "CustomEvent.html#property_stopped", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "stoppedFn", "url": "CustomEvent.html#property_stoppedFn", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "stopPropagation", "url": "CustomEvent.html#method_stopPropagation", "type": "method"}, {"access": "", "host": "EventFacade", "name": "stopPropagation", "url": "EventFacade.html#method_stopPropagation", "type": "method"}, {"access": "", "host": "EventHandle", "name": "sub", "url": "EventHandle.html#property_sub", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "subscribe", "url": "CustomEvent.html#method_subscribe", "type": "method"}, {"access": "", "host": "EventTarget", "name": "subscribe", "url": "EventTarget.html#method_subscribe", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "subscribers", "url": "CustomEvent.html#property_subscribers", "type": "property"}, {"access": "", "host": "EventFacade", "name": "target", "url": "EventFacade.html#property_target", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "type", "url": "CustomEvent.html#property_type", "type": "property"}, {"access": "", "host": "EventFacade", "name": "type", "url": "EventFacade.html#property_type", "type": "property"}, {"access": "", "host": "CustomEvent", "name": "unsubscribe", "url": "CustomEvent.html#method_unsubscribe", "type": "method"}, {"access": "", "host": "EventTarget", "name": "unsubscribe", "url": "EventTarget.html#method_unsubscribe", "type": "method"}, {"access": "", "host": "CustomEvent", "name": "unsubscribeAll", "url": "CustomEvent.html#method_unsubscribeAll", "type": "method"}, {"access": "", "host": "EventTarget", "name": "unsubscribeAll", "url": "EventTarget.html#method_unsubscribeAll", "type": "method"}];
</script>
</body>
</html>