{"size": 2082, "ext": "js", "max_stars_repo_path": "html/delivery/output.js", "max_stars_repo_name": "autorouting/main", "max_stars_repo_stars_event_min_datetime": "2020-08-15T12:52:39.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-07T04:12:29.000Z", "max_issues_repo_path": "html/delivery/output.js", "max_issues_repo_name": "autorouting/main", "max_issues_repo_issues_event_min_datetime": "2021-06-06T00:30:36.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-20T21:38:16.000Z", "max_forks_repo_path": "html/delivery/output.js", "max_forks_repo_name": "autorouting/main", "max_forks_repo_forks_event_min_datetime": "2020-08-01T14:42:24.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-24T18:13:54.000Z"}
{"max_stars_count": 3, "max_issues_count": 21, "max_forks_count": 2, "avg_line_length": 40.0384615385, "max_line_length": 230, "alphanum_fraction": 0.558117195}
$(document).ready(function() {
    $.getJSON(location.origin + "/cgi-bin/webgui.py" + location.search, function(data) {
        switch (data.status) {
            case ("made_route"):
                document.querySelector("#loadingscreen").remove();
                document.querySelector("#finalscreen").style.display = "block";
                //console.log(data);
                var solution_display = document.getElementById("solution_display");
                for (var i = 0; i < data.route_solution.length; i++) {
                  solution_display.innerHTML += `<tr><td>${(data.number_sequence[i] == 0)?data.number_sequence.length:data.number_sequence[i]}</td><td>${data.route_solution_nonformatted[i]}</td><td>${data.route_solution[i]}</td>`;
                }
                var route_link = data.route_link;
                var a = document.getElementById("route_link");
                a.href = route_link;
                var qrcode = document.getElementById("qrcode");
                qrcode.src = "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=" + encodeURIComponent(route_link);
                console.log("Maps link for before optimization:\n\t" + data.dev_data.unordered_maps_link)
                break;
            case ("invalid_address"):
              console.log(data);
              document.querySelector("#containerbox").innerHTML = "";
              var solution_display = document.createElement("p");
              solution_display.innerHTML = data.errorMessage;
              document.querySelector("#containerbox").appendChild(solution_display);
              break;
        }
    });
});

var i = 0;
function startLoadingBar() {
  if (i == 0) {
    i = 1;
    var elem = document.getElementById("loadingBar");
    var width = 1;
    var id = setInterval(move, 8);
    function move() {
      if (width >= 100) {
        clearInterval(id);
        i = 0;
      } 
      
      else {
        width += (100 - width) ** 1.2 / 90 ** 1.2;
        elem.style.width = width + "px";
                
      }
    }
  }
}

startLoadingBar()