summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--css/styles.css6
-rw-r--r--epgsearch.cpp17
-rw-r--r--epgsearch.h2
-rw-r--r--pages/searchresults.ecpp36
4 files changed, 49 insertions, 12 deletions
diff --git a/css/styles.css b/css/styles.css
index 07bbe3b..da4c04a 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -851,6 +851,12 @@ table.searchresults td.border {
width: 1px;
}
+table.searchresults div.more {
+ margin: 0px;
+ font-weight: bold;
+ cursor: pointer;
+}
+
/*
##############################
# Login
diff --git a/epgsearch.cpp b/epgsearch.cpp
index 551604a..4ea3c60 100644
--- a/epgsearch.cpp
+++ b/epgsearch.cpp
@@ -25,7 +25,7 @@ bool CheckEpgsearchVersion()
{
cPlugin* epgsearch = cPluginManager::GetPlugin("epgsearch");
if (!epgsearch) return false;
- char minVersion[] = "0.9.21";
+ char minVersion[] = "0.9.22";
if (string(epgsearch->Version()) < string(minVersion))
throw HtmlError( tr("Required minimum version of epgsearch: ") + string(minVersion));
return true;
@@ -478,13 +478,14 @@ SearchResult::SearchResult( string const& data )
case 1: m_eventId = lexical_cast< u_int32_t >( *part ); break;
case 2: m_title = StringReplace( *part, "|", ":" ); break;
case 3: m_shorttext = StringReplace( *part, "|", ":" ); break;
- case 4: m_starttime = lexical_cast< unsigned long >( *part ); break;
- case 5: m_stoptime = lexical_cast< unsigned long >( *part ); break;
- case 6: m_channel = lexical_cast< tChannelID >( *part ); break;
- case 7: m_timerstart = lexical_cast< unsigned long >( *part ); break;
- case 8: m_timerstop = lexical_cast< unsigned long >( *part ); break;
- case 9: m_file = *part; break;
- case 10: m_timerMode = lexical_cast< int >( *part ); break;
+ case 4: m_description = StringReplace( *part, "|", ":" ); break;
+ case 5: m_starttime = lexical_cast< unsigned long >( *part ); break;
+ case 6: m_stoptime = lexical_cast< unsigned long >( *part ); break;
+ case 7: m_channel = lexical_cast< tChannelID >( *part ); break;
+ case 8: m_timerstart = lexical_cast< unsigned long >( *part ); break;
+ case 9: m_timerstop = lexical_cast< unsigned long >( *part ); break;
+ case 10: m_file = *part; break;
+ case 11: m_timerMode = lexical_cast< int >( *part ); break;
}
}
} catch ( bad_lexical_cast const& ex ) {
diff --git a/epgsearch.h b/epgsearch.h
index 6c38ee1..5a67a54 100644
--- a/epgsearch.h
+++ b/epgsearch.h
@@ -312,6 +312,7 @@ public:
tEventID EventId() const { return m_eventId; }
std::string const& Title() const { return m_title; }
std::string const& ShortText() const { return m_shorttext; }
+ std::string const& Description() const { return m_description; }
time_t StartTime() const { return m_starttime; }
time_t StopTime() const { return m_stoptime; }
tChannelID Channel() const { return m_channel; }
@@ -325,6 +326,7 @@ private:
tEventID m_eventId;
std::string m_title;
std::string m_shorttext;
+ std::string m_description;
time_t m_starttime;
time_t m_stoptime;
tChannelID m_channel;
diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp
index 22fbbc2..a900061 100644
--- a/pages/searchresults.ecpp
+++ b/pages/searchresults.ecpp
@@ -5,6 +5,7 @@
#include "epgsearch.h"
#include "tools.h"
#include "setup.h"
+#include "epg_events.h"
using namespace vdrlive;
using namespace std;
@@ -49,14 +50,26 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<{
string current_day = "";
bool active_line = false;
- for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) {
-// active_line = !active_line;
- string channelname = Channels.GetByChannelID(result->Channel())->Name();
+ EpgEvents epgEvents;
+ int evntNr = 0;
+
+ for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) {
+// active_line = !active_line;
+ string channelname = Channels.GetByChannelID(result->Channel())->Name();
string start(result->StartTime() ? FormatDateTime(tr("%I:%M %p"), result->StartTime()) : "");
string end(result->StopTime() ? FormatDateTime(tr("%I:%M %p"), result->StopTime()) : "");
string day(result->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), result->StartTime()) : "");
tEventID event = result->EventId();
tChannelID channel_id(result->Channel());
+ string description = result->Description();
+
+
+ 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;
+
if (current_day != day) {
if (current_day != "") {
}>
@@ -75,7 +88,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<td style="border-left: 1px solid black"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td>
<td><$ channelname $></td>
<td><$ start $> - <$ end $></td>
- <td><strong><$ result->Title() $></strong><br /><$ result->ShortText() $><br /></td>
+
+ <td>
+ <div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><strong><$ result->Title() $></strong></div><$ result->ShortText() $><br />
+ </td>
+
<td style="border-right: 1px solid black">&nbsp;</td>
</tr>
% }
@@ -86,6 +103,17 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
% }
</table>
</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->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()) &>
+<{
+ }
+}>
+ </div>
</body>
</html>