{"size": 1019, "ext": "js", "max_stars_repo_path": "diwali-special/control.js", "max_stars_repo_name": "PremjitAdhikary/Mesmerize", "max_stars_repo_stars_event_min_datetime": "2020-11-20T16:12:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-26T15:03:45.000Z", "max_issues_repo_path": "diwali-special/control.js", "max_issues_repo_name": "PremjitAdhikary/Mesmerize", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "diwali-special/control.js", "max_forks_repo_name": "PremjitAdhikary/Mesmerize", "max_forks_repo_forks_event_min_datetime": "2020-02-19T10:38:02.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-19T10:38:02.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.475, "max_line_length": 97, "alphanum_fraction": 0.6584887144}
import { bus } from '../components/event-bus.js';

setBus(bus);
let initData = {
  choice_hostel: 2,
  choice_four_fw: 1,
  choice_five_fw: 1
};
setData(initData);

document.getElementById('choice_hostel').onclick = e => {
  let val = Number(e.target.value);
  if (val) {
    bus.dispatch("ControlDSch", { choice_hostel: val });
    showChoices();
  }
};

function showChoices() {
  document.getElementById('four_choice').style.display = (choice_hostel == 1 ? 'block' : 'none');
  document.getElementById('five_choice').style.display = (choice_hostel == 2 ? 'block' : 'none');
}

document.getElementById('four_fw').onclick = e => {
  let val = Number(e.target.value);
  if (val) {
    bus.dispatch("ControlDSc4fw", { choice_four_fw: val });
  }
};

document.getElementById('five_fw').onclick = e => {
  let val = Number(e.target.value);
  if (val) {
    bus.dispatch("ControlDSc5fw", { choice_five_fw: val });
  }
};

document.getElementById('fireBtn').onclick = () => bus.dispatch("ControlDSfb", {  });

showChoices();