From f6f71da928b975fd39afee1d639b495bcdeff9b8 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Wed, 18 Jul 2007 23:48:14 +0000 Subject: - 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. --- pages/pageelems.ecpp | 17 ++++++++++++++++- pages/setup.ecpp | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 4 deletions(-) (limited to 'pages') 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> + } + <# ---------------------------------------------------------------------- #> @@ -123,6 +136,7 @@ int update_status(1); <# ---------------------------------------------------------------------- #> <%def ajax_js> +<%cpp>if (LiveSetup().GetUseAjax()) { @@ -139,6 +153,7 @@ int update_status(1); }); --> <%cpp> } +<%cpp> } <# ---------------------------------------------------------------------- #> 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; @@ -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" : ""; + <& pageelems.doc_type &> @@ -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"); + } //--> @@ -131,9 +145,23 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -
<$ tr("Show dynamic VDR information box") $>:
+
<$ tr("Show live logo image") $>:
- CHECKIF(!showInfoBox.empty()); /> + CHECKIF(!showLogo.empty()); /> + + + +
<$ tr("Use ajax technology") $>:
+ + CHECKIF(!useAjax.empty()); onclick="changeduseajax(this)"/> + -- cgit v1.2.3