From 162677a55f93defc8fc124b89b137a444ab78edb Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Sun, 29 Apr 2007 18:02:47 +0000 Subject: - xml version of infobox, updates only pagelements inside the box not whole box. This circumvents the tooltip stacking problem. - updated styles for this change. - updated i18n.cpp for this change. - Changed javascript implementation for infobox. - Box doesn't change size after first update. - added some <%cpp> { tags to prevent newlines inserted by tntnet. See tntnet documentation about this. - Added infobox to all pages that didn't had one. --- i18n.cpp | 22 ++ javascript/vdr_status.js | 89 ++++++-- pages/Makefile | 5 +- pages/edit_searchtimer.ecpp | 147 +++++++------- pages/edit_timer.ecpp | 12 +- pages/ibox.ecpp | 177 ++++++++++++++++ pages/infobox.ecpp | 141 ------------- pages/menu.ecpp | 3 + pages/pageelems.ecpp | 57 +++++- pages/recordings.ecpp | 2 +- pages/remote.ecpp | 2 +- pages/schedule.ecpp | 2 +- pages/searchepg.ecpp | 479 ++++++++++++++++++++++---------------------- pages/searchtimers.ecpp | 5 +- pages/timers.ecpp | 2 +- pages/tooltip.ecpp | 2 +- pages/whats_on.ecpp | 2 +- 17 files changed, 651 insertions(+), 498 deletions(-) create mode 100644 pages/ibox.ecpp delete mode 100644 pages/infobox.ecpp diff --git a/i18n.cpp b/i18n.cpp index 364613c..7d3e928 100644 --- a/i18n.cpp +++ b/i18n.cpp @@ -729,6 +729,28 @@ const tI18nPhrase Phrases[] = { "", // Dansk "", // Czech }, + { "retrieving status ...", // English + "Hole Status ...", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // Finnish + "", // Polski + "", // Español + "", // Greek + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // Russian + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Czech + }, { "previous channel", // English "Sender zurück", // Deutsch "", // Slovenski diff --git a/javascript/vdr_status.js b/javascript/vdr_status.js index 2a2a0d1..829b19c 100644 --- a/javascript/vdr_status.js +++ b/javascript/vdr_status.js @@ -8,35 +8,92 @@ var vst_timer; var vst_boxId = null; var vst_url = null; -function LiveStatusAjaxRequest(url, containerid) +function LiveStatusRequest(url, containerid) { if (vst_url == null) + { vst_url = url; + } if (vst_boxId == null) vst_boxId = containerid; - var status = new LiveAjaxCall("text", url); + var status = new LiveAjaxCall("xml", url); status.oncomplete = function() { - document.getElementById(containerid).innerHTML = this.xml.responseText; + try { + LiveStatusShowInfo(this.xml.responseXML, containerid); + } + catch (e) { + LiveStatusReportError(e.message, containerid); + } if (vst_reload) - vst_timer = window.setTimeout("LiveStatusAjaxRequest('" + url + "', '" + containerid + "')", 1000); + vst_timer = window.setTimeout("LiveStatusRequest('" + url + "', '" + containerid + "')", 1000); } status.onerror = function(message) { vst_reload = false; - document.getElementById(containerid).innerHTML = - '
' + - '
ERROR
' + - '
 toggle reload on and off ERROR
' + - '
' + - '
' + - '
' + message + '
' + - '
' + - ''; + LiveStatusReportError(message, containerid); + } + status.request("update", vst_reload ? "1" : "0"); +} + +function LiveStatusShowInfo(xmldoc, containerId) +{ + var epgInfo = xmldoc.getElementsByTagName('epginfo').item(0); + + for (var i = 0; i < epgInfo.childNodes.length; i++) { + var node = epgInfo.childNodes.item(i); + if (node.nodeType == 1) { + var textContent = ""; + if (node.firstChild != null) + textContent = node.firstChild.nodeValue; + LiveStatusSetTextContent(containerId, node.nodeName, textContent); } - status.request("", ""); + } +} + +function LiveStatusReportError(message, containerId) +{ + LiveStatusSetTextContent(containerId, 'caption', 'ERROR'); + LiveStatusSetTextContent(containerId, 'name', message); +} + +function LiveStatusSetTextContent(containerId, nodeName, textContent) +{ + var docNode = document.getElementById(containerId + '_' + nodeName); + if (docNode != null) { + switch (nodeName) { + case "caption": + case "timenow": + case "name": + case "duration": + { + if (docNode.innerHTML != textContent) + docNode.innerHTML = textContent; + break; + } + case "elapsed": + { + var width = textContent + "px"; + if (docNode.style.width != width) + docNode.style.width = width; + break; + } + case "nextchan": + case "prevchan": + { + if (textContent != "") { + docNode.href = "javascript:LiveSimpleAjaxRequest('switch_channel.xml', 'param', '" + textContent + "');"; + docNode.style.visibility = "visible"; + } + else { + docNode.style.visibility = "hidden"; + } + } + default: + break; + } + } } function LiveStatusToggleUpdate() @@ -48,7 +105,7 @@ function LiveStatusToggleUpdate() } else { vst_reload = true; - LiveStatusAjaxRequest(vst_url, vst_boxId); + LiveStatusRequest(vst_url, vst_boxId); } var img = document.getElementById('statusReloadBtn'); if (img != null) { diff --git a/pages/Makefile b/pages/Makefile index d9be777..f9dec2d 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -19,8 +19,9 @@ 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 edit_searchtimer.o \ - searchresults.o login.o searchepg.o + searchtimers.o infobox.o edit_searchtimer.o \ + searchresults.o login.o searchepg.o \ + ibox.o ibox_status.o ### Default rules: diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index 92b6170..c1e2695 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -92,8 +92,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); }> <%cpp> -#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); -#define CHECKIF(x) reply.out() << ( (x) ? "checked=\"checked\"" : "" ); +#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); +#define CHECKIF(x) reply.out() << ( (x) ? "checked=\"checked\"" : "" ); SearchTimers searchtimers; searchtimer = 0; @@ -130,7 +130,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); infos.push_back(os.str()); } searchtimer->SetExtEPGInfo(infos); - } + } searchtimer->SetUseChannel((SearchTimer::eUseChannel)usechannel); if (usechannel == SearchTimer::Interval) { @@ -139,19 +139,19 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } if (usechannel == SearchTimer::Group) searchtimer->SetChannelText(changrpsel); - + searchtimer->SetUseTime(usetime); if (usetime) { searchtimer->SetStartTime(StringToInt(start_h) * 100 + StringToInt(start_m)); searchtimer->SetStopTime(StringToInt(stop_h) * 100 + StringToInt(stop_m)); - } + } searchtimer->SetUseDuration(useduration); if (useduration) { searchtimer->SetMinDuration(durationmin); searchtimer->SetMaxDuration(durationmax); - } + } searchtimer->SetUseDayOfWeek(useweekday); if (useweekday) { @@ -167,7 +167,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } searchtimer->SetUseInFavorites(useinfavorites); searchtimer->SetUseAsSearchTimer(useassearchtimer); - searchtimer->SetSearchTimerAction(searchtimeraction); + searchtimer->SetSearchTimerAction(searchtimeraction); searchtimer->SetUseSeriesRecording(seriesrecording); searchtimer->SetDirectory(directory); searchtimer->SetDelRecsAfterDays(delrecafterdays); @@ -176,9 +176,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer->SetBlacklistMode(blacklistmode); if (blacklistmode == 1) searchtimer->ParseBlacklist(blacklistids_internal); - + searchtimer->SetSwitchMinBefore(switchminbefore); - + searchtimer->SetAvoidRepeats(avoidrepeats); if (avoidrepeats) { @@ -187,21 +187,21 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer->SetCompareTitle(comparetitle); searchtimer->SetCompareSubtitle(comparesubtitle); searchtimer->SetCompareSummary(comparesummary); - } - unsigned long catsselected = 0; + } + unsigned long catsselected = 0; for (unsigned int i=0; i< avoidrepeatscatselected.size(); i++) catsselected |= (1<< (avoidrepeatscatselected[i]-1)); - + searchtimer->SetCompareCategories(catsselected); searchtimer->SetPriority(priority); searchtimer->SetLifetime(lifetime); searchtimer->SetMarginStart(marginstart); searchtimer->SetMarginStop(marginstop); searchtimer->SetUseVPS(usevps); - + if (!testmode) { - searchtimers.Save(searchtimer); + searchtimers.Save(searchtimer); return reply.redirect("searchtimers.html"); } else @@ -214,7 +214,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); pageTitle = searchtimer ? tr("Edit search timer") : tr("New search timer"); if ( searchtimer != 0 ) { - search = searchtimer->Search(); + search = searchtimer->Search(); mode = searchtimer->SearchMode(); tolerance = searchtimer->Tolerance(); matchcase = searchtimer->MatchCase(); @@ -263,18 +263,18 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } else { - wday_sun = -dayofweek & 0x01; - wday_mon = -dayofweek & 0x02; - wday_tue = -dayofweek & 0x04; - wday_wed = -dayofweek & 0x08; - wday_thu = -dayofweek & 0x10; - wday_fri = -dayofweek & 0x20; - wday_sat = -dayofweek & 0x40; + wday_sun = -dayofweek & 0x01; + wday_mon = -dayofweek & 0x02; + wday_tue = -dayofweek & 0x04; + wday_wed = -dayofweek & 0x08; + wday_thu = -dayofweek & 0x10; + wday_fri = -dayofweek & 0x20; + wday_sat = -dayofweek & 0x40; } - } + } useinfavorites = searchtimer->UseInFavorites(); useassearchtimer = searchtimer->UseAsSearchTimer(); - searchtimeraction = searchtimer->SearchTimerAction(); + searchtimeraction = searchtimer->SearchTimerAction(); seriesrecording = searchtimer->UseSeriesRecording(); directory = searchtimer->Directory(); delrecafterdays = searchtimer->DelRecsAfterDays(); @@ -287,7 +287,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); for(unsigned int i=0; i parts = StringSplit( infos[i], '#' ); extepgvalues.push_back(parts.size() > 1?parts[1]:""); } @@ -320,13 +320,15 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); usetitle = true; usesubtitle = true; usedescr = true; - } + } <& pageelems.doc_type &> - <& pageelems.ajax_js &> + VDR Live - <$ searchtimer ? tr("Edit search timer") : tr("New search timer") $> + <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> + <& pageelems.ajax_js &> - - VDR Live - <$ searchtimer ? tr("Edit search timer") : tr("New search timer") $> - - -
- <& pageelems.logo &> - <& menu active=("searchtimers") &> -
-
+ + <& pageelems.logo &> + <& menu active=("searchtimers") &>
@@ -459,7 +455,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<$ searchtimer ? tr("Edit search timer") : tr("New search timer") $>
- + @@ -467,7 +463,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); - + @@ -498,7 +494,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); id="matchcase"/> - + @@ -506,10 +502,10 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); /> - + /> - + /> @@ -525,7 +521,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); onclick="changeduseextepginfo(this)" id="useextepginfo"/> -
<%include>page_exit.eh diff --git a/pages/ibox.ecpp b/pages/ibox.ecpp new file mode 100644 index 0000000..badd690 --- /dev/null +++ b/pages/ibox.ecpp @@ -0,0 +1,177 @@ +<%pre> +#include +#include +#include +#include +#include +#include + +#include "exception.h" +#include "tools.h" +#include "epg_events.h" + +using namespace vdrlive; +using namespace std; + + +<%args> + int update; + +<%cpp> + EpgEvents epgEvents; + string EMPTY_STR; + tChannelID prev_chan; + tChannelID next_chan; + + reply.setContentType( "application/xml" ); + + 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 { + string CHANNEL_STR("channel"); + ReadLock channelsLock( Channels ); + + if (cDevice::CurrentChannel()) { + cChannel* Channel = Channels.GetByNumber(cDevice::CurrentChannel()); + + cChannel* tmp = Channels.GetByNumber(Channels.GetPrevNormal(cDevice::CurrentChannel())); + if (tmp) + prev_chan = tmp->GetChannelID(); + tmp = Channels.GetByNumber(Channels.GetNextNormal(cDevice::CurrentChannel())); + if (tmp) + next_chan = tmp->GetChannelID(); + + string chanName(Channel->Name()); + 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_STR, + Event, + Channel->Name())); + epgEvents.push_back(epgEvent); + } + else { + string noInfo(tr("no epg info for current event!")); + EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, + chanName, + noInfo, + EMPTY_STR, EMPTY_STR, + time(0), + time(0))); + epgEvents.push_back(epgEvent); + } + } + else { + string noInfo(tr("no epg info for current channel!")); + EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, + Channel->Name(), + noInfo, + EMPTY_STR, EMPTY_STR, + time(0), + time(0))); + epgEvents.push_back(epgEvent); + } + } + else { + string chanName(tr("no current channel!")); + EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, + chanName, + chanName, + EMPTY_STR, EMPTY_STR, + time(0), + time(0))); + epgEvents.push_back(epgEvent); + } + } + if (epgEvents.size() == 0) { + string ERROR_STR("error"); + string noInfo(tr("error retrieving status info!")); + string chanName(tr("no current channel!")); + EpgEventPtr epgEvent(new EpgEvent(ERROR_STR, + chanName, + noInfo, + EMPTY_STR, EMPTY_STR, + time(0), + time(0))); + epgEvents.push_back(epgEvent); + } + for (vector::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { + EpgEventPtr epg = *i; + if (prev_chan.Valid() && next_chan.Valid()) + { + +<& xmlresponse update=(update) 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()) prev_chan=(prev_chan) next_chan=(next_chan) &> +<%cpp> + } + else if (prev_chan.Valid()) { + +<& xmlresponse update=(update) 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()) prev_chan=(prev_chan) &> +<%cpp> + } + else if (next_chan.Valid()) { + +<& xmlresponse update=(update) 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()) next_chan=(next_chan) &> +<%cpp> + } + else { + +<& xmlresponse update=(update) 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()) &> +<%cpp> + } + break; + } + + +<%def xmlresponse> +<%args> + int update; + string type; + string currentTime; + string caption; + string title; + string duration; + int elapsed; + string prev_chan; + string next_chan; + + + + + <$ update $> + + 1 + + + <$ update $> + + <$ type $> + <$ caption $> + <$ currentTime $> + <$ title $> + <$ duration $> + <$ elapsed $> + <$ next_chan $> + <$ prev_chan $> + + + + diff --git a/pages/infobox.ecpp b/pages/infobox.ecpp deleted file mode 100644 index afc44b4..0000000 --- a/pages/infobox.ecpp +++ /dev/null @@ -1,141 +0,0 @@ -<%pre> -#include -#include -#include -#include -#include -#include - -#include "exception.h" -#include "tools.h" -#include "epg_events.h" - -using namespace vdrlive; -using namespace std; - - -<%include>page_init.eh -<{ - EpgEvents epgEvents; - string EMPTY_STR; - tChannelID prev_chan; - tChannelID next_chan; - - 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 { - string CHANNEL_STR("channel"); - ReadLock channelsLock( Channels ); - - if (cDevice::CurrentChannel()) { - cChannel* Channel = Channels.GetByNumber(cDevice::CurrentChannel()); - if (!Channel) - throw HtmlError("got invalid channel number!"); - - cChannel* tmp = Channels.GetByNumber(Channels.GetPrevNormal(cDevice::CurrentChannel())); - if (tmp) - prev_chan = tmp->GetChannelID(); - tmp = Channels.GetByNumber(Channels.GetNextNormal(cDevice::CurrentChannel())); - if (tmp) - next_chan = tmp->GetChannelID(); - - string chanName(Channel->Name()); - 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_STR, - Event, - Channel->Name())); - epgEvents.push_back(epgEvent); - } - else { - string noInfo(tr("no epg info for current event!")); - EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, - chanName, - noInfo, - EMPTY_STR, EMPTY_STR, - time(0), - time(0))); - epgEvents.push_back(epgEvent); - } - } - else { - string noInfo(tr("no epg info for current channel!")); - EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, - Channel->Name(), - noInfo, - EMPTY_STR, EMPTY_STR, - time(0), - time(0))); - epgEvents.push_back(epgEvent); - } - } - else { - string chanName(tr("no current channel!")); - EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, - chanName, - chanName, - EMPTY_STR, EMPTY_STR, - time(0), - time(0))); - epgEvents.push_back(epgEvent); - } - } - if (epgEvents.size() == 0) { - string ERROR_STR("error"); - string noInfo(tr("error retrieving status info!")); - string chanName(tr("no current channel!")); - EpgEventPtr epgEvent(new EpgEvent(ERROR_STR, - chanName, - noInfo, - EMPTY_STR, EMPTY_STR, - time(0), - time(0))); - epgEvents.push_back(epgEvent); - } - for (vector::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { - EpgEventPtr epg = *i; - if (prev_chan.Valid() && next_chan.Valid()) - { -}> - <& 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()) prev_chan=(prev_chan) next_chan=(next_chan) &> -<{ - } - else if (prev_chan.Valid()) { -}> - <& 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()) prev_chan=(prev_chan) &> -<{ - } - else if (next_chan.Valid()) { -}> - <& 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()) next_chan=(next_chan) &> -<{ - } - else { -}> - <& 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()) &> -<{ - } - break; - } -}> -<%include>page_exit.eh diff --git a/pages/menu.ecpp b/pages/menu.ecpp index cc81879..fb6b2f9 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -30,6 +30,9 @@ std::string set_component; % } ><$ tr("Recordings") $> | ><$ tr("Remote Control") $> + % if (LiveSetup().UseAuth()) { | <$ tr("Logout") $> % } diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index 6ed608a..6f70d94 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -3,6 +3,7 @@ #include #include #include "tools.h" +#include "i18n.h" using namespace std; using namespace vdrlive; @@ -20,19 +21,64 @@ using namespace vdrlive; <%def logo>
<# ---------------------------------------------------------------------- #> +<%def infobox> +
+
+
+
<$ tr("retrieving status ...") $>
+
--:--
+
+
+
+
--:--
+
+
+
+ > + + + <& ajax_action_href action=("switch_channel") id=("infobox_prevchan") image=("one_downarrow.png") tip=(tr("previous channel")) &> + <& ajax_action_href action=("switch_channel") id=("infobox_nextchan") image=("one_uparrow.png") tip=(tr("next channel")) &> + +
+
+ <& progressbar id=("infobox_elapsed") &> +
+
+
+
+ + +<# ---------------------------------------------------------------------- #> + +<%def infobox_start_update> +<%cpp> { LiveStatusRequest('ibox.xml', 'infobox')<%cpp> } + + +<# ---------------------------------------------------------------------- #> + +<%def hide_element> +<%args> + bool hide = true; + +<%cpp> if (hide) { style="visibility: hidden"<%cpp> } + + +<# ---------------------------------------------------------------------- #> + <%def progressbar> <%args> - string progress; + string progress = "0"; + string id; -
+
px">
<# ---------------------------------------------------------------------- #> @@ -61,8 +107,9 @@ using namespace vdrlive; string param; string image; string alt; + string id; - if (!tip.empty()) { <& tooltip.hint text=(tip) &> <%cpp> } ><$ alt $> +<%cpp> { .xml', 'param', '<$ param $>');" <%cpp>if (!tip.empty()) { <& tooltip.hint text=(tip) &> <%cpp> } ><$ alt $> <%cpp> } <# ---------------------------------------------------------------------- #> diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index d9c620d..87c534e 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -38,7 +38,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& pageelems.ajax_js &> - + <& pageelems.logo &> <& menu active=("recordings") &>
diff --git a/pages/remote.ecpp b/pages/remote.ecpp index c8293aa..354f9b6 100644 --- a/pages/remote.ecpp +++ b/pages/remote.ecpp @@ -70,7 +70,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } //--> - + <& pageelems.logo &> <& menu active="remote" component=("remote.remote_actions")>
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index db775d3..1de1e66 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -55,7 +55,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> - + <& pageelems.logo &> <& menu active=("schedule") component=("schedule.channel_selection")>
diff --git a/pages/searchepg.ecpp b/pages/searchepg.ecpp index bb33c91..da86589 100644 --- a/pages/searchepg.ecpp +++ b/pages/searchepg.ecpp @@ -69,8 +69,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); }> <%cpp> -#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); -#define CHECKIF(x) reply.out() << ( (x) ? "checked=\"checked\"" : "" ); +#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); +#define CHECKIF(x) reply.out() << ( (x) ? "checked=\"checked\"" : "" ); searchtimer = 0; @@ -96,7 +96,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); infos.push_back(os.str()); } searchtimer.SetExtEPGInfo(infos); - } + } searchtimer.SetUseChannel((SearchTimer::eUseChannel)usechannel); if (usechannel == SearchTimer::Interval) { @@ -105,19 +105,19 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } if (usechannel == SearchTimer::Group) searchtimer.SetChannelText(changrpsel); - + searchtimer.SetUseTime(usetime); if (usetime) { searchtimer.SetStartTime(StringToInt(start_h) * 100 + StringToInt(start_m)); searchtimer.SetStopTime(StringToInt(stop_h) * 100 + StringToInt(stop_m)); - } + } searchtimer.SetUseDuration(useduration); if (useduration) { searchtimer.SetMinDuration(durationmin); searchtimer.SetMaxDuration(durationmax); - } + } searchtimer.SetUseDayOfWeek(useweekday); if (useweekday) { @@ -134,7 +134,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetBlacklistMode(blacklistmode); if (blacklistmode == 1) searchtimer.ParseBlacklist(blacklistids_internal); - + searchtimer.SetId(0); string md5 = SearchResults::AddQuery(searchtimer.ToText()); return reply.redirect("searchresults.html?searchtimerquery=" + md5); @@ -150,8 +150,10 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& pageelems.doc_type &> - <& pageelems.ajax_js &> + VDR Live - <$ tr("Search") $> + <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> + <& pageelems.ajax_js &> - - VDR Live - <$ tr("Search") $> - - -
- <& pageelems.logo &> - <& menu active=("searchepg") &> -
-
-
-
- - + + <& pageelems.logo &> + <& menu active=("searchepg") &> +
+ + +
+ + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - - + - -
<$ tr("Search settings") $>
<$ tr("Search term") $>:
<$ tr("Extended search") $>: + onclick="changeduseextendedsearch(this)" id="useextendedsearch"/> + -
<$ tr("Use time") $>: + onclick="changedusetime(this)" id="usetime" /> + +
<$ tr("Use duration") $>: + onclick="changeduseduration(this)" id="useduration" /> + +
<$ tr("Use day of week") $>: + onclick="changeduseweekday(this)" id="useweekday" /> + +
- + <$ tr("Use blacklists" ) $>: + +
-
-
+ +
+ + + + + + + + + + + +
diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index 41284c0..81c53aa 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -34,13 +34,12 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& pageelems.doc_type &> - <& pageelems.ajax_js &> VDR-Live - <$ pageTitle $> - + <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> - + <& pageelems.logo &> <& menu active=("searchtimers") component=("searchtimers.searchtimer_actions")>
diff --git a/pages/timers.ecpp b/pages/timers.ecpp index db45dd6..a910224 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -52,7 +52,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> - + <& pageelems.logo &> <& menu active=("timers") component=("timers.timer_actions")>
diff --git a/pages/tooltip.ecpp b/pages/tooltip.ecpp index 8dedc49..a52eb7b 100644 --- a/pages/tooltip.ecpp +++ b/pages/tooltip.ecpp @@ -23,7 +23,7 @@ value[]; <%args> text; - onmouseover="domTT_activate(this, event, 'predefined', 'tipHint', 'content', '<$ text $>');" +<%cpp> { onmouseover="domTT_activate(this, event, 'predefined', 'tipHint', 'content', '<$ text $>');" <%cpp> } <%def info> diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 68ad112..2e81e23 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -43,7 +43,7 @@ if (type == "now") { <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> - + <& pageelems.logo &> <& menu active=(type) &>
-- cgit v1.2.3