aboutsummaryrefslogtreecommitdiff
path: root/plugin/notes
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/notes')
-rw-r--r--plugin/notes/notes.html30
-rw-r--r--plugin/notes/notes.js17
2 files changed, 31 insertions, 16 deletions
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html
index 75f1b9b..53d50c3 100644
--- a/plugin/notes/notes.html
+++ b/plugin/notes/notes.html
@@ -38,8 +38,8 @@
#current-slide {
position: absolute;
- width: 65%;
- height: 100%;
+ width: 50%;
+ height: 50%;
top: 0;
left: 0;
padding-right: 0;
@@ -47,20 +47,19 @@
#upcoming-slide {
position: absolute;
- width: 35%;
- height: 40%;
+ width: 50%;
+ height: 50%;
right: 0;
top: 0;
}
#speaker-controls {
position: absolute;
- top: 40%;
- right: 0;
- width: 35%;
- height: 60%;
+ top: 50%;
+ left: 0;
+ width: 100%;
+ height: 50%;
overflow: auto;
-
font-size: 18px;
}
@@ -188,6 +187,10 @@
var data = JSON.parse( event.data );
+ // The overview mode is only useful to the reveal.js instance
+ // where navigation occurs so we don't sync it
+ if( data.state ) delete data.state.overview;
+
// Messages sent by the notes plugin inside of the main window
if( data && data.namespace === 'reveal-notes' ) {
if( data.type === 'connect' ) {
@@ -203,8 +206,10 @@
// Send a message back to notify that the handshake is complete
window.opener.postMessage( JSON.stringify({ namespace: 'reveal-notes', type: 'connected'} ), '*' );
}
- else if( /slidechanged|fragmentshown|fragmenthidden|overviewshown|overviewhidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
+ else if( /slidechanged|fragmentshown|fragmenthidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
+
window.opener.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ]} ), '*' );
+
}
}
@@ -288,9 +293,10 @@
'backgroundTransition=none'
].join( '&' );
+ var urlSeparator = /\?/.test(data.url) ? '&' : '?';
var hash = '#/' + data.state.indexh + '/' + data.state.indexv;
- var currentURL = data.url + '?' + params + '&postMessageEvents=true' + hash;
- var upcomingURL = data.url + '?' + params + '&controls=false' + hash;
+ var currentURL = data.url + urlSeparator + params + '&postMessageEvents=true' + hash;
+ var upcomingURL = data.url + urlSeparator + params + '&controls=false' + hash;
currentSlide = document.createElement( 'iframe' );
currentSlide.setAttribute( 'width', 1280 );
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 };