// 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/>.
//

// This file contains 'site specific' information about pass types and
// how they're displayed in the driver facing UI.
//
// BULK_PASS and OVERRIDE_PASS are tied to the HTML elements being displayed.
// The `ui_bulk_...` and `ui_fareoverride_...` are the IDs of the HTML elements
// that can be altered depending on need.
//
// The BULK_RULE and OVERRIDE_RULE are what gets passed to the underlying
// Popufare system and should reflect the rules present both in the installation
// database and in the `rules.scm` file local to the DIU.
//

//--

// Populate these values with your site specific information
// for both bulk passes and 'override' pass types.
//
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"];

// Text to be diplayed in the 'bulk accept' screen
//
var BULK_PASS_NAME = ["Adult Cash", "Youth Cash", "Half Cash",
                      "Special Event", "Transfer", "Interline",
                      "School A", "School B", "School C",
                      "Org A", "Org B", "Org C"];

//--

var OVERRIDE_PASS =  [ "adult", "youth", "half",
                       "bike", "wheelchair", "transfer",
                       "event", "interline",
                       "schoola", "schoolb", "schoolc",
                       "orga", "orgb", "orgc" ];
var OVERRIDE_RULE = [ "CASH-ADULT", "CASH-YOUTH", "CASH-HALF",
                      "MISC-BIKE", "MISC-WHEELCHAIR", "MISC-TRANSFER",
                      "MISC-EVENT", "MISC-INTERLINE",
                      "OVR-SCHOOLA", "OVR-SCHOOLB", "OVR-SCHOOLC",
                      "OVR-ORGA", "OVR-ORGB", "OVR-ORGC" ];

//--

// 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 = "School A"; }

  var ele = document.getElementById("ui_bulk_schoolb");
  if (ele) { ele.innerHTML = "School B"; }

  var ele = document.getElementById("ui_bulk_schoolc");
  if (ele) { ele.innerHTML = "School C"; }

  var ele = document.getElementById("ui_bulk_orga");
  if (ele) { ele.innerHTML = "Org A"; }

  var ele = document.getElementById("ui_bulk_orgb");
  if (ele) { ele.innerHTML = "Org B"; }

  var ele = document.getElementById("ui_bulk_orgc");
  if (ele) { ele.innerHTML = "Org C"; }

  //--

  var ele = document.getElementById("ui_fareoverride_schoola");
  if (ele) { ele.innerHTML = "School A"; }

  var ele = document.getElementById("ui_fareoverride_schoolb");
  if (ele) { ele.innerHTML = "School B"; }

  var ele = document.getElementById("ui_fareoverride_schoolc");
  if (ele) { ele.innerHTML = "School C"; }

  var ele = document.getElementById("ui_fareoverride_orga");
  if (ele) { ele.innerHTML = "Org A"; }

  var ele = document.getElementById("ui_fareoverride_orgb");
  if (ele) { ele.innerHTML = "Org B"; }

  var ele = document.getElementById("ui_fareoverride_orgc");
  if (ele) { ele.innerHTML = "Org C"; }

}

