diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-02-18 22:22:35 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-02-18 22:22:35 +0000 |
commit | 4c0d3398fc6444169ee47935b9ab814eb3929e72 (patch) | |
tree | eed61c51a9c32ee726553d893567419d67b3bfdd /pages | |
parent | 55076f14be853cb7cb1c801484267214e98c4a5e (diff) | |
download | vdr-plugin-live-4c0d3398fc6444169ee47935b9ab814eb3929e72.tar.gz vdr-plugin-live-4c0d3398fc6444169ee47935b9ab814eb3929e72.tar.bz2 |
- Added status box with current channel, program and elapsed time in the
logo area.
- Added support for progress bars to display elapsed content.
- Extendend ajax.js to be usable for non xml requests.
- adapted styles for the new features.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/Makefile | 10 | ||||
-rw-r--r-- | pages/error.ecpp | 2 | ||||
-rw-r--r-- | pages/infobox.ecpp | 72 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 49 | ||||
-rw-r--r-- | pages/recordings.ecpp | 8 | ||||
-rw-r--r-- | pages/remote.ecpp | 10 | ||||
-rw-r--r-- | pages/schedule.ecpp | 3 | ||||
-rw-r--r-- | pages/searchtimers.ecpp | 3 | ||||
-rw-r--r-- | pages/timers.ecpp | 3 | ||||
-rw-r--r-- | pages/tooltip.ecpp | 2 | ||||
-rw-r--r-- | pages/whats_on.ecpp | 10 |
11 files changed, 146 insertions, 26 deletions
diff --git a/pages/Makefile b/pages/Makefile index bebbd6f..805c556 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -15,11 +15,11 @@ VDRDIR ?= ../../../.. ### The object files (add further files here): -OBJS = menu.o channels.o recordings.o schedule.o \ - screenshot.o timers.o whats_on.o switch_channel.o \ - keypress.o remote.o channels_widget.o edit_timer.o \ - error.o pageelems.o tooltip.o play_recording.o \ - searchtimers.o +OBJS = menu.o channels.o recordings.o schedule.o \ + screenshot.o timers.o whats_on.o switch_channel.o \ + keypress.o remote.o channels_widget.o edit_timer.o \ + error.o pageelems.o tooltip.o play_recording.o \ + searchtimers.o infobox.o ### Default rules: diff --git a/pages/error.ecpp b/pages/error.ecpp index 116d3b4..e7bc8c5 100644 --- a/pages/error.ecpp +++ b/pages/error.ecpp @@ -16,7 +16,7 @@ <body> <div class="left_area"> <& pageelems.logo &> - <& menu > + <& menu &> </div> <div class="right_area"> <div class="inhalt"> diff --git a/pages/infobox.ecpp b/pages/infobox.ecpp new file mode 100644 index 0000000..b338015 --- /dev/null +++ b/pages/infobox.ecpp @@ -0,0 +1,72 @@ +<%pre> +#include <vdr/plugin.h> +#include <vdr/config.h> +#include <vdr/recording.h> +#include <vdr/channels.h> +#include <vdr/menu.h> +#include <vdr/device.h> + +#include "exception.h" +#include "tools.h" +#include "epg_events.h" + +using namespace vdrlive; +using namespace std; + +</%pre> +<%include>page_init.eh</%include> +<{ + EpgEvents epgEvents; + + if (cReplayControl::NowReplaying()) { + cThreadLock RecordingsLock(&Recordings); + cRecording *Recording = Recordings.GetByName(cReplayControl::NowReplaying()); + if (Recording) { + const cRecordingInfo* info = Recording->Info(); + if (info) { + EpgEventPtr epgEvent(new EpgEvent("recording", + Recording->Name(), + info->Title() ? info->Title() : Recording->Name(), + info->ShortText() ? info->ShortText() : "", + info->Description() ? info->Description() : "", + Recording->start, + Recording->start)); + epgEvents.push_back(epgEvent); + } + } + } + else { + ReadLock channelsLock( Channels ); + if (cDevice::CurrentChannel()) { + cChannel* Channel = Channels.GetByNumber(cDevice::CurrentChannel()); + if (!Channel) + throw HtmlError("got invalid channel number!"); + cSchedulesLock schedulesLock; + const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); + const cSchedule *Schedule = Schedules->GetSchedule(Channel); + if (Schedule) { + const cEvent *Event = Schedule->GetPresentEvent(); + if (Event) { + EpgEventPtr epgEvent(new EpgEvent("channel", + Event, + Channel->Name())); + epgEvents.push_back(epgEvent); + } + } + } + } + if (epgEvents.size() > 0) { + for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { + EpgEventPtr epg = *i; +}> + <& pageelems.status_box type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) &> +<{ + } + } + else { +}> + No relevant information could be retrieved! +<{ + } +}> +<%include>page_exit.eh</%include> diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index 8cc94fd..92afc5a 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -17,7 +17,21 @@ using namespace vdrlive; <# ---------------------------------------------------------------------- #> <%def logo> -<img src="logo.png" alt="VDR Live!" class="logo"/> +<div class="page_header"> + <img src="logo.png" alt="VDR Live!" class="logo"/> + <div id="infobox"> + </div> +</div> +<div style="clear: both"></div> +</%def> + +<# ---------------------------------------------------------------------- #> + +<%def progressbar> +<%args> + string progress; +</%args> +<div class="__progress"><div class="__elapsed" style="width: <$ progress $>px"></div></div> </%def> <# ---------------------------------------------------------------------- #> @@ -60,6 +74,7 @@ using namespace vdrlive; string title; string short_descr; string long_descr; + int elapsed = -1; </%args> <div class="epg_description" id="<$ (boxId) $>"> <div class="station"> @@ -71,6 +86,9 @@ using namespace vdrlive; </div> <div> <div class="info"><$ (time) $></div> +% if (elapsed >= 0) { + <div class="progress"><div><& pageelems.progressbar progress=(elapsed) &></div></div> +% } <div class="title"><$ (title) $></div> <div class="short"><$ (short_descr) $></div> <div class="description"> @@ -80,3 +98,32 @@ using namespace vdrlive; </div> </div> </%def> + +<# ---------------------------------------------------------------------- #> + +<%def status_box> +<%args> + string type; + string currentTime; + string caption; + string title; + string duration; + int elapsed; +</%args> + <div class="statuscontent"> + <div class="st_header"> + <div class="caption"><$ caption $></div> + <div class="now"> <$ currentTime $></div> + </div> + <div class="st_content"> + <div class="name"><$ title $></div> + <div class="duration"> <$ duration $></div> + </div> + <div class="st_controls"> + <div class="buttons"> </div> +% if (elapsed >= 0) { + <div class="progress"><& pageelems.progressbar progress=(elapsed) &></div> +% } + </div> + </div> +</%def> diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index 1901b78..755a3bc 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -27,14 +27,14 @@ EpgEvents epgEvents; <head> <title>VDR-Live - <$ pageTitle $></title> <link rel="stylesheet" type="text/css" href="styles.css" /> - <script type="text/javascript" language="javascript" src="treeview.js"></script> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> + <script type="text/javascript" language="javascript" src="treeview.js"></script> </head> - <body> + <body onload="LiveStatusAjaxRequest('infobox.html', 'infobox')"> <& pageelems.logo &> <& menu active=("recordings") &> - <div class="inhalt"> + <div class="inhalt"> % if (Recordings.Count() == 0) { Keine Aufnahmen vorhanden % } else { @@ -154,7 +154,7 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { + epg->StartTime(tr("%b %d %y")) + string(" ") + epg->StartTime(tr("%I:%M %p"))); }> - <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) tools_comp=("recordings.rec_tools") time=(start) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) &> + <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) tools_comp=("recordings.rec_tools") time=(start) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) elapsed=(epg->Elapsed()) &> <{ } }> diff --git a/pages/remote.ecpp b/pages/remote.ecpp index 4565680..16033ff 100644 --- a/pages/remote.ecpp +++ b/pages/remote.ecpp @@ -64,12 +64,9 @@ using namespace vdrlive; <title>VDR-Live - <$ pageTitle $></title> <link rel="stylesheet" type="text/css" href="/styles.css" /> </head> - <body onload="StreamInit(); FillIntervals();"> - <div class="left_area"> - <& pageelems.logo &> - <& menu active="remote" &> - </div> - <div class="right_area" + <body onload="StreamInit(); FillIntervals()"> + <& pageelems.logo &> + <& menu active="remote" &> <div class="inhalt"> <div class="screenshot"> <img src="screenshot.jpg" name="vdrlive" /><br /> @@ -150,7 +147,6 @@ using namespace vdrlive; </tr> </table> </div> - </div> </body> </html> <%include>page_exit.eh</%include> diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index f524c7f..5e04264 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -46,8 +46,9 @@ using namespace vdrlive; <head> <title>VDR Live - <$ pageTitle $></title> <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.ajax_js &> </head> - <body> + <body onload="LiveStatusAjaxRequest('infobox.html', 'infobox')"> <& pageelems.logo &> <& menu active=("schedule") component=("schedule.channel_selection")> <div class="inhalt"> diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index cf3ee1a..1915cd2 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -18,8 +18,9 @@ using namespace vdrlive; <head> <title>VDR-Live - <$ pageTitle $></title> <link rel="stylesheet" type="text/css" href="/styles.css" /> + <& pageelems.ajax_js &> </head> - <body> + <body onload="LiveStatusAjaxRequest('infobox.html', 'infobox')"> <& pageelems.logo &> <& menu active=("searchtimers") &> <div class="inhalt"> diff --git a/pages/timers.ecpp b/pages/timers.ecpp index 84d8371..d24a2d5 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -18,8 +18,9 @@ using namespace vdrlive; <head> <title>VDR-Live - <$ pageTitle $></title> <link rel="stylesheet" type="text/css" href="/styles.css" /> + <& pageelems.ajax_js &> </head> - <body> + <body onload="LiveStatusAjaxRequest('infobox.html', 'infobox')"> <& pageelems.logo &> <& menu active=("timers") &> <div class="inhalt"> diff --git a/pages/tooltip.ecpp b/pages/tooltip.ecpp index acdf567..32ce737 100644 --- a/pages/tooltip.ecpp +++ b/pages/tooltip.ecpp @@ -44,5 +44,5 @@ domId; <%args> domId; </%args> - <a href="#void" onclick="domTT_close('<$ (domId + "_tip") $>')"><img src="close.png" alt=""></a> + <a href="#void" onclick="domTT_close('<$ (domId + "_tip") $>')"><img src="close.png" alt="" /></a> </%def> diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 78a6347..555b6ed 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -38,7 +38,7 @@ if (type == "now") { <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> - <body> + <body onload="LiveStatusAjaxRequest('infobox.html', 'infobox')"> <& pageelems.logo &> <& menu active=(type) &> <div class="inhalt"> @@ -54,7 +54,7 @@ if (type == "now") { if (Schedule) { const cEvent *Event = (type == "now" ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent()); if (Event) { - std::string evntId("eventId_"); + string evntId("eventId_"); evntId += lexical_cast<std::string, int>(++evntNr); EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); epgEvents.push_back(epgEvent); @@ -81,10 +81,12 @@ if (type == "now") { <div class="short"><$ (epgEvent->ShortDescr()) $></div> <div class="description"><$ (StringWordTruncate(epgEvent->LongDescr(), 150, truncated)) $></div> <div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (string(tr("more")) + string(" ...")) $></div> +% if (epgEvent->Elapsed() >= 0) { + <div class="progress"><div><& pageelems.progressbar progress=(epgEvent->Elapsed()) &></div></div> +% } </div> </div> </div> - <{ } } @@ -99,7 +101,7 @@ if (type == "now") { for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { EpgEventPtr epg = *i; }> - <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) time=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) &> + <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) time=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) elapsed=(epg->Elapsed()) &> <{ } }> |