Skip to content

Commit

Permalink
Merge pull request #24 from will16363/Will_Jones
Browse files Browse the repository at this point in the history
Will jones
  • Loading branch information
will16363 authored Dec 5, 2022
2 parents e101801 + 62301b7 commit 7442cd4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.2/dist/leaflet.css"
integrity="sha256-sA+zWATbFveLLNqWO2gtiw3HL/lh1giY/Inf1BJ0z14="
crossorigin=""/>
<link rel="stylesheet" href="css/styles.css" />
<link rel="stylesheet" href="/css/styles.css" />
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.9.2/dist/leaflet.js"
integrity="sha256-o9N1jGDZrf5tS+Ft4gbIK7mYMipq9lqpVJ91xHSyKhg="
Expand Down Expand Up @@ -38,7 +38,7 @@ <h3>Searchable Crime Types:</h3>
</div>
</div>
</div>
<script src="js/script.js"></script>
<script src="/js/script.js"></script>
</body>

</html>
9 changes: 9 additions & 0 deletions js/accident_w_impound.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ async function getData() {
return reply;
}

function filterList(list, filterInputValue) {
return list.filter((item) => {
if (!item.street_address) { return; }
const lowerCaseName = item.street_address.toLowerCase();
const lowerCaseQuery = filterInputValue.toLowerCase();
return lowerCaseName.includes(lowerCaseQuery);
});
}

async function mainEvent() {
// the async keyword means we can make API requests
const form = document.querySelector('.main_form'); // get your main form so you can do JS with it
Expand Down
7 changes: 7 additions & 0 deletions other_pages/accident_with_impound.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ <h3>Accidents with Impound Occurrences</h3>
<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>
<button type="submit" id="get-resto">Show accidents with impounds...</button>
</form>
<form action="/api" class="box main_form">
<div>
<label for="resto">Filter by address</label>
<input type="text" name="resto" id="resto" />
</div>
<button type="submit" id="get-resto">Filter</button>
</form>
<div class="box" id="crime_list">A list of accidents with impounds</div>
</div>
</div>
Expand Down

0 comments on commit 7442cd4

Please sign in to comment.