Enable search via URL hash, and update browser history when searching #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there!
As a long-term user of the Beolingus dictionary, I was sad to learn today that it has been taken offline.
However, I was happy to find that they recommended this simple, modern and speedy open source project as a replacement. Thank you!
I have always accessed Beolingus via a browser search shortcut (e.g.
https://dict.tu-chemnitz.de/dings.cgi?…&query=%s
). But with this web app, I noticed that it's not possible to pass in the search term via the URL, so I can't create a similar shortcut.Therefore I added the ability to specify a search term via URL hash (e.g.
https://example.com/#q=beispiel
) — specifically using a URL hash rather than a query parameter, so that the search term doesn't get sent to the server hosting this webapp.Furthermore, I update the URL hash when the input field changes, so you can follow your browser history of searched words. To make that history and navigation a bit nicer, the search term is also now appended to the page title.
Hopefully this seems useful, and you're open to PRs!
If so, I could also add a note about this functionality on the index page to help users. Though it should also become clear that the URL updates when users start entering search terms.
Screenshot:
