From e5188e9418ed183d5d1a2ad4d3148f3578f2ead1 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Fri, 19 Jan 2007 22:03:03 +0000 Subject: - 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. --- Makefile | 4 ++-- css/styles.css | 9 +++++--- epg_events.cpp | 47 ++++++++++++++++++++++++++++++++++++++ epg_events.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ pages/pageelems.ecpp | 41 +++++++++++++--------------------- pages/recordings.ecpp | 2 +- pages/whats_on.ecpp | 51 +++++++++++++++++++++++++----------------- tools.cpp | 5 +++++ tools.h | 1 + 9 files changed, 170 insertions(+), 52 deletions(-) create mode 100644 epg_events.cpp create mode 100644 epg_events.h diff --git a/Makefile b/Makefile index 1f40b4b..3c716aa 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.29 2007/01/18 18:29:30 lordjaxom Exp $ +# $Id: Makefile,v 1.30 2007/01/19 22:03:03 tadi Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. @@ -59,7 +59,7 @@ SUBDIRS = httpd pages css images javascript ### The object files (add further files here): PLUGINOBJS = $(PLUGIN).o thread.o tntconfig.o setup.o i18n.o timers.o \ - tools.o recordings.o tasks.o status.o + tools.o recordings.o tasks.o status.o epg_events.o WEBLIBS = pages/libpages.a css/libcss.a images/libimages.a \ javascript/libjavascript.a diff --git a/css/styles.css b/css/styles.css index d4f04a1..e303e35 100644 --- a/css/styles.css +++ b/css/styles.css @@ -41,6 +41,7 @@ div.domTThint { font-size: 11px; border: 1px solid #EBC94C; background-color: #F4FFC3; + max-width: 35em; } div.domTThint .caption { @@ -201,7 +202,7 @@ table td.buttonpanel { */ div.event { width: 255px; - height: 255px; + height: 155px; padding: 0; margin-right: 5px; float: left; @@ -238,7 +239,7 @@ div.station div div div { div.content { width: 253px; - height: 220px; + height: 120px; padding: 0; margin: 0; @@ -251,7 +252,7 @@ div.content { div.content div.tools { float: left; width: 26px; - height: 220px; + height: 120px; margin: 0; padding: 0; @@ -270,6 +271,8 @@ div.content div { div.description { margin: 5px; + font-weight: bold; + cursor: pointer; } div.info { diff --git a/epg_events.cpp b/epg_events.cpp new file mode 100644 index 0000000..f2f7fc2 --- /dev/null +++ b/epg_events.cpp @@ -0,0 +1,47 @@ +#include "tools.h" + +#include "epg_events.h" + +namespace vdrlive +{ + EpgEvent::EpgEvent(const std::string& id, const cEvent* event, const char* channelName) : + eventId(id), + title(event->Title() ? event->Title() : ""), + channel_name(channelName), + short_descr(event->ShortText() ? event->ShortText() : ""), + long_descr(event->Description() ? event->Description() : ""), + start_time(event->StartTime()), + end_time(event->EndTime()) + { + } + + EpgEvent::~EpgEvent() + { + } + + const std::string EpgEvent::StartTime(const char* format) const + { + return FormatDateTime(format, start_time); + } + + const std::string EpgEvent::EndTime(const char* format) const + { + return FormatDateTime(format, end_time); + } + + EpgEvents::EpgEvents() : + std::vector() + { + } + + EpgEvents::~EpgEvents() + { + } +#ifdef never + EpgEventsPtr EpgEvents::dim(size_t count) + { + EpgEventsPtr ePtr(new EpgEvents(count)); + return ePtr; + } +#endif +}; // namespace vdrlive diff --git a/epg_events.h b/epg_events.h new file mode 100644 index 0000000..61ba3ff --- /dev/null +++ b/epg_events.h @@ -0,0 +1,62 @@ +#ifndef VDR_LIVE_WHATS_ON_H +#define VDR_LIVE_WHATS_ON_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "live.h" + +namespace vdrlive +{ + + class EpgEvent + { + public: + EpgEvent(const std::string& id, const cEvent* event, const char* channelName = ""); + + virtual ~EpgEvent(); + + const std::string& Id() const { return eventId; } + + const std::string& Title() const { return title; } + + const std::string& ChannelName() const { return channel_name; } + + const std::string& ShortDescr() const { return short_descr; } + + const std::string& LongDescr() const { return long_descr; } + + const std::string StartTime(const char* format) const; + + const std::string EndTime(const char* format) const; + + private: + std::string eventId; + std::string title; + std::string channel_name; + std::string short_descr; + std::string long_descr; + time_t start_time; + time_t end_time; + }; + + typedef boost::shared_ptr EpgEventPtr; + + class EpgEvents : public std::vector { + public: + EpgEvents(); + virtual ~EpgEvents(); + + private: + }; +}; // namespace vdrlive + +#endif // VDR_LIVE_WHATS_ON_H + 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; +<# ---------------------------------------------------------------------- #> + <%def doc_type> +<# ---------------------------------------------------------------------- #> + <%def logo> -<# -<%def header_box> -<%args> -content[]; -component; - -<{ -}> -
-
-
-
-% for(content_type::const_iterator it = content.begin(); it != content.end(); ++it) { - <$ *it $> -% } -% if (!component.empty()) { - <& (component) &> -% } -
-
-
-
- -#> +<# ---------------------------------------------------------------------- #> <%def event_timer> <%args> @@ -48,20 +30,27 @@ component; /> +<# ---------------------------------------------------------------------- #> + <%def ajax_js> +<# ---------------------------------------------------------------------- #> + <%def ajax_action_href> <%args> string action; + string tip; string param; string image; string alt = ""; - <$ alt $> + if (!tip.empty()) { <& tooltip.hint text=(tip) &> <%cpp> } ><$ alt $> +<# ---------------------------------------------------------------------- #> + <%def epg_tt_box> <%args> string boxId; @@ -85,7 +74,7 @@ component;
<$ (title) $>
<$ (short_descr) $>
- <$ (long_descr) $> + <{ reply.out() << StringEscapeAndBreak(long_descr); }>
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;
<& recordings.recordings_item &>
-