summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-01-19 22:03:03 +0000
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-01-19 22:03:03 +0000
commite5188e9418ed183d5d1a2ad4d3148f3578f2ead1 (patch)
tree89cd98939d217768bbfeafe2268c6fa388a41395 /pages
parent359faf6c427f3ced6ec938e8b029b5f614eed4eb (diff)
downloadvdr-plugin-live-e5188e9418ed183d5d1a2ad4d3148f3578f2ead1.tar.gz
vdr-plugin-live-e5188e9418ed183d5d1a2ad4d3148f3578f2ead1.tar.bz2
- Added new class epgEvent. Sie epg_events.h. This class collects epg
data from other structures. It can the be used to appent to the page a hidden section with full epg datas for the epg-popup boxes. - Changed whats_on to uses this new feature. - No description in the event boxes any more. A mouse over tooltip shows a shortened version of the description. A click on 'more' displays a full epg box. - Added tip parameter to ajax_action_href. The text is displayed as tooltip when hoovering over the link. - Adapted style.css to make event boxes smaller.
Diffstat (limited to 'pages')
-rw-r--r--pages/pageelems.ecpp41
-rw-r--r--pages/recordings.ecpp2
-rw-r--r--pages/whats_on.ecpp51
3 files changed, 47 insertions, 47 deletions
diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp
index 932184b..61089b1 100644
--- a/pages/pageelems.ecpp
+++ b/pages/pageelems.ecpp
@@ -4,41 +4,23 @@
#include "tools.h"
using namespace std;
+using namespace vdrlive;
</%pre>
+<# ---------------------------------------------------------------------- #>
+
<%def doc_type>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</%def>
+<# ---------------------------------------------------------------------- #>
+
<%def logo>
<img src="logo.png" alt="VDR Live!" class="logo"/>
</%def>
-<#
-<%def header_box>
-<%args>
-content[];
-component;
-</%args>
-<{
-}>
- <div class="head_box_l">
- <div class="head_box_m">
- <div class="head_box_r">
- <table class="head_box_text"><tr><td>
-% for(content_type::const_iterator it = content.begin(); it != content.end(); ++it) {
- <$ *it $>
-% }
-% if (!component.empty()) {
- <& (component) &>
-% }
- </td></tr></table>
- </div>
- </div>
- </div>
-</%def>
-#>
+<# ---------------------------------------------------------------------- #>
<%def event_timer>
<%args>
@@ -48,20 +30,27 @@ component;
<a href="edit_timer.html?channelid=<$ channelid $>&eventid=<$ eventid $>"><img src="record.png" alt="" <& tooltip.hint text=(tr("Record this")) &> /></a>
</%def>
+<# ---------------------------------------------------------------------- #>
+
<%def ajax_js>
<script type="text/javascript" language="javascript" src="ajax.js"></script>
</%def>
+<# ---------------------------------------------------------------------- #>
+
<%def ajax_action_href>
<%args>
string action;
+ string tip;
string param;
string image;
string alt = "";
</%args>
- <a href="javascript:LiveSimpleAjaxRequest('<$ action $>.xml', 'param', '<$ param $>');"><img src="<$ image $>" border="0" alt="<$ alt $>" /></a>
+ <a href="javascript:LiveSimpleAjaxRequest('<$ action $>.xml', 'param', '<$ param $>');" <%cpp>if (!tip.empty()) { </%cpp><& tooltip.hint text=(tip) &> <%cpp> } </%cpp>><img src="<$ image $>" alt="<$ alt $>" /></a>
</%def>
+<# ---------------------------------------------------------------------- #>
+
<%def epg_tt_box>
<%args>
string boxId;
@@ -85,7 +74,7 @@ component;
<div class="title"><$ (title) $></div>
<div class="short"><$ (short_descr) $></div>
<div class="description">
- <$ (long_descr) $>
+ <{ reply.out() << StringEscapeAndBreak(long_descr); }>
</div>
</div>
</div>
diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp
index 59d255c..a97dd17 100644
--- a/pages/recordings.ecpp
+++ b/pages/recordings.ecpp
@@ -37,7 +37,7 @@ RecordingsTree::RecordingsItemPtr currRecItem;
<div class="recordings">
<& recordings.recordings_item &>
</div>
- <div class="recordings_data" style="display: none;">
+ <div class="epg_data" style="display: none;">
<& recordings.recordings_data &>
</div>
% }
diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp
index b9062e0..d0e0595 100644
--- a/pages/whats_on.ecpp
+++ b/pages/whats_on.ecpp
@@ -6,6 +6,7 @@
#include <vdr/i18n.h>
#include "setup.h"
#include "tools.h"
+#include "epg_events.h"
using namespace std;
using namespace vdrlive;
@@ -34,7 +35,7 @@ if (type == "now") {
<head>
<title>VDR-Live - <$ head $></title>
<link rel="stylesheet" type="text/css" href="styles.css" />
- <& tooltip.javascript &>
+ <& tooltip.javascript var=("domTT_oneOnly") value=("true") var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
<body>
@@ -42,50 +43,47 @@ if (type == "now") {
<& menu active=(type) &>
<div class="inhalt">
<{
+ EpgEvents epgEvents;
+
ReadLock channelsLock( Channels );
if (channelsLock) {
+ int evntNr = 0;
for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) {
if (!Channel->GroupSep()) {
const cSchedule *Schedule = Schedules->GetSchedule(Channel);
if (Schedule) {
const cEvent *Event = (type == "now" ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent());
if (Event) {
- string title(Event->Title() ? Event->Title() : "");
- string channel_name(Channel->Name());
- 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()) : "");
+ std::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();
bool truncated = false;
- description = StringWordTruncate(description, 250, truncated);
- if (truncated) {
- description += string(" ") + tr("more") + string(" ...");
- }
+ string description(StringWordTruncate(epgEvent->LongDescr(), 250, truncated));
}>
<div class="event">
<div class="station">
- <div><div><div><$ channel_name $></div></div></div>
+ <div><div><div><$ (epgEvent->ChannelName()) $></div></div></div>
</div>
<div class="content">
<div class="tools">
<& pageelems.event_timer channelid=(channel_id) eventid=(event) &>
- <& pageelems.ajax_action_href action="switch_channel" param=(channel_id) image="zap.png" alt="" &>
+% if (type == "now") {
+ <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &>
+% }
</div>
<div>
- <div class="info"><$ start $> - <$ end $></div>
- <div class="title"><$ title $></div>
- <div class="short"><$ short_description $></div>
- <div class="description">
- <{ reply.out() << StringEscapeAndBreak( description ); }>
- </div>
+ <div class="info"><$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $></div>
+ <div class="title"><$ (epgEvent->Title()) $></div>
+ <div class="short"><$ (epgEvent->ShortDescr()) $></div>
+ <div class="description"<& tooltip.hint text=(StringEscapeAndBreak(description) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (string(tr("more")) + string(" ...")) $></div>
</div>
</div>
</div>
-
<{
}
}
@@ -94,6 +92,19 @@ if (type == "now") {
}
}>
</div>
+
+ <div class="epg_data" style="display: none;">
+<{
+ // create hidden div for the tooltip hints.
+ for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) {
+ EpgEventPtr epg = *i;
+}>
+ <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->ChannelName()) 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()) &>
+<{
+ }
+}>
+ </div>
+
</body>
</html>
<%include>page_exit.eh</%include>