Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit a69dc7c

Browse files
committed
Release 1.0.0
1 parent 87ff682 commit a69dc7c

File tree

4 files changed

+50
-21
lines changed

4 files changed

+50
-21
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<a name="1.0.0"></a>
2+
## 1.0.0 (2015-03-01)
3+
4+
5+
#### Bug Fixes
6+
7+
* **protractor-$timeout:** use $interval service for reply timeouts so protractor tests can continue ([eed05bd9](http://github.com/knalli/angular-vertxbus/commit/eed05bd91a1aa5da2df00295653747147c9eb5d1))
8+
* **service:** avoid duplicate broadcast events for (dis)connected ([0f56411d](http://github.com/knalli/angular-vertxbus/commit/0f56411df70d754a7722427169f8150aef5e5d2b))
9+
* **wrapper:** avoid invalid host+port combination (CORS) ([e29def5d](http://github.com/knalli/angular-vertxbus/commit/e29def5dca9a476dcc829e7cdc68839d5711c59e), closes [#39](http://github.com/knalli/angular-vertxbus/issues/39))
10+
11+
112
<a name="0.11.2"></a>
213
### 0.11.2 (2015-01-16)
314

dist/angular-vertxbus.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-vertxbus - v0.11.2 - 2015-01-16
1+
/*! angular-vertxbus - v1.0.0 - 2015-03-01
22
* http://github.com/knalli/angular-vertxbus
33
* Copyright (c) 2015 ; Licensed */
44
(function() {
@@ -31,7 +31,7 @@
3131
enabled: true,
3232
debugEnabled: false,
3333
prefix: 'vertx-eventbus.',
34-
urlServer: "" + location.protocol + "//" + location.hostname + ":" + (location.port || 80),
34+
urlServer: "" + location.protocol + "//" + location.hostname + (location.port ? ':' + location.port : ''),
3535
urlPath: '/eventbus',
3636
reconnectEnabled: true,
3737
sockjsStateInterval: 10000,
@@ -419,19 +419,25 @@
419419
return this;
420420
};
421421
this.skipUnauthorizeds.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": provider.skipUnauthorizeds";
422-
this.$get = ['$rootScope', '$q', '$interval', '$timeout', 'vertxEventBus', '$log', function($rootScope, $q, $interval, $timeout, vertxEventBus, $log) {
423-
var callbackMap, connectionIntervalCheck, connectionState, debugEnabled, enabled, ensureOpenAuthConnection, ensureOpenConnection, loginPromise, messageBuffer, messageQueue, prefix, reconnectEnabled, sockjsOptions, sockjsReconnectInterval, sockjsStateInterval, urlPath, urlServer, util, validSession, wrapped, _ref, _ref1;
422+
this.$get = ['$rootScope', '$q', '$interval', 'vertxEventBus', '$log', function($rootScope, $q, $interval, vertxEventBus, $log) {
423+
var callbackMap, connectionIntervalCheck, connectionState, debugEnabled, enabled, ensureOpenAuthConnection, ensureOpenConnection, loginPromise, messageBuffer, messageQueue, prefix, reconnectEnabled, sockjsOptions, sockjsReconnectInterval, sockjsStateInterval, states, urlPath, urlServer, util, validSession, wrapped, _ref, _ref1;
424424
_ref = (vertxEventBus != null ? vertxEventBus.getOptions() : void 0) || {}, enabled = _ref.enabled, debugEnabled = _ref.debugEnabled, prefix = _ref.prefix, urlServer = _ref.urlServer, urlPath = _ref.urlPath, reconnectEnabled = _ref.reconnectEnabled, sockjsStateInterval = _ref.sockjsStateInterval, sockjsReconnectInterval = _ref.sockjsReconnectInterval, sockjsOptions = _ref.sockjsOptions, messageBuffer = _ref.messageBuffer;
425425
connectionState = vertxEventBus != null ? (_ref1 = vertxEventBus.EventBus) != null ? _ref1.CLOSED : void 0 : void 0;
426426
validSession = false;
427427
loginPromise = null;
428428
messageQueue = new Queue(messageBuffer);
429429
callbackMap = new SimpleMap();
430+
states = {
431+
connected: false
432+
};
430433
if (enabled && vertxEventBus) {
431434
vertxEventBus.onopen = function() {
432435
var address, callback, callbacks, fn, _i, _len, _ref2;
433436
wrapped.getConnectionState(true);
434-
$rootScope.$broadcast("" + prefix + "system.connected");
437+
if (!states.connected) {
438+
states.connected = true;
439+
$rootScope.$broadcast("" + prefix + "system.connected");
440+
}
435441
_ref2 = wrapped.handlers;
436442
for (address in _ref2) {
437443
if (!__hasProp.call(_ref2, address)) continue;
@@ -456,7 +462,10 @@
456462
};
457463
vertxEventBus.onclose = function() {
458464
wrapped.getConnectionState(true);
459-
return $rootScope.$broadcast("" + prefix + "system.disconnected");
465+
if (states.connected) {
466+
states.connected = false;
467+
return $rootScope.$broadcast("" + prefix + "system.disconnected");
468+
}
460469
};
461470
vertxEventBus.onclose.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": 'onclose' handler";
462471
}
@@ -532,9 +541,9 @@
532541
}
533542
});
534543
if (deferred) {
535-
return $timeout((function() {
544+
return $interval((function() {
536545
return deferred.reject();
537-
}), timeout);
546+
}), timeout, 1);
538547
}
539548
};
540549
next.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": util.send (ensureOpenAuthConnection callback)";
@@ -574,9 +583,9 @@
574583
};
575584
next.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": util.login (callback)";
576585
vertxEventBus.login(username, password, next);
577-
$timeout((function() {
586+
$interval((function() {
578587
return deferred.reject();
579-
}), timeout);
588+
}), timeout, 1);
580589
return deferred.promise;
581590
}
582591
};

0 commit comments

Comments
 (0)