Created
May 17, 2021 10:48
-
-
Save AJFaraday/fb40109fcd91da0e579634c65ede70a8 to your computer and use it in GitHub Desktop.
Conversion template?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StripSearch { | |
static months = { | |
'01': 'January', | |
... | |
} | |
static setup_events() { | |
document.getElementById("query").addEventListener('keyup', StripSearch.run_search); | |
} | |
static run_search(e) { | |
e.preventDefault(); | |
search = new StripSearch(document.getElementById("query").value) | |
} | |
constructor(searchTerm) { | |
this.query = searchTerm; | |
this.results = this.run_search(searchTerm); | |
} | |
// formerly query() | |
run_search(searchTerm) { | |
... | |
r.onreadystatechange = () => start(r); // Inline function definition | |
} | |
// formerly start(r) | |
complete_search(request) { | |
.. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment