Permalink
Browse files

Updated minified version.

  • Loading branch information...
1 parent 4cca25b commit d2b738dd7fe17a97c1d50ca6cb3566bbf9ab326b @efeminella committed Apr 18, 2012
Showing with 12 additions and 14 deletions.
  1. +4 −6 build/build.js
  2. +8 −8 src/backbone-eventbroker.js
View
@@ -5,26 +5,24 @@ var parser = require( 'uglify-js' ).parser,
src = '../src/backbone-eventbroker.js',
built = '../backbone-eventbroker-min.js';
-var _build = function()
+var _build = function()
{
console.log( 'Loading ' + src );
- fs.readFile( src, 'utf8', function ( error, data )
- {
+ fs.readFile( src, 'utf8', function ( error, data ) {
if ( error ) {
return console.log( 'Error' + error );
}
_write( _minify( data ) );
});
};
-var _minify = function( source )
-{
+var _minify = function( source ) {
var ast = uglify.ast_squeeze( uglify.ast_mangle( parser.parse( source ) ) );
return uglify.gen_code( ast );
};
-var _write = function( min )
+var _write = function( min )
{
fs.writeFile( built, min, function( error ) {
if ( error ) {
@@ -23,21 +23,21 @@
var _registration = function( interests, context, broker, method )
{
if ( !context && interests.interests ) {
- context = interests;
- interests = interests.interests;
+ context = interests;
+ interests = interests.interests;
}
for ( var event in interests ) {
- broker[ method ]( event, context[ interests[event] ], context );
+ broker[ method ]( event, context[ interests[event] ], context );
}
return broker;
};
/*
- * Defines an Event registry API which allows for registering and unregistering
- * multiple events/callbacks. The API is similar to Backbone.Events.on in that
- * it maps events to callbacks as well as a context. The main difference is that
- * mutliple event / callback mappings can be created as one-to-one mappings for
- * a given context.
+ * Defines an Event registry which allows for registering and unregistering
+ * multiple events/callbacks. This API is similar to Backbone.Events.on in
+ * that it maps events to callbacks as well as a context. The main difference
+ * is that mutliple event / callback mappings can be created as one-to-one
+ * mappings for a given context.
*/
var EventRegistry =
{

0 comments on commit d2b738d

Please sign in to comment.