Explorar o código

Merge branch 'master' of https://tree.clementinecomputing.com/clementinecomputing/popufare

clementinecomputing %!s(int64=5) %!d(string=hai) anos
pai
achega
9ae1f2aaa8

+ 25 - 6
busunit/DIUv2/html/css/diustyles.css

@@ -82,8 +82,10 @@ p:focus {
   font-family: monospace;
   outline: thin solid #999999;
   background: #f7f7f7;
-  width:90vw;
-  height:60vh;
+  /* width:90vw; */
+  width:95vw;
+  /* height:60vh; */
+  height:70vh;
   overflow:hidden;
 }
 
@@ -153,13 +155,23 @@ body { letter-spacing: 0.25em; }
 
 }
 
+.bdispSmall {
+  font-size: 4vh;
+  margin-top: 1vh;
+  margin-right: 1vw;
+
+  font-weight: bold;
+  color: #444444;
+  margin-left: auto;
+
+  background: none;
+  border: none;
+
+}
+
 .bstatus  { font-size: 6vh; border: solid .3vw #888888; box-shadow: .5vw .5vw 0px #aaaaaa; }
 .bstatus  { font-size: 6vh; border: solid .3vw #888888; box-shadow: .5vw .5vw 0px #aaaaaa; }
 .bdrop    { font-size: 6vh; border: solid .3vw #888888; box-shadow: .5vw .5vw 0px #aaaaaa; }
-/*
-.bdropinp { font-size: 6vh; border: solid .3vw #888888; box-shadow: .5vw .5vw 0px #aaaaaa; }
-*/
-
 .bkey         { width: 20vh; height: 20vh; }
 
 .bkeyFull     { width: 96vw; height: 96vh; }
@@ -173,6 +185,13 @@ body { letter-spacing: 0.25em; }
   font-size: 6.5vh;
 }
 
+.bkeyDate {
+  width:16vw;
+  height:6vh;
+  font-family: monospace;
+  font-size: 3.5vh;
+}
+
 .bkeyTimeBig  { width:16vw; height:10vh; }
 
 .bkeyw      { width: 25vw; height: 17vh; }

+ 1 - 0
busunit/DIUv2/html/index-ORG.html

@@ -71,6 +71,7 @@
         <div class='pure-u-1-3 col'> <button onmousedown='_beep();' class='bdropinp bkeyw' id='ui_login_login'>Login</button> </div>
         <div class='pure-u-1-3 col'>
           <button class='bdisp bkeyTime' id='ui_login_time'> 02:34 </button>
+          <button class='bdispSmall bkeyDate' id='ui_login_date'> </button>
         </div>
         <div class='pure-u-1-3 col'> <button onmousedown='_beep();' class='bdropinp bkeyw' id='ui_login_configuration'>Config</button> </div>
 

+ 32 - 15
busunit/DIUv2/html/js/diu_ui-ORG.js

@@ -295,25 +295,32 @@ function _get_now_HH_MM() {
   return _time_str;
 }
 
+function _get_now_YYYY_MM_DD() {
+  var _dt = new Date();
+
+  var _sep = "-";
+
+  var _yr = _dt.getFullYear();
+  var _mo = _dt.getMonth()+1;
+  var _dy = _dt.getDate();
+
+  var _yr_str = _yr.toString();
+  var _mo_str = _mo.toString();
+  if (_mo < 10) {
+    _mo_str = "0" + _mo_str;
+  }
+  var _dy_str = _dy.toString();
+  if (_dy < 10) {
+    _dy_str = "0" + _dy_str;
+  }
+
+  return _yr_str + _sep + _mo_str + _sep + _dy_str;
+}
+
 function _update_display_time() {
   var ele = document.getElementById("ui_main_time");
   if (typeof ele === "undefined") { return; }
-
-  /*
-  var _dt = new Date();
-  var _sep = ":";
-  if ( (_dt.getSeconds() % 2) == 0) { _sep = " "; }
-  var _hr = _dt.getHours();
-  var _min = _dt.getMinutes();
-  var _hr_str = _hr.toString();
-  var _min_str = _min.toString();
-  if (_hr < 10) { _hr_str = "0" + _hr_str; }
-  if (_min < 10) { _min_str = "0" + _min_str; }
-  var _time_str = _hr_str + _sep + _min_str;
-  */
-
   var _time_str = _get_now_HH_MM();
-
   ele.innerHTML = "<span style='white-space:nowrap;'>" + _time_str + "</span>";
 }
 
@@ -328,6 +335,15 @@ function _update_login_time() {
   ele.innerHTML = "<span style='white-space:nowrap;'>" + _time_str + "</span>";
 }
 
+function _update_login_date() {
+  var ele = document.getElementById("ui_login_date");
+  if (typeof ele === "undefined") { return; }
+
+  var _date_str = _get_now_YYYY_MM_DD();
+
+  ele.innerHTML = "<span style='white-space:nowrap;'>" + _date_str + "</span>";
+}
+
 //------------
 
 // value is from [0,1]
@@ -1313,6 +1329,7 @@ function init() {
 
   window.setInterval(_update_display_time, 200);
   window.setInterval(_update_login_time, 200);
+  window.setInterval(_update_login_date, 200);
 
   // watchdog
   //