diff --git a/modules/ConnectionHandler.py b/modules/ConnectionHandler.py index 4a9645e..9190bdd 100644 --- a/modules/ConnectionHandler.py +++ b/modules/ConnectionHandler.py @@ -12,7 +12,6 @@ from GenerateContentPlug import GenerateContentPlug from JSONRPCPlug import JSONRPCPlug - from MusicDB import MusicDB class ConnectionHandler(Thread): diff --git a/modules/Plug.py b/modules/Plug.py index f918bc8..2871dd3 100644 --- a/modules/Plug.py +++ b/modules/Plug.py @@ -6,6 +6,7 @@ class Plug: content_type = { "css": "text/css", "html": "application/xhtml+xml", + #"html": "text/html", "js": "text/javascript", "jpg": "image/jpeg", "png": "image/png", diff --git a/static/ajam.js b/static/ajam.js index dd591d1..aec1bf5 100644 --- a/static/ajam.js +++ b/static/ajam.js @@ -45,13 +45,10 @@ function callrpc(method, args, callback, url) { } var hash = rpcparam2hash(doc.childNodes[0]); xmlrpc.mycallback(hash) - } else if (type = "text/json") { + } else if (type == "text/plain") { debug("JSON processing") - var params; - eval("params = " + xmlrpc.responseText); + eval("var params = " + xmlrpc.responseText); xmlrpc.mycallback(params) - } else if (type = "text/plain") { - xmlrpc.mycallback(xmlrpc.responseText) } else { debug("UNEXPECTED NON XML/HTML/PLAIN RESPONSE FROM SERVER"); } diff --git a/static/newpimp.js b/static/newpimp.js index efe82d8..7bf83be 100644 --- a/static/newpimp.js +++ b/static/newpimp.js @@ -218,7 +218,10 @@ function stream_drilldown() { debug("Drilling into " + this.id.substr(7)); /* Ask pimp to generate us a stream entry page */ - callrpc("load_stream", {"stream":this.id}, loadstream); + var pane = document.getElementById("streamlist_pane"); + callrpc("loadstream", {"stream":this.id.substr(7)}, loadstream_callback); + Effect.Fade(pane, 1000); + } function populate_stream_pane(streamname) { @@ -427,18 +430,35 @@ function enqueue_callback() { debug("Enqueue callback success?"); } -function loadstream() { - /* Ask the server about the stream */ - callrpc("loadstream", {'stream': pimp["currentstream"]}, loadstream_callback) -} - function loadstream_callback(params) { - debug("LOADSTREAM") - Object.dpDump(params) -} + var streamdoc; + + streamdoc = mkelement("div"); + streamdoc.id = "streaminfo_pane"; + + var titlebar = mkelement("div"); + var titlename = mkelement("div"); + titlename.appendChild(mktext(params["name"] + " (/stream/blah)")); + var clientnum = mkelement("span"); + clientnum.appendChild(mktext("[" + params["clients"] + " clients]")); + clientnum.style.fontSize = "small"; + clientnum.style.float = "right"; + + titlebar.appendChild(titlename); + titlebar.appendChild(clientnum); + + titlebar.style.borderLeft = "1em solid #8899DD"; + titlebar.style.borderBottom = "3px solid #8899DD"; + titlebar.style.paddingLeft = "3px"; + titlebar.style.fontWeight = "bold"; + + streamdoc.appendChild(titlebar); + streamdoc.appendChild(mktext("this is a test... hurray")); + + streamdoc.style.opacity = 0; + document.getElementById("container").appendChild(streamdoc); -function pageload() { - loader() + setTimeout(function() { Effect.Appear(streamdoc, 1000); }, 1); } window.onload = loadfunc; diff --git a/static/pimp.js b/static/oldpimp.js similarity index 100% rename from static/pimp.js rename to static/oldpimp.js diff --git a/static/style.css b/static/style.css index f0a020d..9319f89 100644 --- a/static/style.css +++ b/static/style.css @@ -8,23 +8,20 @@ html,body { .titlebar { background-color: #DDEEFF; border-bottom: 1px solid black; - padding-top: 1em; padding-left: 1em; - padding-right: 1em; font-weight: bold; - font-variant: small-caps; } .titlebar h4 { margin: 0px; padding: 0px; - margin-right: 3em; font-size: 36pt; display: inline; } .content { margin: 1em; + margin-top: 2em; } input[type="text"] { @@ -32,6 +29,15 @@ input[type="text"] { background-color: lightyellow; } +input[type="submit"], input[type="button"] { + border: 1px solid grey; + background-color: #DDDDEE; +} + +input[type="submit"]:hover, input[type="button"]:hover { + background-color: #EEEEDD; +} + #streamlist table tr th { text-align: left; font-variant: small-caps; @@ -83,7 +89,6 @@ input[type="text"] { } .pane > * { - margin: 1em; border: 1px solid black; } @@ -178,6 +183,33 @@ input[type="text"] { text-align: center; } +/* Menu bar */ +#menubar { + /*display: none;*/ + height: 1em; +} + #searchbar { - display: none; + padding-top: 2px; + float: right; +} + +#tabs { + float: left; } + +.tab { + background-color: #EAF3F8; + padding-left: .5em; + padding-right: .5em; + font-weight: bold; + font-variant: small-caps; + font-size: 1.2em; +} + + +/* Stream View */ +#streamview_pane { + background-color: #EEEEFF; +} + diff --git a/templates/layout.html b/templates/layout.html index 5e52899..d2f0b49 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -3,8 +3,13 @@ Happy control! -