diu_ui_site_specific.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Copyright (c) 2019 Clementine Computing LLC.
  2. //
  3. // License: CC0
  4. //
  5. // To the extent possible under law, the person who associated CC0 with
  6. // this file has waived all copyright and related or neighboring rights
  7. // to this file.
  8. //
  9. // You should have received a copy of the CC0 legalcode along with this
  10. // work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
  11. //
  12. // This file contains 'site specific' information about pass types and
  13. // how they're displayed in the driver facing UI.
  14. //
  15. // BULK_PASS and OVERRIDE_PASS are tied to the HTML elements being displayed.
  16. // The `ui_bulk_...` and `ui_fareoverride_...` are the IDs of the HTML elements
  17. // that can be altered depending on need.
  18. //
  19. // The BULK_RULE and OVERRIDE_RULE are what gets passed to the underlying
  20. // Popufare system and should reflect the rules present both in the installation
  21. // database and in the `rules.scm` file local to the DIU.
  22. //
  23. //--
  24. // Populate these values with your site specific information
  25. // for both bulk passes and 'override' pass types.
  26. //
  27. var BULK_PASS = ["adult", "youth", "half",
  28. "event", "transfer", "interline",
  29. "schoola", "schoolb", "schoolc",
  30. "orga", "orgb", "orgc"];
  31. var BULK_RULE = ["BULK-CASH-ADULT", "BULK-CASH-YOUTH", "BULK-CASH-HALF",
  32. "BULK-MISC-EVENT", "BULK-MISC-TRANSFER", "BULK-MISC-INTERLINE",
  33. "BULK-OVR-SCHOOLA", "BULK-OVR-SCHOOLB", "BULK-OVR-SCHOOLC",
  34. "BULK-OVR-ORGA", "BULK-OVR-ORGB", "BULK-OVR-ORGC"];
  35. // Text to be diplayed in the 'bulk accept' screen
  36. //
  37. var BULK_PASS_NAME = ["Adult Cash", "Youth Cash", "Half Cash",
  38. "Special Event", "Transfer", "Interline",
  39. "School A", "School B", "School C",
  40. "Org A", "Org B", "Org C"];
  41. //--
  42. var OVERRIDE_PASS = [ "adult", "youth", "half",
  43. "bike", "wheelchair", "transfer",
  44. "event", "interline",
  45. "schoola", "schoolb", "schoolc",
  46. "orga", "orgb", "orgc" ];
  47. var OVERRIDE_RULE = [ "CASH-ADULT", "CASH-YOUTH", "CASH-HALF",
  48. "MISC-BIKE", "MISC-WHEELCHAIR", "MISC-TRANSFER",
  49. "MISC-EVENT", "MISC-INTERLINE",
  50. "OVR-SCHOOLA", "OVR-SCHOOLB", "OVR-SCHOOLC",
  51. "OVR-ORGA", "OVR-ORGB", "OVR-ORGC" ];
  52. //--
  53. // This function can be used after the Popufare UI has been initialized to do
  54. // any work that couldn't be done otherwise.
  55. //
  56. function PopufareSiteInit(data) {
  57. var ele = {};
  58. var ele = document.getElementById("ui_bulk_schoola");
  59. if (ele) { ele.innerHTML = "School A"; }
  60. var ele = document.getElementById("ui_bulk_schoolb");
  61. if (ele) { ele.innerHTML = "School B"; }
  62. var ele = document.getElementById("ui_bulk_schoolc");
  63. if (ele) { ele.innerHTML = "School C"; }
  64. var ele = document.getElementById("ui_bulk_orga");
  65. if (ele) { ele.innerHTML = "Org A"; }
  66. var ele = document.getElementById("ui_bulk_orgb");
  67. if (ele) { ele.innerHTML = "Org B"; }
  68. var ele = document.getElementById("ui_bulk_orgc");
  69. if (ele) { ele.innerHTML = "Org C"; }
  70. //--
  71. var ele = document.getElementById("ui_fareoverride_schoola");
  72. if (ele) { ele.innerHTML = "School A"; }
  73. var ele = document.getElementById("ui_fareoverride_schoolb");
  74. if (ele) { ele.innerHTML = "School B"; }
  75. var ele = document.getElementById("ui_fareoverride_schoolc");
  76. if (ele) { ele.innerHTML = "School C"; }
  77. var ele = document.getElementById("ui_fareoverride_orga");
  78. if (ele) { ele.innerHTML = "Org A"; }
  79. var ele = document.getElementById("ui_fareoverride_orgb");
  80. if (ele) { ele.innerHTML = "Org B"; }
  81. var ele = document.getElementById("ui_fareoverride_orgc");
  82. if (ele) { ele.innerHTML = "Org C"; }
  83. }