diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-05-27 08:02:35 +0000 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-05-27 08:02:35 +0000 |
commit | ffe665bc701a0e89706394e7180c92e3ea95dd4f (patch) | |
tree | 6900f28499eb0acf095533c25b50d18038f8f312 /pages | |
parent | 7be7e55411a9556ed08107ff5605bfb5f75435d5 (diff) | |
download | vdr-plugin-live-ffe665bc701a0e89706394e7180c92e3ea95dd4f.tar.gz vdr-plugin-live-ffe665bc701a0e89706394e7180c92e3ea95dd4f.tar.bz2 |
- again more flexible handling a lazy input time
- redisplay selected or given time (dropdown / input field) in corresponding field after reload
Diffstat (limited to 'pages')
-rw-r--r-- | pages/whats_on.ecpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index a28b381..7e27bc8 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -15,6 +15,7 @@ using namespace vdrlive; <%args> type = "now"; string attime; +string fixtime; </%args> <%session scope="global"> @@ -30,14 +31,19 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); string head; time_t seektime = 0; +string displaytime; if (type == "now") { head = tr("What's running at")+string(" ")+FormatDateTime(tr("%I:%M %p"), time(0)); } else if (type == "next") { head = tr("What's on next?"); } else if (type == "at") { - attime = ExpandTimeString(attime); - seektime = GetTimeT(attime); + if (attime != "") + displaytime = ExpandTimeString(attime); + else if (fixtime != "") + displaytime = ExpandTimeString(fixtime); + + seektime = GetTimeT(displaytime); if (seektime - time(0) + 3600 < 0) // if wanted time is past more then 1h, then use tomorrow seektime += SECSINDAY; head = tr("What's running at") + string(" ") + FormatDateTime(tr("%I:%M %p"), seektime) +string(" (") +FormatDateTime(tr("%a, %b %d"), seektime) + string(")"); @@ -54,12 +60,24 @@ if (type == "now") { <script type="text/javascript"><!-- function init() { - document.getElementById("spectime").value = "<$ attime $>"; +% if (attime != "") { + document.getElementById("spectime").value = "<$ attime $>"; +% } +<{ + if (fixtime != "") { + vector< string > parts = StringSplit( LiveSetup().GetTimes(), ';' ); + vector< string >::const_iterator part = parts.begin(); + for ( int i = 0; part != parts.end(); ++i, ++part ) { + if (*part == fixtime) { +}> + document.getElementById("userdeftimes").options[<$ i+1 $>].selected = true; +<{ }}} +}> } function showtime(selection) { if (selection.options[selection.selectedIndex].value != "") - window.location.href = "whats_on.html?type=at&attime=" + selection.options[selection.selectedIndex].value; + window.location.href = "whats_on.html?type=at&fixtime=" + selection.options[selection.selectedIndex].value; } function showspectime(selection) { |