summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-07-18 23:48:14 +0000
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-07-18 23:48:14 +0000
commitf6f71da928b975fd39afee1d639b495bcdeff9b8 (patch)
tree03e3e64d26080184ab28d90445e6fa2f2d99c091 /pages
parent440d211c5084980e959ed269d468900d69a82cc2 (diff)
downloadvdr-plugin-live-f6f71da928b975fd39afee1d639b495bcdeff9b8.tar.gz
vdr-plugin-live-f6f71da928b975fd39afee1d639b495bcdeff9b8.tar.bz2
- Setup option to use Ajax technology. If turned off no javascript is
loaded but almost all functionality is exposed via single html pages. This can speed up loading over slow links at the cost of a fancy interface. - Infobox is only available with Ajax features enabled but can still be switched on/off when Ajax is active. - Added posibility to turn off the logo. When also infobox is turned off the menu line appears at the top of the page. This is helpful for PDA based browsers and low resolution screens.
Diffstat (limited to 'pages')
-rw-r--r--pages/pageelems.ecpp17
-rw-r--r--pages/setup.ecpp34
2 files changed, 47 insertions, 4 deletions
diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp
index 9fee05b..6de3bfc 100644
--- a/pages/pageelems.ecpp
+++ b/pages/pageelems.ecpp
@@ -34,12 +34,25 @@ int update_status(1);
<# ---------------------------------------------------------------------- #>
<%def logo>
+<%cpp>
+ if (LiveSetup().GetShowLogo()
+ || (LiveSetup().GetUseAjax() && LiveSetup().GetShowInfoBox())) {
+</%cpp>
<div class="page_header">
+<%cpp>
+ if (LiveSetup().GetShowLogo()) {
+</%cpp>
<a href="<$ LiveSetup().GetStartScreenLink()$>">
<img src="<$ LiveSetup().GetThemedLink("img", "logo.png") $>" alt="VDR Live!" class="logo"></img></a>
-<%cpp>if (LiveSetup().GetShowInfoBox()) { </%cpp><& infobox &><%cpp> } </%cpp>
+<%cpp>
+ }
+</%cpp>
+<%cpp>if (LiveSetup().GetUseAjax() && LiveSetup().GetShowInfoBox()) { </%cpp><& infobox &><%cpp> } </%cpp>
</div>
<div style="clear: both"></div>
+<%cpp>
+ }
+</%cpp>
</%def>
<# ---------------------------------------------------------------------- #>
@@ -123,6 +136,7 @@ int update_status(1);
<# ---------------------------------------------------------------------- #>
<%def ajax_js>
+<%cpp>if (LiveSetup().GetUseAjax()) { </%cpp>
<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>
@@ -139,6 +153,7 @@ int update_status(1);
});
--></script>
<%cpp> } </%cpp>
+<%cpp> } </%cpp>
</%def>
<# ---------------------------------------------------------------------- #>
diff --git a/pages/setup.ecpp b/pages/setup.ecpp
index 2ec0e28..f363368 100644
--- a/pages/setup.ecpp
+++ b/pages/setup.ecpp
@@ -17,6 +17,8 @@ using namespace std;
string startscreen;
string theme;
string localnetmask;
+ string showLogo;
+ string useAjax;
string showInfoBox;
int authchanged = 0;
</%args>
@@ -50,7 +52,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
LiveSetup().SetTimes(times);
LiveSetup().SetStartScreen(startscreen);
LiveSetup().SetTheme(theme);
- LiveSetup().SetShowInfoBox(!showInfoBox.empty());
+ LiveSetup().SetShowLogo(!showLogo.empty());
+ LiveSetup().SetUseAjax(!useAjax.empty());
+ if (LiveSetup().GetUseAjax()) {
+ LiveSetup().SetShowInfoBox(!showInfoBox.empty());
+ }
LiveSetup().SaveSetup();
message = tr("Setup saved.");
}
@@ -68,7 +74,10 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
startscreen = LiveSetup().GetStartScreen();
theme = LiveSetup().GetTheme();
localnetmask = LiveSetup().GetLocalNetMask();
+ showLogo = LiveSetup().GetShowLogo() ? "1" : "";
+ useAjax = LiveSetup().GetUseAjax() ? "1" : "";
showInfoBox = LiveSetup().GetShowInfoBox() ? "1" : "";
+
</%cpp>
<& pageelems.doc_type &>
<html>
@@ -80,6 +89,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
function initform()
{
changeduseauth(document.getElementById("useauth"));
+ changeduseajax(document.getElementById("useAjax"));
if (document.getElementById("message").value != "")
alert(document.getElementById("message").value);
}
@@ -91,6 +101,10 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
{
document.getElementById("authchanged").value = 1;
}
+ function changeduseajax(selection)
+ {
+ document.getElementById("ajaxsection").style.display = (selection.checked ? "block" : "none");
+ }
//--></script>
</head>
<body onload="initform()">
@@ -131,9 +145,23 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
</td>
</tr>
<tr>
- <td class="label leftcol"><div class="withmargin"><$ tr("Show dynamic VDR information box") $>:</div></td>
+ <td class="label leftcol"><div class="withmargin"><$ tr("Show live logo image") $>:</div></td>
<td class="rightcol">
- <input type="checkbox" name="showInfoBox" id="showInfoBox" value="1" <%cpp> CHECKIF(!showInfoBox.empty()); </%cpp>/>
+ <input type="checkbox" name="showLogo" id="showLogo" value="1" <%cpp> CHECKIF(!showLogo.empty()); </%cpp>/>
+ </td>
+ </tr>
+ <tr>
+ <td class="label leftcol"><div class="withmargin"><$ tr("Use ajax technology") $>:</div></td>
+ <td class="rightcol">
+ <input type="checkbox" name="useAjax" id="useAjax" value="1" <%cpp> CHECKIF(!useAjax.empty()); </%cpp> onclick="changeduseajax(this)"/>
+ <div id="ajaxsection" style="display: none">
+ <table border="0" cellpadding="0" cellspacing="0" class="dependent">
+ <tr>
+ <td class="label"><div class="withmargin"><$ tr("Show dynamic VDR information box") $>:</div></td>
+ <td><input type="checkbox" name="showInfoBox" id="showInfoBox" value="1" <%cpp> CHECKIF(!showInfoBox.empty()); </%cpp>/></td>
+ </tr>
+ </table>
+ </div>
</td>
</tr>
<tr>