new icons
This commit is contained in:
parent
aed665f361
commit
9b64fe6429
8 changed files with 28 additions and 17 deletions
|
@ -56,7 +56,7 @@ ContactList.prototype.addContact = function(name) {
|
|||
close = document.createElement("span");
|
||||
close.classList.add("remove");
|
||||
login.innerHTML = name;
|
||||
close.innerHTML = "x";
|
||||
close.innerHTML = '<img src="img/delcontact.png" alt="x" title="delete contact">';
|
||||
li.appendChild(login);
|
||||
li.appendChild(close);
|
||||
li.addEventListener("dblclick", function() {
|
||||
|
|
|
@ -172,22 +172,16 @@ NsClient.prototype.sendMessage = function(to, message) {
|
|||
};
|
||||
|
||||
NsClient.prototype.updateStatus = function() {
|
||||
var status_txt = document.getElementById("status_txt");
|
||||
var status = "disconnected", status_msg = "";
|
||||
|
||||
if (this.is_connected) {
|
||||
if (status_txt !== null) {
|
||||
status_txt.innerHTML = this.state;
|
||||
}
|
||||
|
||||
var status_msg = "user_cmd state ";
|
||||
status_msg = "user_cmd state ";
|
||||
status = this.state;
|
||||
status_msg += this.state + ":";
|
||||
status_msg += Math.round(new Date().getTime() / 1000) + "\n";
|
||||
chrome.socket.write(this.socket, str2ab(status_msg), function(w_inf) {});
|
||||
} else {
|
||||
if (status_txt !== null) {
|
||||
status_txt.innerHTML = 'disconnected';
|
||||
}
|
||||
}
|
||||
$cs.ui.onUserStatusChange(status);
|
||||
};
|
||||
|
||||
NsClient.prototype.changeStatus = function(new_status) {
|
||||
|
|
16
lib/nsui.js
16
lib/nsui.js
|
@ -20,7 +20,21 @@ var Nsui = function() {
|
|||
};
|
||||
|
||||
Nsui.prototype.setReconnect = function(func) {
|
||||
document.getElementById("reconnect").addEventListener("click", func, false);
|
||||
document.getElementById("user-status").addEventListener("click", func, false);
|
||||
};
|
||||
|
||||
Nsui.prototype.onUserStatusChange = function(new_status) {
|
||||
var el = document.getElementById("user-status-img");
|
||||
|
||||
if (el !== null) {
|
||||
if (new_status !== "disconnected") {
|
||||
el.src = 'img/status/me-connected.png';
|
||||
} else {
|
||||
el.src = 'img/status/me-disconnected.png';
|
||||
}
|
||||
el.alt = new_status;
|
||||
el.title = new_status;
|
||||
}
|
||||
};
|
||||
|
||||
Nsui.prototype.createTab = function(name) {
|
||||
|
|
Reference in a new issue