Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will jones #24

Merged
merged 6 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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