Просмотр исходного кода

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

clementinecomputing 6 лет назад
Родитель
Сommit
ab5fadd8d9

+ 46 - 2
aux/deploy-busunit-interactive

@@ -74,6 +74,8 @@ echo ""
 echo -n "Hit return to continue [ok]: "
 read hitreturn
 
+DATESTR=`date '+%Y%m%d%H%M%S'`
+
 ###### basic sanity checks to make sure we're installing on a Raspberry Pi
 ######
 
@@ -441,6 +443,44 @@ if [[ "$setupsound" =~ ^[yY]$ ]] ; then
 
 fi
 
+##### Change hostname
+#####
+
+echo -n "Change hostname? [y/N]: "
+read changehostname
+
+if [[ "$changehostname" =~ ^[yY]$ ]] ; then
+
+
+  echo -n "  New hostname [popufaredev]: "
+  read newhostname
+
+  if [[ "$newhostname" == "" ]] ; then
+    newhostname=popufaredev
+  fi
+
+  echo "  Saving /etc/hostname to /root/hostname.$DATESTR"
+  sudo cp /etc/hostname /root/hostname.$DATESTR
+  sudo bash -c "echo '$newhostname' > /etc/hostname"
+
+  tfn=`mktemp`
+  echo -e '127.0.0.1\tlocalhost' > $tfn
+  echo -e '::1\t\tlocalhost ip6-localhost ip6-loopback' >> $tfn
+  echo -e 'ff02::1\t\tip6-allnodes' >> $tfn
+  echo -e 'ff02::2\t\tip6-allrouters' >> $tfn
+  echo '' >> $tfn
+  echo -e '127.0.1.1\t'"$newhostname" >> $tfn
+
+  echo "  Saving /etc/hosts to /root/hosts.$DATESTR"
+  sudo cp /etc/hosts /root/hosts.$DATESTR
+
+  echo "  Creating new /etc/hosts file"
+  sudo mv $tfn /etc/hosts
+  sudo chmod 644 /etc/hosts
+
+fi
+
+
 ##### Setup kiosk
 #####
 
@@ -455,11 +495,16 @@ if [[ "$setupkiosk" =~ ^[yY]?$ ]] ; then
   echo "  enabling kiosk.service ('systemctl enable kiosk.service')"
   sudo systemctl enable kiosk.service
 
+  ## Changing hostname will screw up chromium if it's already been run under a different
+  ## hostname. Remove the files that cause the problems so Chromium can run without
+  ## issue.
+  ##
+  echo "  removing chromium 'Singleton*' files"
+  sudo rm -rf /home/bus/.config/chromium/Singleton*
 fi
 
 echo ""
 
-
 ##### Setup startup
 #####
 
@@ -475,7 +520,6 @@ if [[ "$setupstartup" =~ ^[yY]?$ ]] ; then
   sudo cp /etc/rc.local $tmpfn
   sudo mv $tmpfn /root/$bfn
 
-
   echo "  /home/bus/popufare/busunit/scripts/rc.local -> /etc/rc.local"
   sudo cp /home/bus/popufare/busunit/scripts/rc.local /etc/rc.local
 

BIN
busunit/DIUv2/html/assets/363920__samsterbirdies__8-bit-error.mp3


+ 50 - 36
busunit/DIUv2/html/css/diustyles.css

@@ -46,6 +46,56 @@ p:focus {
   border:0;
 }
 
+.textwindow {
+  float: left;
+  color: #444444;
+  font-size: 5vh;
+  letter-spacing: 0.125vh;
+  font-weight:bold;
+  font-family: monospace;
+  outline: thin solid #999999;
+  background: #f7f7f7;
+  width:80vw;
+  height:60vh;
+  overflow:hidden;
+}
+
+.textwindowmain {
+  float: left;
+  color: #444444;
+  font-size: 5vh;
+  letter-spacing: 0.125vh;
+  font-weight:bold;
+  font-family: monospace;
+  outline: thin solid #999999;
+  background: #f7f7f7;
+  width:65vw;
+  height:51vh;
+  overflow:hidden;
+}
+
+.textrow {
+  padding-left: 0.5vw;
+  float:left;
+  width: 100%;
+  text-align:left;
+}
+
+.textrow.accept {
+  background: #44cc44;
+  color: #444444;
+}
+
+.textrow.reject {
+  background: #cc4444;
+  color: #333333;
+}
+
+.textrow.error {
+  background: #ff7f33;
+  color: #444444;
+}
+
 /***********/
 
 /* 
@@ -79,36 +129,6 @@ p:focus {
 }
 */
 
