Skip to content

Commit

Permalink
Update the Pusher JS client to version 2.2.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristandunn committed Feb 16, 2015
1 parent d2cff9c commit b31be2d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 1.3.0 — Unreleased

* Only enable the WebSocket transport. (Tristan Dunn)
* Update the Pusher JS client to version 2.2.3. (Tristan Dunn)
* Update the Pusher JS client to version 2.2.4. (Tristan Dunn)
* Update development and test dependencies. (Tristan Dunn)

## 1.2.0 — August 9th, 2014
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Pusher JavaScript Library v2.2.3
* Pusher JavaScript Library v2.2.4
* http://pusher.com/
*
* Copyright 2014, Pusher
Expand Down Expand Up @@ -626,7 +626,7 @@
}).call(this);

;(function() {
Pusher.VERSION = '2.2.3';
Pusher.VERSION = '2.2.4';
Pusher.PROTOCOL = 7;

// DEPRECATED: WS connection parameters
Expand Down Expand Up @@ -1087,15 +1087,15 @@
* @param {String} name
* @param {Function} callback
*/
prototype.load = function(name, callback) {
prototype.load = function(name, options, callback) {
var self = this;

if (self.loading[name] && self.loading[name].length > 0) {
self.loading[name].push(callback);
} else {
self.loading[name] = [callback];

var request = new Pusher.ScriptRequest(self.getPath(name));
var request = new Pusher.ScriptRequest(self.getPath(name, options));
var receiver = self.receivers.create(function(error) {
self.receivers.remove(receiver);

Expand Down Expand Up @@ -1177,7 +1177,7 @@
}

if (!window.JSON) {
Pusher.Dependencies.load("json2", initializeOnDocumentBody);
Pusher.Dependencies.load("json2", {}, initializeOnDocumentBody);
} else {
initializeOnDocumentBody();
}
Expand Down Expand Up @@ -2079,25 +2079,29 @@
}));

if (self.hooks.beforeInitialize) {
self.hooks.beforeInitialize();
self.hooks.beforeInitialize.call(self);
}

if (self.hooks.isInitialized()) {
self.changeState("initialized");
} else if (self.hooks.file) {
self.changeState("initializing");
Pusher.Dependencies.load(self.hooks.file, function(error, callback) {
if (self.hooks.isInitialized()) {
self.changeState("initialized");
callback(true);
} else {
if (error) {
self.onError(error);
Pusher.Dependencies.load(
self.hooks.file,
{ encrypted: self.options.encrypted },
function(error, callback) {
if (self.hooks.isInitialized()) {
self.changeState("initialized");
callback(true);
} else {
if (error) {
self.onError(error);
}
self.onClose();
callback(false);
}
self.onClose();
callback(false);
}
});
);
} else {
self.onClose();
}
Expand Down Expand Up @@ -2367,7 +2371,8 @@
if (window.WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR === undefined) {
window.WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR = true;
}
window.WEB_SOCKET_SWF_LOCATION = Pusher.Dependencies.getRoot() +
window.WEB_SOCKET_SWF_LOCATION =
Pusher.Dependencies.getRoot({ encrypted: this.options.encrypted }) +
"/WebSocketMain.swf";
},
isInitialized: function() {
Expand Down
2 changes: 1 addition & 1 deletion features/support/application/views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ul></ul>
</section>

<script src="/javascripts/vendor/pusher-2.2.3.js"></script>
<script src="/javascripts/vendor/pusher-2.2.4.js"></script>
<script>
window.addEventListener("DOMContentLoaded", function() {
// Create the client instance using the PusherFake server.
Expand Down

0 comments on commit b31be2d

Please sign in to comment.