From a111eaa876a95a3491cc94a8a2c16c3c7aa3c6cc Mon Sep 17 00:00:00 2001 From: Jim Cowart Date: Tue, 20 Mar 2012 02:42:48 -0400 Subject: [PATCH] Updated build artifacts --- example/amd/js/libs/postal/postal.js | 2 +- example/standard/js/postal.js | 2 +- .../standard/postal.diagnostics.min.gz.js | Bin 307 -> 307 bytes lib/browser/standard/postal.js | 2 +- lib/browser/standard/postal.min.gz.js | Bin 1651 -> 1660 bytes lib/browser/standard/postal.min.js | 2 +- lib/node/postal.js | 2 +- src/main/ChannelDefinition.js | 2 +- 8 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/amd/js/libs/postal/postal.js b/example/amd/js/libs/postal/postal.js index 313dfc6..0f3e2dd 100644 --- a/example/amd/js/libs/postal/postal.js +++ b/example/amd/js/libs/postal/postal.js @@ -56,7 +56,7 @@ ChannelDefinition.prototype = { }, publish: function(data, envelope) { - var env = envelope || {}; + var env = (Object.prototype.toString.call(envelope) === "[object String]") ? { topic: envelope } : envelope || {}; env.channel = this.channel; env.timeStamp = new Date(); env.topic = env.topic || this.topic; diff --git a/example/standard/js/postal.js b/example/standard/js/postal.js index 313dfc6..0f3e2dd 100644 --- a/example/standard/js/postal.js +++ b/example/standard/js/postal.js @@ -56,7 +56,7 @@ ChannelDefinition.prototype = { }, publish: function(data, envelope) { - var env = envelope || {}; + var env = (Object.prototype.toString.call(envelope) === "[object String]") ? { topic: envelope } : envelope || {}; env.channel = this.channel; env.timeStamp = new Date(); env.topic = env.topic || this.topic; diff --git a/lib/browser/standard/postal.diagnostics.min.gz.js b/lib/browser/standard/postal.diagnostics.min.gz.js index b4fe75f7a1e4e7170a668685d808f05bc4f294f2..ce0d3c9925f7b2e1bf2c41dba0c9cd255b7213f5 100644 GIT binary patch delta 15 WcmdnYw3&%bzMF&LiP}asT}A*Sxdajb delta 15 WcmdnYw3&%bzMF%=NOdEdE+YURhyz~$ diff --git a/lib/browser/standard/postal.js b/lib/browser/standard/postal.js index 313dfc6..0f3e2dd 100644 --- a/lib/browser/standard/postal.js +++ b/lib/browser/standard/postal.js @@ -56,7 +56,7 @@ ChannelDefinition.prototype = { }, publish: function(data, envelope) { - var env = envelope || {}; + var env = (Object.prototype.toString.call(envelope) === "[object String]") ? { topic: envelope } : envelope || {}; env.channel = this.channel; env.timeStamp = new Date(); env.topic = env.topic || this.topic; diff --git a/lib/browser/standard/postal.min.gz.js b/lib/browser/standard/postal.min.gz.js index 2ac0cb51b37720b6c7d965685842fb83a837ecf2..d01661180a344e3410f62208f75c2c84211d7a32 100644 GIT binary patch delta 1590 zcmV-62FdyJ4EziRABzY8<0g>?J%6{~x#LAu%2k}D9>olEv{U!F%pym~C{86IZny5v zX6>9$x8kz>=`GzV6|yLKR!Db+dszbQ3aP3hb+{)mNJcdZxJUi}%)nEdxWppk)mEko zk3nEKenSgK68D9RBl7bcugM&5h?{4nqKS)R(w{)P8h^2e`Xmd@_5D0=7k>mfTXbvG zkIPT0h|@K!UV4IXLI}f*a1_8uFTeX*(Zu5b8K$YvlMEis5yEGpuJJXoaRYVmCZBI; zn#zRG{a)f`MrC=-3ES^ow+^rUyvS6hSth%(VkIwPCW8rnN@%fes44wKrfanc1*Yehs7int$+ioELFc#Oj_z zW<5(wRnQnnYoNX^3VQF&QMXD6-(>xEDyi$ez+X|)RpV^#NOz}icxuD}+vN`cADbqs41 z2jb%rqLO?aDf<>Up`8vw$dgtAB7bKw$k|q>YwJdd1%Rcg^Gz0+?}n{2 zj%^F;7)G@?k74SwI2E2nL$monQSGx38Zk1Mt973HG|!WJ&$izoav&_co}+l3LV|c( zW29dD@S@AS2^;BRdqpU;6G&@=D1m<7b-k--bEE_?4MmKjH-9gajF)JTU%|r9bYy z)EDN;Hi6qv5_KLd8|oEEP%8PJYEb4% zOAT!r-jW>$%aZ|=a6H@Qw2+e;1ArN6ux-g!v)O34q$^X>oXrg)9W(xv>vwm#=l<)S zQ%D7QLcs=JeD+_gvHSV6?;>mRxt{c&+jBqYspad7e=xoHhUXW*tb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/postal.min.js index 316f540..e70d1e7 100644 --- a/lib/browser/standard/postal.min.js +++ b/lib/browser/standard/postal.min.js @@ -1 +1 @@ -(function(a,b,c){typeof define=="function"&&define.amd?define(["underscore"],function(d){return c(d,a,b)}):c(a._,a,b)})(this,document,function(a,b,c,d){var e="/",f=50,g=0,h="postal",i=function(){},j=function(){var b;return function(c){var d=!1;return a.isString(c)?(d=c===b,b=c):(d=a.isEqual(c,b),b=a.clone(c)),!d}},k=function(a,b){this.channel=a||e,this.topic=b||""};k.prototype={subscribe:function(){var a=arguments.length;if(a===1)return new l(this.channel,this.topic,arguments[0]);if(a===2)return new l(this.channel,arguments[0],arguments[1])},publish:function(a,b){var c=b||{};c.channel=this.channel,c.timeStamp=new Date,c.topic=c.topic||this.topic,p.configuration.bus.publish(a,c)}};var l=function(a,b,c){this.channel=a,this.topic=b,this.callback=c,this.priority=f,this.constraints=new Array(0),this.maxCalls=g,this.onHandled=i,this.context=null,p.publish({event:"subscription.created",channel:a,topic:b},{channel:h,topic:"subscription.created"}),p.configuration.bus.subscribe(this)};l.prototype={unsubscribe:function(){p.configuration.bus.unsubscribe(this),p.publish({event:"subscription.removed",channel:this.channel,topic:this.topic},{channel:h,topic:"subscription.removed"})},defer:function(){var a=this.callback;return this.callback=function(b){setTimeout(a,0,b)},this},disposeAfter:function(b){if(a.isNaN(b)||b<=0)throw"The value provided to disposeAfter (maxCalls) must be a number greater than zero.";var c=this.onHandled,d=a.after(b,a.bind(function(){this.unsubscribe(this)},this));return this.onHandled=function(){c.apply(this.context,arguments),d()},this},ignoreDuplicates:function(){return this.withConstraint(new j),this},whenHandledThenExecute:function(b){if(!a.isFunction(b))throw"Value provided to 'whenHandledThenExecute' must be a function";return this.onHandled=b,this},withConstraint:function(b){if(!a.isFunction(b))throw"Predicate constraint must be a function";return this.constraints.push(b),this},withConstraints:function(b){var c=this;return a.isArray(b)&&a.each(b,function(a){c.withConstraint(a)}),c},withContext:function(a){return this.context=a,this},withDebounce:function(b){if(a.isNaN(b))throw"Milliseconds must be a number";var c=this.callback;return this.callback=a.debounce(c,b),this},withDelay:function(b){if(a.isNaN(b))throw"Milliseconds must be a number";var c=this.callback;return this.callback=function(a){setTimeout(c,b,a)},this},withPriority:function(b){if(a.isNaN(b))throw"Priority must be a number";return this.priority=b,this},withThrottle:function(b){if(a.isNaN(b))throw"Milliseconds must be a number";var c=this.callback;return this.callback=a.throttle(c,b),this}};var m={cache:{},compare:function(a,b){if(this.cache[b]&&this.cache[b][a])return!0;var c=new RegExp("^"+a.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/#/g,"[A-Z,a-z,0-9]*")+"$"),d=c.test(b);return d&&(this.cache[b]||(this.cache[b]={}),this.cache[b][a]=!0),d}},n={subscriptions:{},wireTaps:new Array(0),publish:function(b,c){a.each(this.wireTaps,function(a){a(b,c)}),a.each(this.subscriptions[c.channel],function(d){a.each(d,function(d){p.configuration.resolver.compare(d.topic,c.topic)&&a.all(d.constraints,function(a){return a(b)})&&typeof d.callback=="function"&&(d.callback.apply(d.context,[b,c]),d.onHandled())})})},subscribe:function(a){var b,c,d,e=this.subscriptions[a.channel],f;e||(e=this.subscriptions[a.channel]={}),f=this.subscriptions[a.channel][a.topic],f||(f=this.subscriptions[a.channel][a.topic]=new Array(0)),b=f.length-1;for(;b>=0;b--)if(f[b].priority<=a.priority){f.splice(b+1,0,a),c=!0;break}return c||f.unshift(a),a},unsubscribe:function(a){if(this.subscriptions[a.channel][a.topic]){var b=this.subscriptions[a.channel][a.topic].length,c=0;for(;c=0;b--)if(f[b].priority<=a.priority){f.splice(b+1,0,a),c=!0;break}return c||f.unshift(a),a},unsubscribe:function(a){if(this.subscriptions[a.channel][a.topic]){var b=this.subscriptions[a.channel][a.topic].length,c=0;for(;c