Permalink
Browse files

expose Signal constructor instead of NS and bump version to 0.8.0 - c…

…loses #44
  • Loading branch information...
1 parent 9d2f265 commit 2aa2080370808c4c707c8f01350ff2ac2bb44f56 @millermedeiros committed Jul 31, 2012
View
@@ -1,6 +1,13 @@
# JS-Signals Changelog #
+## v0.8.0 (2012/07/31) ##
+
+ - expose Signal constructor for brevity instead of namespace while still
+ keeping an alias for backwards compatibility. (#44)
+
+
+
## v0.7.4 (2012/02/24) ##
### Fixes ###
View
@@ -29,7 +29,6 @@
</tstamp>
<loadfile property="license.txt" srcFile="${src.dir}/license.txt"/>
- <loadfile property="signals.js" srcFile="${src.dir}/signals.js"/>
<loadfile property="SignalBinding.js" srcFile="${src.dir}/SignalBinding.js"/>
<loadfile property="Signal.js" srcFile="${src.dir}/Signal.js"/>
@@ -38,7 +37,6 @@
<replace>
<fileset dir="${dist.dir}" includes="${dist.name}" />
<replacefilter token="//::LICENSE:://" value="${license.txt}" />
- <replacefilter token="//::SIGNALS_JS:://" value="${signals.js}" />
<replacefilter token="//::SIGNAL_BINDING_JS:://" value="${SignalBinding.js}" />
<replacefilter token="//::SIGNAL_JS:://" value="${Signal.js}" />
<!-- version number, build number/date should come after other replaces -->
View
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Fri Feb 24 22:30:44 BRST 2012
-build.number=253
+#Tue Jul 31 10:58:42 BRT 2012
+build.number=265
@@ -9,7 +9,7 @@ jsdoc-toolkit.dir = ${build.dir}/jsdoc-toolkit
jslint.jar = ${build.dir}/jslint4java/jslint4java-1.4.6.jar
product.name = signals
-version.number = 0.7.4
+version.number = 0.8.0
dist.name = ${product.name}.js
dist.min.name = ${product.name}.min.js
View
@@ -1,4 +1,4 @@
-/*global signals:false, SignalBinding:false*/
+/*global SignalBinding:false*/
// Signal --------------------------------------------------------
//================================================================
@@ -12,19 +12,27 @@
/**
* Custom event broadcaster
* <br />- inspired by Robert Penner's AS3 Signals.
+ * @name Signal
* @author Miller Medeiros
* @constructor
*/
- signals.Signal = function () {
+ function Signal() {
/**
* @type Array.<SignalBinding>
* @private
*/
this._bindings = [];
this._prevParams = null;
- };
+ }
- signals.Signal.prototype = {
+ Signal.prototype = {
+
+ /**
+ * Signals Version Number
+ * @type String
+ * @const
+ */
+ VERSION : '::VERSION_NUMBER::',
/**
* If Signal should keep record of previously dispatched parameters and
@@ -177,7 +185,7 @@
/**
* Stop propagation of the event, blocking the dispatch to next listeners on the queue.
* <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
+ * @see Signal.prototype.disable
*/
halt : function () {
this._shouldPropagate = false;
@@ -215,7 +223,7 @@
/**
* Forget memorized arguments.
- * @see signals.Signal.memorize
+ * @see Signal.memorize
*/
forget : function(){
this._prevParams = null;
@@ -239,3 +247,22 @@
}
};
+
+
+ // Namespace -----------------------------------------------------
+ //================================================================
+
+ /**
+ * Signals namespace
+ * @namespace
+ * @name signals
+ */
+ var signals = Signal;
+
+ /**
+ * Custom event broadcaster
+ * @see Signal
+ */
+ // alias for backwards compatibility (see #gh-44)
+ signals.Signal = Signal;
+
View
@@ -8,8 +8,8 @@
* @author Miller Medeiros
* @constructor
* @internal
- * @name signals.SignalBinding
- * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
+ * @name SignalBinding
+ * @param {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).
@@ -33,15 +33,15 @@
/**
* Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @memberOf signals.SignalBinding.prototype
+ * @memberOf SignalBinding.prototype
* @name context
* @type Object|undefined|null
*/
this.context = listenerContext;
/**
* Reference to Signal object that listener is currently bound to.
- * @type signals.Signal
+ * @type Signal
* @private
*/
this._signal = signal;
@@ -54,7 +54,7 @@
this._priority = priority || 0;
}
- SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {
+ SignalBinding.prototype = {
/**
* If binding is active and should be executed.
View
@@ -1,12 +0,0 @@
- /**
- * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals
- * @name signals
- */
- var signals = /** @lends signals */{
- /**
- * Signals Version Number
- * @type String
- * @const
- */
- VERSION : '::VERSION_NUMBER::'
- };
View
@@ -1,11 +1,9 @@
/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
-/*global define:false, require:false, exports:false, module:false*/
+/*global define:false, require:false, exports:false, module:false, signals:false */
//::LICENSE:://
(function(global){
-//::SIGNALS_JS:://
-
//::SIGNAL_BINDING_JS:://
//::SIGNAL_JS:://
@@ -17,6 +15,7 @@
module.exports = signals;
} else { //browser
//use string because of Google closure compiler ADVANCED_MODE
+ /*jslint sub:true */
global['signals'] = signals;
}
View
@@ -65,6 +65,10 @@ YUI().use('node', 'console', 'test', function (Y){
Y.Assert.areSame(0, s.getNumListeners());
},
+ testAlias : function(){
+ Y.Assert.areSame( signals, signals.Signal );
+ },
+
//-------------------------- Add ---------------------------------------//
testAddSingle : function(){
View
@@ -31,11 +31,11 @@ <h2>Classes</h2>
<li><i><a href="symbols/_global_.html">_global_</a></i></li>
- <li><a href="symbols/signals.html">signals</a></li>
+ <li><a href="symbols/Signal.html">Signal</a></li>
- <li><a href="symbols/signals.Signal.html">signals.Signal</a></li>
+ <li><a href="symbols/SignalBinding.html">SignalBinding</a></li>
- <li><a href="symbols/signals.SignalBinding.html">signals.SignalBinding</a></li>
+ <li><a href="symbols/signals.html">signals</a></li>
</ul>
@@ -61,7 +61,7 @@ <h2><a href="symbols/src/_Users_millermedeiros_Projects__open_source_js-signals_
</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 Feb 24 2012 22:30:52 GMT-0200 (BRST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Jul 31 2012 10:58:48 GMT-0300 (BRT)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
View
@@ -30,11 +30,11 @@ <h2>Classes</h2>
<li><i><a href="symbols/_global_.html">_global_</a></i></li>
- <li><a href="symbols/signals.html">signals</a></li>
+ <li><a href="symbols/Signal.html">Signal</a></li>
- <li><a href="symbols/signals.Signal.html">signals.Signal</a></li>
+ <li><a href="symbols/SignalBinding.html">SignalBinding</a></li>
- <li><a href="symbols/signals.SignalBinding.html">signals.SignalBinding</a></li>
+ <li><a href="symbols/signals.html">signals</a></li>
</ul>
@@ -56,27 +56,27 @@ <h2><a href="symbols/_global_.html">_global_</a></h2>
<div class="member">
<div class="fixedFont modifiers" style="float:right">
- Namespace
+ Class
</div>
- <h2><a href="symbols/signals.html">signals</a></h2>
- Signals Namespace - Custom event/messaging system based on AS3 Signals
+ <h2><a href="symbols/Signal.html">Signal</a></h2>
+
</div>
<div class="member">
<div class="fixedFont modifiers" style="float:right">
Class
</div>
- <h2><a href="symbols/signals.Signal.html">signals.Signal</a></h2>
+ <h2><a href="symbols/SignalBinding.html">SignalBinding</a></h2>
</div>
<div class="member">
<div class="fixedFont modifiers" style="float:right">
- Class
+ Namespace
</div>
- <h2><a href="symbols/signals.SignalBinding.html">signals.SignalBinding</a></h2>
+ <h2><a href="symbols/signals.html">signals</a></h2>
</div>
@@ -85,7 +85,7 @@ <h2><a href="symbols/signals.SignalBinding.html">signals.SignalBinding</a></h2>
</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 Feb 24 2012 22:30:52 GMT-0200 (BRST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Jul 31 2012 10:58:48 GMT-0300 (BRT)
| template based on Steffen Siering <a href="http://github.com/urso/jsdoc-simple">jsdoc-simple</a>.
</div>
</body>
Oops, something went wrong.

0 comments on commit 2aa2080

Please sign in to comment.