I am using reveal.js for a slide presentation. Reveal.js provides a "Speaker View" window. In Reveal.js's "Tall" layout, it shows an "Upcoming" slide in an overlay box called "Upcoming".
To help me keep track of where I am, I would like to change that text to include the hash portion of the URL, like "#1" or #/1/0/1". (The hash portion of a Reveal.js URL is its slide-deck position.)
How can I do this?
Here is a screenshot of the "Speaker View" window:

I believe there is a way better solution than this, but if you need a quick, easy and safe solution, I think you can use this. Seeing the documentation, I don't think there's any API for this, so I had to come up with own solution. The way I see it, the speaker view is using
iframeto show the upcoming slide and unfortunately it doesn't send any callback when the upcoming slide has changed (so the speaker view doesn't know the state of the upcoming slide). Normally, you would want to usepostMessageto send back the state after the upcoming iframe succeed changing the slide, but this approach might break something if you're not careful. So my proposed approach is to basically synchronize theUpcominglabel with thehashurl of the iframe. The easiest way to do this is by usingsetIntervalto do a polling and get the hash value and append it to theUpcominglabel.First thing you must do is to open this file
plugin/notes/speaker-view.html(I assume you have this file in your project directory since it should be added when you clone the original repository), then look for this functionsetupIframes( data ), then add these codes at the end of the function, like so:After that, you need to rebuild the project, run this command:
After the build is done, you can start run the project again. You can also change the
300(300ms) to maybe1000(1s) if you want, the smaller the values, the more synchronized it will be.If you're wondering why I don't propose using
hashchangeevent on the iframe, it's because it doesn't work on this case, I tested it.