Release 1.0.2.4.
[rsync-backup] / check-bkp-status.in
index 3e1f714..d45c06b 100644 (file)
@@ -153,6 +153,7 @@ html_header () {
 <html>
 <head>
   <title>$now rsync-backup report</title>
+  <meta name=viewport content="width=device-width initial-scale=1.0">
   <style type='text/css'><!--
        body {
          background: white;
@@ -221,9 +222,11 @@ html_header () {
          padding: 1ex;
          background: #eee;
          border: solid thin black;
-         overflow-y: auto;
+         overflow: auto;
        }
 
+       pre.logdump { max-height: 120ex; }
+
        .hide { display: none; }
        a.expand-button {
          float: right;
@@ -242,9 +245,11 @@ html_header () {
   <script type='text/javascript'><!--
        var LAST_EXPAND = null;
        function elt(id) { return document.getElementById(id); }
+       function elt_class_p(elt, cls) {
+         return elt.className.match('\\\\b' + cls + '\\\\b');
+       }
        function add_elt_class(elt, cls) {
-         if (!elt.className.match('\\\\b' + cls + '\\\\b'))
-           elt.className += ' ' + cls;
+         if (!elt_class_p(elt, cls)) elt.className += ' ' + cls;
        }
        function rm_elt_class(elt, cls) {
          elt.className = elt.className.replace(
@@ -253,7 +258,7 @@ html_header () {
        function toggle_expand(ev, tag) {
          var d = elt('logdump-' + tag);
          var b = elt('expand-' + tag);
-         if (d.className.match(/\bhide\b/)) do_show(d, b);
+         if (elt_class_p(d, 'hide')) do_show(d, b);
          else do_hide(d, b);
          ev.preventDefault();
        }
@@ -264,14 +269,17 @@ html_header () {
        function do_hide(d, b) {
          add_elt_class(d, 'hide');
          b.textContent = '[show]';
+         if (LAST_EXPAND !== null && d === LAST_EXPAND[0])
+           LAST_EXPAND = null;
        }
        function expand_log(tag) {
-         if (LAST_EXPAND !== null)
-           do_hide(LAST_EXPAND[0], LAST_EXPAND[1]);
+         if (LAST_EXPAND !== null) do_hide(LAST_EXPAND[0], LAST_EXPAND[1]);
          var d = elt('logdump-' + tag);
          var b = elt('expand-' + tag);
-         LAST_EXPAND = [d, b];
-         do_show(d, b);
+         if (elt_class_p(d, 'hide')) {
+           LAST_EXPAND = [d, b];
+           do_show(d, b);
+         }
        }
        function make_toggle_button(tag) {
          document.write(
@@ -369,8 +377,8 @@ html_footer () {
   cat <<EOF
 
 <div class=footer>
-  Checked at $now $now_time.
-  <br><tt>rsync-backup</tt> $VERSION; &copy; 2014 Mark Wooding
+  Checked at $now $now_time<br>
+  <tt>rsync-backup</tt> $VERSION; &copy; 2014 Mark Wooding
 </div>
 
 </body>