-.statuslogin {
-  resize:none;
-  background: #f7f7f7;
-  overflow:hidden;
-  overflow-x:hidden;
-  overflow-y:hidden;
-  word-wrap:off;
-  -webkit-user-select: none;
-  -webkit-touch-callout: none;
-  -khtml-user-select: none;
-  -ms-user-select: none;
-  -o-user-select: none;
-  user-select: none;
-  -moz-user-select: none;
-}
-
-.statusmain {
-  resize:none;
-  background: #f7f7f7;
-  word-wrap:off;
-  -webkit-user-select: none;
-  -webkit-touch-callout: none;
-  -khtml-user-select: none;
-  -ms-user-select: none;
-  -o-user-select: none;
-  user-select: none;
-  cursor:default;
-  -moz-user-select: none;
-}
-
 .bkeyFull {
   width: 96vw;
   height:96vh;
@@ -121,9 +141,6 @@ p:focus {
     letter-spacing: 0.125em;
   }
 
-  .statuslogin { font-size:20px; }
-  .statusmain { font-size:20px; }
-
   .row { height: 80px; }
   .col { width: 80px; }
 
@@ -203,9 +220,6 @@ p:focus {
     letter-spacing: 0.25em;
   }
 
-  .statuslogin { font-size:40px; }
-  .statusmain { font-size:40px; }
-
   .row { height: 160px; }
   .col { width: 160px; }
 

+ 14 - 29
busunit/DIUv2/html/index-ORG.html

@@ -58,14 +58,14 @@
 
         <button class='invisiblock' id='ui_login_blockwindow'> </button>
 
-<textarea class='statuslogin' type='textarea' id='ui_login_status' rows='12' cols='80' disabled readonly>
-Tunnel: . GPRS: . Eq# . #Msg: .
-Last Token Read (.): ""
-GPS: .
+        <div id='ui_login_status' class='textwindow'>
+          <div class='textrow'>Tunnel: . GPRS: . Eq# . #Msg: .</div><br>
+          <div class='textrow'>Last Token Read (.): ""</div><br>
+          <div class='textrow'>GPS: .</div><br>
+          <br>
+          <div class='textrow'>Package    Version        Installed</div>
 
-Package    Version        Installed
-
-</textarea>
+        </div>
 
       </div>
 
@@ -222,7 +222,7 @@ Diagnostic window...
       <div style='width:100%; height:100%;'>
 
         <div class='pure-g row' style='width:100%; height:100%;' >
-          <div class='pure-u-1-6 col' style=' position:absolute; top:20%; margin-left:25%; '> <button onmousedown='_beep();' class='bdropinp bkeyHuge' id='ui_driverincorrect_btn'>Incorrect Login</button> </div>
+          <div class='pure-u-1-6 col' style=' position:absolute; top:10vh; margin-left:10vw; '> <button onmousedown='_beep();' class='bdropinp bkeyHuge' id='ui_driverincorrect_btn'>Incorrect Login</button> </div>
         </div>
 
       </div>
@@ -324,13 +324,6 @@ Diagnostic window...
 
     <div id='ui_paddleunknown' style='display:none;'>
 
-      <!--
-      <br>
-      <div class='pure-g row'>
-        <div class='pure-u-1-6 col'> <button onmousedown='_beep();' class='bdropinp bkeyw' id='ui_paddleunknown_btn'>Unknown Paddle</button> </div>
-      </div>
-      -->
-
       <div style='width:100%; height:100%;'>
 
         <div class='pure-g row' style='width:100%; height:100%;' >
@@ -382,19 +375,11 @@ Diagnostic window...
 
         <div class='pure-u-1-2 col'>
           <button class='invisiblock' id='ui_main_blockwindow'> </button>
-          <textarea
-            wrap=""
-            class='statusmain'
-            type='textarea'
-            id='ui_main_status'
-            rows='10'
-            cols='40'
-            onselect='return false;'
-            unselectable='on'
-            disabled readonly>
-          ...
-          </textarea>
-        </div>
+
+          <div id='ui_main_status' class='textwindowmain'>
+          </div>
+
+       </div>
 
       </div>
 
@@ -425,7 +410,6 @@ Diagnostic window...
 
       </div>
 
-      <!-- <div id="mainstatus">Rt 9900   Trip 1   Stop 0   GPS No   Tun Yes   2019-08-13 04:58</div> -->
       <div id="mainstatus"></div>
 
     </div> <!-- ui_main -->
@@ -645,6 +629,7 @@ Diagnostic window...
   </body>
 
   <script src='js/moment.js'></script>
+  <script src='js/diu_ui_site_specific.js'></script>
   <script src='js/diu_ui.js'></script>
 
 </html>

+ 199 - 96
busunit/DIUv2/html/js/diu_ui-ORG.js

@@ -27,13 +27,31 @@ var _fqADDRESS = _ADDRESS + ":" + _PORT;
 var BG_COLOR = "#f7f7f7";
 var TEXT_COLOR = "#444444";
 
-var DIU_UI_VERSION = "0.1.0";
-var DIU_UI_VERSION_DATE = "2019-09-04 15:24:11";
+var DIU_UI_VERSION = "0.1.4";
+var DIU_UI_VERSION_DATE = "2019-11-24 11:29:00";
 
 var g_snd = {
+  "reject_fare" : "",
+  "accept_fare" : "",
+  "rule_error" : "",
   "button_press" : ""
 };
 
+function _beep_error() {
+  g_snd.rule_error.currentTime=0;
+  g_snd.rule_error.play();
+}
+
+function _beep_reject() {
+  g_snd.reject_fare.currentTime=0;
+  g_snd.reject_fare.play();
+}
+
+function _beep_accept() {
+  g_snd.accept_fare.currentTime=0;
+  g_snd.accept_fare.play();
+}
+
 function _beep() {
   g_snd.button_press.currentTime=0;
   g_snd.button_press.play();
@@ -55,8 +73,10 @@ var g_ctx = {
   "bulkfare_count" : "",
 
   "status_text": "",
-  "status_text_w": 0,
-  "status_text_h": 0,
+  "status_text_w": 32,
+  "status_text_h": 9,
+
+  "status_html_text":"",
 
   "diu_status" : {},
 
@@ -548,8 +568,6 @@ function _cb_status(inp) {
     var kv = fields[ii].split("=");
     if (kv.length!=2) { continue; }
     g_ctx.diu_status[kv[0].trim()] = kv[1].trim();
-
-
   }
 
   var m = g_ctx.diu_status;
@@ -565,20 +583,30 @@ function _cb_status(inp) {
     var gps_str = ( ((lat.length>0) && (lon.length>0)) ?  (" (" + lat + "/" + lon + ")") : "" );
 
     var ele = document.getElementById("ui_login_status");
-    var str = "";
-    str += "Tunnel: " + has_tunn + "  GPRS: " + has_gprs + "  Eq#: " + m["equipno"] + "  #Msg: " + m["nmsg"] + "\n";
-    str += "Last Token Read (" + m["last_token"] + ")\n";
-    str += "GPS: " + has_gps + gps_str + "\n";
-    str += "\n";
-    //      012345678012345678901234567890
-    str += "Package   Version   Installed\n";
-    //str += "-----------------------------\n";
-    str += _sp("ui") + _sp(DIU_UI_VERSION) + _sp(DIU_UI_VERSION_DATE) + "\n";
-    str += "\n";
-
-    if ("IMEI" in m) { str += "IMEI = " + m["IMEI"] + "\n"; }
-    if ("IMSI" in m) { str += "IMSI = " + m["IMSI"] + "\n"; }
-    if ("ETH0" in m) { str += "ETH0 = " + m["ETH0"] + "\n"; }
+
+    var html_a = [];
+    html_a.push("Tunnel: " + has_tunn + "  GPRS: " + has_gprs + "  Eq#: " + m["equipno"] + "  #Msg: " + m["nmsg"]);
+    html_a.push("Last Token Read (" + m["last_token"] + ")");
+    html_a.push("GPS: " + has_gps + gps_str + "");
+    html_a.push(" ");
+    html_a.push("Package   Version   Installed");
+    html_a.push(_sp("ui") + _sp(DIU_UI_VERSION) + _sp(DIU_UI_VERSION_DATE) + "");
+    html_a.push(" ");
+
+    if ("IMEI" in m) { html_a.push("IMEI = " + m["IMEI"] + ""); }
+    if ("IMSI" in m) { html_a.push("IMSI = " + m["IMSI"] + ""); }
+    if ("ETH0" in m) { html_a.push("ETH0 = " + m["ETH0"] + ""); }
+    html_a.push(" ");
+
+    for (var ii=0; ii<html_a.length; ii++) {
+      html_a[ii] = html_a[ii].replace(/ /g, '&nbsp;');
+    }
+
+    //span_str = "<div style='float:left; width: 100%; margin: 0 auto; display:block; text-align:left;  background: #770000; color:#008800;'>";
+    //span_str = "<div style='float:left; width: 100%; text-align:left;  background: #770000; color:#008800;'>";
+    //var div_hdr = "<div style='float:left; width: 100%; text-align:left; '>";
+    var div_hdr = "<div class='textrow'>";
+    var str = div_hdr + html_a.join("</div><br>" + div_hdr ) + "</div>";
 
     ele.innerHTML = str;
   }
@@ -611,10 +639,8 @@ function _main_message_clear() {
 
 function _main_message_replace(msg, bg_color, text_color) {
   var ele = document.getElementById("ui_main_status");
-  g_ctx.status_text_w = ele.cols;
-  g_ctx.status_text_h = ele.rows;
 
-  bg_color = ((typeof bg_color === "undeinfed") ? BG_COLOR : bg_color);
+  bg_color = ((typeof bg_color === "undefined") ? BG_COLOR : bg_color);
   text_color = ((typeof text_color === "undefined") ? TEXT_COLOR : text_color);
 
   var lines = g_ctx.status_text.split("\n");
@@ -631,31 +657,118 @@ function _main_message_replace(msg, bg_color, text_color) {
 
   lines[idx] = msg;
 
+  var html_lines = [];
+  for (var i=0; i<lines.length; i++) {
+    html_lines.push(lines[i].slice(0,g_ctx.status_text_w));
+
+    if (html_lines[i].match(/ACCEPT/)) {
+      html_lines[i] = "<div class='textrow accept'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/REJECT/)) {
+      html_lines[i] = "<div class='textrow reject'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/[Uu]nknown/)) {
+      html_lines[i] = "<div class='textrow reject'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/[Pp]assback/)) {
+      html_lines[i] = "<div class='textrow reject'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/Rule execution error/)) {
+      html_lines[i] = "<div class='textrow error'>" + html_lines[i] + "</div>";
+    }
+    else {
+      html_lines[i] = "<div class='textrow'>" + html_lines[i] + "</div>";
+    }
+
+  }
+
+  g_ctx.status_text = lines.join("\n");
+
   g_ctx.status_text = lines.join("\n");
-  ele.innerHTML = g_ctx.status_text;
+  g_ctx.status_html_text = html_lines.join("<br>");
+  ele.innerHTML = g_ctx.status_html_text;
+
+  // sounds
+  //
+  if (msg.match(/ACCEPT/)) {
+    _beep_accept();
+  }
+  else if (msg.match(/REJECT/)) {
+    _beep_reject();
+  }
+  else if (msg.match(/[Uu]nknown/)) {
+    _beep_reject();
+  }
+  else if (msg.match(/[Pp]assback/)) {
+    _beep_reject();
+  }
+  else if (msg.match(/Rule execution error/)) {
+    _beep_error();
+  }
+
 }
 
 function _main_message_add(msg, bg_color, text_color) {
   var ele = document.getElementById("ui_main_status");
-  g_ctx.status_text_w = ele.cols;
-  g_ctx.status_text_h = ele.rows;
 
-  bg_color = ((typeof bg_color === "undeinfed") ? BG_COLOR : bg_color);
+  bg_color = ((typeof bg_color === "undefined") ? BG_COLOR : bg_color);
   text_color = ((typeof text_color === "undefined") ? TEXT_COLOR : text_color);
 
   var txt = g_ctx.status_text + "\n" + msg;
 
+  var html_lines = [];
+
   var lines = txt.split("\n");
   if (lines.length > g_ctx.status_text_h) {
     var n = lines.length;
     lines = lines.slice(n - g_ctx.status_text_h);
   }
   for (var i=0; i<lines.length; i++) {
-    lines[i] = lines[i].slice(0,g_ctx.status_text_w);
+    html_lines.push(lines[i].slice(0,g_ctx.status_text_w));
+
+    if (html_lines[i].match(/ACCEPT/)) {
+      html_lines[i] = "<div class='textrow accept'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/REJECT/)) {
+      html_lines[i] = "<div class='textrow reject'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/[Uu]nknown/)) {
+      html_lines[i] = "<div class='textrow reject'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/[Pp]assback/)) {
+      html_lines[i] = "<div class='textrow reject'>" + html_lines[i] + "</div>";
+    }
+    else if (html_lines[i].match(/Rule execution error/)) {
+      html_lines[i] = "<div class='textrow error'>" + html_lines[i] + "</div>";
+    }
+    else {
+      html_lines[i] = "<div class='textrow'>" + html_lines[i] + "</div>";
+    }
+
   }
 
   g_ctx.status_text = lines.join("\n");
-  ele.innerHTML = g_ctx.status_text;
+  g_ctx.status_html_text = html_lines.join("<br>");
+  ele.innerHTML = g_ctx.status_html_text;
+
+  // sounds
+  //
+  if (msg.match(/ACCEPT/)) {
+    _beep_accept();
+  }
+  else if (msg.match(/REJECT/)) {
+    _beep_reject();
+  }
+  else if (msg.match(/[Uu]nknown/)) {
+    _beep_reject();
+  }
+  else if (msg.match(/[Pp]assback/)) {
+    _beep_reject();
+  }
+  else if (msg.match(/Rule execution error/)) {
+    _beep_error();
+  }
+
 }
 
 
@@ -723,6 +836,7 @@ function ui_pattern_mousedown(ev) {
   var height = rect.height;
 
   if (ui_pattern.state == "idle") {
+
     if (y < (height/4)) {
       ui_pattern.state = "square_0";
     }
@@ -752,63 +866,17 @@ function ui_pattern_mousedown(ev) {
 
   else if (ui_pattern.state == "square_2") {
     if (x < (width/4)) {
-      _switch_ui("ui_diagnostic");
+      ui_pattern.state = "square_3";
+    }
+    else {
+      ui_pattern.state = "idle"
     }
-    ui_pattern.state = "idle"
-  }
-
-  return false;
-
-
-//  if (ui_pattern.state == "idle") {
-//
-//    if ((x < (width/4)) && (y < (height/4))) {
-//      ui_pattern.state = "cross_0_start";
-//    }
-//    else {
-//      ui_pattern.state = "idle"
-//    }
-//
-//  }
-//  else if (ui_pattern.state == "cross_0_end") {
-//
-//    if ((x > (3*width/4)) && (y < (height/4))) {
-//      ui_pattern.state = "cross_1_start";
-//    }
-//    else {
-//      ui_pattern.state = "idle"
-//    }
-//
-//  }
-//  else {
-//    ui_pattern.state = "idle";
-//  }
-//
-//  return false;
-
-}
-
-function ui_pattern_mouseup(ev) {
-  return false;
-}
-
-function __ui_pattern_mouseup_depricated(ev) {
-
-  var ele = document.getElementById("body");
-  var rect = ele.getBoundingClientRect();
-
-  var x = ev["x"];
-  var y = ev["y"];
-
-  var width = rect.width;
-  var height = rect.height;
-
-  if (ui_pattern.state == "cross_0_start") {
 
-    console.log("cp0");
+  }
 
-    if ((x > (3*width/4)) && (y > (3*height/4))) {
-      ui_pattern.state = "cross_0_end";
+  else if (ui_pattern.state == "square_3") {
+    if (y < (height/4)) {
+      ui_pattern.state = "square_4";
     }
     else {
       ui_pattern.state = "idle"
@@ -816,25 +884,38 @@ function __ui_pattern_mouseup_depricated(ev) {
 
   }
 
-  else if (ui_pattern.state == "cross_1_start") {
-
-    console.log("cp1");
+  else if (ui_pattern.state == "square_4") {
+    if (x > (3*width/4)) {
+      ui_pattern.state = "square_5";
+    }
+    else {
+      ui_pattern.state = "idle"
+    }
+  }
 
+  else if (ui_pattern.state == "square_5") {
+    if (y > (3*height/4)) {
+      ui_pattern.state = "square_6";
+    }
+    else {
+      ui_pattern.state = "idle"
+    }
+  }
 
-    if ((x < (width/4)) && (y > (3*height/4))) {
+  else if (ui_pattern.state == "square_6") {
+    if (x < (width/4)) {
       _switch_ui("ui_diagnostic");
     }
-
-    ui_pattern.state = "idle";
-
-  }
-  else {
-    ui_pattern.state = "idle";
+    ui_pattern.state = "idle"
   }
 
   return false;
 }
 
+function ui_pattern_mouseup(ev) {
+  return false;
+}
+
 //------------
 
 function _mainscreen() {
@@ -958,6 +1039,9 @@ function init() {
 
   document.getElementById('ui_bulk_menu').onclick = function() { _switch_ui("ui_main"); }
 
+  // Setup "Bulk" UI accept buttons to do proper screen switching and
+  // other tasks.
+  //
   var bulk_pass = ["adult", "youth", "half", "event", "transfer", "interline",
                     "schoola", "schoolb", "schoolc", "orga", "orgb", "orgc"];
   var bulk_rule = ["BULK-CASH-ADULT", "BULK-CASH-YOUTH", "BULK-CASH-HALF",
@@ -966,6 +1050,21 @@ function init() {
                    "BULK-OVR-ORGA", "BULK-OVR-ORGB", "BULK-OVR-ORGC"];
   var bulk_pass_name = ["Adult Cash", "Youth Cash", "Half Cash", "Special Event", "Transfer", "Interline",
                         "School A", "Sschool B", "School C", "Org A", "Org B", "Org C"];
+
+  // use site specific values if available, otherwise default to the above
+  //
+  if ((typeof BULK_PASS !== "undefined") && (BULK_PASS.length > 0)) {
+    bulk_pass = BULK_PASS;
+  }
+
+  if ((typeof BULK_RULE !== "undefined") && (BULK_RULE.length > 0)) {
+    bulk_rule= BULK_RULE;
+  }
+
+  if ((typeof BULK_PASS_NAME !== "undefined") && (BULK_PASS_NAME.length > 0)) {
+    bulk_pass_name = BULK_PASS_NAME;
+  }
+
   for (var i=0; i<bulk_pass.length; i++) {
     var p = bulk_pass[i];
     var u = bulk_pass_name[i];
@@ -982,7 +1081,6 @@ function init() {
     })(r, u);
   }
 
-
   // bulk accept fares
   //
   document.getElementById('ui_bulkaccept_ok').onclick = _bulkaccept_ok;
@@ -1094,7 +1192,6 @@ function init() {
   block_ele.style.x = rect.x;
   block_ele.style.y = rect.y;
 
-
   ele = document.getElementById("ui_main_status");
   ele.ondragstart = function() { return false; }
   ele.onselectstart = function() { return false; }
@@ -1112,12 +1209,18 @@ function init() {
   block_ele.style.x = rect.x;
   block_ele.style.y = rect.y;
 
-
   ele = document.getElementById("body");
   ele.onmousedown = ui_pattern_mousedown;
   ele.onmouseup = ui_pattern_mouseup;
 
   g_snd.button_press = new Audio("assets/459992_florianreichelt_beep_short.mp3");
+  g_snd.accept_fare = new Audio("assets/443026__qubodup__public-domain-beep-sound.mp3");
+  g_snd.reject_fare = new Audio("assets/368780__gurie__start-sound-beep.mp3");
+  g_snd.rule_error = new Audio("assets/363920__samsterbirdies__8-bit-error.mp3");
+
+  if (typeof PopufareSiteInit !== "undefined") {
+    PopufareSiteInit();
+  }
 
 }
 

+ 70 - 0
busunit/DIUv2/html/js/diu_ui_site_specific.js

@@ -0,0 +1,70 @@
+// Copyright (c) 2019 Clementine Computing LLC.
+//
+// License: CC0
+//
+// To the extent possible under law, the person who associated CC0 with
+// this file has waived all copyright and related or neighboring rights
+// to this file.
+//
+// You should have received a copy of the CC0 legalcode along with this
+// work.  If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+//
+
+
+// Populate these values with your site specific information
+//
+var BULK_PASS =  ["adult", "youth", "half", "event", "transfer", "interline",
+                  "schoola", "schoolb", "schoolc", "orga", "orgb", "orgc"];
+var BULK_RULE = ["BULK-CASH-ADULT", "BULK-CASH-YOUTH", "BULK-CASH-HALF",
+                 "BULK-MISC-EVENT", "BULK-MISC-TRANSFER", "BULK-MISC-INTERLINE",
+                 "BULK-OVR-SCHOOLA", "BULK-OVR-SCHOOLB", "BULK-OVR-SCHOOLC",
+                 "BULK-OVR-ORGA", "BULK-OVR-ORGB", "BULK-OVR-ORGC"];
+var BULK_PASS_NAME = ["Adult Cash", "Youth Cash", "Half Cash", "Special Event", "Transfer", "Interline",
+                      "School A", "Sschool B", "School C", "Org A", "Org B", "Org C"];
+
+// This function can be used after the Popufare UI has been initialized to do
+// any work that couldn't be done otherwise.
+//
+function PopufareSiteInit(data) {
+  var ele = {};
+
+  var ele = document.getElementById("ui_bulk_schoola");
+  if (ele) { ele.innerHTML = "Uni A"; }
+
+  var ele = document.getElementById("ui_bulk_schoolb");
+  if (ele) { ele.innerHTML = "Uni B"; }
+
+  var ele = document.getElementById("ui_bulk_schoolc");
+  if (ele) { ele.innerHTML = "Uni C"; }
+
+  var ele = document.getElementById("ui_bulk_orga");
+  if (ele) { ele.innerHTML = "Orga A"; }
+
+  var ele = document.getElementById("ui_bulk_orgb");
+  if (ele) { ele.innerHTML = "Orga B"; }
+
+  var ele = document.getElementById("ui_bulk_orgc");
+  if (ele) { ele.innerHTML = "Orga C"; }
+
+  //--
+
+  var ele = document.getElementById("ui_fareoverride_schoola");
+  if (ele) { ele.innerHTML = "Univ A"; }
+
+  var ele = document.getElementById("ui_fareoverride_schoolb");
+  if (ele) { ele.innerHTML = "Univ B"; }
+
+  var ele = document.getElementById("ui_fareoverride_schoolc");
+  if (ele) { ele.innerHTML = "Univ C"; }
+
+  var ele = document.getElementById("ui_fareoverride_orga");
+  if (ele) { ele.innerHTML = "Orgi A"; }
+
+  var ele = document.getElementById("ui_fareoverride_orgb");
+  if (ele) { ele.innerHTML = "Orgi B"; }
+
+  var ele = document.getElementById("ui_fareoverride_orgc");
+  if (ele) { ele.innerHTML = "Orgi C"; }
+
+}
+