Skip to content

Commit

Permalink
Merge branch 'r2.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
pl committed Nov 26, 2013
2 parents e4e133f + 615329f commit 63f4a38
Show file tree
Hide file tree
Showing 27 changed files with 678 additions and 502 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 2.1.4 (2013-11-26)

[NEW] Added the `Pusher.prototype.allChannels` method

[NEW] Implemented the `enabledTransports` option

[NEW] Implemented the `disabledTransports` option

[CHANGED] Connections are not closed anymore after receiving an offline event

[CHANGED] Connections are still attempted, even if the browser indicates it's offline

[CHANGED] When not connected, an online event will trigger a new connection attempt immediately

[CHANGED] Updated the stats protocol

## 2.1.3 (2013-10-21)

[CHANGED] Updated the json2 library
Expand Down
9 changes: 5 additions & 4 deletions JFile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ target_dir './dist'

src_dir './src'

version '2.1.3'
version '2.1.4'

bundle 'pusher.js' do
license 'pusher-licence.js'
file 'pusher.js'

file 'utils/timer.js'
file 'utils/periodic_timer.js'

file 'util.js'
file 'defaults.js'
file 'config.js'
Expand All @@ -20,9 +24,6 @@ bundle 'pusher.js' do
file 'dependency_loader.js'
file 'dependencies.js'

file 'utils/timer.js'
file 'utils/periodic_timer.js'

file 'base64.js'
file 'jsonp/jsonp_request.js'
file 'jsonp/jsonp_receiver.js'
Expand Down
30 changes: 30 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ Disables Flash, leaving only WebSockets and HTTP fallback.

Disables stats collection, so that connection metrics are not submitted to Pusher’s servers.

#### `enabledTransports` (Array)

Specifies which transports should be used by Pusher to establish a connection. Useful for applications running in controlled, well-behaving environments. Available transports: `ws`, `flash`, `sockjs`. Additional transports may be added in the future and without adding them to this list, they will be disabled.

// will only use WebSockets
var pusher = new Pusher(API_KEY, { enabledTransports: ["ws"] });

#### `disabledTransports` (Array)

Specified which transports must not be used by Pusher to establish a connection. This settings overwrites transports whitelisted via the `enabledTransports` options. Available transports: `ws`, `flash`, `sockjs`. Additional transports may be added in the future and without adding them to this list, they will be enabled.

// will use all transports except for flash
var pusher = new Pusher(API_KEY, { disabledTransports: ["flash"] });

// will only use WebSockets
var pusher = new Pusher(API_KEY, {
enabledTransports: ["ws", "flash"],
disabledTransports: ["flash"]
});

#### `wsHost`, `wsPort`, `wssPort`, `httpHost`, `httpPort`, `httpsPort`

These can be changed to point to alternative Pusher URLs (used internally for our staging server).
Expand Down Expand Up @@ -101,6 +121,16 @@ It is possible to access channels by name, through the `channel` function:

channel = socket.channel('private-my-channel');

It is possible to access all subscribed channels through the `allChannels` function:

var channels = socket.allChannels();
console.group('Pusher - subscribed to:');
for (var i = 0; i < channels.length; i++) {
var channel = channels[i];
console.log(channel.name);
}
console.groupEnd();

## Binding to events

Events can be bound to at 2 levels, the global, and per channel. They take a very similar form to the way events are handled in jQuery.
Expand Down
2 changes: 1 addition & 1 deletion dist/flashfallback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Pusher JavaScript Library v2.1.3
* Pusher JavaScript Library v2.1.4
* http://pusherapp.com/
*
* Copyright 2011, Pusher
Expand Down
2 changes: 1 addition & 1 deletion dist/flashfallback.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 63f4a38

Please sign in to comment.