Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
162 lines (138 sloc) 5.99 KB
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- JS file -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-109186351-1"></script>
<script src="gtag.js"></script>
<script src="https://cdn.ravenjs.com/3.23.3/raven.min.js" crossorigin="anonymous"></script>
<!-- CSS file -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.min.css">
<!-- Additional CSS Themes file - not required-->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.themes.min.css">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<style>
.table td {
padding-top: 2rem;
padding-bottom: 2rem;
font-size: 30px;
border-top: none;
font-family: 'Lato', sans-serif;
}
</style>
<title>Live Bus Tracker</title>
<!-- Bootstrap -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Global site tag (gtag.js) - Google Analytics -->
</head>
<body>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!--<form class="navbar-form" role="search">
<div class="input-group add-on">
<input class="form-control" placeholder="Search" name="srch-term" id="srch-term" type="text">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
</div>
</div>
</form>-->
<!-- Image and text -->
<div class='container' style='margin-top:80px;'>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="#">UIUC Bus Tracker</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home<span class="sr-only">(current)</span></a>
</li>
</div>
</nav>
<center>
<h1> Trip Planner</h1>
</br>
<h4>Starting Point:</h4>
<form>
<input id='field-1'> <br/>
<h4>Destination:</h4>
<input id='field-2'>
</br>
</form>
</br>
<button type="button" class="btn btn-info" onclick="redirect();">Submit</button>
<br/></br>Data provided by Champaign-Urbana Mass Transit District.
</center>
</div>
</body>
<script>
//set cookies
//var myAry = [1, 2, 3];
//Cookies.set('name', JSON.stringify(myAry));
var origin_id;
var destination_id;
function redirect() {
window.location = `TripPlanner.html?origin=${origin_id}&destination=${destination_id}`
}
var options_primary = {
url: function (phrase) {
return "https://www.cumtd.com/autocomplete/stops/v1.0/json/search?query=" + phrase + "&format=json";
},
getValue: "n",
list: {
onChooseEvent: function () {
origin_id = $("#field-1").getSelectedItemData().i;
console.log(origin_id);
}
}
};
var options_secondary = {
url: function (phrase) {
return "https://www.cumtd.com/autocomplete/stops/v1.0/json/search?query=" + phrase + "&format=json";
},
getValue: "n",
list: {
onChooseEvent: function () {
destination_id = $("#field-2").getSelectedItemData().i;
console.log(destination_id);
//window.location = `BusTracking.html?id=${id}&name=${name}`
}
}
};
$("#field-1").easyAutocomplete(options_primary);
$("#field-2").easyAutocomplete(options_secondary);
</script>
<script type="text/javascript">
window._urq = window._urq || [];
_urq.push(['initSite', '96cc2c62-7395-4573-8001-5b852e8d380b']);
(function () {
var ur = document.createElement('script');
ur.type = 'text/javascript';
ur.async = true;
ur.src = ('https:' == document.location.protocol ? 'https://cdn.userreport.com/userreport.js' : 'http://cdn.userreport.com/userreport.js');
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ur, s);
})();
</script>
</body>
</html>