<commit_before>whenWeAreReady(user,function() {

  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (xhttp.readyState == 4 && xhttp.status == 200) {
      results = JSON.parse(xhttp.responseText);

      user.hq = results;

      //menu bar code
      var ul = document.getElementsByClassName("nav navbar-nav");

      var li = document.createElement("li");
      li.classList.add("dropdown");

      var tonight = new Date();

      tonight.setHours(23, 59, 59, 0);

      tonight = new Date(tonight.getTime());


      var thismorning = new Date();

      thismorning.setHours(0, 0, 0, 0);

      thismorning = new Date(thismorning.getTime());


      var vars = "?host=" + location.hostname + "&hq=" + user.currentHqId + "&start=" + encodeURIComponent(thismorning.toISOString()) + "&end=" + encodeURIComponent(tonight.toISOString());

      var jobsummaryUrl = lighthouseUrl + "pages/summary.html" + vars;
      var jobstatsUrl = lighthouseUrl + "pages/stats.html" + vars;
      var jobexportUrl = lighthouseUrl + "pages/advexport.html" + vars;

      var teamsummaryUrl = lighthouseUrl + "pages/teamsummary.html" + vars;

      var aboutURL = "https://github.com/OSPFNeighbour/Lighthouse/blob/master/README.md" //chrome.extension.getURL("lighthouse/about.html");


      li.innerHTML = "<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><span class=\"nav-text\"><img width=\"16px\" style=\"vertical-align: text-bottom;margin-right:5px\" src=\"" + lighthouseUrl + "icons/lh.png" + "\">Lighthouse</span></a><ul class=\"dropdown-menu\"><li role=\"presentation\" class=\"dropdown-header\">Jobs</li><li><a href=\"" + jobsummaryUrl + "\">Job Summary (" + results.Code + " Today)</a></li><li><a href=\"" + jobstatsUrl + "\">Job Statistics (" + results.Code + " Today)</a></li><li><a href=\"" + jobexportUrl + "\">Job Export (" + results.Code + " Today)</a></li><li role=\"presentation\" class=\"divider\"></li><li role=\"presentation\" class=\"dropdown-header\">Teams</li><li><a href=\"" + teamsummaryUrl + "\">Team Summary (" + results.Code + " Today)</a></li><li role=\"presentation\" class=\"divider\"></li><li role=\"presentation\" class=\"dropdown-header\">About</li><li><a href=\"" + aboutURL + "\">About Lighthouse</a></li>";

      $('.nav .navbar-nav:not(".navbar-right")').append(li);


        //lighthouse menu for teams
        if (location.pathname == "/Teams") {

          var filtermenu = '<li class=""> <a href="#" class="js-sub-menu-toggle"> <i class="fa fa-fw"></i><img width="14px" style="vertical-align:top;margin-right:10px;float:left" src="$LHURLicons/lh-black.png"><span class="text" style="margin-left: -20px;">Lighthouse Quick Filters</span> <i class="toggle-icon fa fa-angle-left"></i> </a> <ul class="sub-menu " style="display: none;"> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Locations</a> <span class="label tag tag-property tag-disabled" id="filtermyhq"><span class="tag-text">$UNIT</span></span> <span class="label tag tag-property tag-disabled" id="filterallmyregion"><span class="tag-text">$REGION</span></span> <span class="label tag tag-property tag-disabled" id="clearlocator"><span class="tag-text">NSW</span></span> <br> </span> </ul> </li>';

          filtermenu = filtermenu.replace(/\$LHURL/g, lighthouseUrl);
          filtermenu = filtermenu.replace(/\$UNIT/g, user.hq.Code);
          filtermenu = filtermenu.replace(/\$REGION/g, user.hq.ParentEntity.Code);

          $('.main-menu > li:nth-child(1)').after(filtermenu);

          $("#filterallmyregion").click(function() {
            filterViewModel.selectedEntities.removeAll();
            filtershowallmyregion();
          });

          $("#filtermyhq").click(function() {
            filterViewModel.selectedEntities.removeAll();
            filterViewModel.selectedEntities.push(user.hq);
            filterViewModel.updateFilters();
          });

          $("#clearlocator").click(function() {
            filterViewModel.selectedEntities.removeAll();
            filterViewModel.updateFilters();
          });



        }

      //lighthouse menu for jobs

      if (location.pathname == "/Jobs") {

       //with dates var filtermenu = '<li class=""> <a href="#" class="js-sub-menu-toggle"> <i class="fa fa-fw"></i><img width="14px" style="vertical-align:top;margin-right:10px;float:left" src="$LHURLicons/lh-black.png"><span class="text" style="margin-left: -20px;">Lighthouse Quick Filters</span> <i class="toggle-icon fa fa-angle-left"></i> </a> <ul class="sub-menu " style="display: none;"> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Time Range</a> <span class="label tag tag-task tag-disabled" id="filtertoday"><span class="tag-text">Today</span></span> <span class="label tag tag-task tag-disabled" id="filter3day"><span class="tag-text">3 Days</span></span> <span class="label tag tag-task tag-disabled" id="filter7day"><span class="tag-text">7 Days</span></span><span class="label tag tag-task tag-disabled" id="filter30day"><span class="tag-text">30 Days</span></span> </span><span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Status</a> <span class="label tag tag-job-status tag-disabled" id="filteropen"><span class="tag-text">Open</span></span> <span class="label tag tag-job-status tag-disabled" id="filterclosed"><span class="tag-text">Closed</span></span> <span class="label tag tag-lighthouse" id="filterallstatus"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Type</a> <span class="label tag tag-rescue tag-disabled" id="filterrescue"><span class="tag-text">Rescue</span></span> <span class="label tag tag-job-type tag-disabled" id="filterstorm"><span class="tag-text">Storm</span></span> <span class="label tag tag-flood-misc tag-disabled" id="filterflood"><span class="tag-text">Flood</span></span> <span class="label tag tag-lighthouse" id="filteralltype"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Locations</a> <span class="label tag tag-property tag-disabled" id="filtermyhq"><span class="tag-text">$UNIT</span></span> <span class="label tag tag-property tag-disabled" id="filterallmyregion"><span class="tag-text">$REGION</span></span> <span class="label tag tag-property tag-disabled" id="clearlocator"><span class="tag-text">NSW</span></span> <br> </span> </ul> </li>';


        var filtermenu = '<li class=""> <a href="#" class="js-sub-menu-toggle"> <i class="fa fa-fw"></i><img width="14px" style="vertical-align:top;margin-right:10px;float:left" src="$LHURLicons/lh-black.png"><span class="text" style="margin-left: -20px;">Lighthouse Quick Filters</span> <i class="toggle-icon fa fa-angle-left"></i> </a> <ul class="sub-menu " style="display: none;"><span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Status</a> <span class="label tag tag-job-status tag-disabled" id="filteropen"><span class="tag-text">Open</span></span> <span class="label tag tag-job-status tag-disabled" id="filterclosed"><span class="tag-text">Closed</span></span> <span class="label tag tag-lighthouse" id="filterallstatus"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Type</a> <span class="label tag tag-rescue tag-disabled" id="filterrescue"><span class="tag-text">Rescue</span></span> <span class="label tag tag-job-type tag-disabled" id="filterstorm"><span class="tag-text">Storm</span></span> <span class="label tag tag-flood-misc tag-disabled" id="filterflood"><span class="tag-text">Flood</span></span> <span class="label tag tag-lighthouse" id="filteralltype"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Locations</a> <span class="label tag tag-property tag-disabled" id="filtermyhq"><span class="tag-text">$UNIT</span></span> <span class="label tag tag-property tag-disabled" id="filterallmyregion"><span class="tag-text">$REGION</span></span> <span class="label tag tag-property tag-disabled" id="clearlocator"><span class="tag-text">NSW</span></span> <br> </span> </ul> </li>';

        filtermenu = filtermenu.replace(/\$LHURL/g, lighthouseUrl);
        filtermenu = filtermenu.replace(/\$UNIT/g, user.hq.Code);
        filtermenu = filtermenu.replace(/\$REGION/g, user.hq.ParentEntity.Code);

        $('.main-menu > li:nth-child(1)').after(filtermenu);

        $("#filterrescue").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.parentJobTypeClicked({
            Id: 5,
            Name: "Rescue",
            Description: "Rescue",
            ParentId: null
          });
          filterViewModel.updateFilters();
        });

        $("#filterstorm").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedRescueTypes.removeAll();
          filterViewModel.parentJobTypeClicked({
            Id: 1,
            Name: "Storm",
            Description: "Storm",
            ParentId: null
          });
          filterViewModel.updateFilters();
        });
        $("#filterflood").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedRescueTypes.removeAll();
          filterViewModel.parentJobTypeClicked({
            Id: 4,
            Name: "Flood Assistance",
            Description: "FloodAssistance",
            ParentId: null
          });
          filterViewModel.rescueTypeClicked({
            Id: 4,
            Name: "FR",
            Description: "Flood Rescue",
            ParentId: 5
          });
          filterViewModel.updateFilters();
        });
        $("#filteralltype").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedRescueTypes.removeAll();
          filterViewModel.updateFilters();
        });

        $("#filteropen").click(function() {
          filterViewModel.selectedStatusTypes.removeAll();
          filterViewModel.selectedStatusTypes.push({
            Id: 2,
            Name: "Acknowledged",
            Description: "Acknowledged",
            ParentId: null
          });
          filterViewModel.selectedStatusTypes.push({
            Id: 1,<commit_msg>fixes #47<commit_after>whenWeAreReady(user,function() {

  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (xhttp.readyState == 4 && xhttp.status == 200) {
      results = JSON.parse(xhttp.responseText);

      user.hq = results;

      //menu bar code
      var ul = document.getElementsByClassName("nav navbar-nav");

      var li = document.createElement("li");
      li.classList.add("dropdown");

      var tonight = new Date();

      tonight.setHours(23, 59, 59, 0);

      tonight = new Date(tonight.getTime());


      var thismorning = new Date();

      thismorning.setHours(0, 0, 0, 0);

      thismorning = new Date(thismorning.getTime());


      var vars = "?host=" + location.hostname + "&hq=" + user.currentHqId + "&start=" + encodeURIComponent(thismorning.toISOString()) + "&end=" + encodeURIComponent(tonight.toISOString());

      var jobsummaryUrl = lighthouseUrl + "pages/summary.html" + vars;
      var jobstatsUrl = lighthouseUrl + "pages/stats.html" + vars;
      var jobexportUrl = lighthouseUrl + "pages/advexport.html" + vars;

      var teamsummaryUrl = lighthouseUrl + "pages/teamsummary.html" + vars;

      var aboutURL = "https://github.com/OSPFNeighbour/Lighthouse/blob/master/README.md" //chrome.extension.getURL("lighthouse/about.html");


      li.innerHTML = "<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><span class=\"nav-text\"><img width=\"16px\" style=\"vertical-align: text-bottom;margin-right:5px\" src=\"" + lighthouseUrl + "icons/lh.png" + "\">Lighthouse</span></a><ul class=\"dropdown-menu\"><li role=\"presentation\" class=\"dropdown-header\">Jobs</li><li><a href=\"" + jobsummaryUrl + "\">Job Summary (" + results.Code + " Today)</a></li><li><a href=\"" + jobstatsUrl + "\">Job Statistics (" + results.Code + " Today)</a></li><li><a href=\"" + jobexportUrl + "\">Job Export (" + results.Code + " Today)</a></li><li role=\"presentation\" class=\"divider\"></li><li role=\"presentation\" class=\"dropdown-header\">Teams</li><li><a href=\"" + teamsummaryUrl + "\">Team Summary (" + results.Code + " Today)</a></li><li role=\"presentation\" class=\"divider\"></li><li role=\"presentation\" class=\"dropdown-header\">About</li><li><a href=\"" + aboutURL + "\">About Lighthouse</a></li>";

      $('.nav .navbar-nav:not(".navbar-right")').append(li);


        //lighthouse menu for teams
        if (location.pathname == "/Teams") {

          var filtermenu = '<li class=""> <a href="#" class="js-sub-menu-toggle"> <i class="fa fa-fw"></i><img width="14px" style="vertical-align:top;margin-right:10px;float:left" src="$LHURLicons/lh-black.png"><span class="text" style="margin-left: -20px;">Lighthouse Quick Filters</span> <i class="toggle-icon fa fa-angle-left"></i> </a> <ul class="sub-menu " style="display: none;"> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Locations</a> <span class="label tag tag-property tag-disabled" id="filtermyhq"><span class="tag-text">$UNIT</span></span> <span class="label tag tag-property tag-disabled" id="filterallmyregion"><span class="tag-text">$REGION</span></span> <span class="label tag tag-property tag-disabled" id="clearlocator"><span class="tag-text">NSW</span></span> <br> </span> </ul> </li>';

          filtermenu = filtermenu.replace(/\$LHURL/g, lighthouseUrl);
          filtermenu = filtermenu.replace(/\$UNIT/g, user.hq.Code);
          filtermenu = filtermenu.replace(/\$REGION/g, user.hq.ParentEntity.Code);

          $('.main-menu > li:nth-child(1)').after(filtermenu);

          $("#filterallmyregion").click(function() {
            filterViewModel.selectedEntities.removeAll();
            filtershowallmyregion();
          });

          $("#filtermyhq").click(function() {
            filterViewModel.selectedEntities.removeAll();
            filterViewModel.selectedEntities.push(user.hq);
            filterViewModel.updateFilters();
          });

          $("#clearlocator").click(function() {
            filterViewModel.selectedEntities.removeAll();
            filterViewModel.updateFilters();
          });



        }

      //lighthouse menu for jobs

      if (location.pathname == "/Jobs") {

       //with dates var filtermenu = '<li class=""> <a href="#" class="js-sub-menu-toggle"> <i class="fa fa-fw"></i><img width="14px" style="vertical-align:top;margin-right:10px;float:left" src="$LHURLicons/lh-black.png"><span class="text" style="margin-left: -20px;">Lighthouse Quick Filters</span> <i class="toggle-icon fa fa-angle-left"></i> </a> <ul class="sub-menu " style="display: none;"> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Time Range</a> <span class="label tag tag-task tag-disabled" id="filtertoday"><span class="tag-text">Today</span></span> <span class="label tag tag-task tag-disabled" id="filter3day"><span class="tag-text">3 Days</span></span> <span class="label tag tag-task tag-disabled" id="filter7day"><span class="tag-text">7 Days</span></span><span class="label tag tag-task tag-disabled" id="filter30day"><span class="tag-text">30 Days</span></span> </span><span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Status</a> <span class="label tag tag-job-status tag-disabled" id="filteropen"><span class="tag-text">Open</span></span> <span class="label tag tag-job-status tag-disabled" id="filterclosed"><span class="tag-text">Closed</span></span> <span class="label tag tag-lighthouse" id="filterallstatus"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Type</a> <span class="label tag tag-rescue tag-disabled" id="filterrescue"><span class="tag-text">Rescue</span></span> <span class="label tag tag-job-type tag-disabled" id="filterstorm"><span class="tag-text">Storm</span></span> <span class="label tag tag-flood-misc tag-disabled" id="filterflood"><span class="tag-text">Flood</span></span> <span class="label tag tag-lighthouse" id="filteralltype"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Locations</a> <span class="label tag tag-property tag-disabled" id="filtermyhq"><span class="tag-text">$UNIT</span></span> <span class="label tag tag-property tag-disabled" id="filterallmyregion"><span class="tag-text">$REGION</span></span> <span class="label tag tag-property tag-disabled" id="clearlocator"><span class="tag-text">NSW</span></span> <br> </span> </ul> </li>';


        var filtermenu = '<li class=""> <a href="#" class="js-sub-menu-toggle"> <i class="fa fa-fw"></i><img width="14px" style="vertical-align:top;margin-right:10px;float:left" src="$LHURLicons/lh-black.png"><span class="text" style="margin-left: -20px;">Lighthouse Quick Filters</span> <i class="toggle-icon fa fa-angle-left"></i> </a> <ul class="sub-menu " style="display: none;"><span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Status</a> <span class="label tag tag-job-status tag-disabled" id="filteropen"><span class="tag-text">Open</span></span> <span class="label tag tag-job-status tag-disabled" id="filterclosed"><span class="tag-text">Closed</span></span> <span class="label tag tag-lighthouse" id="filterallstatus"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Job Type</a> <span class="label tag tag-rescue tag-disabled" id="filterrescue"><span class="tag-text">Rescue</span></span> <span class="label tag tag-job-type tag-disabled" id="filterstorm"><span class="tag-text">Storm</span></span> <span class="label tag tag-flood-misc tag-disabled" id="filterflood"><span class="tag-text">Flood</span></span> <span class="label tag tag-lighthouse" id="filteralltype"><span class="tag-text"><img width="14px" style="width:14px;vertical-align:top;margin-right:5px" src="$LHURLicons/lh-black.png">All</span></span> </span> <span class="twitter-typeahead" style="margin-left:5px;margin-bottom:10px;position:relative;display:inline-block;direction:ltr"> <a>Locations</a> <span class="label tag tag-property tag-disabled" id="filtermyhq"><span class="tag-text">$UNIT</span></span> <span class="label tag tag-property tag-disabled" id="filterallmyregion"><span class="tag-text">$REGION</span></span> <span class="label tag tag-property tag-disabled" id="clearlocator"><span class="tag-text">NSW</span></span> <br> </span> </ul> </li>';

        filtermenu = filtermenu.replace(/\$LHURL/g, lighthouseUrl);
        filtermenu = filtermenu.replace(/\$UNIT/g, user.hq.Code);
        filtermenu = filtermenu.replace(/\$REGION/g, user.hq.ParentEntity.Code);

        $('.main-menu > li:nth-child(1)').after(filtermenu);

        $("#filterrescue").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedFloodAssTypes.removeAll();
          filterViewModel.parentJobTypeClicked({
            Id: 5,
            Name: "Rescue",
            Description: "Rescue",
            ParentId: null
          });
          filterViewModel.updateFilters();
        });

        $("#filterstorm").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedRescueTypes.removeAll();
          filterViewModel.selectedFloodAssTypes.removeAll();
          filterViewModel.parentJobTypeClicked({
            Id: 1,
            Name: "Storm",
            Description: "Storm",
            ParentId: null
          });
          filterViewModel.updateFilters();
        });
        $("#filterflood").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedRescueTypes.removeAll();
          filterViewModel.parentJobTypeClicked({
            Id: 4,
            Name: "Flood Assistance",
            Description: "FloodAssistance",
            ParentId: null
          });
          filterViewModel.rescueTypeClicked({
            Id: 4,
            Name: "FR",
            Description: "Flood Rescue",
            ParentId: 5
          });
          filterViewModel.updateFilters();
        });
        $("#filteralltype").click(function() {
          filterViewModel.selectedParentJobTypes.removeAll();
          filterViewModel.selectedRescueTypes.removeAll();
          filterViewModel.selectedFloodAssTypes.removeAll();
          filterViewModel.updateFilters();
        });

        $("#filteropen").click(function() {
          filterViewModel.selectedStatusTypes.removeAll();
          filterViewModel.selectedStatusTypes.push({
            Id: 2,
            Name: "Acknowledged",
            Description: "Acknowledged",
            ParentId: null
          });
          filterViewModel.selectedStatusTypes.push({
            Id: 1,
{'fraction_non_alphanumeric': 0.18671093442837797, 'fraction_numerical': 0.008562317067843257, 'mean_word_length': 4.185050962627407, 'pattern_counts': {'":': 0, '<': 447, '<?xml version=': 0, '>': 451, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1041004', 'n_tokens_mistral': 7215, 'n_tokens_neox': 6899, 'n_words': 1171}