summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2018-01-09 22:20:32 +0100
committerRoland Stigge <stigge@antcom.de>2018-01-09 22:20:32 +0100
commit97c8b7f21b8aeeda56f68deee8349f381d60eb96 (patch)
tree2b9bf848429902071da32a77e55389bc47d38adf
parentffb84def973e117e52555fb06eb9b078040e2849 (diff)
Fix mobile view, add password configv1.0
-rw-r--r--Makefile3
-rw-r--r--TODO6
-rw-r--r--debian/README.Debian42
-rw-r--r--html/index.html2
-rw-r--r--html/webbox.css23
-rw-r--r--html/webbox.js6
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.
+
+ <Directory "/usr/lib/webbox">
+
+ # ...
+
+ AuthType Basic
+ AuthName "Webbox"
+ AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd"
+ Require valid-user
+ </Directory>
+
+ <Directory "/var/www/webbox">
+ AuthType Basic
+ AuthName "Webbox"
+ AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd"
+ Require valid-user
+ </Directory>
+
+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://<servername>/testbox
Alias /testbox /var/www/webbox
+ <Directory "/var/www/webbox">
+ AuthType Basic
+ AuthName "Webbox"
+ AuthUserFile "/etc/apache2/sites-available/mysite.htpasswd"
+ Require valid-user
+ </Directory>
# 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
</Directory>
-
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 @@
<html>
<head>
<meta charset="utf-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webbox</title>
<link rel="stylesheet" type="text/css" href="webbox.css"/>
<script src="webbox.js"></script>
@@ -47,6 +48,7 @@
<tr><td class="entry" onclick="hideMenu(); move();">Move</td></tr>
<tr><td class="entry" onclick="hideMenu(); info();">Info</td></tr>
<tr><td class="entry" onclick="hideMenu(); selectAll();">Select/Unselect All</td></tr>
+ <tr><td class="entry" onclick="hideMenu();">Close Menu</td></tr>
</table>
</div>
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") {