new icons

This commit is contained in:
Rodolphe Breard 2013-01-21 17:20:22 +01:00
parent aed665f361
commit 9b64fe6429
8 changed files with 28 additions and 17 deletions

View file

@ -14,7 +14,7 @@ body {
#user-status {
position: fixed;
right: 285px;
right: 155px;
top: 10px;
margin: 0;
padding: 0;
@ -29,6 +29,10 @@ body {
padding: 0;
}
.clickable {
cursor: pointer;
}
/*
* Contact list
*/

View file

@ -6,12 +6,11 @@
<link rel="stylesheet" type="text/css" media="all" href="chromesoul.css">
</head>
<body>
<p id="user-status">
Status: <span id="status_txt"></span><br>
<button id="reconnect">Reconnect</button>
<p id="user-status" class="clickable">
<img src="img/status/me-disconnected.png" alt="disconnected" title="disconnected" id="user-status-img">
</p>
<div id="settings-btn"><img src="img/settings.png" atl="settings"></div>
<div id="settings-btn" class="clickable"><img src="img/settings.png" alt="settings" title="settings"></div>
<div id="contact-lst-wrapper">
<input type="text" id="add-contact" placeholder="New contact">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 34 KiB

BIN
img/status/me-connected.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -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() {

View file

@ -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) {

View file

@ -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) {