1
0
Fork 0

the speaker view presentation URL can be overridden via (needed for reveal.js docs)

This commit is contained in:
hakimel 2022-02-25 09:42:44 +01:00
parent 5e12c6aeb7
commit e33c3c72f9
3 changed files with 9 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -67,13 +67,18 @@ const Plugin = () => {
*/ */
function connect() { 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 // Keep trying to connect until we get a 'connected' message back
connectInterval = setInterval( function() { connectInterval = setInterval( function() {
speakerWindow.postMessage( JSON.stringify( { speakerWindow.postMessage( JSON.stringify( {
namespace: 'reveal-notes', namespace: 'reveal-notes',
type: 'connect', type: 'connect',
url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search, state: deck.getState(),
state: deck.getState() url
} ), '*' ); } ), '*' );
}, 500 ); }, 500 );