diff options
Diffstat (limited to 'plugin/notes')
-rw-r--r-- | plugin/notes/notes.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 202e73b..88f98d6 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -11,10 +11,15 @@ */ var RevealNotes = (function() { - function openNotes() { - var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path - jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path - var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1100,height=700' ); + function openNotes( notesFilePath ) { + + if( !notesFilePath ) { + var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path + jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path + notesFilePath = jsFileLocation + 'notes.html'; + } + + var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' ); /** * Connect to the notes window through a postmessage handshake. @@ -96,6 +101,7 @@ var RevealNotes = (function() { } connect(); + } if( !/receiver/i.test( window.location.search ) ) { @@ -120,6 +126,9 @@ var RevealNotes = (function() { } }, false ); + // Show our keyboard shortcut in the reveal.js help overlay + if( window.Reveal ) Reveal.registerKeyboardShortcut( 'S', 'Speaker notes view' ); + } return { open: openNotes }; |