From 070a1e3ee5bbe44b6f3cdadedb031f3eee433ac6 Mon Sep 17 00:00:00 2001
From: "Eric J. Duran"
Date: Wed, 17 Oct 2012 17:46:43 -0400
Subject: [PATCH] Replacing speakernotes plugin with a simple postMessage
system
---
index.html | 31 ++++++++++-
plugin/speakernotes/notes.html => notes.html | 51 ++++++++----------
plugin/speakernotes/client.js | 38 --------------
plugin/speakernotes/index.js | 55 --------------------
4 files changed, 52 insertions(+), 123 deletions(-)
rename plugin/speakernotes/notes.html => notes.html (64%)
delete mode 100644 plugin/speakernotes/client.js
delete mode 100644 plugin/speakernotes/index.js
diff --git a/index.html b/index.html
index 3ea2412c..43d8b38e 100644
--- a/index.html
+++ b/index.html
@@ -350,7 +350,36 @@ function linkify( selector ) {
{ src: 'plugin/speakernotes/client.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } }
]
});
-
+
+ // 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), '*');
+ });
+ }
-
+
-
+
UPCOMING:
-
-
-
+
-