Skip to content

Commit

Permalink
Merge pull request #925 from casualjim/jquery-fixes
Browse files Browse the repository at this point in the history
tiny jquery tweaks
  • Loading branch information
jfarcand committed Feb 21, 2013
2 parents 04953c7 + ece50c4 commit 1eea9f7
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -1693,18 +1693,14 @@ jQuery.atmosphere = function() {
var lastIndex = 0;
var xdrCallback = function (xdr) {
var responseBody = xdr.responseText;
var isJunkEnded = false;

if (responseBody.indexOf("<!-- Welcome to the Atmosphere Framework.") != -1) {
isJunkEnded = true;
}
var isJunkEnded = responseBody.indexOf("<!-- Welcome to the Atmosphere Framework.") != -1;

if (isJunkEnded) {
var endOfJunk = "<!-- EOD -->";
var endOfJunkLenght = endOfJunk.length;
var endOfJunkLength = endOfJunk.length;
var junkEnd = responseBody.indexOf(endOfJunk);
if (junkEnd !== -1) {
responseBody = responseBody.substring(junkEnd + endOfJunkLenght + lastIndex);
responseBody = responseBody.substring(junkEnd + endOfJunkLength + lastIndex);
lastIndex += responseBody.length;
}
}
Expand Down Expand Up @@ -1868,11 +1864,7 @@ jQuery.atmosphere = function() {
clone.appendChild(cdoc.createTextNode("."));

var text = clone.innerText;
var isJunkEnded = true;

if (text.indexOf("<!-- Welcome to the Atmosphere Framework.") == -1) {
isJunkEnded = false;
}
var isJunkEnded = text.indexOf("<!-- Welcome to the Atmosphere Framework.") != -1;

if (isJunkEnded) {
var endOfJunk = "<!-- EOD -->";
Expand Down Expand Up @@ -1992,7 +1984,7 @@ jQuery.atmosphere = function() {
try {
if (_localStorageService) {
_localStorageService.localSend(message);
} else {
} else if (_storageService) {
_storageService.signal("localMessage", jQuery.stringifyJSON({id: guid , event: message}));
}
} catch (err) {
Expand Down

0 comments on commit 1eea9f7

Please sign in to comment.