relevance / org-html-slideshow

JavaScript presentation slides generated from Emacs org-mode
160 stars 42 forks source link

Added History-api support. #2

Closed neotyk closed 12 years ago

neotyk commented 12 years ago

This allows navigating via Back and Forward browsers buttons.

Please review it. Following issues are still present:

stuartsierra commented 12 years ago

It works and is an addition I would like to have. Thanks!

Comments:

I don't know how to fix the problem of duplicate events from browser navigation buttons, but I think this needs to be fixed before I can use the patch. It will become important if/when slide transitions get added.

neotyk commented 12 years ago

Two events are fired in browser after navigation:

Both events get flatten to goog.history.Event at http://closure-library.googlecode.com/svn/docs/closure_goog_history_html5history.js.source.html#line253 From that moment on there is no way to distinguish what event was fired.

As a workaround I will check in history-handler if slide change is needed, otherwise noop.

neotyk commented 12 years ago

HTML5 History API integration is ready. Even than Google Closure Library flattens popstate and hashchange events, slide will be changed only once.

jblomo commented 12 years ago

This is working well for me with one exception: when I click on a section in 'normal' mode, it jumps into 'projection' mode. I'd prefer the modes be separate History events.

stuartsierra commented 12 years ago

Patch no longer applies.