From ad86772f206d7abd119a8ca7b89a31e237e93584 Mon Sep 17 00:00:00 2001 From: Timothep Date: Wed, 9 Mar 2016 11:47:23 +0100 Subject: Horizontal 2-1 View for the speaker notes instead of a vertical 1-2 --- plugin/notes/notes.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index c80e77f..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; } -- cgit v1.2.3 From da5709919b78d1d75a712c6ba6f4520bee3a0be6 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 21 Sep 2016 13:54:42 +0200 Subject: layout selector for speaker view; includes four options --- plugin/notes/notes.html | 222 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 207 insertions(+), 15 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 53d50c3..145490a 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -8,6 +8,7 @@ @@ -152,7 +247,7 @@
-
UPCOMING:
+
Upcoming

Time Click to Reset

@@ -170,6 +265,10 @@
+
+ + +
@@ -182,11 +281,20 @@ currentState, currentSlide, upcomingSlide, + layoutLabel, + layoutDropdown, connected = false; var socket = io.connect( window.location.origin ), socketId = '{{socketId}}'; + var SPEAKER_LAYOUTS = { + 'default': 'Default', + 'wide': 'Wide', + 'tall': 'Tall', + 'notes-only': 'Notes only' + }; + socket.on( 'statechanged', function( data ) { // ignore data from sockets that aren't ours @@ -205,6 +313,8 @@ } ); + setupLayout(); + // Load our presentation iframes setupIframes(); @@ -362,6 +472,74 @@ } + /** + * Sets up the speaker view layout and layout selector. + */ + function setupLayout() { + + layoutDropdown = document.querySelector( '.speaker-layout-dropdown' ); + layoutLabel = document.querySelector( '.speaker-layout-label' ); + + // Render the list of available layouts + for( var id in SPEAKER_LAYOUTS ) { + var option = document.createElement( 'option' ); + option.setAttribute( 'value', id ); + option.textContent = SPEAKER_LAYOUTS[ id ]; + layoutDropdown.appendChild( option ); + } + + // Monitor the dropdown for changes + layoutDropdown.addEventListener( 'change', function( event ) { + + setLayout( layoutDropdown.value ); + + }, false ); + + // Restore any currently persisted layout + setLayout( getLayout() ); + + } + + /** + * Sets a new speaker view layout. The layout is persisted + * in local storage. + */ + function setLayout( value ) { + + var title = SPEAKER_LAYOUTS[ value ]; + + layoutLabel.innerHTML = 'Layout' + ( title ? ( ': ' + title ) : '' ); + layoutDropdown.value = value; + + document.body.setAttribute( 'data-speaker-layout', value ); + + // Persist locally + if( window.localStorage ) { + window.localStorage.setItem( 'reveal-speaker-layout', value ); + } + + } + + /** + * Returns the ID of the most recently set speaker layout + * or our default layout if none has been set. + */ + function getLayout() { + + if( window.localStorage ) { + var layout = window.localStorage.getItem( 'reveal-speaker-layout' ); + if( layout ) { + return layout; + } + } + + // Default to the first record in the layouts hash + for( var id in SPEAKER_LAYOUTS ) { + return id; + } + + } + function zeroPadInteger( num ) { var str = '00' + parseInt( num ); diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 145490a..4fda869 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -544,6 +544,10 @@ } + /** + * Returns the ID of the most recently set speaker layout + * or our default layout if none has been set. + */ function getLayout() { if( window.localStorage ) { -- cgit v1.2.3