Merge branch 'master' of /home/neale/projects/net/spongy

This commit is contained in:
Neale Pickett 2015-01-29 17:57:41 +00:00
commit 8e297e9bf1
5 changed files with 24 additions and 3 deletions

2
README
View File

@ -26,4 +26,4 @@ Features
Todo
-----
I need to make this document suck less.
[Todo list](TODO)

7
TODO Normal file
View File

@ -0,0 +1,7 @@
Todo list
=========
* One server instance for all networks
* One cgi for all networks?
* Make README suck less
* nickname name= attribute set to uhost

View File

@ -80,8 +80,11 @@ function networkConnect(network, baseURL, authtok) {
}
element.close = function() {
console.log("Closing");
eventSource.close();
element.parentNode.removeChild(element);
roomElement.close();
// XXX: Close all associated rooms, too!
}

View File

@ -140,6 +140,13 @@ function newRoom(element, network, name, maxSize) {
network.send(name, text);
}
element.close = function() {
console.log(messages);
console.log(messages.parent);
messages.parent.removeChild(messages);
element.parent.removeChild(element);
}
function clicked() {
element.show();
}

View File

@ -45,6 +45,7 @@ function focus(e) {
}
function handleInput(oEvent) {
console.log(oEvent);
var txt = oEvent.target.value;
if (txt.startsWith("/connect ")) {
// XXX: should allow tokens with spaces
@ -53,7 +54,7 @@ function handleInput(oEvent) {
var url = parts[2];
var authtok = parts[3];
connect(network, url, authtok);
networkConnect(network, url, authtok);
storedConnections[network] = [url, authtok];
chrome.storage.sync.set({"connections": storedConnections});
} else {
@ -77,6 +78,9 @@ function hideChannels(oEvent) {
function keyPress(oEvent) {
document.getElementById("input").focus();
if (oEvent.keyIdentifier == "Enter") {
handleInput(oEvent);
}
}
function restore(items) {
@ -91,7 +95,7 @@ function restore(items) {
function init() {
chrome.storage.sync.get(["connections"], restore);
document.getElementById("input").addEventListener("change", handleInput);
//document.getElementById("input").addEventListener("change", handleInput);
document.getElementById("hide-channels").addEventListener("click", hideChannels);
window.addEventListener("keypress", keyPress);