brainpm / bpm-webplayer

display interactive content bundled by brainpm (bpm) in a web browser
0 stars 0 forks source link

support deep links #2

Closed regular closed 9 years ago

regular commented 9 years ago

use url fragments to display deep links in the address bar Change the fragment when scrolling

jfr3000 commented 9 years ago

stuff from your comment is done (https://github.com/regular/bpm-webplayer/commit/031a8a12fc52c2250834791b4a6160ff616d1400), but actual deep links don't work yet if that episode hasn't been unlocked by the user yet. any pointers?

regular commented 9 years ago

on page load, extract fragment from url, make sure the episode is loaded and scroll to it.

regular commented 9 years ago

After your change, the scrolling was bumpy. Reason: when you change location.hash, the browser searches for an anchor tag (<a href="#something">) and scrolls there. At lease for 'remote-thought'control' such an anchor did exist. (github-flavored markdown generates anchor tags for each h1)

I changed this behaviour in bpm bundle, the anchors are now prefixed with the episode's name. This partially fixed the jumping behaviour. The remaining issues is a noticeable delay when the hash is changes, so the scrolling still isn't smooth (in latest Chrome)

We should try if this fixes the delay: http://stackoverflow.com/questions/3870057/how-can-i-update-window-location-hash-without-jumping-the-document

jfr3000 commented 9 years ago

won't fix