search word on double-click + persist page state via URL hash#17
search word on double-click + persist page state via URL hash#17glowinthedark wants to merge 6 commits intoitkach:masterfrom
Conversation
Store current dictionary and lookup word in the top page URL hash to allow persisting state on page refresh. Allows reopening a specific article with the lookup word via a top frame URL like - http://127.0.0.1:8013/#/slob/c52148ef-0ac7-47cf-bd0f-c503552ebdd7/awake?blob=155-10&q=awake
|
@itkach let me know if you think it's an issue and if you think the two points addressed by this PR must go separately regarding double-clicking on a word: Update: doubleclick action has been updated to emulate a link click in the current dictionary only — this imo is a more expected behaviour and also does not require setting directly the iframe content Update 2: this change is messing up the history and back/forward don't work as expected, given that with frames the page has two histories: top-level history and the frame's own history; updating the URL hash apparently triggers a history push state for the top frame and this messes up the back/forward behaviour, given that with an unchanged top-frame history the history buttons act on the nested frame history rather than top-frame not clear what would be the best approach to have the history working properly, apart from getting rid of frames entirely and use instead a DIV for rendering content. |
change doubleclick behaviour to search in the current dictionary only
- open 1st result after lookup when content empty - cleanup
Allows reopening a specific article with the lookup word via a top frame URL like
With this change clicking refresh in the browser will allow the page state to survive, and the original search and definition to be shown rather than a reset to original empty state. Moreover, this allows bookmarking definitions in a specific dictionary.
Double-clicking a word in the content frame initiates a lookup
and opening 1st result in the content frameand searching the double-clicked word in the current dictionary.After a lookup open first entry in content frame