Skip to content
Browse files

Merge branch 'release-0.5.1'

  • Loading branch information...
2 parents 7365bf6 + 0b116bc commit c1d80d1caf3818829a9538dfd2a622b4bf2016be @millermedeiros committed Jan 30, 2011
View
24 CHANGELOG.markdown
@@ -2,6 +2,22 @@
+## v0.5.1 (2011/01/30) ##
+
+### API changes ###
+
+ - made `SignalBinding` constructor private. (issue #15)
+ - changed params order on `SignalBinding` constructor.
+ - removed `signals.isDef()`. (issue #14)
+
+### Other ###
+
+ - added JSLint to the build process. (issue #12)
+ - validated source code using JSLint. (issue #13)
+ - improved docs.
+
+
+
## v0.5 (2010/12/03) ##
### API changes ###
@@ -11,12 +27,12 @@
- `Signal.dispose()` (issue #6)
- `signals.VERSION`
- `signals.isDef()`
-
+
- Removed:
- - `SignalBinding.listener` (issue #3)
-
+ - `SignalBinding.listener` (issue #3)
+
- Renamed:
- - `SignalBinding.listenerScope` -> `SignalBinding.context` (issue #4)
+ - `SignalBinding.listenerScope` -> `SignalBinding.context` (issue #4)
### Fixes ###
View
24 build.xml
@@ -34,8 +34,8 @@
<filelist dir="${src.dir}">
<file name="intro.js" />
<file name="signals.js" />
- <file name="Signal.js" />
<file name="SignalBinding.js" />
+ <file name="Signal.js" />
<file name="outro.js" />
</filelist>
</concat>
@@ -49,6 +49,20 @@
<echo message="${dist.name} built." />
</target>
+ <target name="lint">
+ <echo message="JSLinting ${dist.name}..."/>
+
+ <apply executable="java" parallel="false">
+ <filelist dir="${dist.dir}">
+ <file name="${dist.name}"/>
+ </filelist>
+ <arg line="-jar"/>
+ <arg path="${jslint.jar}"/>
+ </apply>
+
+ <echo message="JSLinted ${dist.name}."/>
+ </target>
+
<target name="minify">
<echo message="Building ${dist.min.name}..." />
@@ -59,7 +73,7 @@
<arg line="-jar" />
<arg path="${yuicompressor.jar}" />
<arg value="--charset" />
- <arg value="ANSI" />
+ <arg value="UTF8" />
<arg value="-v" />
<arg value="-o" />
<targetfile />
@@ -69,7 +83,7 @@
<echo message="${dist.min.name} built." />
</target>
- <target name="generateDoc">
+ <target name="generateDocs" depends="-purgeDocs">
<echo message="Generating documentation" />
<apply executable="java" parallel="false" verbose="true">
<fileset dir="${dist.dir}">
@@ -84,11 +98,11 @@
<echo message="Documentation generated" />
</target>
- <target name="compile" depends="build, minify">
+ <target name="compile" depends="build, lint, minify">
<echo message="Build Complete." />
</target>
- <target name="all" depends="compile, generateDoc">
+ <target name="all" depends="compile, generateDocs">
<echo message="Build Complete." />
</target>
View
4 dev/build/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Fri Dec 03 17:27:32 EST 2010
-build.number=101
+#Sun Jan 30 01:55:10 EST 2011
+build.number=127
View
3 dev/build/build.properties
@@ -5,7 +5,8 @@ dist.dir = dist
docs.dir = ${dist.dir}/docs
jsdoc-toolkit.dir = ${build.dir}/jsdoc-toolkit
yuicompressor.jar = ${build.dir}/yuicompressor/yuicompressor-2.4.2.jar
+jslint.jar = ${build.dir}/jslint4java/jslint4java-1.4.6.jar
product.name = js-signals
-version.number = 0.5
+version.number = 0.5.1
dist.name = ${product.name}.js
dist.min.name = ${product.name}.min.js
View
23 dev/build/jslint4java/LICENCE.txt
@@ -0,0 +1,23 @@
+Copyright (C) 2007 by Dominic Mitchell
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
View
42 dev/build/jslint4java/README.markdown
@@ -0,0 +1,42 @@
+jslint for java <http://code.google.com/p/jslint4java/>
+=======================================================
+
+This is a java wrapper around the fabulous tool by Douglas Crockford, jslint
+(See <http://jslint.com/>). It provides a simple interface for detecting
+potential problems in JavaScript code.
+
+You can run it on the command line:
+
+ % java -jar jslint4java-1.4.6.jar application.js
+ jslint:application.js:11:9:Line breaking error ')'.
+ jslint:application.js:11:10:Missing semicolon.
+
+There are a multitude of options; try `--help` for more details.
+
+The output is colon separated fields. The fields are:
+
+ * "jslint"
+ * the file name
+ * the line number (starting at zero)
+ * the character number (starting at zero)
+ * the problem that was found
+
+You may also use the jar as an ant task. The quickest way to get started is
+to drop it in `~/.ant/lib`. See `docs/ant.html` for more details.
+
+**NB:** The packaged jar file includes a builtin version of rhino (a JavaScript
+engine). If this causes trouble, you can download a standalone version
+through the maven repository.
+
+If you wish to use jslint4java from within Java, please use a maven dependency:
+
+ <dependency>
+ <groupId>com.googlecode.jslint4java</groupId>
+ <artifactId>jslint4java</artifactId>
+ <version>1.4.6</version>
+ </dependency>
+
+If you have any comments or queries, please send them to dom [at] happygiraffe.net.
+
+This software is licenced under the BSD licence (see LICENCE.txt).
+
View
BIN dev/build/jslint4java/jslint4java-1.4.6.jar
Binary file not shown.
View
60 dev/src/Signal.js
@@ -1,13 +1,13 @@
/**
- * Signal - custom event broadcaster
+ * Custom event broadcaster
* <br />- inspired by Robert Penner's AS3 Signals.
* @author Miller Medeiros
* @constructor
*/
signals.Signal = function(){
/**
- * @type Array.<signals.SignalBinding>
+ * @type Array.<SignalBinding>
* @private
*/
this._bindings = [];
@@ -32,12 +32,14 @@
* @param {Function} listener
* @param {boolean} isOnce
* @param {Object} [scope]
- * @return {signals.SignalBinding}
+ * @return {SignalBinding}
* @private
*/
_registerListener : function(listener, isOnce, scope){
- if(!signals.isDef(listener)) throw new Error('listener is a required param of add() and addOnce().');
+ if(typeof listener !== 'function'){
+ throw new Error('listener is a required param of add() and addOnce().');
+ }
var prevIndex = this._indexOfListener(listener),
binding;
@@ -48,15 +50,15 @@
throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.');
}
} else {
- binding = new signals.SignalBinding(listener, isOnce, scope, this);
+ binding = new SignalBinding(this, listener, isOnce, scope);
this._addBinding(binding);
}
return binding;
},
/**
- * @param {signals.SignalBinding} binding
+ * @param {SignalBinding} binding
* @private
*/
_addBinding : function(binding){
@@ -65,13 +67,15 @@
/**
* @param {Function} listener
- * @return {int}
+ * @return {number}
* @private
*/
_indexOfListener : function(listener){
var n = this._bindings.length;
while(n--){
- if(this._bindings[n]._listener === listener) return n;
+ if(this._bindings[n]._listener === listener){
+ return n;
+ }
}
return -1;
},
@@ -80,7 +84,7 @@
* Add a listener to the signal.
* @param {Function} listener Signal handler function.
* @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @return {signals.SignalBinding} An Object representing the binding between the Signal and listener.
+ * @return {SignalBinding} An Object representing the binding between the Signal and listener.
*/
add : function(listener, scope){
return this._registerListener(listener, false, scope);
@@ -90,7 +94,7 @@
* Add listener to the signal that should be removed after first execution (will be executed only once).
* @param {Function} listener Signal handler function.
* @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @return {signals.SignalBinding} An Object representing the binding between the Signal and listener.
+ * @return {SignalBinding} An Object representing the binding between the Signal and listener.
*/
addOnce : function(listener, scope){
return this._registerListener(listener, true, scope);
@@ -110,10 +114,14 @@
* @return {Function} Listener handler function.
*/
remove : function(listener){
- if(!signals.isDef(listener)) throw new Error('listener is a required param of remove().');
+ if(typeof listener !== 'function'){
+ throw new Error('listener is a required param of remove().');
+ }
var i = this._indexOfListener(listener);
- if(i !== -1) this._removeByIndex(i);
+ if(i !== -1){
+ this._removeByIndex(i);
+ }
return listener;
},
@@ -128,15 +136,17 @@
},
/**
- * @return {uint} Number of listeners attached to the Signal.
+ * @return {number} Number of listeners attached to the Signal.
*/
getNumListeners : function(){
return this._bindings.length;
},
/**
- * Disable Signal, will block dispatch to listeners until `enable()` is called.
+ * Disable Signal. Block dispatch to listeners until `enable()` is called.
+ * <p><strong>IMPORTANT:</strong> If this method is called during a dispatch it will only have effect on the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>
* @see signals.Signal.prototype.enable
+ * @see signals.Signal.prototype.halt
*/
disable : function(){
this._isEnabled = false;
@@ -159,7 +169,8 @@
/**
* Stop propagation of the event, blocking the dispatch to next listeners on the queue.
- * - should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
+ * <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
+ * @see signals.Signal.prototype.disable
*/
halt : function(){
this._shouldPropagate = false;
@@ -170,23 +181,28 @@
* @param {...*} [params] Parameters that should be passed to each handler.
*/
dispatch : function(params){
- if(! this._isEnabled) return;
+ if(! this._isEnabled){
+ return;
+ }
var paramsArr = Array.prototype.slice.call(arguments),
bindings = this._bindings.slice(), //clone array in case add/remove items during dispatch
- i = 0,
- cur;
+ i,
+ n = this._bindings.length;
this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch.
- while(cur = bindings[i++]){
- if(cur.execute(paramsArr) === false || !this._shouldPropagate) break; //execute all callbacks until end of the list or until a callback returns `false` or stops propagation
+ for(i=0; i<n; i++){
+ //execute all callbacks until end of the list or until a callback returns `false` or stops propagation
+ if(bindings[i].execute(paramsArr) === false || !this._shouldPropagate){
+ break;
+ }
}
},
/**
- * Remove binding from signal and destroy any reference to external Objects (destroy Signal object).
- * <br /> - calling methods on the signal instance after calling dispose will throw errors.
+ * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
+ * <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
*/
dispose : function(){
this.removeAll();
View
24 dev/src/SignalBinding.js
@@ -1,16 +1,17 @@
/**
* Object that represents a binding between a Signal and a listener function.
- * <br />- <strong>Constructor shouldn't be called by regular user, used internally.</strong>
+ * <br />- <strong>This is an internall constructor and shouldn't be called by regular user.</strong>
* <br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
* @author Miller Medeiros
* @constructor
+ * @name signals.SignalBinding
+ * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
* @param {Function} listener Handler function bound to the signal.
* @param {boolean} isOnce If binding should be executed just once.
- * @param {?Object} listenerContext Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
+ * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
*/
- signals.SignalBinding = function(listener, isOnce, listenerContext, signal){
+ function SignalBinding(signal, listener, isOnce, listenerContext){
/**
* Handler function bound to the signal.
@@ -28,7 +29,9 @@
/**
* Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @type Object
+ * @memberOf signals.SignalBinding.prototype
+ * @name context
+ * @type {Object|undefined}
*/
this.context = listenerContext;
@@ -38,10 +41,9 @@
* @private
*/
this._signal = signal;
- };
-
+ }
- signals.SignalBinding.prototype = {
+ SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {
/**
* @type boolean
@@ -59,7 +61,9 @@
var r;
if(this._isEnabled){
r = this._listener.apply(this.context, paramsArr);
- if(this._isOnce) this.detach();
+ if(this._isOnce){
+ this.detach();
+ }
}
return r; //avoid warnings on some editors
},
@@ -82,7 +86,7 @@
/**
* Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).
- * <br /> - calling methods on the binding instance after calling dispose will throw errors.
+ * <p><strong>IMPORTANT:</strong> calling methods on the binding instance after calling dispose will throw errors.</p>
*/
dispose : function(){
this.detach();
View
12 dev/src/intro.js
@@ -1,8 +1,10 @@
+/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
+
/*!!
- * JS Signals <https://github.com/millermedeiros/js-signals>
- * Released under the MIT license (http://www.opensource.org/licenses/mit-license.php)
- * @author Miller Medeiros <http://millermedeiros.com>
+ * JS Signals <http://millermedeiros.github.com/js-signals/>
+ * Released under the MIT license <http://www.opensource.org/licenses/mit-license.php>
+ * @author Miller Medeiros <http://millermedeiros.com/>
* @version ::VERSION_NUMBER::
- * @build ::BUILD_NUMBER:: ::BUILD_DATE::
+ * @build ::BUILD_NUMBER:: (::BUILD_DATE::)
*/
-(function(){
+(function(window){
View
2 dev/src/outro.js
@@ -1 +1 @@
-}());
+}(this));
View
9 dev/src/signals.js
@@ -11,11 +11,4 @@
* @const
*/
signals.VERSION = '::VERSION_NUMBER::';
-
- /**
- * @param {*} param Parameter to check.
- * @return {boolean} `true` if parameter is different than `undefined`.
- */
- signals.isDef = function(param){
- return typeof param !== 'undefined';
- };
+
View
4 dist/docs/files.html
@@ -46,7 +46,7 @@ <h1 class="classTitle">File Index</h1>
<div class="member">
- <h2><a href="symbols/src/C__Miller_Personal_open_source_projects_js-signals_dist_js-signals.js.html">C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js</a></h2>
+ <h2><a href="symbols/src/_Users_millermedeiros_Documents_Projects__open_source_js-signals_dist_js-signals.js.html">/Users/millermedeiros/Documents/Projects/_open_source/js-signals/dist/js-signals.js</a></h2>
<dl>
@@ -61,7 +61,7 @@ <h1 class="classTitle">File Index</h1>
</div>
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
2 dist/docs/index.html
@@ -85,7 +85,7 @@ <h1 class="classTitle">Class Index</h1>
</div>
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
11 dist/docs/symbolindex.html
@@ -203,15 +203,6 @@ <h1 id="classTitle">Symbol Index</h1>
</tr>
<tr class="symbolEntry">
- <td class="symbolName">isDef</td>
- <td>
-
- <a href="symbols/signals.html#.isDef">signals.isDef</a>
-
- </td>
- </tr>
-
- <tr class="symbolEntry">
<td class="symbolName">isEnabled</td>
<td>
@@ -302,7 +293,7 @@ <h1 id="classTitle">Symbol Index</h1>
</div>
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
2 dist/docs/symbols/_global_.html
@@ -101,7 +101,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
41 dist/docs/symbols/signals.Signal.html
@@ -143,7 +143,7 @@ <h1 class="classTitle">
- <br /><i>Defined in: </i> <a href="../symbols/src/C__Miller_Personal_open_source_projects_js-signals_dist_js-signals.js.html">js-signals.js</a>.
+ <br /><i>Defined in: </i> <a href="../symbols/src/_Users_millermedeiros_Documents_Projects__open_source_js-signals_dist_js-signals.js.html">js-signals.js</a>.
</p>
@@ -159,7 +159,7 @@ <h1 class="classTitle">
</div>
<div class="description">
- <p>Signal - custom event broadcaster
+ <p>Custom event broadcaster
<br />- inspired by Robert Penner's AS3 Signals.</p>
<br /><i>Author: </i>Miller Medeiros.
</div>
@@ -193,7 +193,7 @@ <h1 class="classTitle">
<div class="fixedFont">
<div class="modifiers">
</div>
- <span class="light">{<a href="../symbols/signals.SignalBinding.html">signals.SignalBinding</a>}</span>
+ <span class="light">{SignalBinding}</span>
<b>add</b>(listener, scope)
</div>
@@ -230,7 +230,7 @@ <h1 class="classTitle">
<dl class="detailList">
<dt class="heading">Returns:</dt>
- <dd><span class="light fixedFont">{<a href="../symbols/signals.SignalBinding.html">signals.SignalBinding</a>}</span> An Object representing the binding between the Signal and listener.</dd>
+ <dd><span class="light fixedFont">{SignalBinding}</span> An Object representing the binding between the Signal and listener.</dd>
</dl>
@@ -244,7 +244,7 @@ <h1 class="classTitle">
<div class="fixedFont">
<div class="modifiers">
</div>
- <span class="light">{<a href="../symbols/signals.SignalBinding.html">signals.SignalBinding</a>}</span>
+ <span class="light">{SignalBinding}</span>
<b>addOnce</b>(listener, scope)
</div>
@@ -281,7 +281,7 @@ <h1 class="classTitle">
<dl class="detailList">
<dt class="heading">Returns:</dt>
- <dd><span class="light fixedFont">{<a href="../symbols/signals.SignalBinding.html">signals.SignalBinding</a>}</span> An Object representing the binding between the Signal and listener.</dd>
+ <dd><span class="light fixedFont">{SignalBinding}</span> An Object representing the binding between the Signal and listener.</dd>
</dl>
@@ -300,7 +300,9 @@ <h1 class="classTitle">
</div>
<div class="description">
- <p>Disable Signal, will block dispatch to listeners until <code>enable()</code> is called.</p>
+ <p>Disable Signal. Block dispatch to listeners until <code>enable()</code> is called.</p>
+
+<p><strong>IMPORTANT:</strong> If this method is called during a dispatch it will only have effect on the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>
</div>
@@ -319,6 +321,8 @@ <h1 class="classTitle">
<dd>signals.Signal.prototype.enable</dd>
+ <dd>signals.Signal.prototype.halt</dd>
+
</dl>
@@ -372,8 +376,9 @@ <h1 class="classTitle">
</div>
<div class="description">
- <p>Remove binding from signal and destroy any reference to external Objects (destroy Signal object).
-<br /> - calling methods on the signal instance after calling dispose will throw errors.</p>
+ <p>Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).</p>
+
+<p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
</div>
@@ -429,7 +434,7 @@ <h1 class="classTitle">
<div class="fixedFont">
<div class="modifiers">
</div>
- <span class="light">{uint}</span>
+ <span class="light">{number}</span>
<b>getNumListeners</b>()
</div>
@@ -449,7 +454,7 @@ <h1 class="classTitle">
<dl class="detailList">
<dt class="heading">Returns:</dt>
- <dd><span class="light fixedFont">{uint}</span> Number of listeners attached to the Signal.</dd>
+ <dd><span class="light fixedFont">{number}</span> Number of listeners attached to the Signal.</dd>
</dl>
@@ -468,8 +473,9 @@ <h1 class="classTitle">
</div>
<div class="description">
- <p>Stop propagation of the event, blocking the dispatch to next listeners on the queue.
-- should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
+ <p>Stop propagation of the event, blocking the dispatch to next listeners on the queue.</p>
+
+<p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
</div>
@@ -483,6 +489,13 @@ <h1 class="classTitle">
+ <dl class="detailList">
+ <dt class="heading">See:</dt>
+
+ <dd>signals.Signal.prototype.disable</dd>
+
+ </dl>
+
</div>
@@ -638,7 +651,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
31 dist/docs/symbols/signals.SignalBinding.html
@@ -140,7 +140,7 @@ <h1 class="classTitle">
- <br /><i>Defined in: </i> <a href="../symbols/src/C__Miller_Personal_open_source_projects_js-signals_dist_js-signals.js.html">js-signals.js</a>.
+ <br /><i>Defined in: </i> <a href="../symbols/src/_Users_millermedeiros_Documents_Projects__open_source_js-signals_dist_js-signals.js.html">js-signals.js</a>.
</p>
@@ -152,12 +152,12 @@ <h1 class="classTitle">
</div>
<div class="fixedFont">
- <b>signals.SignalBinding</b>(listener, isOnce, listenerContext, signal)
+ <b>signals.SignalBinding</b>(signal, listener, isOnce, listenerContext)
</div>
<div class="description">
<p>Object that represents a binding between a Signal and a listener function.
-<br />- <strong>Constructor shouldn't be called by regular user, used internally.</strong>
+<br />- <strong>This is an internall constructor and shouldn't be called by regular user.</strong>
<br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.</p>
<br /><i>Author: </i>Miller Medeiros.
</div>
@@ -170,6 +170,12 @@ <h1 class="classTitle">
<dt class="heading">Parameters:</dt>
<dt>
+ <span class="light fixedFont">{<a href="../symbols/signals.Signal.html">signals.Signal</a>}</span> <b>signal</b>
+
+ </dt>
+ <dd>Reference to Signal object that listener is currently bound to.</dd>
+
+ <dt>
<span class="light fixedFont">{Function}</span> <b>listener</b>
</dt>
@@ -182,17 +188,11 @@ <h1 class="classTitle">
<dd>If binding should be executed just once.</dd>
<dt>
- <span class="light fixedFont">{?Object}</span> <b>listenerContext</b>
-
+ <span class="light fixedFont">{Object}</span> <b>listenerContext</b>
+ <i>Optional</i>
</dt>
<dd>Context on which listener will be executed (object that should represent the `this` variable inside listener function).</dd>
- <dt>
- <span class="light fixedFont">{<a href="../symbols/signals.Signal.html">signals.Signal</a>}</span> <b>signal</b>
-
- </dt>
- <dd>Reference to Signal object that listener is currently bound to.</dd>
-
</dl>
@@ -218,7 +218,7 @@ <h1 class="classTitle">
<div class="modifiers">
</div>
- <span class="light">{Object}</span>
+
<b>context</b>
</div>
@@ -325,8 +325,9 @@ <h1 class="classTitle">
</div>
<div class="description">
- <p>Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).
-<br /> - calling methods on the binding instance after calling dispose will throw errors.</p>
+ <p>Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).</p>
+
+<p><strong>IMPORTANT:</strong> calling methods on the binding instance after calling dispose will throw errors.</p>
</div>
@@ -572,7 +573,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
65 dist/docs/symbols/signals.html
@@ -77,15 +77,6 @@
<!-- function summary -->
- <h3>Functions</h3>
- <ul>
-
- <li class="fixedFont">
- <a href="../symbols/signals.html#.isDef">isDef</a>
- </li>
-
- </ul>
-
<!-- end function summary -->
<!-- events summary -->
@@ -108,7 +99,7 @@ <h1 class="classTitle">
Signals Namespace - Custom event/messaging system based on AS3 Signals
- <br /><i>Defined in: </i> <a href="../symbols/src/C__Miller_Personal_open_source_projects_js-signals_dist_js-signals.js.html">js-signals.js</a>.
+ <br /><i>Defined in: </i> <a href="../symbols/src/_Users_millermedeiros_Documents_Projects__open_source_js-signals_dist_js-signals.js.html">js-signals.js</a>.
</p>
@@ -178,58 +169,6 @@ <h1 class="classTitle">
<!-- ============================== method details ========================= -->
- <div class="details">
- <div class="sectionTitle">
- Method Detail
- </div>
-
- <div class="member">
- <a name=".isDef"> </a>
- <div class="fixedFont">
- <div class="modifiers">&lt;static&gt;
- </div>
- <span class="light">{boolean}</span>
- <span class="light">signals.</span><b>isDef</b>(param)
-
- </div>
- <div class="description">
-
-
-
- </div>
-
-
-
-
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
-
- <dt>
- <span class="light fixedFont">{*}</span> <b>param</b>
-
- </dt>
- <dd>Parameter to check.</dd>
-
- </dl>
-
-
-
-
-
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
-
- <dd><span class="light fixedFont">{boolean}</span> `true` if parameter is different than `undefined`.</dd>
-
- </dl>
-
-
-
-
- </div>
-
- </div>
-
<!-- ============================== event details ========================= -->
@@ -240,7 +179,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both;text-align:center">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Dec 03 2010 17:27:36 GMT-0500 (EST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Sun Jan 30 2011 01:57:32 GMT-0500 (EST)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
381 ...cs/symbols/src/C__Miller_Personal_open_source_projects_js-signals_dist_js-signals.js.html
@@ -1,381 +0,0 @@
-<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
- .KEYW {color: #933;}
- .COMM {color: #bbb; font-style: italic;}
- .NUMB {color: #393;}
- .STRN {color: #393;}
- .REGX {color: #339;}
- .line {border-right: 1px dotted #666; color: #666; font-style: normal;}
- </style></head><body><pre><span class='line'> 1</span> <span class="COMM">/*!!
-<span class='line'> 2</span> * JS Signals &lt;https://github.com/millermedeiros/js-signals>
-<span class='line'> 3</span> * Released under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-<span class='line'> 4</span> * @author Miller Medeiros &lt;http://millermedeiros.com>
-<span class='line'> 5</span> * @version 0.5
-<span class='line'> 6</span> * @build 100 12/03/2010 05:27 PM
-<span class='line'> 7</span> */</span><span class="WHIT">
-<span class='line'> 8</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 11</span> * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals
-<span class='line'> 12</span> * @name signals
-<span class='line'> 13</span> */</span><span class="WHIT">
-<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">signals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.signals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 17</span> * Signals Version Number
-<span class='line'> 18</span> * @type string
-<span class='line'> 19</span> * @const
-<span class='line'> 20</span> */</span><span class="WHIT">
-<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">signals.VERSION</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'0.5'</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 24</span> * @param {*} param Parameter to check.
-<span class='line'> 25</span> * @return {boolean} `true` if parameter is different than `undefined`.
-<span class='line'> 26</span> */</span><span class="WHIT">
-<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">signals.isDef</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">param</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 30</span>
-<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 32</span> * Signal - custom event broadcaster
-<span class='line'> 33</span> * &lt;br />- inspired by Robert Penner's AS3 Signals.
-<span class='line'> 34</span> * @author Miller Medeiros
-<span class='line'> 35</span> * @constructor
-<span class='line'> 36</span> */</span><span class="WHIT">
-<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">signals.Signal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 39</span> * @type Array.&lt;signals.SignalBinding>
-<span class='line'> 40</span> * @private
-<span class='line'> 41</span> */</span><span class="WHIT">
-<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">this._bindings</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">signals.Signal.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 49</span> * @type boolean
-<span class='line'> 50</span> * @private
-<span class='line'> 51</span> */</span><span class="WHIT">
-<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">_shouldPropagate</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 55</span> * @type boolean
-<span class='line'> 56</span> * @private
-<span class='line'> 57</span> */</span><span class="WHIT">
-<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">_isEnabled</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 61</span> * @param {Function} listener
-<span class='line'> 62</span> * @param {boolean} isOnce
-<span class='line'> 63</span> * @param {Object} [scope]
-<span class='line'> 64</span> * @return {signals.SignalBinding}
-<span class='line'> 65</span> * @private
-<span class='line'> 66</span> */</span><span class="WHIT">
-<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">_registerListener</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isOnce</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">signals.isDef</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'listener is a required param of add() and addOnce().'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prevIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._indexOfListener</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">binding</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">prevIndex</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//avoid creating a new Binding for same listener if already added to list</span><span class="WHIT">
-<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">binding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._bindings</span><span class="PUNC">[</span><span class="NAME">prevIndex</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">binding.isOnce</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">isOnce</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'You cannot add'</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isOnce</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Once'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">'() then add'</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">isOnce</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Once'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">'() the same listener without removing the relationship first.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">binding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">signals.SignalBinding</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isOnce</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">this._addBinding</span><span class="PUNC">(</span><span class="NAME">binding</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">binding</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 88</span> * @param {signals.SignalBinding} binding
-<span class='line'> 89</span> * @private
-<span class='line'> 90</span> */</span><span class="WHIT">
-<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">_addBinding</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">binding</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">this._bindings.push</span><span class="PUNC">(</span><span class="NAME">binding</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'> 96</span> * @param {Function} listener
-<span class='line'> 97</span> * @return {int}
-<span class='line'> 98</span> * @private
-<span class='line'> 99</span> */</span><span class="WHIT">
-<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">_indexOfListener</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>101</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._bindings.length</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>102</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._bindings</span><span class="PUNC">[</span><span class="NAME">n</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">_listener</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'>105</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>106</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>107</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>108</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>109</span> * Add a listener to the signal.
-<span class='line'>110</span> * @param {Function} listener Signal handler function.
-<span class='line'>111</span> * @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
-<span class='line'>112</span> * @return {signals.SignalBinding} An Object representing the binding between the Signal and listener.
-<span class='line'>113</span> */</span><span class="WHIT">
-<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">add</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._registerListener</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>117</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>118</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>119</span> * Add listener to the signal that should be removed after first execution (will be executed only once).
-<span class='line'>120</span> * @param {Function} listener Signal handler function.
-<span class='line'>121</span> * @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
-<span class='line'>122</span> * @return {signals.SignalBinding} An Object representing the binding between the Signal and listener.
-<span class='line'>123</span> */</span><span class="WHIT">
-<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">addOnce</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._registerListener</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>127</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>128</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>129</span> * @private
-<span class='line'>130</span> */</span><span class="WHIT">
-<span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">_removeByIndex</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>132</span> </span><span class="WHIT"> </span><span class="NAME">this._bindings</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">_destroy</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//no reason to a SignalBinding exist if it isn't attached to a signal</span><span class="WHIT">
-<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">this._bindings.splice</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>135</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>136</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>137</span> * Remove a single listener from the dispatch queue.
-<span class='line'>138</span> * @param {Function} listener Handler function that should be removed.
-<span class='line'>139</span> * @return {Function} Listener handler function.
-<span class='line'>140</span> */</span><span class="WHIT">
-<span class='line'>141</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>142</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">signals.isDef</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'listener is a required param of remove().'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>143</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>144</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._indexOfListener</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>145</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this._removeByIndex</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>147</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>148</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>149</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>150</span> * Remove all listeners from the Signal.
-<span class='line'>151</span> */</span><span class="WHIT">
-<span class='line'>152</span> </span><span class="WHIT"> </span><span class="NAME">removeAll</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>153</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._bindings.length</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">this._removeByIndex</span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'>157</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>158</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>159</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>160</span> * @return {uint} Number of listeners attached to the Signal.
-<span class='line'>161</span> */</span><span class="WHIT">
-<span class='line'>162</span> </span><span class="WHIT"> </span><span class="NAME">getNumListeners</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>163</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._bindings.length</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>165</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>166</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>167</span> * Disable Signal, will block dispatch to listeners until `enable()` is called.
-<span class='line'>168</span> * @see signals.Signal.prototype.enable
-<span class='line'>169</span> */</span><span class="WHIT">
-<span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">disable</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>171</span> </span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>172</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>173</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>174</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>175</span> * Enable broadcast to listeners.
-<span class='line'>176</span> * @see signals.Signal.prototype.disable
-<span class='line'>177</span> */</span><span class="WHIT">
-<span class='line'>178</span> </span><span class="WHIT"> </span><span class="NAME">enable</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>180</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>181</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>182</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>183</span> * @return {boolean} If Signal is currently enabled and will broadcast message to listeners.
-<span class='line'>184</span> */</span><span class="WHIT">
-<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>186</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>187</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>188</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>189</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>190</span> * Stop propagation of the event, blocking the dispatch to next listeners on the queue.
-<span class='line'>191</span> * - should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
-<span class='line'>192</span> */</span><span class="WHIT">
-<span class='line'>193</span> </span><span class="WHIT"> </span><span class="NAME">halt</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>194</span> </span><span class="WHIT"> </span><span class="NAME">this._shouldPropagate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>195</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>196</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>197</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>198</span> * Dispatch/Broadcast Signal to all listeners added to the queue.
-<span class='line'>199</span> * @param {...*} [params] Parameters that should be passed to each handler.
-<span class='line'>200</span> */</span><span class="WHIT">
-<span class='line'>201</span> </span><span class="WHIT"> </span><span class="NAME">dispatch</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>202</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>203</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>204</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">paramsArr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Array.prototype.slice.call</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>205</span> </span><span class="WHIT"> </span><span class="NAME">bindings</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._bindings.slice</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">//clone array in case add/remove items during dispatch</span><span class="WHIT">
-<span class='line'>206</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">cur</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>208</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>209</span> </span><span class="WHIT"> </span><span class="NAME">this._shouldPropagate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//in case `halt` was called before dispatch or during the previous dispatch.</span><span class="WHIT">
-<span class='line'>210</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>211</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NAME">cur</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bindings</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>212</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">cur.execute</span><span class="PUNC">(</span><span class="NAME">paramsArr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this._shouldPropagate</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//execute all callbacks until end of the list or until a callback returns `false` or stops propagation</span><span class="WHIT">
-<span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'>214</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>215</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>216</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>217</span> * Remove binding from signal and destroy any reference to external Objects (destroy Signal object).
-<span class='line'>218</span> * &lt;br /> - calling methods on the signal instance after calling dispose will throw errors.
-<span class='line'>219</span> */</span><span class="WHIT">
-<span class='line'>220</span> </span><span class="WHIT"> </span><span class="NAME">dispose</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>221</span> </span><span class="WHIT"> </span><span class="NAME">this.removeAll</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>222</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this._bindings</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>223</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>224</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>225</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>226</span> * @return {string} String representation of the object.
-<span class='line'>227</span> */</span><span class="WHIT">
-<span class='line'>228</span> </span><span class="WHIT"> </span><span class="NAME">toString</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>229</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'[Signal isEnabled: '</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">' numListeners: '</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getNumListeners</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">']'</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>230</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'>231</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>232</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>233</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>234</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>235</span> * Object that represents a binding between a Signal and a listener function.
-<span class='line'>236</span> * &lt;br />- &lt;strong>Constructor shouldn't be called by regular user, used internally.&lt;/strong>
-<span class='line'>237</span> * &lt;br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
-<span class='line'>238</span> * @author Miller Medeiros
-<span class='line'>239</span> * @constructor
-<span class='line'>240</span> * @param {Function} listener Handler function bound to the signal.
-<span class='line'>241</span> * @param {boolean} isOnce If binding should be executed just once.
-<span class='line'>242</span> * @param {?Object} listenerContext Context on which listener will be executed (object that should represent the `this` variable inside listener function).
-<span class='line'>243</span> * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
-<span class='line'>244</span> */</span><span class="WHIT">
-<span class='line'>245</span> </span><span class="WHIT"> </span><span class="NAME">signals.SignalBinding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isOnce</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listenerContext</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">signal</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>246</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>247</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>248</span> * Handler function bound to the signal.
-<span class='line'>249</span> * @type Function
-<span class='line'>250</span> * @private
-<span class='line'>251</span> */</span><span class="WHIT">
-<span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">this._listener</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>253</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>254</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>255</span> * If binding should be executed just once.
-<span class='line'>256</span> * @type boolean
-<span class='line'>257</span> * @private
-<span class='line'>258</span> */</span><span class="WHIT">
-<span class='line'>259</span> </span><span class="WHIT"> </span><span class="NAME">this._isOnce</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isOnce</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>260</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>261</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>262</span> * Context on which listener will be executed (object that should represent the `this` variable inside listener function).
-<span class='line'>263</span> * @type Object
-<span class='line'>264</span> */</span><span class="WHIT">
-<span class='line'>265</span> </span><span class="WHIT"> </span><span class="NAME">this.context</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">listenerContext</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>266</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>267</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>268</span> * Reference to Signal object that listener is currently bound to.
-<span class='line'>269</span> * @type signals.Signal
-<span class='line'>270</span> * @private
-<span class='line'>271</span> */</span><span class="WHIT">
-<span class='line'>272</span> </span><span class="WHIT"> </span><span class="NAME">this._signal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">signal</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>273</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>274</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>275</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>276</span> </span><span class="WHIT"> </span><span class="NAME">signals.SignalBinding.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>277</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>278</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>279</span> * @type boolean
-<span class='line'>280</span> * @private
-<span class='line'>281</span> */</span><span class="WHIT">
-<span class='line'>282</span> </span><span class="WHIT"> </span><span class="NAME">_isEnabled</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>283</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>284</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>285</span> * Call listener passing arbitrary parameters.
-<span class='line'>286</span> * &lt;p>If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.&lt;/p>
-<span class='line'>287</span> * @param {Array} [paramsArr] Array of parameters that should be passed to the listener
-<span class='line'>288</span> * @return {*} Value returned by the listener.
-<span class='line'>289</span> */</span><span class="WHIT">
-<span class='line'>290</span> </span><span class="WHIT"> </span><span class="NAME">execute</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramsArr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>291</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>292</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._isEnabled</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>293</span> </span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._listener.apply</span><span class="PUNC">(</span><span class="NAME">this.context</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramsArr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>294</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._isOnce</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.detach</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>295</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'>296</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//avoid warnings on some editors</span><span class="WHIT">
-<span class='line'>297</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>298</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>299</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>300</span> * Detach binding from signal.
-<span class='line'>301</span> * - alias to: mySignal.remove(myBinding.getListener());
-<span class='line'>302</span> * @return {Function} Handler function bound to the signal.
-<span class='line'>303</span> */</span><span class="WHIT">
-<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">detach</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>305</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._signal.remove</span><span class="PUNC">(</span><span class="NAME">this._listener</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>306</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>307</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>308</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>309</span> * @return {Function} Handler function bound to the signal.
-<span class='line'>310</span> */</span><span class="WHIT">
-<span class='line'>311</span> </span><span class="WHIT"> </span><span class="NAME">getListener</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>312</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._listener</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>313</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>314</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>315</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>316</span> * Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).
-<span class='line'>317</span> * &lt;br /> - calling methods on the binding instance after calling dispose will throw errors.
-<span class='line'>318</span> */</span><span class="WHIT">
-<span class='line'>319</span> </span><span class="WHIT"> </span><span class="NAME">dispose</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">this.detach</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>321</span> </span><span class="WHIT"> </span><span class="NAME">this._destroy</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>322</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>323</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>324</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>325</span> * Delete all instance properties
-<span class='line'>326</span> * @private
-<span class='line'>327</span> */</span><span class="WHIT">
-<span class='line'>328</span> </span><span class="WHIT"> </span><span class="NAME">_destroy</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>329</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this._signal</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>330</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this._isOnce</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>331</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this._listener</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>332</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.context</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>333</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>334</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>335</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>336</span> * Disable SignalBinding, block listener execution. Listener will only be executed after calling `enable()`.
-<span class='line'>337</span> * @see signals.SignalBinding.enable()
-<span class='line'>338</span> */</span><span class="WHIT">
-<span class='line'>339</span> </span><span class="WHIT"> </span><span class="NAME">disable</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>340</span> </span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>341</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>342</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>343</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>344</span> * Enable SignalBinding. Enable listener execution.
-<span class='line'>345</span> * @see signals.SignalBinding.disable()
-<span class='line'>346</span> */</span><span class="WHIT">
-<span class='line'>347</span> </span><span class="WHIT"> </span><span class="NAME">enable</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>348</span> </span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>349</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>350</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>351</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>352</span> * @return {boolean} If SignalBinding is currently paused and won't execute listener during dispatch.
-<span class='line'>353</span> */</span><span class="WHIT">
-<span class='line'>354</span> </span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>355</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>356</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>357</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>358</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>359</span> * @return {boolean} If SignalBinding will only be executed once.
-<span class='line'>360</span> */</span><span class="WHIT">
-<span class='line'>361</span> </span><span class="WHIT"> </span><span class="NAME">isOnce</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>362</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._isOnce</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>363</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
-<span class='line'>364</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>365</span> </span><span class="WHIT"> </span><span class="COMM">/**
-<span class='line'>366</span> * @return {string} String representation of the object.
-<span class='line'>367</span> */</span><span class="WHIT">
-<span class='line'>368</span> </span><span class="WHIT"> </span><span class="NAME">toString</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
-<span class='line'>369</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'[SignalBinding isOnce: '</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this._isOnce</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">', isEnabled: '</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this._isEnabled</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">']'</span><span class="PUNC">;</span><span class="WHIT">
-<span class='line'>370</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
-<span class='line'>371</span> </span><span class="WHIT"> </span><span class="WHIT">
-<span class='line'>372</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">