From 97c8b7f21b8aeeda56f68deee8349f381d60eb96 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Tue, 9 Jan 2018 22:20:32 +0100 Subject: Fix mobile view, add password config --- Makefile | 3 +++ TODO | 6 ++---- debian/README.Debian | 42 +++++++++++++++++++++++++++++++++++++++++- html/index.html | 2 ++ html/webbox.css | 23 ++++++++++++++++++++++- html/webbox.js | 6 ++++++ 6 files changed, 76 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index dd411cf..157e3e0 100644 --- a/Makefile +++ b/Makefile @@ -20,3 +20,6 @@ deb: clean: make -C src clean + dh_clean + +.PHONY: clean diff --git a/TODO b/TODO index 14bb2b4..03d1a79 100644 --- a/TODO +++ b/TODO @@ -1,14 +1,13 @@ Prio 1 (for next version) ====== -mobile: font size -mobile: escape in menu -password Prio 2 (for future versions) ====== +scroll in dialog/menu / handle too small popup window +google pagespeed insights https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.kneipenband.com%2Fwebbox%2F&tab=mobile rename function handle errors from http gallery @@ -16,7 +15,6 @@ chromecast player handle writability register GET/POST functions -handle too small popup window sandclock during operations i18n forward/back button diff --git a/debian/README.Debian b/debian/README.Debian index 65db4e4..f24b3b8 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -56,6 +56,36 @@ WEBBOX_NAME Title of the webbox. Will be written on top of the Web UI. +Authentication +-------------- + +There is currently no separate authentication implemented in webbox. +Instead, the web browser's authentication can be used, e.g. + + + + # ... + + AuthType Basic + AuthName "Webbox" + AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd" + Require valid-user + + + + AuthType Basic + AuthName "Webbox" + AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd" + Require valid-user + + +Add a login/password pair to the password file: + +# htpasswd -c /etc/apache2/sites-available/mysite.htpasswd username + +Remember to secure both the static web server path and the fastcgi application +paths in the browser, i.e. /usr/lib/webbox and /var/www/webbox + Example configuration for Apache -------------------------------- @@ -66,6 +96,12 @@ VirtualHost configuration: # Define the URL of the webbox served by the Apache server: # http:///testbox Alias /testbox /var/www/webbox + + AuthType Basic + AuthName "Webbox" + AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd" + Require valid-user + # Actual location of files to be served FcgidInitialEnv WEBBOX_PATH /home/testbox @@ -90,9 +126,13 @@ VirtualHost configuration: # Order allow,deny # Allow from all Require all granted + + AuthType Basic + AuthName "Webbox" + AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd" + Require valid-user - Contact ------- diff --git a/html/index.html b/html/index.html index db60e7a..92fdc78 100644 --- a/html/index.html +++ b/html/index.html @@ -2,6 +2,7 @@ + Webbox @@ -47,6 +48,7 @@ Move Info Select/Unselect All + Close Menu diff --git a/html/webbox.css b/html/webbox.css index 46f46ec..19d303e 100644 --- a/html/webbox.css +++ b/html/webbox.css @@ -53,6 +53,7 @@ div, td, h1 { border-style: solid; border-color: #808080; padding: 10pt; + box-sizing: border-box; } .menusymbol { @@ -74,6 +75,7 @@ div, td, h1 { border-style: solid; border-color: #808080; padding: 10pt; + box-sizing: border-box; } table.menudialog { @@ -82,7 +84,6 @@ table.menudialog { table.menudialog td.entry { cursor: pointer; - width: 100%; border-width: 0; border-bottom-width: 1px; border-style: solid; @@ -169,3 +170,23 @@ table.list td.name { border: 0; /* 1px solid #000000; */ color: #0000FF; } + +@media only screen and (min-width: 1px) and (max-width: 630px) { + .menuwindow { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0; + } + + .dialogwindow { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0; + } +} diff --git a/html/webbox.js b/html/webbox.js index dd57966..8612062 100644 --- a/html/webbox.js +++ b/html/webbox.js @@ -240,6 +240,12 @@ function initMainpage() { // default action for "Cancel" button: hide dialog window document.getElementById("cancelbutton").onclick = hideDialog; + // on click outside of menu, close menu + document.getElementById("greyout").onclick = function() { + hideDialog(); + hideMenu(); + } + // on Escape, globally hide dialog and menu window document.onkeydown = function(evt) { if (evt.key == "Escape") { -- cgit v1.2.3