diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-05-31 23:44:01 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-05-31 23:44:01 +0000 |
commit | 4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe (patch) | |
tree | 1594cf050f0f23da64c41b02d739a9e4e1808e21 | |
parent | 5d74b90e216827453c87eeb0addae5bb081c40f5 (diff) | |
download | vdr-plugin-live-4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe.tar.gz vdr-plugin-live-4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe.tar.bz2 |
- Added doc/ChangeLog
- Added doc/css-themeing.txt
- Implemented support for site wide style overrides. Fixes Bug #339
- Updated all pages to use the override mechanism.
- Added needed files to Makefile
- Introduced USRDIR configuration variable to Makefile.
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | css/siteprefs.css | 17 | ||||
-rw-r--r-- | doc/ChangeLog | 13 | ||||
-rw-r--r-- | doc/css-themeing.txt | 27 | ||||
-rw-r--r-- | filecache.cpp | 2 | ||||
-rw-r--r-- | pages/Makefile | 4 | ||||
-rw-r--r-- | pages/content.ecpp | 17 | ||||
-rw-r--r-- | pages/edit_searchtimer.ecpp | 50 | ||||
-rw-r--r-- | pages/edit_timer.ecpp | 2 | ||||
-rw-r--r-- | pages/error.ecpp | 10 | ||||
-rw-r--r-- | pages/login.ecpp | 2 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 7 | ||||
-rw-r--r-- | pages/recordings.ecpp | 2 | ||||
-rw-r--r-- | pages/remote.ecpp | 2 | ||||
-rw-r--r-- | pages/schedule.ecpp | 2 | ||||
-rw-r--r-- | pages/searchepg.ecpp | 4 | ||||
-rw-r--r-- | pages/searchresults.ecpp | 10 | ||||
-rw-r--r-- | pages/searchtimers.ecpp | 2 | ||||
-rw-r--r-- | pages/setup.ecpp | 6 | ||||
-rw-r--r-- | pages/timers.ecpp | 2 | ||||
-rw-r--r-- | pages/whats_on.ecpp | 6 | ||||
-rw-r--r-- | setup.cpp | 20 | ||||
-rw-r--r-- | tntconfig.cpp | 1 |
23 files changed, 145 insertions, 72 deletions
@@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.38 2007/05/30 17:30:00 winni Exp $ +# $Id: Makefile,v 1.39 2007/05/31 23:44:01 tadi Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. @@ -33,6 +33,7 @@ LIBS += $(shell tntnet-config --libs) VDRDIR ?= ../../.. LIBDIR ?= ../../lib TMPDIR ?= /tmp +USRDIR ?= /usr/share/vdr-plugin-$(PLUGIN) ### Allow user defined options to overwrite defaults: @@ -51,10 +52,10 @@ PACKAGE = vdr-$(ARCHIVE) INCLUDES += -I$(VDRDIR)/include -Ihttpd -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DUSRDIR='"$(USRDIR)"' export DEFINES -LIBS += httpd/libhttpd.a +LIBS += httpd/libhttpd.a SUBDIRS = httpd pages css images javascript @@ -62,7 +63,7 @@ SUBDIRS = httpd pages css images javascript PLUGINOBJS = $(PLUGIN).o thread.o tntconfig.o setup.o i18n.o timers.o \ tools.o recordings.o tasks.o status.o epg_events.o epgsearch.o \ - grab.o md5.o + grab.o md5.o filecache.o WEBLIBS = pages/libpages.a css/libcss.a images/libimages.a \ javascript/libjavascript.a diff --git a/css/siteprefs.css b/css/siteprefs.css new file mode 100644 index 0000000..ed92cb0 --- /dev/null +++ b/css/siteprefs.css @@ -0,0 +1,17 @@ +/* ###################### + # This file is part of vdr-live! + # It is here to give the users the possibility to change the + # default css style of vdr-live to their needs. + # + # If you don't want to change default settings, make this file + # empty, but don't delete it. + ###################### +*/ + +/* uncomment this below, to make all tables full page width. +*/ +/* +table { + width: 100%; +} +*/ diff --git a/doc/ChangeLog b/doc/ChangeLog new file mode 100644 index 0000000..e1f3988 --- /dev/null +++ b/doc/ChangeLog @@ -0,0 +1,13 @@ +2007-06-01 Dieter Hametner <dh+vdr@gekrumbel.de> + + These changes fix bug entry #339 + * css-themeing.txt: describe how to do css themeing. + * content.ecpp: + - check for additional parameter and use it as mime + type. + - use compile time variable USRDIR for path to the files + loaded via content.ecpp + * pageelems.ecpp: link to css/siteprefs.css + * pages/*.ecpp: changed style link to pageelems.stylesheet + component. + * tntconfig.cpp: added MapUrl for css<something>/cssfile.
\ No newline at end of file diff --git a/doc/css-themeing.txt b/doc/css-themeing.txt new file mode 100644 index 0000000..be84e26 --- /dev/null +++ b/doc/css-themeing.txt @@ -0,0 +1,27 @@ +How to do live theming with CSS. +================================ + +Live supports CSS theming. While the structure of the html pages is +given by the plugin, there is the possibility to change the look +through CSS. + +Currently a predefined, compiled into the plugin stylesheet 'styles.css' is +delivered first. Then a stylesheet 'css/siteprefs.css' is sent to the +browser. 'css/siteprefs.css' is a normal file that is found in +USRDIR. The default of USRDIR is /usr/share/vdr-plugin-live. This +can be changed at compile time by setting the USRDIR variable +(i.E. USRDIR=/tmp/live make) + +One of the next steps will be a mechanism to select additional style +files and images through a theme setting in vdr. The different themes +will be also located in theme related subdirs beneath USRDIR. + + +User Contribution +================= + +If you created a nice new look, you can provide it to us. We will try +to include it into the live distribution. + +If you need special html support for your styling needs don't hesitate +to submit a suggestion. diff --git a/filecache.cpp b/filecache.cpp index 37a1e85..1ecb60f 100644 --- a/filecache.cpp +++ b/filecache.cpp @@ -41,9 +41,11 @@ FileCache& LiveFileCache() } // namespace vdrlive +#if 0 using namespace vdrlive; int main() { FileCache::ptr_type f = LiveFileCache().get("/tmp/live/active.png"); } +#endif diff --git a/pages/Makefile b/pages/Makefile index 55cb633..da62cb8 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -22,7 +22,7 @@ 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 + ffw_recording.o rwd_recording.o setup.o content.o ### Default rules: @@ -53,4 +53,4 @@ libpages.a: $(OBJS) $(AR) r $@ $^ clean: - @rm -f *~ *.o core* libpages.a $(OBJS:%.o=%.cpp) $(DEPFILE) + @rm -f *~ *.o core* libpages.a $(OBJS:%.o=%.cpp) diff --git a/pages/content.ecpp b/pages/content.ecpp index 666b5a6..1390b08 100644 --- a/pages/content.ecpp +++ b/pages/content.ecpp @@ -15,12 +15,21 @@ bool logged_in(false); <%cpp> //if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -reply.setContentType("image/png"); +string mime("image/png"); +if (request.getArgsCount() > 0) { + mime = request.getArg(0); + dsyslog("vdrlive::content found mime arg (%s)", mime.c_str()); +} +reply.setContentType(mime); +dsyslog("vdrlive::content::mimetype(%s)", mime.c_str()); -FileCache::ptr_type f = LiveFileCache().get("/tmp/live/" + request.getPathInfo()); -if (f.get() == 0) - throw tnt::NotFoundException(request.getUrl()); +// FileCache::ptr_type f = LiveFileCache().get("/tmp/live/" + request.getPathInfo()); +string path(request.getPathInfo()); +FileCache::ptr_type f = LiveFileCache().get(USRDIR "/" + path); +if (f.get() == 0) { + throw tnt::NotFoundException(request.getUrl()); +} string ctime = tnt::HttpMessage::htdate(f->ctime()); string browserTime = request.getHeader(tnt::httpheader::ifModifiedSince); if (browserTime == ctime) diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index 3049e94..75d2e6a 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -127,7 +127,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); infos.push_back(os.str()); } searchtimer.SetExtEPGInfo(infos); - } + } searchtimer.SetUseChannel((SearchTimer::eUseChannel)usechannel); if (usechannel == SearchTimer::Interval) { @@ -136,19 +136,19 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } if (usechannel == SearchTimer::Group) searchtimer.SetChannelText(changrpsel); - + searchtimer.SetUseTime(usetime); if (usetime) { searchtimer.SetStartTime(StringToInt(start_h) * 100 + StringToInt(start_m)); searchtimer.SetStopTime(StringToInt(stop_h) * 100 + StringToInt(stop_m)); - } + } searchtimer.SetUseDuration(useduration); if (useduration) { searchtimer.SetMinDuration(durationmin); searchtimer.SetMaxDuration(durationmax); - } + } searchtimer.SetUseDayOfWeek(useweekday); if (useweekday) { @@ -164,7 +164,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } searchtimer.SetUseInFavorites(useinfavorites); searchtimer.SetUseAsSearchTimer(useassearchtimer); - searchtimer.SetSearchTimerAction(searchtimeraction); + searchtimer.SetSearchTimerAction(searchtimeraction); searchtimer.SetUseSeriesRecording(seriesrecording); searchtimer.SetDirectory(directory); searchtimer.SetDelRecsAfterDays(delrecafterdays); @@ -173,8 +173,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetBlacklistMode(blacklistmode); if (blacklistmode == 1) searchtimer.ParseBlacklist(blacklistids_internal); - - searchtimer.SetSwitchMinBefore(switchminbefore); + + searchtimer.SetSwitchMinBefore(switchminbefore); searchtimer.SetAvoidRepeats(avoidrepeats); if (avoidrepeats) { @@ -183,8 +183,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetCompareTitle(comparetitle); searchtimer.SetCompareSubtitle(comparesubtitle); searchtimer.SetCompareSummary(comparesummary); - } - unsigned long catsselected = 0; + } + unsigned long catsselected = 0; for (unsigned int i=0; i< avoidrepeatscatselected.size(); i++) catsselected |= (1<< (avoidrepeatscatselected[i]-1)); searchtimer.SetCompareCategories(catsselected); @@ -193,10 +193,10 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetMarginStart(marginstart); searchtimer.SetMarginStop(marginstop); searchtimer.SetUseVPS(usevps); - + if (!testmode) { - searchtimers.Save(&searchtimer); + searchtimers.Save(&searchtimer); return reply.redirect("searchtimers.html"); } else @@ -213,7 +213,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); if ( searchtimer == 0 ) throw HtmlError( tr("Couldn't find searchtimer. Maybe you mistyped your request?") ); - search = searchtimer->Search(); + search = searchtimer->Search(); mode = searchtimer->SearchMode(); tolerance = searchtimer->Tolerance(); matchcase = searchtimer->MatchCase(); @@ -262,18 +262,18 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } else { - wday_sun = -dayofweek & 0x01; - wday_mon = -dayofweek & 0x02; - wday_tue = -dayofweek & 0x04; - wday_wed = -dayofweek & 0x08; - wday_thu = -dayofweek & 0x10; - wday_fri = -dayofweek & 0x20; - wday_sat = -dayofweek & 0x40; + wday_sun = -dayofweek & 0x01; + wday_mon = -dayofweek & 0x02; + wday_tue = -dayofweek & 0x04; + wday_wed = -dayofweek & 0x08; + wday_thu = -dayofweek & 0x10; + wday_fri = -dayofweek & 0x20; + wday_sat = -dayofweek & 0x40; } - } + } useinfavorites = searchtimer->UseInFavorites(); useassearchtimer = searchtimer->UseAsSearchTimer(); - searchtimeraction = searchtimer->SearchTimerAction(); + searchtimeraction = searchtimer->SearchTimerAction(); seriesrecording = searchtimer->UseSeriesRecording(); directory = searchtimer->Directory(); delrecafterdays = searchtimer->DelRecsAfterDays(); @@ -286,7 +286,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); for(unsigned int i=0; i<extEPGInfos.size(); i++) { if (i<infos.size()) - { + { vector< string > parts = StringSplit( infos[i], '#' ); extepgvalues.push_back(parts.size() > 1?parts[1]:""); } @@ -324,13 +324,13 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); lifetime = lexical_cast< int >(EPGSearchSetupValues::ReadValue("DefLifetime")); marginstart = lexical_cast< int >(EPGSearchSetupValues::ReadValue("DefMarginStart")); marginstop = lexical_cast< int >(EPGSearchSetupValues::ReadValue("DefMarginStop")); - } + } </%cpp> <& pageelems.doc_type &> <html> <head> <title>VDR Live - <$ editsearchtimer ? tr("Edit search timer") : tr("New search timer") $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- @@ -446,7 +446,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } function changeddirselection(selection) { - document.getElementById("directory").value = selection.value; + document.getElementById("directory").value = selection.value; } //--></script> </head> diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index 2ed8863..8b775cb 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -116,7 +116,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> diff --git a/pages/error.ecpp b/pages/error.ecpp index bb82887..df24dd4 100644 --- a/pages/error.ecpp +++ b/pages/error.ecpp @@ -20,18 +20,14 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="/styles.css" /> + <& pageelems.stylesheets &> </head> <body> - <div class="left_area"> - <& pageelems.logo &> - <& menu &> - </div> - <div class="right_area"> + <& pageelems.logo &> + <& menu &> <div class="inhalt"> <& error.error_widget errorTitle=(errorTitle) errorMessage=(errorMessage) &> </div> - </div> </body> </html> <%def error_widget> diff --git a/pages/login.ecpp b/pages/login.ecpp index 20624a8..e517963 100644 --- a/pages/login.ecpp +++ b/pages/login.ecpp @@ -35,7 +35,7 @@ if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetSt <html> <head> <title>VDR-Live - <$ tr("Login") $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index c823042..99b6882 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -32,6 +32,13 @@ static bool HasEpgsearch() <# ---------------------------------------------------------------------- #> +<%def stylesheets> +<link rel="stylesheet" type="text/css" href="styles.css"/> +<link rel="stylesheet" type="text/css" href="css/siteprefs.css"/> +</%def> + +<# ---------------------------------------------------------------------- #> + <%def logo> <div class="page_header"> <img src="logo.png" alt="VDR Live!" class="logo"></img> diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index ebc68e7..b1b6b55 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -32,7 +32,7 @@ EpgEvents epgEvents; <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript" src="treeview.js"></script> diff --git a/pages/remote.ecpp b/pages/remote.ecpp index bbe51ae..12850f0 100644 --- a/pages/remote.ecpp +++ b/pages/remote.ecpp @@ -20,7 +20,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="/styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index e231a21..a02c32c 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -52,7 +52,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> diff --git a/pages/searchepg.ecpp b/pages/searchepg.ecpp index ef734c5..6e4d2f4 100644 --- a/pages/searchepg.ecpp +++ b/pages/searchepg.ecpp @@ -151,7 +151,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR Live - <$ tr("Search") $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- @@ -308,7 +308,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <input type="checkbox" name="usetitle" value="1" <{ CHECKIF(usetitle) }> /> <label for="usetitle"><$ tr("Title") $> </label> </div> - + <div class="dotted"> <input type="checkbox" name="usesubtitle" value="1" <{ CHECKIF(usesubtitle) }> /> <label for="usesubtitle"><$ tr("Episode") $> </label> diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp index 4a183ef..9c395e1 100644 --- a/pages/searchresults.ecpp +++ b/pages/searchresults.ecpp @@ -37,9 +37,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); s.SetId(0); s.SetSearch(searchplain); s.SetSearchMode(0); - s.SetUseTitle(true); + s.SetUseTitle(true); s.SetUseSubtitle(false); - s.SetUseDescription(false); + s.SetUseDescription(false); results.GetByQuery(s.ToText()); } </%cpp> @@ -47,7 +47,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="/styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> @@ -76,7 +76,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); 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())); @@ -105,7 +105,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <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"> </td> </tr> % } diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index 1c23347..d54fd5c 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -35,7 +35,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="styles.css"> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> diff --git a/pages/setup.ecpp b/pages/setup.ecpp index 1650211..1c0393f 100644 --- a/pages/setup.ecpp +++ b/pages/setup.ecpp @@ -24,7 +24,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <%cpp> #define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); - if ( request.getMethod() == "POST") { + if ( request.getMethod() == "POST") { LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0); LiveSetup().SetUseAuth(useauth); if (useauth) { @@ -34,7 +34,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } LiveSetup().SetTimes(times); LiveSetup().SetStartScreen(startscreen); - LiveSetup().SaveSetup(); + LiveSetup().SaveSetup(); } pageTitle = tr("Setup"); int ilastchannel = LiveSetup().GetLastChannel(); @@ -53,7 +53,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="/styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- diff --git a/pages/timers.ecpp b/pages/timers.ecpp index eebcb7e..dc67178 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -45,7 +45,7 @@ using namespace vdrlive; <html> <head> <title>VDR-Live - <$ pageTitle $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> </head> diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 0af929b..e975551 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -69,7 +69,7 @@ if (type == "now") { <html> <head> <title>VDR-Live - <$ head $></title> - <link rel="stylesheet" type="text/css" href="styles.css" /> + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <script type="text/javascript"><!-- @@ -105,7 +105,7 @@ if (type == "now") { 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) { + if (Schedule) { const cEvent *Event = NULL; if (type == "now") Event = Schedule->GetPresentEvent(); @@ -113,7 +113,7 @@ if (type == "now") { Event = Schedule->GetFollowingEvent(); else if (type == "at") Event = Schedule->GetEventAround(seektime); - + if (Event) { string evntId("eventId_"); evntId += lexical_cast<std::string, int>(++evntNr); @@ -25,7 +25,7 @@ Setup::Setup(): m_lastChannel( 0 ), m_screenshotInterval( 1000 ), m_useAuth( 1 ), - m_adminLogin("admin") + m_adminLogin("admin") { m_adminPasswordMD5 = "4:" + MD5Hash("live"); liveplugin = cPluginManager::GetPlugin("live"); @@ -108,28 +108,28 @@ bool Setup::CheckServerIps() bool Setup::HaveEPGSearch(void) { - return cPluginManager::GetPlugin("epgsearch") != NULL; + return cPluginManager::GetPlugin("epgsearch") != NULL; } std::string Setup::GetMD5HashAdminPassword() const { // format is <length>:<md5-hash of password> - vector< string > parts = StringSplit( m_adminPasswordMD5, ':' ); + vector< string > parts = StringSplit( m_adminPasswordMD5, ':' ); return (parts.size() > 1) ? parts[1] : ""; } int Setup::GetAdminPasswordLength() const { // format is <length>:<md5-hash of password> - vector< string > parts = StringSplit( m_adminPasswordMD5, ':' ); + vector< string > parts = StringSplit( m_adminPasswordMD5, ':' ); return (parts.size() > 0) ? lexical_cast< int >( parts[0] ) : 0; } -std::string Setup::SetAdminPassword(std::string password) -{ +std::string Setup::SetAdminPassword(std::string password) +{ ostringstream passwordStr; passwordStr << password.size() << ":" << MD5Hash(password); - m_adminPasswordMD5 = passwordStr.str(); + m_adminPasswordMD5 = passwordStr.str(); return m_adminPasswordMD5; } @@ -176,7 +176,7 @@ cMenuSetupLive::cMenuSetupLive(): strcpy(m_adminLogin, vdrlive::LiveSetup().GetAdminLogin().c_str()); m_oldpasswordMD5 = m_newpasswordMD5 = vdrlive::LiveSetup().GetMD5HashAdminPassword(); - + string strHidden(vdrlive::LiveSetup().GetAdminPasswordLength(), '*'); strn0cpy(m_tmpPassword, strHidden.c_str(), sizeof(m_tmpPassword)); strcpy(m_adminPassword, ""); @@ -228,9 +228,9 @@ eOSState cMenuSetupLive::ProcessKey(eKeys Key) bool bPassWasInEditMode = false; if (ItemText && strlen(ItemText) > 0 && strstr(ItemText, tr("Admin password")) == ItemText) bPassWasInEditMode = InEditMode(ItemText, tr("Admin password"), m_tmpPassword); - + eOSState state = cMenuSetupPage::ProcessKey(Key); - + ItemText = Get(Current())->Text(); bool bPassIsInEditMode = false; if (ItemText && strlen(ItemText) > 0 && strstr(ItemText, tr("Admin password")) == ItemText) diff --git a/tntconfig.cpp b/tntconfig.cpp index 04add46..6a6e576 100644 --- a/tntconfig.cpp +++ b/tntconfig.cpp @@ -35,6 +35,7 @@ void TntConfig::WriteConfig() // XXX modularize file << "MapUrl ^/$ login@" << endl; + file << "MapUrl /css.*/(.+) content@ css/$1 text/css" << endl; file << "MapUrl /([^/]+/.+) content@ $1" << endl; file << "MapUrl /([^.]+)(\\..+)? $1@" << endl; file << "PropertyFile " << m_propertiesPath << endl; |