From 296242f8d3d5f5513d5278e72941ef868c3cb4e5 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Wed, 24 Oct 2012 14:33:16 +0200 Subject: Make the fragments visible in speaker notes --- plugin/notes/notes.html | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 485edec..c69950b 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -109,12 +109,15 @@ window.addEventListener( 'message', function( event ) { var data = JSON.parse( event.data ); - - if( data.markdown ) { - notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes ); - } - else { - notes.innerHTML = data.notes; + console.log(data); + // No need for updating the notes in case of fragement changes + if ( data.notes !== undefined) { + if( data.markdown ) { + notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes ); + } + else { + notes.innerHTML = data.notes; + } } // Kill the slide listeners while responding to the event @@ -124,6 +127,14 @@ currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv ); nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv ); + // Showing and hiding fragments + if (data.fragment === 'next') { + currentSlide.contentWindow.Reveal.nextFragment(); + } + else if (data.fragment === 'prev') { + currentSlide.contentWindow.Reveal.prevFragment(); + } + // Resume listening on the next cycle setTimeout( addSlideListeners, 1 ); -- cgit v1.2.3 From 13e7550afe26b216de6a9f97b3a55b60a2ee4cde Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Wed, 24 Oct 2012 14:53:50 +0200 Subject: Delete console output. --- plugin/notes/notes.html | 3 +-- plugin/notes/notes.js | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index c69950b..775ccb4 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -109,8 +109,7 @@ window.addEventListener( 'message', function( event ) { var data = JSON.parse( event.data ); - console.log(data); - // No need for updating the notes in case of fragement changes + // No need for updating the notes in case of fragment changes if ( data.notes !== undefined) { if( data.markdown ) { notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes ); diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 45d13a4..0573440 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -29,7 +29,6 @@ var RevealNotes = (function() { * set in the events above to define the needed slideDate. */ function post(eventType) { - console.log(eventType); var slideElement = Reveal.getCurrentSlide(), indexh = Reveal.getIndices().h, indexv = Reveal.getIndices().v, -- cgit v1.2.3 From 1801bf67eaf1fac8cb5776fe9ba83cc9e13272d6 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Wed, 24 Oct 2012 15:06:32 +0200 Subject: Delete functionality to control presentation from notes window Its was impossible (at least for me) to keep the windows in sync without bloating the code too much. --- plugin/notes/notes.html | 25 ------------------------- plugin/notes/notes.js | 10 ---------- 2 files changed, 35 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 775ccb4..90083cf 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -119,9 +119,6 @@ } } - // Kill the slide listeners while responding to the event - removeSlideListeners(); - // Update the note slides currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv ); nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv ); @@ -134,30 +131,8 @@ currentSlide.contentWindow.Reveal.prevFragment(); } - // Resume listening on the next cycle - setTimeout( addSlideListeners, 1 ); - }, false ); - function addSlideListeners() { - currentSlide.contentWindow.Reveal.addEventListener( 'slidechanged', onNotesSlideChange, false ); - nextSlide.contentWindow.Reveal.addEventListener( 'slidechanged', onNotesSlideChange, false ); - } - - function removeSlideListeners() { - currentSlide.contentWindow.Reveal.removeEventListener( 'slidechanged', onNotesSlideChange, false ); - nextSlide.contentWindow.Reveal.removeEventListener( 'slidechanged', onNotesSlideChange, false ); - } - - function onNotesSlideChange( event ) { - window.opener.postMessage( JSON.stringify({ - indexh : event.indexh, - indexv : event.indexv - }), '*' ); - } - - addSlideListeners(); - })( window ); }, false ); diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 0573440..00d386d 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -69,16 +69,6 @@ var RevealNotes = (function() { notesPopup.postMessage( JSON.stringify( slideData ), '*' ); } - // The main presentation is kept in sync when navigating the - // note slides so that the popup may be used as a remote - window.addEventListener( 'message', function( event ) { - var data = JSON.parse( event.data ); - - if( data && typeof data.indexh === 'number' && typeof data.indexv === 'number' ) { - Reveal.slide( data.indexh, data.indexv ); - } - } ); - // Navigate to the current slide when the notes are loaded notesPopup.addEventListener( 'load', function( event ) { post('slidechanged'); -- cgit v1.2.3 From 605f7140e3406d4decd4182e13059e5666fdac8c Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sun, 28 Oct 2012 18:48:52 -0400 Subject: updated markdown references in notes plugin --- README.md | 10 +++++----- plugin/notes-server/notes.html | 2 +- plugin/notes/notes.html | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/README.md b/README.md index a7527a5..06edf1a 100644 --- a/README.md +++ b/README.md @@ -97,13 +97,13 @@ Reveal.js doesn't _rely_ on any third party scripts to work but a few optional l ```javascript Reveal.initialize({ dependencies: [ - // Syntax highlight for elements - { src: 'lib/js/highlight.js', async: true, callback: function() { window.hljs.initHighlightingOnLoad(); } }, // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/ - { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } } + { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, // Interpret Markdown in
elements - { src: 'lib/js/data-markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, - { src: 'lib/js/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + // Syntax highlight for elements + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, // Zoom in and out with Alt+click { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, // Speaker notes diff --git a/plugin/notes-server/notes.html b/plugin/notes-server/notes.html index d71d7f8..053cb5e 100644 --- a/plugin/notes-server/notes.html +++ b/plugin/notes-server/notes.html @@ -99,7 +99,7 @@
- + +
- + UPCOMING:
@@ -102,45 +114,48 @@ UPCOMING: +
+
+

Time

+ 0:00:00 AM +
+
+

Elapsed

+ 00:00:00 +
+
-- cgit v1.2.3 From 784fa9d2e3570054728d21f8098199dc9d4164b9 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sat, 26 Jan 2013 13:32:07 -0500 Subject: merge in timer in notes window, timer now stays hidden until initial time is set --- plugin/notes/notes.html | 146 ++++++++++++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 62 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index f8e7f70..af2fbfc 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -95,10 +95,22 @@ .error code { font-family: monospace; } + .time { + width: 448px; + margin: 30px 0 0 10px; + float: left; text-align: center; + opacity: 0; + + -webkit-transition: opacity 0.4s; + -moz-transition: opacity 0.4s; + -o-transition: opacity 0.4s; + transition: opacity 0.4s; } - .elapsed, .clock { + + .elapsed, + .clock { color: #333; font-size: 2em; text-align: center; @@ -107,12 +119,15 @@ background-color: #eee; border-radius: 10px; } - .elapsed h2, .clock h2 { + + .elapsed h2, + .clock h2 { font-size: 0.8em; line-height: 100%; margin: 0; color: #aaa; } + .elapsed .mute { color: #ddd; } @@ -130,61 +145,85 @@ UPCOMING: -
-
+ +
+

Time

- 0:00:00 AM + 0:00:00 AM
-
+

Elapsed

- 00:00:00 + 00:00:00
+
-- cgit v1.2.3 From 380264afc8468544d82f3e50115cef249f08fff5 Mon Sep 17 00:00:00 2001 From: hakimel Date: Wed, 6 Feb 2013 19:15:30 -0500 Subject: merge in notes improvement --- plugin/notes/notes.html | 32 ++++++++++++++++---------------- plugin/notes/notes.js | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index af2fbfc..50d172a 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -29,16 +29,16 @@ border: none; -webkit-transform-origin: 0 0; - -moz-transform-origin: 0 0; - -ms-transform-origin: 0 0; - -o-transform-origin: 0 0; - transform-origin: 0 0; + -moz-transform-origin: 0 0; + -ms-transform-origin: 0 0; + -o-transform-origin: 0 0; + transform-origin: 0 0; -webkit-transform: scale(0.5); - -moz-transform: scale(0.5); - -ms-transform: scale(0.5); - -o-transform: scale(0.5); - transform: scale(0.5); + -moz-transform: scale(0.5); + -ms-transform: scale(0.5); + -o-transform: scale(0.5); + transform: scale(0.5); } #wrap-next-slide { @@ -55,16 +55,16 @@ border: none; -webkit-transform-origin: 0 0; - -moz-transform-origin: 0 0; - -ms-transform-origin: 0 0; - -o-transform-origin: 0 0; - transform-origin: 0 0; + -moz-transform-origin: 0 0; + -ms-transform-origin: 0 0; + -o-transform-origin: 0 0; + transform-origin: 0 0; -webkit-transform: scale(0.35); - -moz-transform: scale(0.35); - -ms-transform: scale(0.35); - -o-transform: scale(0.35); - transform: scale(0.35); + -moz-transform: scale(0.35); + -ms-transform: scale(0.35); + -o-transform: scale(0.35); + transform: scale(0.35); } .slides { diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 72f6a10..63de05a 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -5,7 +5,7 @@ var RevealNotes = (function() { function openNotes() { - var jsFileLocation = document.querySelector('script[src*=notes]').src; // this js file path + 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=1120,height=850' ); -- cgit v1.2.3 From d7b92c9c6581dd33567a03bc2f0a3c7f4d5c305d Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 27 Feb 2013 16:55:42 -0500 Subject: update main window when current slide changes in notes (closes #343) --- plugin/notes/notes.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugin/notes/notes.html') diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 50d172a..e14c6ac 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -225,6 +225,13 @@ }, 1000 ); + // Navigate the main window when the notes slide changes + currentSlide.contentWindow.Reveal.addEventListener( 'slidechanged', function( event ) { + + window.opener.Reveal.slide( event.indexh, event.indexv ); + + } ); + } else { -- cgit v1.2.3