diff --git a/webroot/config.php b/webroot/config.php index ba2d461b6db8d4e13c5f2c975f1a6a8f59d0c5b7..b48d05ef7eb161c2f5a65d9b7265ea3ab4fdcbaf 100644 --- a/webroot/config.php +++ b/webroot/config.php @@ -13,7 +13,7 @@ array("Wettervorhersage", "widget_light", 3,1, 1,2), array("TwitterWall", "widget_light", 4,1, 2,4), array("Prepaid", "widget_light", 0,3, 2,3), - array("Dummy", "widget_dark", 2,3, 2,2), + array("Jukezone", "widget_dark", 2,3, 2,2), array("Dummy", "widget_light", 2,5, 2,1), array("Marvin", "widget_light", 4,5, 2,1) ); diff --git a/webroot/css/widget_dark.css b/webroot/css/widget_dark.css index a94e6604f9f863b03c8c57fd3ed99cd66ed5dbcc..b2e49994ca3eb480c469378dbaa4f99c286ebd46 100644 --- a/webroot/css/widget_dark.css +++ b/webroot/css/widget_dark.css @@ -10,6 +10,82 @@ color:#ffffff; cursor:default; } + +.widget_dark .invisiblebox { + font-family: inherit; + margin: 10; + padding: 0; + cursor:default; +} + +.widget_dark .table { + border: 1px dashed #F2EFE5; + background-color:#261C13; + font-family: inherit; + margin: 0; + padding: 2; + cursor:default; +} + +.widget_dark .box { + background-color:#261C13; + border: 1px dashed #F2EFE5; + font-family: inherit; + color:#ffffff; + margin: 10; + position:relative; + cursor:default; +} + +.widget_dark h1 { + margin-top: 10; + margin-left: 10; + margin-bottom: 0; + padding: 0; + font-family: inherit; + font-size: 1.0em; + cursor:default; +} +.widget_dark h2 { + margin: 0; + padding: 0; + font-family: inherit; + font-size: 0.8em; + color: #dddddd; + cursor:default; +} +.widget_dark h3 { + margin: 0; + padding: 0; + font-family: inherit; + font-size: 0.6em; + color: #bbbbbb; + cursor:default; +} + +.widget_dark ul { + background-color:#261C13; + margin: 0; + padding: 0; + list-style: none; + overflow:hidden; + position:relative; + height:auto; + cursor:default; +} +.widget_dark li { + background-color:#261C13; + float: left; + border-bottom: 1px dashed #F2EFE5; + width: 100%; + color: #999999; + cursor:default; +} +.widget_dark li img { + padding: 4; + cursor:default; +} + .widget_dark a, .widget_dark a:hover, .widget_dark a:visited, .widget_dark a:active { text-decoration:none; font-family: inherit; @@ -18,3 +94,9 @@ color: #aaaaaa; cursor:default; } + +.widget_dark img +{ + float:left; + cursor:default; +} diff --git a/webroot/index.php b/webroot/index.php index 382148f81773f1e6d4a9cae3defecc9c16d6d390..83e3773b911fa53944ec4f7ee6f0f1b67aefb06e 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -23,7 +23,7 @@ include_once "widgets/$widgetname/$widgetname.php"; $widget = new $widgetname($widgetsizex,$widgetsizey); $widgetoutput = $widget->giveOutput(); - print("<div id='$widgetname' class='$widgetclass' + print("<div class='$widgetclass' style='position:absolute; left:".$widgetposx."px;top:".$widgetposy."px; width:".$widgetsizex."px;height:".$widgetsizey."px;'>"); diff --git a/webroot/widgets/Jukezone/Jukezone.js b/webroot/widgets/Jukezone/Jukezone.js new file mode 100644 index 0000000000000000000000000000000000000000..01b8af3c0f5a44864b6151f8186d01701b7f4964 --- /dev/null +++ b/webroot/widgets/Jukezone/Jukezone.js @@ -0,0 +1,68 @@ +function fillJukezone(response) { + var content = '<table class="box" align="center" width="95%">'; + content += '<tr><td width="30%"><h2>Status:</h2></td><td style="color:00aa00">Online</td></tr>'; + + content += '<tr><td width="30%"><h2>Volume:</h2></td><td>'; + content += '<table cellspacing="0" cellpadding="0"><tr>'; + content += '<td>[</td>'; + for(var i=0;i<response['volume'];i+=2) + content += '<td onclick="setVolume('+i+')">:</td>'; + content += '<td><b>||</b></td>'; + for(var i=response['volume']+2;i<=100;i+=2) + content += '<td onclick="setVolume('+i+')">:</td>'; + content += '<td>]</td>'; + content += '</tr></table>'; + content += '</td></tr>'; + + content += '<tr><td width="30%" valign="top"><h2>Streams:</h2></td><td><table>'; + var i=0; + $.each(response['streams'], function(k,v) { + if(response['nowplaying']==i) + content += '<tr><td><h2>[</h2></td><td><h2 onclick="playStream(\''+v+'\')">'+k+'</h2></td><td><h2>]</h2></td></tr>'; + else + content += '<tr><td></td><td><h2 onclick="playStream(\''+v+'\')">'+k+'</h2></td><td></td></tr>'; + i++; + }); + content += '</table></td></tr>'; + + content += '</table>'; + $("#Jukezone").html(content); +} + +function resetJukezone() { + var content = '<table class="box" style="align:center;width:95%;">'; + content += '<tr><td width="30%"><h2>Status:</h2></td><td style="color:aa0000">Offline</td></tr>'; + content += '</table>'; + $("#Jukezone").html(content); +} + +function setVolume(v) { + $.getJSON("widgets/Jukezone/ajax.php?volume="+v, function (response) + { + fillJukezone(response); + }); +} + +function playStream(v) { + $.getJSON("widgets/Jukezone/ajax.php?play="+v, function (response) + { + fillJukezone(response); + }); +} + +function updateJukezone() { + $.getJSON("widgets/Jukezone/ajax.php", function (response) + { + fillJukezone(response); + }); +} + +$(document).ready(function() + { + addFunctionToMinuteTimer(updateJukezone); + resetJukezone(); + updateJukezone(); + } +); + + diff --git a/webroot/widgets/Jukezone/Jukezone.php b/webroot/widgets/Jukezone/Jukezone.php new file mode 100644 index 0000000000000000000000000000000000000000..1b65797a887ddfd67a1f2e6f7975caea634386a4 --- /dev/null +++ b/webroot/widgets/Jukezone/Jukezone.php @@ -0,0 +1,21 @@ +<?php + +require_once 'widgets/iWidget.php'; + +class Jukezone implements iWidget +{ + public function __construct($width, $height) + { + + } + + public function giveOutput() + { + $widgetOutput = '<h1>Jukezone</h1>'."\n"; + $widgetOutput .= '<script src="widgets/Jukezone/Jukezone.js" type="text/javascript"></script>'."\n"; + $widgetOutput .= '<span id="Jukezone"></span>'."\n"; + return $widgetOutput; + } +} + +?> diff --git a/webroot/widgets/Jukezone/ajax.php b/webroot/widgets/Jukezone/ajax.php new file mode 100644 index 0000000000000000000000000000000000000000..8db34d9e24daceb83de2ce7abc7f686db52b0850 --- /dev/null +++ b/webroot/widgets/Jukezone/ajax.php @@ -0,0 +1,12 @@ +<?php + $requesturl = 'http://192.168.123.104/ajax.php'; + //$requesturl = 'http://10.0.2.70/ajax.php'; + if(isset($_GET["volume"])) + $requesturl .= '?volume='.$_GET["volume"]; + if(isset($_GET["play"])) + $requesturl .= '?play='.$_GET["play"]; + + $httpRequest = new HttpRequest($requesturl, HttpRequest::METH_GET); + $httpRequest->send(); + print($httpRequest->getResponseBody()); +?> diff --git a/webroot/widgets/ZoneOffen/ZoneOffen.php b/webroot/widgets/ZoneOffen/ZoneOffen.php index fe280e44e923ac6bdf323e3c1678da3617471b91..77f3b3ecde15a90cc0bc1084519d6235ed1f8ef7 100644 --- a/webroot/widgets/ZoneOffen/ZoneOffen.php +++ b/webroot/widgets/ZoneOffen/ZoneOffen.php @@ -13,7 +13,8 @@ class ZoneOffen implements iWidget public function giveOutput() { $widgetOutput = '<script src="widgets/ZoneOffen/ZoneOffen.js" type="text/javascript"></script>'."\n"; - $widgetOutput .= '<center><table width="60%" height="100%" border="0" cellpadding="0" cellspacing="4">'."\n"; + $widgetOutput .= '<h1>Warpzone Live:</h1>'."\n"; + $widgetOutput .= '<center><table width="60%" border="0" cellpadding="0" cellspacing="4">'."\n"; $widgetOutput .= ' <tr>'."\n"; $widgetOutput .= ' <td width="50%" align="right"><b><p>Status: </p><p>Lounge: </p><p>Werkstatt: </p></b></td>'."\n"; $widgetOutput .= ' <td width="50%" align="right"><span id="ZoneOffen_values"><font color="#cc3300"><p>Unbekannt</p><p>Unbekannt</p><p>Unbekannt</p></font></span></td>'."\n";