diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-12 19:10:34 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-12 19:10:34 +0000 |
commit | 7b003f8aaafc2d95dcf7c9dfc5cbc6288b37915c (patch) | |
tree | 35ba447699c1fd1c1f41dd672fcc1e127d6ea3cc /pages | |
parent | 9f65a960ca7d4cc3819e1434de05b9428acc23ad (diff) | |
download | vdr-plugin-live-7b003f8aaafc2d95dcf7c9dfc5cbc6288b37915c.tar.gz vdr-plugin-live-7b003f8aaafc2d95dcf7c9dfc5cbc6288b37915c.tar.bz2 |
- Update to the mootools framework.
- New more XHTML compliant tips.
- Optional AJAX enabled infoboxes for epg information.
- Major speed enhancement for the single pages, due to less data to
transfer to the browser.
- See doc/ChangeLog for more detailed changes description.
- See doc/dev-conventions.txt for how we benefit from mootools package
on the ECMAScript side of live.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/Makefile | 3 | ||||
-rw-r--r-- | pages/channels_widget.ecpp | 3 | ||||
-rw-r--r-- | pages/edit_searchtimer.ecpp | 1 | ||||
-rw-r--r-- | pages/edit_timer.ecpp | 1 | ||||
-rw-r--r-- | pages/epginfo.ecpp | 114 | ||||
-rw-r--r-- | pages/ibox.ecpp | 97 | ||||
-rw-r--r-- | pages/login.ecpp | 1 | ||||
-rw-r--r-- | pages/menu.ecpp | 21 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 18 | ||||
-rw-r--r-- | pages/recordings.ecpp | 37 | ||||
-rw-r--r-- | pages/remote.ecpp | 1 | ||||
-rw-r--r-- | pages/schedule.ecpp | 41 | ||||
-rw-r--r-- | pages/searchepg.ecpp | 1 | ||||
-rw-r--r-- | pages/searchresults.ecpp | 21 | ||||
-rw-r--r-- | pages/searchtimers.ecpp | 1 | ||||
-rw-r--r-- | pages/setup.ecpp | 1 | ||||
-rw-r--r-- | pages/timers.ecpp | 1 | ||||
-rw-r--r-- | pages/tooltip.ecpp | 41 | ||||
-rw-r--r-- | pages/whats_on.ecpp | 38 |
19 files changed, 209 insertions, 233 deletions
diff --git a/pages/Makefile b/pages/Makefile index 09818e5..fde3974 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -22,7 +22,8 @@ OBJS = menu.o channels.o recordings.o schedule.o \ searchtimers.o edit_searchtimer.o searchresults.o \ searchepg.o login.o ibox.o xmlresponse.o \ play_recording.o pause_recording.o stop_recording.o \ - ffw_recording.o rwd_recording.o setup.o content.o + ffw_recording.o rwd_recording.o setup.o content.o \ + epginfo.o ### Default rules: diff --git a/pages/channels_widget.ecpp b/pages/channels_widget.ecpp index ed6d30e..fcf8321 100644 --- a/pages/channels_widget.ecpp +++ b/pages/channels_widget.ecpp @@ -27,8 +27,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); int lastChannel = LiveSetup().GetLastChannel(); </%cpp> <select name="<$ name $>" <{ reply.out() << ( !onchange.empty() ? "onchange=\""+onchange+"\"" : "" ); }>> -% for ( cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= lastChannel; -% listChannel = Channels.Next( listChannel ) ) { +% for ( cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= lastChannel; listChannel = Channels.Next( listChannel ) ) { % if ( listChannel->GroupSep() || *listChannel->Name() == '\0' ) % continue; % diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index c541ede..4d27b59 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -331,7 +331,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR Live - <$ editsearchtimer ? tr("Edit search timer") : tr("New search timer") $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index 73e2852..6bf3b9c 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -126,7 +126,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> <body> diff --git a/pages/epginfo.ecpp b/pages/epginfo.ecpp new file mode 100644 index 0000000..9487040 --- /dev/null +++ b/pages/epginfo.ecpp @@ -0,0 +1,114 @@ +<%pre> +#include <sys/stat.h> +#include <vdr/tools.h> +#include "exception.h" +#include "setup.h" +#include "tools.h" +#include "epg_events.h" +#include "recordings.h" + +using namespace vdrlive; +using namespace std; + +</%pre> +<%args> + string epgid; + string async; +</%args> +<%session scope="global"> +bool logged_in(false); +</%session> +<%include>page_init.eh</%include> +<%cpp> +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +</%cpp> +<%cpp> + pageTitle = tr("Electronic program guide information"); + + bool ajaxReq = !async.empty() && (lexical_cast<int>(async) != 0); + + EpgInfoPtr epgEvent; + bool aboutBox(false); + + // These get initialized when needed. When freed by getting out + // out of scope they will release (if initialized) important + // Semaphores/Locks. + cSchedulesLock schedulesLock; + RecordingsManagerPtr recordings; + + if (!epgid.empty()) { + + const string recording("recording_"); + const string event("event_"); + const string aboutbox("aboutBox"); + + // check for recording: + if (epgid.compare(0, recording.length(), recording) == 0) { + recordings = LiveRecordingsManager(); + const cRecording* recording = recordings->GetByMd5Hash(epgid); + if (recording == 0) { + throw HtmlError(tr("Couldn't find recording or no recordings available")); + } + epgEvent = EpgEvents::CreateEpgInfo(epgid, recording); + } + // check for event: + else if (epgid.compare(0, event.length(), event) == 0) { + const cSchedules* schedules = cSchedules::Schedules(schedulesLock); + if (!schedules) { + throw HtmlError(tr("Error aquiring schedules")); + } + epgEvent = EpgEvents::CreateEpgInfo(epgid, schedules); + } + // check for aboutbox: + else if (epgid.compare(0, aboutbox.length(), aboutbox) == 0) { + aboutBox = true; + } + } +</%cpp> +<& pageelems.doc_type &> +<html> + <head> + <title>VDR-Live - <$ pageTitle $></title> +<%cpp> + if (!ajaxReq) { +</%cpp> + <& pageelems.stylesheets &> + <& pageelems.ajax_js &> +<%cpp> + } +</%cpp> + </head> + <body> +<%cpp> + if (!ajaxReq) { +</%cpp> + <& pageelems.logo &> + <& menu &> +<%cpp> + } +</%cpp> + <div class="inhalt"> +<%cpp> + if (epgEvent) { + string start(epgEvent->StartTime("%a,") + string(" ") + + epgEvent->StartTime(tr("%b %d %y")) + string(" ") + + epgEvent->StartTime(tr("%I:%M %p"))); + string tools_component; + if (recordings) { + tools_component = epgEvent->Archived().empty() ? "recordings.rec_tools" : "recordings.archived_disc" ; + } +</%cpp> + <& pageelems.epg_tt_box boxId=(epgEvent->Id()) caption=(epgEvent->Caption()) tools_comp=(tools_component) time=(start) title=(epgEvent->Title()) short_descr=(epgEvent->ShortDescr()) long_descr=(epgEvent->LongDescr()) archived=(epgEvent->Archived()) elapsed=(epgEvent->Elapsed()) &> +<%cpp> + } + if (aboutBox) { +</%cpp> + <& pageelems.about_tt_box &> +<%cpp> + } +</%cpp> + </div> + </body> +</html> + +<%include>page_exit.eh</%include> diff --git a/pages/ibox.ecpp b/pages/ibox.ecpp index 4d819f5..0118c07 100644 --- a/pages/ibox.ecpp +++ b/pages/ibox.ecpp @@ -25,7 +25,6 @@ int update_status(1); </%session> <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); - EpgEvents epgEvents; string EMPTY_STR; tChannelID prev_chan; tChannelID next_chan; @@ -39,25 +38,16 @@ int update_status(1); #else const char* NowReplaying = cControl::Control()?cReplayControl::LastReplayed():NULL; #endif + + EpgInfoPtr epgEvent; + if (NowReplaying) { RecordingsManagerPtr recManager = LiveRecordingsManager(); cRecording *recording = Recordings.GetByName(NowReplaying); if (recording) { - string name(recording->Name()); - size_t index = name.find_last_of('~'); - if (index != string::npos) - name = name.substr(index, name.length()); - const cRecordingInfo* info = recording->Info(); - if (info) { - EpgEventPtr epgEvent(new EpgEvent(recManager->Md5Hash(recording), - tr("playing recording"), - info->Title() ? info->Title() : name, - info->ShortText() ? info->ShortText() : "", - info->Description() ? info->Description() : "", - recording->start, - recording->start)); - epgEvents.push_back(epgEvent); - } + epgEvent = EpgEvents::CreateEpgInfo(recManager->Md5Hash(recording), + recording, + tr("playing recording")); } } else { @@ -75,7 +65,7 @@ int update_status(1); if (tmp) next_chan = tmp->GetChannelID(); - string chanName(Channel->Name()); + const string chanName(Channel->Name()); cSchedulesLock schedulesLock; const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); const cSchedule *Schedule = Schedules->GetSchedule(Channel); @@ -83,80 +73,61 @@ int update_status(1); if (Schedule) { const cEvent *Event = Schedule->GetPresentEvent(); if (Event) { - EpgEventPtr epgEvent(new EpgEvent(CHANNEL_STR, - Event, - Channel->Name())); - epgEvents.push_back(epgEvent); + epgEvent = EpgEvents::CreateEpgInfo(Channel, + Event, + CHANNEL_STR.c_str()); } 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); + const string noInfo(tr("no epg info for current event!")); + epgEvent = EpgEvents::CreateEpgInfo(CHANNEL_STR, + chanName, + noInfo); } } 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); + const string noInfo(tr("no epg info for current channel!")); + epgEvent = EpgEvents::CreateEpgInfo(CHANNEL_STR, + Channel->Name(), + noInfo); } } 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); + const string chanName(tr("no current channel!")); + epgEvent = EpgEvents::CreateEpgInfo(CHANNEL_STR, + chanName, + chanName); } } - 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); + if (!epgEvent) { + const string ERROR_STR("error"); + const string noInfo(tr("error retrieving status info!")); + const string chanName(tr("no current channel!")); + epgEvent = EpgEvents::CreateEpgInfo(ERROR_STR, + chanName, + noInfo); } - for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { - EpgEventPtr epg = *i; + else { if (prev_chan.Valid() && next_chan.Valid()) { </%cpp> -<& xmlresponse.ibox update=(update_status) 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) &> +<& xmlresponse.ibox update=(update_status) type=(epgEvent->Id()) caption=(epgEvent->Caption()) currentTime=(epgEvent->CurrentTime(tr("%I:%M:%S %p"))) duration=(epgEvent->StartTime(tr("%I:%M %p")) + string(" - ") + epgEvent->EndTime(tr("%I:%M %p"))) title=(epgEvent->Title()) elapsed=(epgEvent->Elapsed()) prev_chan=(prev_chan) next_chan=(next_chan) &> <%cpp> } else if (prev_chan.Valid()) { </%cpp> -<& xmlresponse.ibox update=(update_status) 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) &> +<& xmlresponse.ibox update=(update_status) type=(epgEvent->Id()) caption=(epgEvent->Caption()) currentTime=(epgEvent->CurrentTime(tr("%I:%M:%S %p"))) duration=(epgEvent->StartTime(tr("%I:%M %p")) + string(" - ") + epgEvent->EndTime(tr("%I:%M %p"))) title=(epgEvent->Title()) elapsed=(epgEvent->Elapsed()) prev_chan=(prev_chan) &> <%cpp> } else if (next_chan.Valid()) { </%cpp> -<& xmlresponse.ibox update=(update_status) 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) &> +<& xmlresponse.ibox update=(update_status) type=(epgEvent->Id()) caption=(epgEvent->Caption()) currentTime=(epgEvent->CurrentTime(tr("%I:%M:%S %p"))) duration=(epgEvent->StartTime(tr("%I:%M %p")) + string(" - ") + epgEvent->EndTime(tr("%I:%M %p"))) title=(epgEvent->Title()) elapsed=(epgEvent->Elapsed()) next_chan=(next_chan) &> <%cpp> } else { </%cpp> -<& xmlresponse.ibox update=(update_status) 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()) &> +<& xmlresponse.ibox update=(update_status) type=(epgEvent->Id()) caption=(epgEvent->Caption()) currentTime=(epgEvent->CurrentTime(tr("%I:%M:%S %p"))) duration=(epgEvent->StartTime(tr("%I:%M %p")) + string(" - ") + epgEvent->EndTime(tr("%I:%M %p"))) title=(epgEvent->Title()) elapsed=(epgEvent->Elapsed()) &> <%cpp> } - break; } </%cpp> diff --git a/pages/login.ecpp b/pages/login.ecpp index 70fe7d8..754ec82 100644 --- a/pages/login.ecpp +++ b/pages/login.ecpp @@ -38,7 +38,6 @@ if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetSt <head> <title>VDR-Live - <$ tr("Login") $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> <body onload="document.auth.login.focus()"> diff --git a/pages/menu.ecpp b/pages/menu.ecpp index e94e885..ff42045 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -32,23 +32,23 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); set_component = component; }> <div class="menu"> - <a href="whats_on.html?type=now" <& menu.setactive current=("whats_on") &>><$ tr("What's on?") $></a> | - <a href="schedule.html" <& menu.setactive current=("schedule") &>><$ tr("Schedule") $></a> | - <a href="timers.html" <& menu.setactive current=("timers") &>><$ tr("Timers") $></a> | + <a href="whats_on.html?type=now" <& menu.setactive current=("whats_on") &>><$ tr("What's on?") $></a> + | <a href="schedule.html" <& menu.setactive current=("schedule") &>><$ tr("Schedule") $></a> + | <a href="timers.html" <& menu.setactive current=("timers") &>><$ tr("Timers") $></a> % if ( LiveFeatures< features::epgsearch >().Recent() ) { - <a href="searchepg.html" <& menu.setactive current=("searchepg") &>><$ tr("Search") $></a> | - <a href="searchtimers.html" <& menu.setactive current=("searchtimers") &>><$ tr("Searchtimers") $></a> | + | <a href="searchepg.html" <& menu.setactive current=("searchepg") &>><$ tr("Search") $></a> + | <a href="searchtimers.html" <& menu.setactive current=("searchtimers") &>><$ tr("Searchtimers") $></a> % } - <a href="recordings.html" <& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a> | - <a href="remote.html" <& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a> | - <a href="setup.html" <& menu.setactive current=("setup") &>><$ tr("Setup") $></a> + | <a href="recordings.html" <& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a> + | <a href="remote.html" <& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a> + | <a href="setup.html" <& menu.setactive current=("setup") &>><$ tr("Setup") $></a> <# --- Used by D.H. to test infobox (not part of the released version) | <a href="ibox_status.html" <& menu.setactive current=("status") &>><$ tr("Status Test") $></a> --- #> % if (LiveSetup().UseAuth()) { | <a id="login" href="login.html?action=logout"><$ tr("Logout") $></a> % } - | <a<& tooltip.display domId=("aboutBox") &> href="#">?</a> + | <a <& tooltip.display domId=("aboutBox") &>>?</a> </div> % if (!component.empty()) { <div class="pagemenu"> @@ -67,9 +67,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); </div> </div> % } -<div style="display:none;"> - <& pageelems.about_tt_box &> -</div> <%def setactive> <%args> diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index cab4a5c..c8efa22 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -125,16 +125,18 @@ int update_status(1); <%def ajax_js> <script type="text/javascript" src="js/mootools/mootools.v1.11.js"></script> <script type="text/javascript" src="js/live/liveajax.js"></script> + <script type="text/javascript" src="js/live/infowin.js"></script> + <script type="text/javascript" src="js/live/hinttips.js"></script> <%cpp>if (LiveSetup().GetShowInfoBox()) { </%cpp> <script type="text/javascript" src="js/live/vdr_status.js"></script> <script type="text/javascript"><!-- var InfoBox = new LiveVdrInfo('ibox.xml', 'infobox'); window.addEvent('domready', function(){ - InfoBox.request(<%cpp> if (update_status) { reply.sout() << "true"; } else { reply.sout() << "false"; } </%cpp>); - }); + InfoBox.request(<%cpp> if (update_status) { reply.sout() << "true"; } else { reply.sout() << "false"; } </%cpp>); + }); window.addEvent('unload', function(){ - InfoBox.pageFinished(); - }); + InfoBox.pageFinished(); + }); --></script> <%cpp> } </%cpp> </%def> @@ -169,7 +171,7 @@ int update_status(1); </%args> <div class="epg_description" id="<$ (boxId) $>"> <div class="station"> - <div class="boxheader"><div><div><$ (caption) $><& tooltip.close domId=(boxId) &></div></div></div> + <div class="boxheader"><div><div class="caption"><$ (caption) $></div></div></div> </div> <div class="epg_content"> <div class="epg_tools"> @@ -191,11 +193,11 @@ int update_status(1); </%def> <%def about_tt_box> - <div class="about_box" id="aboutBox"> + <div class="epg_description" id="aboutBox"> <div class="station"> - <div class="boxheader"><div><div><$ tr(LIVESUMMARY) $><& tooltip.close domId=("aboutBox") &></div></div></div> + <div class="boxheader"><div><div class="caption"><$ tr(LIVESUMMARY) $></div></div></div> </div> - <div class="about_content"> + <div class="epg_content"> <div> <div class="about_head"><div><div><$ tr("Authors") $></div></div></div> <div class="about_left"><$ tr("Project leader") $>:</div> diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index 2132541..5ceb7b4 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -20,7 +20,6 @@ using namespace std; </%session> <%request scope="page"> RecordingsTree recordingsTree(LiveRecordingsManager()); -EpgEvents epgEvents; </%request> <%include>page_init.eh</%include> <%cpp> @@ -33,7 +32,6 @@ EpgEvents epgEvents; <head> <title>VDR-Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript" src="treeview.js"></script> </head> @@ -52,11 +50,6 @@ EpgEvents epgEvents; </div> % } </div> -% if (Recordings.Count() > 0) { - <div class="epg_data" style="display: none;"> -<& recordings.recordings_data &> - </div> -% } </body> </html> <%include>page_exit.eh</%include> @@ -98,16 +91,13 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { for (iter = recordingsTree.begin(path); iter != end; ++iter) { RecordingsTree::RecordingsItemPtr recItem = iter->second; if (!recItem->IsDir()) { - EpgEventPtr epgEvent(RecordingsTree::CreateEpgEvent(recItem)); - if (epgEvent) { - epgEvents.push_back(epgEvent); - } string day(FormatDateTime("%a,", recItem->StartTime())); string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;"); - string hint(tr("Click to view details.")); if (epgEvent && !epgEvent->ShortDescr().empty()) hint = (epgEvent->ShortDescr() + "<br />" + hint); + string shortDescr(recItem->RecInfo()->ShortText() ? recItem->RecInfo()->ShortText() : ""); + string hint(tr("Click to view details.")); if (!shortDescr.empty()) hint = shortDescr + "<br />" + hint; </%cpp> <li class="recording"> - <& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) hint=(hint) shortDescr=(epgEvent ? epgEvent->ShortDescr() : "") archived=(epgEvent ? epgEvent->Archived() : "") archiveId=(recItem->ArchiveId()) &> + <& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &> </li> <%cpp> } @@ -117,24 +107,6 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { <# ---------------------------------------------------------------------- #> -<%def recordings_data> -<%cpp> - // create hidden div for the tooltip hints. - for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { - EpgEventPtr epg = *i; - string start(epg->StartTime("%a,") + string(" ") - + epg->StartTime(tr("%b %d %y")) + string(" ") - + epg->StartTime(tr("%I:%M %p"))); - string tools_component = epg->Archived().empty() ? "recordings.rec_tools" : "recordings.archived_disc" ; -</%cpp> - <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) tools_comp=(tools_component) time=(start) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) archived=(epg->Archived()) elapsed=(epg->Elapsed()) &> -<%cpp> - } -</%cpp> -</%def> - -<# ---------------------------------------------------------------------- #> - <%def rec_tools> <%args> string id; @@ -182,7 +154,6 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { string hint; string shortDescr; string archived; - string archiveId; </%args> <div class="recording_item"> <div class="recording_imgs"><%cpp> reply.out() << StringRepeat(level + 1, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />"); </%cpp><%cpp> if (!archived.empty()) { </%cpp><& archived_disc archived=(archived) &><%cpp> } else { </%cpp><img src="<$ LiveSetup().GetThemedLink("img", "movie.png") $>" alt="movie" /><%cpp> } </%cpp></div> @@ -190,7 +161,7 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { <div class="recording_day" style="width: <$ dayLen $>"><$ day $></div> <div class="recording_date"><$ FormatDateTime(tr("%b %d %y"), startTime) $></div> <div class="recording_time"><$ FormatDateTime(tr("%I:%M %p"), startTime) $></div> - <div class="recording_name" <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span> </span><%cpp> } </%cpp></div> + <div class="recording_name"><a <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span> </span><%cpp> } </%cpp></a></div> </div> <div class="recording_actions"> <%cpp> diff --git a/pages/remote.ecpp b/pages/remote.ecpp index 10eea15..4805728 100644 --- a/pages/remote.ecpp +++ b/pages/remote.ecpp @@ -26,7 +26,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR-Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- var newImg = new Image(); diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index 39942bb..f427a53 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -59,7 +59,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> <body> @@ -74,10 +73,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } else { </%cpp> - <table class="listing" cellspacing="0" cellpadding="0"> + <table class="listing" cellspacing="0" cellpadding="0"> <%cpp> - EpgEvents epgEvents; - string current_day = ""; const cEvent* PresentEvent = Schedule->GetPresentEvent(); time_t now = time(NULL) - ::Setup.EPGLinger * 60; @@ -87,21 +84,16 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); if (Event->EndTime() <= now && Event != PresentEvent) continue; - string evntId("eventId_"); - evntId += lexical_cast<std::string, int>(++evntNr); - EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); - epgEvents.push_back(epgEvent); + EpgInfoPtr epgEvent = EpgEvents::CreateEpgInfo(Channel, Event); + + string title(epgEvent->Title()); + string short_description(epgEvent->ShortDescr()); + string description(epgEvent->LongDescr()); + string start(epgEvent->StartTime(tr("%I:%M %p"))); + string end(epgEvent->EndTime(tr("%I:%M %p"))); + string day(epgEvent->StartTime(tr("%A, %b %d %Y"))); + string strEventID = lexical_cast<string>(Event->EventID()); - string title(Event->Title() ? Event->Title() : ""); - string short_description(Event->ShortText() ? Event->ShortText() : ""); - string description(Event->Description() ? Event->Description() : ""); - string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); - string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); - string day(Event->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), Event->StartTime()) : ""); - tEventID event = Event->EventID(); - ostringstream os; - os << Event->EventID(); - string strEventID = os.str(); bool truncated = false; bool lastEventCurrentDay = false; { @@ -132,26 +124,17 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } </%cpp> <tr> - <td class="action leftcol <? lastEventCurrentDay ? "bottomrow" ?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td> + <td class="action leftcol <? lastEventCurrentDay ? "bottomrow" ?>"><& pageelems.event_timer channelid=(channel_id) eventid=(strEventID) &></td> <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> <td class="topaligned <? lastEventCurrentDay ? "bottomrow" ?>"><div class="withmargin"><$ start $> - <$ end $></div></td> - <td class="<? (Event == PresentEvent) ? "current" ?> topaligned rightcol <? lastEventCurrentDay ? "bottomrow" ?>"><div class="more withmargin" <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ title $></span><br /><span class="short"><%cpp>if (short_description.empty()) { </%cpp> <%cpp> } </%cpp><$ short_description $></span></div></td> + <td class="<? (Event == PresentEvent) ? "current" ?> topaligned rightcol <? lastEventCurrentDay ? "bottomrow" ?>"><div class="more withmargin"><a <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ title $></span><br /><span class="short"><%cpp>if (short_description.empty()) { </%cpp> <%cpp> } </%cpp><$ short_description $></span></a></div></td> </tr> <%cpp> } </%cpp> </table> - </div> - <div class="epg_data" style="display: none;"> -<%cpp> - // create hidden div for the tooltip hints. - for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { - EpgEventPtr epg = *i; -</%cpp> - <& 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()) &> <%cpp> - } } </%cpp> </div> diff --git a/pages/searchepg.ecpp b/pages/searchepg.ecpp index 9ed1387..f885d4e 100644 --- a/pages/searchepg.ecpp +++ b/pages/searchepg.ecpp @@ -152,7 +152,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR Live - <$ tr("Search") $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp index e2b83a2..63226d5 100644 --- a/pages/searchresults.ecpp +++ b/pages/searchresults.ecpp @@ -47,7 +47,6 @@ bool logged_in(false); <head> <title>VDR-Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> <body> @@ -60,8 +59,6 @@ bool logged_in(false); <table class="listing" cellspacing="0" callpadding="0"> <%cpp> string current_day = ""; - EpgEvents epgEvents; - int evntNr = 0; for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) { string channelname = Channels.GetByChannelID(result->Channel())->Name(); @@ -72,11 +69,8 @@ bool logged_in(false); tEventID event = result->EventId(); tChannelID channel_id(result->Channel()); string description = result->Description(); + string epgDomId(EpgEvents::GetDomId(result->Channel(), event)); - string evntId("eventId_"); - evntId += lexical_cast<std::string, int>(++evntNr); - EpgEventPtr epgEvent(new EpgEvent(evntId, channelname, result->Title(), result->ShortText(), description, result->StartTime(), result->StopTime())); - epgEvents.push_back(epgEvent); bool truncated = false; bool bottom = false; @@ -104,22 +98,11 @@ bool logged_in(false); <td class="action leftcol <? bottom ? "bottomrow"?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td> <td class="topaligned <? bottom ? "bottomrow"?>"><div class="withmargin"><a href="schedule.html?channel=<$ channelnr $>"><$ channelname $></a></div></td> <td class="topaligned <? bottom ? "bottomrow"?>"><div class="withmargin"><$ start $> - <$ end $></div></td> - <td class="topaligned rightcol <? bottom ? "bottomrow"?>"><div class="more withmargin"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ result->Title() $></span><br /><span class="short"><%cpp>if (result->ShortText().empty()) { </%cpp> <%cpp> } </%cpp><$ result->ShortText() $></span></div></td> + <td class="topaligned rightcol <? bottom ? "bottomrow"?>"><div class="more withmargin"><a <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgDomId) &>><span class="title"><$ result->Title() $></span><br /><span class="short"><%cpp>if (result->ShortText().empty()) { </%cpp> <%cpp> } </%cpp><$ result->ShortText() $></span></a></div></td> </tr> % } </table> </div> - <div class="epg_data" style="display: none;"> -<%cpp> - // create hidden div for the tooltip hints. - for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { - EpgEventPtr epg = *i; -</%cpp> - <& 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()) &> -<%cpp> - } -</%cpp> - </div> </body> </html> diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index 4cb4a1b..d061843 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -38,7 +38,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR-Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> <body> diff --git a/pages/setup.ecpp b/pages/setup.ecpp index ac9f2c5..2ec0e28 100644 --- a/pages/setup.ecpp +++ b/pages/setup.ecpp @@ -75,7 +75,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <head> <title>VDR-Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- function initform() diff --git a/pages/timers.ecpp b/pages/timers.ecpp index 292f26f..ff637f2 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -47,7 +47,6 @@ using namespace vdrlive; <head> <title>VDR-Live - <$ pageTitle $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> <body> diff --git a/pages/tooltip.ecpp b/pages/tooltip.ecpp index bd11415..e7ddaa6 100644 --- a/pages/tooltip.ecpp +++ b/pages/tooltip.ecpp @@ -4,58 +4,23 @@ using namespace vdrlive; </%pre> -<%def javascript> -<%args> -styleClass="domTThint"; -var[]; -value[]; -</%args> - <script type="text/javascript" src="domLib.js"></script> - <script type="text/javascript" src="domTT.js"></script> - <script type="text/javascript" src="domTT_drag.js"></script> - <script type="text/javascript"> - var domTT_styleClass = "<$ styleClass $>"; -% int idx = 0; -% for (var_type::const_iterator it = var.begin(); it != var.end(); ++it, idx++) { - var <$ *it $> = "<$ (value[idx]) $>"; -% } - domTT_addPredefined('tipHint', 'trail', true, 'delay', 0, 'styleClass', 'domTThint'); - domTT_addPredefined('tipInfo', 'trail', true, 'delay', 0); - domTT_addPredefined('tipDisp', 'trail', false, 'delay', 0, 'type', 'sticky', 'caption', false, 'offsetX', -30, 'offsetY', -30, 'draggable', true); - </script> -</%def> - <%def hint> <%args> text; </%args> -<%cpp> { </%cpp> onmouseover="domTT_activate(this, event, 'predefined', 'tipHint', 'content', '<$ text $>');" <%cpp> } </%cpp> -</%def> - -<%def info> -<%args> -domId; -</%args> - onmouseover="domTT_activate(this, event, 'predefined', 'tipInfo', 'content', document.getElementById('<$ domId $>'));" +title="<$ text $>" </%def> <%def display> <%args> domId; </%args> - onclick="domTT_close(domTT_lastOpened); return makeFalse(domTT_activate(this, event, 'predefined', 'tipDisp', 'content', document.getElementById('<$ domId $>'), 'id', '<$ (domId + "_tip") $>'));" -</%def> - -<%def close> -<%args> -domId; -</%args> - <a href="#void" onclick="domTT_close('<$ (domId + "_tip") $>')"><img src="<$ LiveSetup().GetThemedLink("img", "close.png") $>" alt="" /></a> +href="epginfo.html?epgid=<$ domId $>" </%def> <%def help> <%args> text; </%args> - <img src="<$ LiveSetup().GetThemedLink("img", "help.png") $>" onmouseover="domTT_close(domTT_lastOpened); domTT_activate(this, event, 'predefined', 'tipHint', 'content', '<$ text $>');"></img> +<img src="<$ LiveSetup().GetThemedLink("img", "help.png") $>" alt="" <& hint text=(text) &>></img> </%def> diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 8f052ce..d149e55 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -79,7 +79,6 @@ if (type == "now") { <head> <title>VDR-Live - <$ head $></title> <& pageelems.stylesheets &> - <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- function showtime(selection) @@ -109,7 +108,7 @@ if (type == "now") { ReadLock channelsLock( Channels ); if (channelsLock) { - int evntNr = 0; + // int evntNr = 0; for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { if (Channel->GroupSep()) { continue; @@ -129,13 +128,23 @@ if (type == "now") { continue; } - string evntId("eventId_"); - evntId += lexical_cast<std::string, int>(++evntNr); - EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); - epgEvents.push_back(epgEvent); tChannelID channel_id(Channel->GetChannelID()); tEventID event = Event->EventID(); + + // string evntId("event_"); + // + // string schanid(channel_id.ToString()); + // replace(schanid.begin(), schanid.end(), '.', 'p'); + // replace(schanid.begin(), schanid.end(), '-', 'm'); + // evntId += schanid; + // evntId += '_'; + // evntId += lexical_cast<std::string>(event); + // // evntId += lexical_cast<std::string, int>(++evntNr); + // EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); + // // epgEvents.push_back(epgEvent); + EpgInfoPtr epgEvent = EpgEvents::CreateEpgInfo(Channel, Event); + bool truncated = false; string truncDescription = StringWordTruncate(epgEvent->LongDescr(), maximumTooltipHintLength, truncated); string longDescription = StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) @@ -168,7 +177,7 @@ if (type == "now") { <div class="short withmargin"><$ (epgEvent->ShortDescr()) $></div> <div class="description withmargin"><$ truncDescription $></div> % if (truncated) { - <div class="more withmargin"<& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>><$ tr("more") $> ...</div> + <div class="more withmargin"><a <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>><$ tr("more") $> ...</a></div> % } </div> </div> @@ -193,11 +202,11 @@ if (type == "now") { </div> </td> <td class="topaligned <? lastCurrentChanel ? "bottomrow"?>"> - <div class="more withmargin" + <div class="more withmargin"><a % if (!longDescription.empty()) { <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &> % } - ><span class="title"><$ (epgEvent->Title()) $></span><br /><span class="short"><$ (epgEvent->ShortDescr()) $></span></div> + ><span class="title"><$ (epgEvent->Title()) $></span><br /><span class="short"><$ (epgEvent->ShortDescr()) $></span></a></div> </td> <td class="topaligned rightcol <? lastCurrentChanel ? "bottomrow"?>"><div class="station withmargin"><a href="schedule.html?channel=<$ Channel->Number() $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (epgEvent->Caption()) $></a></div></td> </tr> @@ -210,17 +219,6 @@ if (type == "now") { </table> % } </div> - <div class="epg_data" style="display: none;"> -<%cpp> - // create hidden div for the tooltip hints. - for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { - EpgEventPtr epg = *i; -</%cpp> - <& 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()) &> -<%cpp> - } -</%cpp> - </div> </body> </html> <%include>page_exit.eh</%include> |