|
|
@@ -14,7 +14,12 @@ var
|
|
|
/**
|
|
|
* @type {number}
|
|
|
**/
|
|
|
- SELECTED_ROOM_UNREAD =-1,
|
|
|
+ SELECTED_ROOM_UNREAD = -1,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @type {Element}
|
|
|
+ **/
|
|
|
+ UNREAD_INDICATOR_DOM = document.createElement("span"),
|
|
|
|
|
|
/**
|
|
|
* @type {SimpleChatSystem|null}
|
|
|
@@ -180,6 +185,10 @@ function setNativeTitle(title) {
|
|
|
function selectRoom(room) {
|
|
|
if (SELECTED_ROOM)
|
|
|
unselectRoom();
|
|
|
+
|
|
|
+ UNREAD_INDICATOR_DOM.className = R.klass.msg.unread;
|
|
|
+ UNREAD_INDICATOR_DOM.textContent = locale.newMessage;
|
|
|
+
|
|
|
document.getElementById("room_" +room.id).classList.add(R.klass.selected);
|
|
|
document.body.classList.remove(R.klass.noRoomSelected);
|
|
|
SELECTED_ROOM = room;
|
|
|
@@ -232,6 +241,7 @@ function unstarChannel(room) {
|
|
|
function unselectRoom() {
|
|
|
document.getElementById("room_" +SELECTED_ROOM.id).classList.remove(R.klass.selected);
|
|
|
document.getElementById(R.id.mainSection).classList.add(R.klass.noRoomSelected);
|
|
|
+ UNREAD_INDICATOR_DOM.remove();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -312,6 +322,7 @@ function sendMsg(chan, msg, pendingObj, replyTo) {
|
|
|
url += "&attachments=" +HttpRequestWrapper.encode(JSON.stringify([attachment]));
|
|
|
}
|
|
|
SELECTED_ROOM_UNREAD = -1;
|
|
|
+ UNREAD_INDICATOR_DOM.remove();
|
|
|
HttpRequestWrapper(HttpRequestMethod.POST, url).setResponseType(HttpRequestResponseType.JSON).callbackSuccess(function(code, text, resp) {
|
|
|
if (resp && resp["pendingId"] !== undefined) {
|
|
|
pendingObj.pendingId = resp["pendingId"];
|