aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorEric J. Duran <eric.duran7@gmail.com>2012-10-17 17:46:43 -0400
committerEric J. Duran <eric.duran7@gmail.com>2012-10-17 17:46:43 -0400
commit070a1e3ee5bbe44b6f3cdadedb031f3eee433ac6 (patch)
treea77dff4ec0e458de28263e02ee02be9d8c0e98d1 /index.html
parent558c21e1a3839fa09103c3928b15315bc0928d09 (diff)
downloadfosdem-2018-presentation-070a1e3ee5bbe44b6f3cdadedb031f3eee433ac6.tar
fosdem-2018-presentation-070a1e3ee5bbe44b6f3cdadedb031f3eee433ac6.tar.gz
Replacing speakernotes plugin with a simple postMessage system
Diffstat (limited to 'index.html')
-rw-r--r--index.html31
1 files changed, 30 insertions, 1 deletions
diff --git a/index.html b/index.html
index 3ea2412..43d8b38 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), '*');
+ });
+ }
</script>
</body>