From: Hakim El Hattab
Date: Sun, 21 Oct 2012 00:40:52 +0000 (-0400)
Subject: new postMessage-based notes plugin, moved node-based notes to notes-server (#190)
X-Git-Tag: 2.1.0~20
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c6f8a44edf258567bc8324e45adb66036feb00ee;p=reveal.js.git
new postMessage-based notes plugin, moved node-based notes to notes-server (#190)
---
c6f8a44edf258567bc8324e45adb66036feb00ee
diff --cc README.md
index 1e83ccb,91c4e06..a56b6e0
--- a/README.md
+++ b/README.md
@@@ -105,10 -105,10 +105,9 @@@ Reveal.initialize(
{ 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]' ); } },
// Zoom in and out with Alt+click
-- { src: 'plugin/zoom-js/zoom.js', condition: function() { return !!document.body.classList; } },
-- // Speaker notes support
-- { src: 'plugin/speakernotes/client.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } },
-- { src: '/socket.io/socket.io.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } },
++ { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
++ // Speaker notes
++ { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
```
@@@ -230,27 -200,27 +229,23 @@@ Here's an example of an exported presen
![Chrome Print Settings](https://s3.amazonaws.com/hakim-static/reveal-js/pdf-print-settings.png)
--## Speaker Notes
--
--If you're interested in using speaker notes, reveal.js comes with a Node server that allows you to deliver your presentation in one browser while viewing speaker notes in another.
--
--To include speaker notes in your presentation, simply add an `
-- Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you run the speaker notes server.
++ Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
@@@ -356,12 -345,41 +356,10 @@@ function linkify( selector )
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'lib/js/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'lib/js/data-markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
-- { src: 'plugin/zoom-js/zoom.js', condition: function() { return !!document.body.classList; } },
-- { src: '/socket.io/socket.io.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } },
-- { src: 'plugin/speakernotes/client.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } }
++ { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
++ { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
-
- // Set up simple postMessage notes system.
- var url = window.location.href;
- if(url.indexOf('?' + 'notes' + '=') !== 'true') {
- var notesPopup = window.open('notes.html');
- Reveal.addEventListener('slidechanged', function(event) {
- var nextindexh;
- var nextindexv;
- var slideElement = event.currentSlide;
-
- if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') {
- nextindexh = event.indexh;
- nextindexv = event.indexv + 1;
- } else {
- nextindexh = event.indexh + 1;
- nextindexv = 0;
- }
--
- var notes = slideElement.querySelector('aside.notes');
- var slideData = {
- notes : notes ? notes.innerHTML : '',
- indexh : event.indexh,
- indexv : event.indexv,
- nextindexh : nextindexh,
- nextindexv : nextindexv,
- markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false
- };
- notesPopup.postMessage(JSON.stringify(slideData), '*');
- });
- }