new icons
This commit is contained in:
parent
aed665f361
commit
9b64fe6429
8 changed files with 28 additions and 17 deletions
|
@ -14,7 +14,7 @@ body {
|
||||||
|
|
||||||
#user-status {
|
#user-status {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 285px;
|
right: 155px;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -29,6 +29,10 @@ body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contact list
|
* Contact list
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,12 +6,11 @@
|
||||||
<link rel="stylesheet" type="text/css" media="all" href="chromesoul.css">
|
<link rel="stylesheet" type="text/css" media="all" href="chromesoul.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p id="user-status">
|
<p id="user-status" class="clickable">
|
||||||
Status: <span id="status_txt"></span><br>
|
<img src="img/status/me-disconnected.png" alt="disconnected" title="disconnected" id="user-status-img">
|
||||||
<button id="reconnect">Reconnect</button>
|
|
||||||
</p>
|
</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">
|
<div id="contact-lst-wrapper">
|
||||||
<input type="text" id="add-contact" placeholder="New contact">
|
<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
BIN
img/status/me-connected.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
BIN
img/status/me-disconnected.png
Normal file
BIN
img/status/me-disconnected.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
|
@ -56,7 +56,7 @@ ContactList.prototype.addContact = function(name) {
|
||||||
close = document.createElement("span");
|
close = document.createElement("span");
|
||||||
close.classList.add("remove");
|
close.classList.add("remove");
|
||||||
login.innerHTML = name;
|
login.innerHTML = name;
|
||||||
close.innerHTML = "x";
|
close.innerHTML = '<img src="img/delcontact.png" alt="x" title="delete contact">';
|
||||||
li.appendChild(login);
|
li.appendChild(login);
|
||||||
li.appendChild(close);
|
li.appendChild(close);
|
||||||
li.addEventListener("dblclick", function() {
|
li.addEventListener("dblclick", function() {
|
||||||
|
|
|
@ -172,22 +172,16 @@ NsClient.prototype.sendMessage = function(to, message) {
|
||||||
};
|
};
|
||||||
|
|
||||||
NsClient.prototype.updateStatus = function() {
|
NsClient.prototype.updateStatus = function() {
|
||||||
var status_txt = document.getElementById("status_txt");
|
var status = "disconnected", status_msg = "";
|
||||||
|
|
||||||
if (this.is_connected) {
|
if (this.is_connected) {
|
||||||
if (status_txt !== null) {
|
status_msg = "user_cmd state ";
|
||||||
status_txt.innerHTML = this.state;
|
status = this.state;
|
||||||
}
|
|
||||||
|
|
||||||
var status_msg = "user_cmd state ";
|
|
||||||
status_msg += this.state + ":";
|
status_msg += this.state + ":";
|
||||||
status_msg += Math.round(new Date().getTime() / 1000) + "\n";
|
status_msg += Math.round(new Date().getTime() / 1000) + "\n";
|
||||||
chrome.socket.write(this.socket, str2ab(status_msg), function(w_inf) {});
|
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) {
|
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) {
|
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) {
|
Nsui.prototype.createTab = function(name) {
|
||||||
|
|
Reference in a new issue