From a31920e98250b6b1e9a615ec4af4f02b4e18b6b0 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 30 Sep 2011 12:58:49 -0400 Subject: [PATCH] CC-2438: Add a button to listen to the stream immediately -Streams selectable by their description -Repeatedly clicking on the ON-AIR, focus()es the window instead of reloading it. --- .../views/scripts/dashboard/stream-player.phtml | 2 +- airtime_mvc/public/js/airtime/dashboard/playlist.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/views/scripts/dashboard/stream-player.phtml b/airtime_mvc/application/views/scripts/dashboard/stream-player.phtml index e070b876f..3b5c3449a 100644 --- a/airtime_mvc/application/views/scripts/dashboard/stream-player.phtml +++ b/airtime_mvc/application/views/scripts/dashboard/stream-player.phtml @@ -56,7 +56,7 @@ $(document).ready(function(){ if ($type == "ogg") $type = "oga"; - $label = "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]." Kbit/s)"; + $label = $streamData["${id}_description"]." (".$streamData["${id}_bitrate"]." Kbit/s)"; echo sprintf("", $id, $url, $type, $label); } ?> diff --git a/airtime_mvc/public/js/airtime/dashboard/playlist.js b/airtime_mvc/public/js/airtime/dashboard/playlist.js index 84dd47cfc..cfaad17ac 100644 --- a/airtime_mvc/public/js/airtime/dashboard/playlist.js +++ b/airtime_mvc/public/js/airtime/dashboard/playlist.js @@ -249,6 +249,8 @@ function setupQtip(){ } } +var stream_window = null; + function init() { //begin producer "thread" getScheduleFromServer(); @@ -259,8 +261,9 @@ function init() { setupQtip(); $('#on-air-info').click(function() { - newwindow=window.open("/Dashboard/stream-player", 'name', 'width=400,height=216'); - if (window.focus) {newwindow.focus()} + if (stream_window == null || stream_window.closed) + stream_window=window.open("/Dashboard/stream-player", 'name', 'width=400,height=216'); + stream_window.focus(); return false; }); }