Improve graphs page display on mobile devices.
authorDallen Wilson <dallen.wilson@gmail.com>
Wed, 11 Nov 2015 22:00:26 +0000 (15:00 -0700)
committerEmil Mikulic <emikulic@gmail.com>
Mon, 23 Nov 2015 01:34:19 +0000 (12:34 +1100)
This has little to no effect on a desktop browser, but on a mobile browser, it
will automatically fit the page to the browser window, without the user having
to manually zoom or scroll left or right to see everything. This results in the
graphs being arranged in a single column, rather then a 2x2 grid, which is also
what happens on my desktop when I make the browser window narrower.

html.c

diff --git a/html.c b/html.c
index fe5bb68..5f9c4f7 100644 (file)
--- a/html.c
+++ b/html.c
@@ -35,6 +35,7 @@ void html_open(struct str *buf, const char *title,
          "<title>%s (darkstat %s)</title>\n"
          "<meta name=\"generator\" content=\"" PACKAGE_STRING "\">\n"
          "<meta name=\"robots\" content=\"noindex, noarchive\">\n"
          "<title>%s (darkstat %s)</title>\n"
          "<meta name=\"generator\" content=\"" PACKAGE_STRING "\">\n"
          "<meta name=\"robots\" content=\"noindex, noarchive\">\n"
+         "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\">\n"
          "<link rel=\"stylesheet\" href=\"%s/style.css\" type=\"text/css\">\n",
         title, title_interfaces, root);
 
          "<link rel=\"stylesheet\" href=\"%s/style.css\" type=\"text/css\">\n",
         title, title_interfaces, root);