-
Notifications
You must be signed in to change notification settings - Fork 6
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
Site search (searchbar) #238
base: main
Are you sure you want to change the base?
Conversation
f2c6c54
to
9117f65
Compare
9117f65
to
b289d21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few things to look at here.
js/modules/es4/search.js
Outdated
|
||
//import data from "./search.json"; | ||
const search = new (function() { | ||
//const FlexSearch = require('flexsearch'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an es6 version of this file?
} | ||
|
||
this.init = () => { | ||
body.addEventListener('click', this.handleClick); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you made sure this works with a keyboard (I am not sure this works in that case, so I thought I'd ask).
When I used this with a keyboard a few weeks ago, there was a problem. Can you double check?
} | ||
} | ||
|
||
export default search; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something to correct, but a comment: your code is very easy to understand. I may put you on PRs of other people's work to help with code quality.
@@ -1,3 +1,5 @@ | |||
<link rel="stylesheet" type="text/css" href="css/form.css" > | |||
<link rel="stylesheet" type="text/css" href="css/site-search.css" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- These should be in the file
common-head-tags.php
, since they should be inside the<head>
tag. - Since you are probably not going to be the only one to make this mistake, we should add documentation in the README.md about adding global JS and CSS for all pages. (The global JS isssue is covered in another comment of this code review). Can you please add that as part of this PR?
import search from '../../js/modules/site-search.js'; | ||
search.init(); | ||
</script> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I would like to ensure any external scripts involved are not included via CDN (If there is another case of this outside of your PR, we should remove that). Let's include this in our package.json. Please follow the instructions in the documention when adding a front-end NPM package to our project. (I have noticed the formatting of the bolded text in the glider example in the docs is wanting -- let's discuss in the next standup how to fix that as part of your PR).
- The
<script>
tags should be in end offooter.php
Description
Pictures/Videos