Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiny jquery tweaks #925

Merged
merged 1 commit into from
Feb 21, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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