Skip to content

Commit

Permalink
the speaker view presentation URL can be overridden via (needed for r…
Browse files Browse the repository at this point in the history
…eveal.js docs)
  • Loading branch information
hakimel committed Feb 25, 2022
1 parent 5e12c6a commit e33c3c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin/notes/notes.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/notes/notes.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions plugin/notes/plugin.js
Expand Up @@ -67,13 +67,18 @@ const Plugin = () => {
*/
function connect() {

const presentationURL = deck.getConfig().url;

const url = typeof presentationURL === 'string' ? presentationURL :
window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;

// Keep trying to connect until we get a 'connected' message back
connectInterval = setInterval( function() {
speakerWindow.postMessage( JSON.stringify( {
namespace: 'reveal-notes',
type: 'connect',
url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search,
state: deck.getState()
state: deck.getState(),
url
} ), '*' );
}, 500 );

Expand Down

0 comments on commit e33c3c7

Please sign in to comment.