Skip to content

Commit b414ac4

Browse files
author
Web Advanced
committed
Added before-after
1 parent ebe9be6 commit b414ac4

File tree

10 files changed

+259
-167
lines changed

10 files changed

+259
-167
lines changed

dev/.nuget/content/Scripts/signals.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ var signals = (function (global, undefined) {
1717
takeAction,
1818
getSignalType,
1919
fire,
20-
unload;
20+
unload,
21+
iterator;
2122
/**
2223
* Private function that makes the given signal observable.
2324
* <br />- <strong>(signals are an arbitrary string)</strong>
@@ -54,10 +55,11 @@ var signals = (function (global, undefined) {
5455
*/
5556
takeAction = function (action, signalName, arg) {
5657
var signalType = getSignalType(signalName),
58+
actionsBefore = evts[signalType + ':before'],
5759
actions = evts[signalType],
58-
i = 0,
59-
l,
60+
actionsAfter = evts[signalType + ':after'],
6061
takeAction;
62+
6163
if (actions === undefined) {
6264
return;
6365
}
@@ -66,9 +68,20 @@ var signals = (function (global, undefined) {
6668
} else {
6769
takeAction = unload;
6870
}
69-
l = actions.length;
71+
if(actionsBefore) {
72+
iterator(actionsBefore, takeAction, arg);
73+
}
74+
75+
iterator(actions, takeAction, arg);
76+
77+
if(actionsAfter) {
78+
iterator(actionsAfter, takeAction, arg);
79+
}
80+
};
81+
iterator = function(collection, fn, arg) {
82+
var i = 0, l = collection.length;
7083
for (i; i < l; i += 1) {
71-
takeAction(actions[i], arg, actions, i);
84+
fn(collection[i], arg, collection, i);
7285
}
7386
};
7487
/**
@@ -111,7 +124,7 @@ var signals = (function (global, undefined) {
111124
*/
112125
return signal || 'any';
113126
};
114-
127+
115128
return {
116129
/**
117130
* Add a Listener to the given Signal.

dev/.nuget/content/Scripts/signals.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/Signals.js.0.0.1.nupkg

143 Bytes
Binary file not shown.

docs/files.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h2><a href="symbols/src/signals.js.html">signals.js</a></h2>
5757
</div>
5858
<div class="fineprint" style="clear:both;text-align:center">
5959

60-
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon Dec 12 2011 15:34:51 GMT-0800 (PST)
60+
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 16 2011 14:47:47 GMT-0800 (PST)
6161
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
6262
</div>
6363
</body>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h2><a href="symbols/signals.html">signals</a></h2>
6363
</div>
6464
<div class="fineprint" style="clear:both;text-align:center">
6565

66-
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon Dec 12 2011 15:34:51 GMT-0800 (PST)
66+
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 16 2011 14:47:47 GMT-0800 (PST)
6767
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
6868
</div>
6969
</body>

docs/symbolindex.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ <h1 id="classTitle">Symbol Index</h1>
120120
</td>
121121
</tr>
122122

123+
<tr class="symbolEntry">
124+
<td class="symbolName">iterator</td>
125+
<td>
126+
127+
<a href="symbols/_global_.html#iterator">iterator</a>
128+
129+
</td>
130+
</tr>
131+
123132
<tr class="symbolEntry">
124133
<td class="symbolName">listenerCount</td>
125134
<td>
@@ -198,7 +207,7 @@ <h1 id="classTitle">Symbol Index</h1>
198207
</div>
199208
<div class="fineprint" style="clear:both;text-align:center">
200209

201-
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon Dec 12 2011 15:34:51 GMT-0800 (PST)
210+
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 16 2011 14:47:47 GMT-0800 (PST)
202211
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
203212
</div>
204213
</body>

docs/symbols/_global_.html

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ <h3>Functions</h3>
6666
<a href="../symbols/_global_.html#getSignalType">getSignalType</a>
6767
</li>
6868

69+
<li class="fixedFont">
70+
<a href="../symbols/_global_.html#iterator">iterator</a>
71+
</li>
72+
6973
<li class="fixedFont">
7074
<a href="../symbols/_global_.html#makeObservable">makeObservable</a>
7175
</li>
@@ -207,6 +211,59 @@ <h1 class="classTitle">
207211

208212

209213

214+
</div>
215+
216+
<div class="member">
217+
<a name="iterator"> </a>
218+
<div class="fixedFont">
219+
<div class="modifiers">
220+
</div>
221+
222+
<b>iterator</b>(collection, fn, arg)
223+
224+
</div>
225+
<div class="description">
226+
227+
228+
<br />
229+
<i>Defined in: </i> <a href="../symbols/src/signals.js.html">signals.js</a>.
230+
231+
232+
</div>
233+
234+
235+
236+
237+
<dl class="detailList">
238+
<dt class="heading">Parameters:</dt>
239+
240+
<dt>
241+
<b>collection</b>
242+
243+
</dt>
244+
<dd></dd>
245+
246+
<dt>
247+
<b>fn</b>
248+
249+
</dt>
250+
<dd></dd>
251+
252+
<dt>
253+
<b>arg</b>
254+
255+
</dt>
256+
<dd></dd>
257+
258+
</dl>
259+
260+
261+
262+
263+
264+
265+
266+
210267
</div>
211268

212269
<div class="member">
@@ -427,7 +484,7 @@ <h1 class="classTitle">
427484
<!-- ============================== footer ================================= -->
428485
<div class="fineprint" style="clear:both;text-align:center">
429486

430-
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon Dec 12 2011 15:34:51 GMT-0800 (PST)
487+
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 16 2011 14:47:47 GMT-0800 (PST)
431488
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
432489
</div>
433490
</body>

docs/symbols/signals.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ <h1 class="classTitle">
395395
<!-- ============================== footer ================================= -->
396396
<div class="fineprint" style="clear:both;text-align:center">
397397

398-
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon Dec 12 2011 15:34:51 GMT-0800 (PST)
398+
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 16 2011 14:47:47 GMT-0800 (PST)
399399
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
400400
</div>
401401
</body>

0 commit comments

Comments
 (0)