Permalink
Browse files

Merge branch 'release-0.6.0'

  • Loading branch information...
2 parents e7f0a3c + 574bb08 commit 8b30133864d2d73445f49c0fb823962520c86cd1 @millermedeiros committed Apr 9, 2011
View
@@ -2,6 +2,29 @@
+## v0.6 (2011/04/09) ##
+
+### API changes ###
+
+ - Added:
+ - `Signal.active`
+ - `SignalBinding.active`
+
+ - Removed:
+ - `Signal.protytpe.enable()`
+ - `Signal.protytpe.disable()`
+ - `Signal.protytpe.isEnabled()`
+ - `SignalBinding.protytpe.enable()`
+ - `SignalBinding.protytpe.disable()`
+ - `SignalBinding.protytpe.isEnabled()`
+
+### Other ###
+
+ - created AMD wrapped version.
+ - switched from "module pattern" to a closure with a global export.
+
+
+
## v0.5.3 (2011/02/21) ##
### API changes ###
@@ -48,7 +71,7 @@
- Added:
- `SignalBinding.prototype.getListener()` (issue #3)
- - `Signal.dispose()` (issue #6)
+ - `Signal.prototype.dispose()` (issue #6)
- `signals.VERSION`
- `signals.isDef()`
View
@@ -19,6 +19,16 @@ For a more in-depth introduction read the [JS-Signals Project Page](http://mille
* [MIT License](http://www.opensource.org/licenses/mit-license.php)
+## Distribution Files ##
+
+Files inside `dist` folder.
+
+ * docs/index.html : Documentation.
+ * js-signals.js : Uncompressed source code with comments.
+ * js-signals.amd.js : Uncompressed source code wrapped as an [asynchronous module](http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition) to be used together with [RequireJS](http://requirejs.org/).
+ * js-signals.min.js : Compressed code.
+
+
## Repository Structure ##
### Folder Structure ###
@@ -44,6 +54,6 @@ This project uses [Apache Ant](http://ant.apache.org/) for the build process. If
ant build
-This will delete all JS files inside the `dist` folder, merge/update/compress source files (`dev/src`), validate generated code using [JSLint](http://www.jslint.com/) and copy the output to the `dist` folder.
+This will delete all JS files inside the `dist` folder, merge/update/compress source files, validate generated code using [JSLint](http://www.jslint.com/) and copy the output to the `dist` folder.
**IMPORTANT:** `dist` folder always contain the latest version, regular users should **not** need to run build task.
View
@@ -12,7 +12,7 @@
<target name="-purgeJsDeploy">
<delete>
- <fileset dir="${dist.dir}" includes="${dist.name} ${dist.min.name}" />
+ <fileset dir="${dist.dir}" includes="${dist.name} ${dist.min.name} ${dist.amd.name}" />
</delete>
</target>
@@ -25,20 +25,28 @@
<format property="build.date" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
</tstamp>
- <copy file="${src.dir}/signals.js" tofile="${dist.dir}/${dist.name}" />
+ <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"/>
- <replace file="${dist.dir}/${dist.name}">
+ <copy file="${src.dir}/wrapper_closure.js" tofile="${dist.dir}/${dist.name}" />
+ <copy file="${src.dir}/wrapper_amd.js" tofile="${dist.dir}/${dist.amd.name}" />
+
+ <replace>
+ <fileset dir="${dist.dir}" includes="${dist.name} ${dist.amd.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 -->
<replacefilter token="::VERSION_NUMBER::" value="${version.number}" />
<replacefilter token="::BUILD_NUMBER::" value="${build.number}" />
<replacefilter token="::BUILD_DATE::" value="${build.date}" />
- <replacefilter token="//::SIGNAL_BINDING_JS:://" value="${SignalBinding.js}" />
- <replacefilter token="//::SIGNAL_JS:://" value="${Signal.js}" />
</replace>
<echo message="${dist.name} built." />
- </target>
+ </target>
<target name="lint">
<echo message="JSLinting ${dist.name}..."/>
View
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Mon Feb 21 19:18:50 EST 2011
-build.number=144
+#Sat Apr 09 17:27:18 BRT 2011
+build.number=175
@@ -11,8 +11,9 @@ jslint.jar = ${build.dir}/jslint4java/jslint4java-1.4.6.jar
yuitest-coverage.jar = ${build.dir}/yuitest-coverage/yuitest-coverage-0.5.5.jar
yuitest-coverage-report.jar = ${build.dir}/yuitest-coverage/yuitest-coverage-report-0.5.5.jar
product.name = js-signals
-version.number = 0.5.3
+version.number = 0.6
dist.name = ${product.name}.js
+dist.amd.name = ${product.name}.amd.js
dist.min.name = ${product.name}.min.js
dist.inst.name = ${product.name}.inst.js
coverage.json = ${coverage.dir}/coverage.json
View
@@ -26,10 +26,11 @@
_shouldPropagate : true,
/**
+ * If Signal is active and should broadcast events.
+ * <p><strong>IMPORTANT:</strong> Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>
* @type boolean
- * @private
*/
- _isEnabled : true,
+ active : true,
/**
* @param {Function} listener
@@ -146,31 +147,6 @@
},
/**
- * 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;
- },
-
- /**
- * Enable broadcast to listeners.
- * @see signals.Signal.prototype.disable
- */
- enable : function(){
- this._isEnabled = true;
- },
-
- /**
- * @return {boolean} If Signal is currently enabled and will broadcast message to listeners.
- */
- isEnabled : function(){
- return this._isEnabled;
- },
-
- /**
* 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
@@ -184,7 +160,7 @@
* @param {...*} [params] Parameters that should be passed to each handler.
*/
dispatch : function(params){
- if(! this._isEnabled){
+ if(! this.active){
return;
}
@@ -212,7 +188,7 @@
* @return {string} String representation of the object.
*/
toString : function(){
- return '[Signal isEnabled: '+ this._isEnabled +' numListeners: '+ this.getNumListeners() +']';
+ return '[Signal active: '+ this.active +' numListeners: '+ this.getNumListeners() +']';
}
};
View
@@ -35,7 +35,7 @@
* Context on which listener will be executed (object that should represent the `this` variable inside listener function).
* @memberOf signals.SignalBinding.prototype
* @name context
- * @type {Object|undefined}
+ * @type Object|undefined|null
*/
this.context = listenerContext;
@@ -57,10 +57,10 @@
SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {
/**
+ * If binding is active and should be executed.
* @type boolean
- * @private
*/
- _isEnabled : true,
+ active : true,
/**
* Call listener passing arbitrary parameters.
@@ -70,7 +70,7 @@
*/
execute : function(paramsArr){
var r;
- if(this._isEnabled){
+ if(this.active){
r = this._listener.apply(this.context, paramsArr);
if(this._isOnce){
this.detach();
@@ -116,29 +116,6 @@
},
/**
- * Disable SignalBinding, block listener execution. Listener will only be executed after calling `enable()`.
- * @see signals.SignalBinding.enable()
- */
- disable : function(){
- this._isEnabled = false;
- },
-
- /**
- * Enable SignalBinding. Enable listener execution.
- * @see signals.SignalBinding.disable()
- */
- enable : function(){
- this._isEnabled = true;
- },
-
- /**
- * @return {boolean} If SignalBinding is currently paused and won't execute listener during dispatch.
- */
- isEnabled : function(){
- return this._isEnabled;
- },
-
- /**
* @return {boolean} If SignalBinding will only be executed once.
*/
isOnce : function(){
@@ -149,7 +126,7 @@
* @return {string} String representation of the object.
*/
toString : function(){
- return '[SignalBinding isOnce: '+ this._isOnce +', isEnabled: '+ this._isEnabled +']';
+ return '[SignalBinding isOnce: '+ this._isOnce +', active: '+ this.active +']';
}
};
View
@@ -0,0 +1,7 @@
+/*!!
+ * 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::)
+ */
View
@@ -1,31 +1,12 @@
-/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
-
-/*!!
- * 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::)
- */
-
-/**
- * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals
- */
-var signals = (function(){
-
+ /**
+ * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals
+ * @name signals
+ */
var signals = /** @lends signals */{
/**
* Signals Version Number
- * @type string
+ * @type String
* @const
*/
VERSION : '::VERSION_NUMBER::'
- };
-
-//::SIGNAL_BINDING_JS:://
-
-//::SIGNAL_JS:://
-
- return signals;
-
-}());
+ };
View
@@ -0,0 +1,14 @@
+/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
+/*global define:false*/
+
+//::LICENSE:://
+define(function(){
+
+//::SIGNALS_JS:://
+
+//::SIGNAL_BINDING_JS:://
+
+//::SIGNAL_JS:://
+
+ return signals;
+});
View
@@ -0,0 +1,15 @@
+/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
+/*global window:false, global:false*/
+
+//::LICENSE:://
+(function(global){
+
+//::SIGNALS_JS:://
+
+//::SIGNAL_BINDING_JS:://
+
+//::SIGNAL_JS:://
+
+ global.signals = signals;
+
+}(window || global || this));
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 8b30133

Please sign in to comment.