aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-10-04 13:26:16 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2018-10-04 13:26:22 +0200
commitd5cf3fa13c899014008314d41292880fa8b699bd (patch)
treeab48c34dadd6d9aebf8fddd473267c4a4b03890a
parent8582c9aac8888bc71d2658377778279a5d5f0c34 (diff)
downloadfreenode-live-2017-presentation-d5cf3fa13c899014008314d41292880fa8b699bd.tar
freenode-live-2017-presentation-d5cf3fa13c899014008314d41292880fa8b699bd.tar.gz
formatting and tweaks for #2104
-rw-r--r--index.html23
-rw-r--r--js/reveal.js18
-rw-r--r--plugin/notes/notes.html8
-rw-r--r--plugin/notes/notes.js8
4 files changed, 23 insertions, 34 deletions
diff --git a/index.html b/index.html
index e3e10c1..98accc3 100644
--- a/index.html
+++ b/index.html
@@ -24,23 +24,8 @@
<body>
<div class="reveal">
<div class="slides">
- <section data-timing="6">
- Slide 1
-
- <aside>
- these are not notes
- </aside>
- <aside class="notes">
- these are notes for the first slide
- </aside>
- </section>
- <section>
- Slide 2
-
- <aside class="notes">
- these are the nodes for the second slide
- </aside>
- </section>
+ <section>Slide 1</section>
+ <section>Slide 2</section>
</div>
</div>
@@ -57,9 +42,7 @@
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
- ],
- controlsTutorial: false,
- defaultTiming: 3
+ ]
});
</script>
</body>
diff --git a/js/reveal.js b/js/reveal.js
index 4946df5..ac3135d 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -4099,18 +4099,20 @@
}
/**
- * Returns an array of objects where each object represents the attributes on its respective slide.
+ * Returns an array of objects where each object represents the
+ * attributes on its respective slide.
*/
- function getSlidesMetaInfo() {
+ function getSlidesAttributes() {
- var slides = getSlides();
- return slides.map( function (slide) {
- var meta = {};
+ return getSlides().map( function( slide ) {
+
+ var attributes = {};
for( var i = 0; i < slide.attributes.length; i++ ) {
var attribute = slide.attributes[ i ];
- meta[ attribute.name ] = attribute.value;
+ attributes[ attribute.name ] = attribute.value;
}
- return meta;
+ return attributes;
+
} );
}
@@ -5473,7 +5475,7 @@
// Returns an Array of objects representing the attributes on
// the slides
- getSlidesMetaInfo: getSlidesMetaInfo,
+ getSlidesAttributes: getSlidesAttributes,
// Returns the total number of slides
getTotalSlides: getTotalSlides,
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html
index 56f5187..9e0b230 100644
--- a/plugin/notes/notes.html
+++ b/plugin/notes/notes.html
@@ -408,6 +408,7 @@
* Asynchronously calls the Reveal.js API of the main frame.
*/
function callRevealApi( methodName, methodArguments, callback ) {
+
var callId = ++lastRevealApiCallId;
pendingCalls[callId] = callback;
window.opener.postMessage( JSON.stringify( {
@@ -417,6 +418,7 @@
methodName: methodName,
arguments: methodArguments
} ), '*' );
+
}
/**
@@ -535,7 +537,7 @@
function getTimings( callback ) {
- callRevealApi( 'getSlidesMetaInfo', [], function ( slides ) {
+ callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) {
callRevealApi( 'getConfig', [], function ( config ) {
var defaultTiming = config.defaultTiming;
if (defaultTiming == null) {
@@ -544,8 +546,8 @@
}
var timings = [];
- for ( var i in slides ) {
- var slide = slides[ i ];
+ for ( var i in slideAttributes ) {
+ var slide = slideAttributes[ i ];
var timing = defaultTiming;
if( slide.hasOwnProperty( 'data-timing' )) {
var t = slide[ 'data-timing' ];
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index 552a6fe..fdefd75 100644
--- a/plugin/notes/notes.js
+++ b/plugin/notes/notes.js
@@ -56,17 +56,19 @@ var RevealNotes = (function() {
}
/**
- * Calls the specified Reveal.js method with the provided argument and then pushes the result to the notes
- * frame.
+ * Calls the specified Reveal.js method with the provided argument
+ * and then pushes the result to the notes frame.
*/
function callRevealApi( methodName, methodArguments, callId ) {
- var result = Reveal[methodName].call(Reveal, methodArguments);
+
+ var result = Reveal[methodName].call( Reveal, methodArguments );
notesPopup.postMessage( JSON.stringify( {
namespace: 'reveal-notes',
type: 'return',
result: result,
callId: callId
} ), '*' );
+
}
/**