corrade-http-templates

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 5  →  ?path2? @ 4
/instantMessage/instantMessage.html
@@ -21,7 +21,7 @@
tabTemplate = "<li id='#{id}'><a href='#{href}'>#{label}</a> <span class='ui-icon ui-icon-close' role='presentation'>Remove Tab</span></li>",
tabCounter = 0,
messageIntervals = {},
getConversationsTimeout;
getConversationsTimer;
 
var tabs = $("#tabs").tabs();
 
@@ -65,10 +65,6 @@
if (!conversationExists(avatar.firstname, avatar.lastname))
addTab(avatar.firstname, avatar.lastname);
});
getConversationsTimeout = setTimeout(
getConversations,
1000
);
});
}
 
@@ -106,15 +102,11 @@
function loadInstantMessage(index) {
$.get("messages/" + $("#firstname-" + index).val() + " " + $("#lastname-" + index).val() + ".log" + "?t=" + Math.random(), function(data) {
$("#chat-" + index).html(data);
$("#chat-" + index).animate({
scrollTop: $("#chat-" + index)[0].scrollHeight - $("#chat-" + index).height()
}, 1000);
messageIntervals[index] = setTimeout(
loadInstantMessage,
1000,
index
);
});
 
$("#chat-" + index).animate({
scrollTop: $("#chat-" + index)[0].scrollHeight - $("#chat-" + index).height()
}, 1000);
}
 
// This function checks whether a conversation / tab already exists.
@@ -153,7 +145,7 @@
tabs.find(".ui-tabs-nav").append(li);
tabs.append("<div id='" + id + "'><p>" + " \
<div id='container-" + tabCounter + "'> \
<textarea readonly='readonly' id='chat-" + tabCounter + "' rows='12'></textarea><br/> \
<textarea id='chat-" + tabCounter + "' rows='12'></textarea><br/> \
<div id='controls-" + tabCounter + "'> \
Message: <input type='text' size='70' id='message-" + tabCounter + "'></input> \
<button type='button' id='send-" + tabCounter + "'>Send</button> \
@@ -187,7 +179,7 @@
var panelId = $(this).closest("li").remove().attr("aria-controls");
var selectedIndex = $(this).closest("li").remove().attr("id");
// Pause the conversation retrieval timer.
clearTimeout(getConversationsTimeout);
clearInterval(getConversationsTimer);
$.ajax({
type: 'post',
url: "deleteConversation.php",
@@ -199,7 +191,7 @@
$("#" + panelId).remove();
tabs.tabs("refresh");
// Resume the conversation retrieval timer.
getConversationsTimeout = setTimeout(
getConversationsTimer = setInterval(
getConversations,
1000
);
@@ -215,7 +207,7 @@
}
});
 
messageIntervals[selectedIndex] = setTimeout(
messageIntervals[selectedIndex] = setInterval(
loadInstantMessage,
1000,
selectedIndex
@@ -223,7 +215,7 @@
});
 
// Start a timer to load tabs of existing conversations.
getConversationsTimeout = setTimeout(
getConversationsTimer = setInterval(
getConversations,
1000
);