|
@@ -27,13 +27,25 @@ var _fqADDRESS = _ADDRESS + ":" + _PORT;
|
|
|
var BG_COLOR = "#f7f7f7";
|
|
var BG_COLOR = "#f7f7f7";
|
|
|
var TEXT_COLOR = "#444444";
|
|
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 = {
|
|
var g_snd = {
|
|
|
|
|
+ "reject_fare" : "",
|
|
|
|
|
+ "accept_fare" : "",
|
|
|
"button_press" : ""
|
|
"button_press" : ""
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+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() {
|
|
function _beep() {
|
|
|
g_snd.button_press.currentTime=0;
|
|
g_snd.button_press.currentTime=0;
|
|
|
g_snd.button_press.play();
|
|
g_snd.button_press.play();
|
|
@@ -633,6 +645,23 @@ function _main_message_replace(msg, bg_color, text_color) {
|
|
|
|
|
|
|
|
g_ctx.status_text = lines.join("\n");
|
|
g_ctx.status_text = lines.join("\n");
|
|
|
ele.innerHTML = g_ctx.status_text;
|
|
ele.innerHTML = g_ctx.status_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();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function _main_message_add(msg, bg_color, text_color) {
|
|
function _main_message_add(msg, bg_color, text_color) {
|
|
@@ -656,6 +685,23 @@ function _main_message_add(msg, bg_color, text_color) {
|
|
|
|
|
|
|
|
g_ctx.status_text = lines.join("\n");
|
|
g_ctx.status_text = lines.join("\n");
|
|
|
ele.innerHTML = g_ctx.status_text;
|
|
ele.innerHTML = g_ctx.status_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();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -758,34 +804,6 @@ function ui_pattern_mousedown(ev) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
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) {
|
|
function ui_pattern_mouseup(ev) {
|
|
@@ -805,8 +823,6 @@ function __ui_pattern_mouseup_depricated(ev) {
|
|
|
|
|
|
|
|
if (ui_pattern.state == "cross_0_start") {
|
|
if (ui_pattern.state == "cross_0_start") {
|
|
|
|
|
|
|
|
- console.log("cp0");
|
|
|
|
|
-
|
|
|
|
|
if ((x > (3*width/4)) && (y > (3*height/4))) {
|
|
if ((x > (3*width/4)) && (y > (3*height/4))) {
|
|
|
ui_pattern.state = "cross_0_end";
|
|
ui_pattern.state = "cross_0_end";
|
|
|
}
|
|
}
|
|
@@ -818,9 +834,6 @@ function __ui_pattern_mouseup_depricated(ev) {
|
|
|
|
|
|
|
|
else if (ui_pattern.state == "cross_1_start") {
|
|
else if (ui_pattern.state == "cross_1_start") {
|
|
|
|
|
|
|
|
- console.log("cp1");
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
if ((x < (width/4)) && (y > (3*height/4))) {
|
|
if ((x < (width/4)) && (y > (3*height/4))) {
|
|
|
_switch_ui("ui_diagnostic");
|
|
_switch_ui("ui_diagnostic");
|
|
|
}
|
|
}
|
|
@@ -958,6 +971,9 @@ function init() {
|
|
|
|
|
|
|
|
document.getElementById('ui_bulk_menu').onclick = function() { _switch_ui("ui_main"); }
|
|
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",
|
|
var bulk_pass = ["adult", "youth", "half", "event", "transfer", "interline",
|
|
|
"schoola", "schoolb", "schoolc", "orga", "orgb", "orgc"];
|
|
"schoola", "schoolb", "schoolc", "orga", "orgb", "orgc"];
|
|
|
var bulk_rule = ["BULK-CASH-ADULT", "BULK-CASH-YOUTH", "BULK-CASH-HALF",
|
|
var bulk_rule = ["BULK-CASH-ADULT", "BULK-CASH-YOUTH", "BULK-CASH-HALF",
|
|
@@ -966,6 +982,21 @@ function init() {
|
|
|
"BULK-OVR-ORGA", "BULK-OVR-ORGB", "BULK-OVR-ORGC"];
|
|
"BULK-OVR-ORGA", "BULK-OVR-ORGB", "BULK-OVR-ORGC"];
|
|
|
var bulk_pass_name = ["Adult Cash", "Youth Cash", "Half Cash", "Special Event", "Transfer", "Interline",
|
|
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"];
|
|
"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++) {
|
|
for (var i=0; i<bulk_pass.length; i++) {
|
|
|
var p = bulk_pass[i];
|
|
var p = bulk_pass[i];
|
|
|
var u = bulk_pass_name[i];
|
|
var u = bulk_pass_name[i];
|
|
@@ -982,7 +1013,6 @@ function init() {
|
|
|
})(r, u);
|
|
})(r, u);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// bulk accept fares
|
|
// bulk accept fares
|
|
|
//
|
|
//
|
|
|
document.getElementById('ui_bulkaccept_ok').onclick = _bulkaccept_ok;
|
|
document.getElementById('ui_bulkaccept_ok').onclick = _bulkaccept_ok;
|
|
@@ -1094,7 +1124,6 @@ function init() {
|
|
|
block_ele.style.x = rect.x;
|
|
block_ele.style.x = rect.x;
|
|
|
block_ele.style.y = rect.y;
|
|
block_ele.style.y = rect.y;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
ele = document.getElementById("ui_main_status");
|
|
ele = document.getElementById("ui_main_status");
|
|
|
ele.ondragstart = function() { return false; }
|
|
ele.ondragstart = function() { return false; }
|
|
|
ele.onselectstart = function() { return false; }
|
|
ele.onselectstart = function() { return false; }
|
|
@@ -1112,12 +1141,17 @@ function init() {
|
|
|
block_ele.style.x = rect.x;
|
|
block_ele.style.x = rect.x;
|
|
|
block_ele.style.y = rect.y;
|
|
block_ele.style.y = rect.y;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
ele = document.getElementById("body");
|
|
ele = document.getElementById("body");
|
|
|
ele.onmousedown = ui_pattern_mousedown;
|
|
ele.onmousedown = ui_pattern_mousedown;
|
|
|
ele.onmouseup = ui_pattern_mouseup;
|
|
ele.onmouseup = ui_pattern_mouseup;
|
|
|
|
|
|
|
|
g_snd.button_press = new Audio("assets/459992_florianreichelt_beep_short.mp3");
|
|
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");
|
|
|
|
|
+
|
|
|
|
|
+ if (typeof PopufareSiteInit !== "undefined") {
|
|
|
|
|
+ PopufareSiteInit();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|