readium / readium-js-viewer

👁 ReadiumJS viewer: default web app for Readium.js library
BSD 3-Clause "New" or "Revised" License
550 stars 186 forks source link

Change the 'goto' link param format to a full CFI expression #671

Closed jccr closed 6 years ago

jccr commented 6 years ago

This makes a sharable bookmark link URL go from this: reader.html?epub=...&goto=%7B"idref"%3A"id-id2611884"%2C"elementCfi"%3A"%2F4%2F2%5Bintroduction%5D%2F18%2F12%2F1%3A329"%7D&

To this: reader.html?epub=...&goto=epubcfi(/6/16!/4/2%5Bintroduction%5D/18/12/1:329)

Yet still staying compatible with the previous format.

Before testing or merging this have your branches set to the feature/full-cfi-bookmarking in all submodules.

danielweck commented 6 years ago

Thank you for caring about backwards-compatibility :) The JSON "payload" for the goto querystring parameter offers some degree of extensibility (currently supports two properties: spine item href + in-document CFI), and we would not want to break existing / saved URL bookmarks. I need to review the changes carefully, just to provide a second opinion.

jccr commented 6 years ago

This and related PRs need to have this merged too. https://github.com/readium/readium-shared-js/pull/427 To make this work as intended.