reactive icon indicating copy to clipboard operation
reactive copied to clipboard

Browser history

Open nafg opened this issue 13 years ago • 5 comments

nafg avatar Jul 08 '11 17:07 nafg

This would be awesome! Do you have any plans on how to implement it? After I did my prototype for lift I found out there is also a HTML5 history api on most current browsers

fmpwizard avatar Aug 12 '11 01:08 fmpwizard

On Thu, Aug 11, 2011 at 9:14 PM, fmpwizard < [email protected]>wrote:

This would be awesome!

Who do you think gave me the idea? ;)

Do you have any plans on how to implement it?

Not too specific.

After I did my prototype for lift I found out there is also a HTML5 history api on most current browsers

Reply to this email directly or view it on GitHub: https://github.com/nafg/reactive/issues/17#issuecomment-1787454

nafg avatar Aug 12 '11 01:08 nafg

I hope to have some time in the coming weeks to look over at the demo I did using Lift and I'll try to reduce the manual JavaScript I wrote and see what comes out.

fmpwizard avatar Sep 02 '11 03:09 fmpwizard

I finally had a need to do some history integration. It's actually not too bad, especially with the (recently merged) JsInterpolator:

    for(state <- signal.change) {
      val newUrl = constructUrl(state)
      page.queue(js"""history.pushState($state, "", $newUrl)""")
    }
    def popState(state: State) = signal ()= state
    page.queue(js"""window.onpopstate = function(event) { ${popState _}(event.state)""")

@fmpwizard better late than never :)

I think this sort of obviates the need for a built-in feature, but I'm open to input.

nafg avatar Apr 24 '15 07:04 nafg

(I'm using reactive-routing for associating a "State" with a reversible route, as well)

nafg avatar Apr 24 '15 07:04 nafg