Merge branch 'master' of /home/neale/projects/net/spongy
This commit is contained in:
commit
8e297e9bf1
2
README
2
README
|
@ -26,4 +26,4 @@ Features
|
||||||
Todo
|
Todo
|
||||||
-----
|
-----
|
||||||
|
|
||||||
I need to make this document suck less.
|
[Todo list](TODO)
|
||||||
|
|
|
@ -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
|
|
@ -80,8 +80,11 @@ function networkConnect(network, baseURL, authtok) {
|
||||||
}
|
}
|
||||||
|
|
||||||
element.close = function() {
|
element.close = function() {
|
||||||
|
console.log("Closing");
|
||||||
eventSource.close();
|
eventSource.close();
|
||||||
element.parentNode.removeChild(element);
|
element.parentNode.removeChild(element);
|
||||||
|
roomElement.close();
|
||||||
|
// XXX: Close all associated rooms, too!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,13 @@ function newRoom(element, network, name, maxSize) {
|
||||||
network.send(name, text);
|
network.send(name, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
element.close = function() {
|
||||||
|
console.log(messages);
|
||||||
|
console.log(messages.parent);
|
||||||
|
messages.parent.removeChild(messages);
|
||||||
|
element.parent.removeChild(element);
|
||||||
|
}
|
||||||
|
|
||||||
function clicked() {
|
function clicked() {
|
||||||
element.show();
|
element.show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ function focus(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleInput(oEvent) {
|
function handleInput(oEvent) {
|
||||||
|
console.log(oEvent);
|
||||||
var txt = oEvent.target.value;
|
var txt = oEvent.target.value;
|
||||||
if (txt.startsWith("/connect ")) {
|
if (txt.startsWith("/connect ")) {
|
||||||
// XXX: should allow tokens with spaces
|
// XXX: should allow tokens with spaces
|
||||||
|
@ -53,7 +54,7 @@ function handleInput(oEvent) {
|
||||||
var url = parts[2];
|
var url = parts[2];
|
||||||
var authtok = parts[3];
|
var authtok = parts[3];
|
||||||
|
|
||||||
connect(network, url, authtok);
|
networkConnect(network, url, authtok);
|
||||||
storedConnections[network] = [url, authtok];
|
storedConnections[network] = [url, authtok];
|
||||||
chrome.storage.sync.set({"connections": storedConnections});
|
chrome.storage.sync.set({"connections": storedConnections});
|
||||||
} else {
|
} else {
|
||||||
|
@ -77,6 +78,9 @@ function hideChannels(oEvent) {
|
||||||
|
|
||||||
function keyPress(oEvent) {
|
function keyPress(oEvent) {
|
||||||
document.getElementById("input").focus();
|
document.getElementById("input").focus();
|
||||||
|
if (oEvent.keyIdentifier == "Enter") {
|
||||||
|
handleInput(oEvent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore(items) {
|
function restore(items) {
|
||||||
|
@ -91,7 +95,7 @@ function restore(items) {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
chrome.storage.sync.get(["connections"], restore);
|
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);
|
document.getElementById("hide-channels").addEventListener("click", hideChannels);
|
||||||
window.addEventListener("keypress", keyPress);
|
window.addEventListener("keypress", keyPress);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue