Skip to content

Commit

Permalink
Regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
paddybyers committed Nov 8, 2014
1 parent ddf0092 commit add26a0
Show file tree
Hide file tree
Showing 16 changed files with 660 additions and 420 deletions.
634 changes: 430 additions & 204 deletions browser/static/ably.js

Large diffs are not rendered by default.

Binary file modified browser/static/ably.js.gz
Binary file not shown.
312 changes: 158 additions & 154 deletions browser/static/ably.min.js

Large diffs are not rendered by default.

Binary file modified browser/static/ably.min.js.gz
Binary file not shown.
15 changes: 12 additions & 3 deletions browser/static/compat-pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
var h = result[i];
if (!startTime)
startTime = endTime = h.timestamp;
presults.push(h.data);
presults.push(JSON.parse(h.data));
}
callback([presults, startTime, endTime]);
}
Expand Down Expand Up @@ -281,7 +281,7 @@
*/
PUBNUB.publish = function(args, callback) {
callback = callback || args.callback || noop;
var message = args.message;
var message = JSON.stringify(args.message);
var channel = args.channel;
var error = args.error || noop;
var timestamp = Date.now();
Expand Down Expand Up @@ -371,7 +371,16 @@

var subscr = function(channel, callback, args) {
if(subscriptions[channel]) return log('Already Connected');
var cb = function(message) { callback(message.data); };
var cb = function(message) {
var data;
try {
data = JSON.parse(message.data);
} catch(e) {
log('PUBNUB.subscribe: Error: '+e);
return;
}
callback(data);
};

// Create channel and register for message callbacks and presence events if necessary
var ablyChannel = getChannel(channel);
Expand Down
Binary file modified browser/static/compat-pubnub.js.gz
Binary file not shown.
18 changes: 9 additions & 9 deletions browser/static/compat-pubnub.min.js

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

Binary file modified browser/static/compat-pubnub.min.js.gz
Binary file not shown.
5 changes: 3 additions & 2 deletions browser/static/compat-pusher.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ var Utils = (function() {

this.channel.subscribe(function(message) {
log('PusherChannel::message callback: Event object '+JSON.stringify(this)+', message '+JSON.stringify(message));
self.channel.emit(message.name, message.data);
self.channel.emit(message.name, JSON.parse(message.data));
});
this.bindings = {};
this.bind_alls = [];
Expand Down Expand Up @@ -744,7 +744,8 @@ var Utils = (function() {
* whether or not the trigger was successful.
*/
PusherChannel.prototype.trigger = function(event, data) {
log('PusherChannel::trigger: Event '+event+', data '+JSON.stringify(data));
data = JSON.stringify(data);
log('PusherChannel::trigger: Event '+event+', data '+ data);
if (!this.active) { log('PusherChannel::trigger: Inactive'); return true; }
this.channel.publish(event, data);
return true;
Expand Down
Binary file modified browser/static/compat-pusher.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions browser/static/compat-pusher.min.js

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

Binary file modified browser/static/compat-pusher.min.js.gz
Binary file not shown.
32 changes: 16 additions & 16 deletions browser/static/iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,14 +623,8 @@ var XHRRequest = (function() {
return false;
};

function responseHeaders(xhr) {
var headers = {};
if(xhr.getResponseHeader) {
var contentType = xhr.getResponseHeader('Content-Type');
if(contentType)
headers['Content-Type'] = contentType;
}
return headers;
function getContentType(xhr) {
return xhr.getResponseHeader && xhr.getResponseHeader('Content-Type');
}

function XHRRequest(uri, headers, params, body, requestMode) {
Expand All @@ -651,13 +645,12 @@ var XHRRequest = (function() {
return xhrSupported ? new XHRRequest(uri, headers, params, body, requestMode) : new XDRRequest(uri, headers, params, body, requestMode);
};

XHRRequest.prototype.complete = function(err, body) {
XHRRequest.prototype.complete = function(err, body, headers, unpacked) {
if(!this.requestComplete) {
this.requestComplete = true;
var xhr = this.xhr;
if(body)
this.emit('data', body);
this.emit('complete', err, body, (xhr && responseHeaders(xhr)));
this.emit('complete', err, body, headers, unpacked);
this.dispose();
}
};
Expand Down Expand Up @@ -705,8 +698,10 @@ var XHRRequest = (function() {
var streaming,
statusCode,
responseBody,
contentType,
successResponse,
streamPos = 0;
streamPos = 0,
unpacked = false;

function onResponse() {
clearTimeout(timer);
Expand All @@ -729,7 +724,12 @@ var XHRRequest = (function() {
}
return;
}
responseBody = JSON.parse(String(responseBody));

var json = ((contentType = getContentType(xhr)) == 'application/json');
if(json) {
responseBody = JSON.parse(String(responseBody));
unpacked = true;
}
} catch(e) {
var err = new Error('Malformed response body from server: ' + e.message);
err.statusCode = 400;
Expand All @@ -738,7 +738,7 @@ var XHRRequest = (function() {
}

if(successResponse) {
self.complete(null, responseBody);
self.complete(null, responseBody, (contentType && {'Content-Type': contentType}), unpacked);
return;
}

Expand Down Expand Up @@ -919,7 +919,7 @@ var XHRRequest = (function() {
self.complete(err);
return;
}
self.complete(null, responseBody);
self.complete(null, responseBody, {'Content-Type': 'application/json'}, true);
}

function onProgress() {
Expand Down Expand Up @@ -1002,7 +1002,7 @@ var XHRRequest = (function() {
DomEvent.addUnloadListener(clearPendingRequests);
if(typeof(Http) !== 'undefined') {
Http.supportsAuthHeaders = xhrSupported;
Http.Request = function(uri, headers, params, body, format, callback) {
Http.Request = function(uri, headers, params, body, callback) {
var req = createRequest(uri, headers, params, body, REQ_SEND);
req.once('complete', callback);
req.exec();
Expand Down
Binary file modified browser/static/iframe.js.gz
Binary file not shown.
Loading

0 comments on commit add26a0

Please sign in to comment.