slippery 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -2
- data/assets/LICENSE.md +21 -0
- data/assets/README.md +48 -0
- data/assets/highlight.js/CHANGES.md +693 -0
- data/assets/highlight.js/README.md +86 -37
- data/assets/highlight.js/README.ru.md +65 -24
- data/assets/highlight.js/highlight.pack.js +2 -1
- data/assets/highlight.js/styles/agate.css +108 -0
- data/assets/highlight.js/styles/androidstudio.css +66 -0
- data/assets/highlight.js/styles/arduino-light.css +88 -0
- data/assets/highlight.js/styles/arta.css +25 -93
- data/assets/highlight.js/styles/ascetic.css +20 -28
- data/assets/highlight.js/styles/atelier-cave-dark.css +83 -0
- data/assets/highlight.js/styles/atelier-cave-light.css +85 -0
- data/assets/highlight.js/styles/atelier-dune-dark.css +69 -0
- data/assets/highlight.js/styles/atelier-dune-light.css +69 -0
- data/assets/highlight.js/styles/atelier-estuary-dark.css +84 -0
- data/assets/highlight.js/styles/atelier-estuary-light.css +84 -0
- data/assets/highlight.js/styles/atelier-forest-dark.css +69 -0
- data/assets/highlight.js/styles/atelier-forest-light.css +69 -0
- data/assets/highlight.js/styles/atelier-heath-dark.css +69 -0
- data/assets/highlight.js/styles/atelier-heath-light.css +69 -0
- data/assets/highlight.js/styles/atelier-lakeside-dark.css +69 -0
- data/assets/highlight.js/styles/atelier-lakeside-light.css +69 -0
- data/assets/highlight.js/styles/atelier-plateau-dark.css +84 -0
- data/assets/highlight.js/styles/atelier-plateau-light.css +84 -0
- data/assets/highlight.js/styles/atelier-savanna-dark.css +84 -0
- data/assets/highlight.js/styles/atelier-savanna-light.css +84 -0
- data/assets/highlight.js/styles/atelier-seaside-dark.css +69 -0
- data/assets/highlight.js/styles/atelier-seaside-light.css +69 -0
- data/assets/highlight.js/styles/atelier-sulphurpool-dark.css +69 -0
- data/assets/highlight.js/styles/atelier-sulphurpool-light.css +69 -0
- data/assets/highlight.js/styles/atom-one-dark.css +96 -0
- data/assets/highlight.js/styles/atom-one-light.css +96 -0
- data/assets/highlight.js/styles/brown-paper.css +64 -0
- data/assets/highlight.js/styles/codepen-embed.css +22 -70
- data/assets/highlight.js/styles/color-brewer.css +20 -118
- data/assets/highlight.js/styles/darcula.css +77 -0
- data/assets/highlight.js/styles/dark.css +20 -62
- data/assets/highlight.js/styles/darkula.css +6 -0
- data/assets/highlight.js/styles/default.css +67 -121
- data/assets/highlight.js/styles/docco.css +22 -61
- data/assets/highlight.js/styles/dracula.css +76 -0
- data/assets/highlight.js/styles/far.css +26 -67
- data/assets/highlight.js/styles/foundation.css +22 -70
- data/assets/highlight.js/styles/github-gist.css +71 -0
- data/assets/highlight.js/styles/github.css +23 -51
- data/assets/highlight.js/styles/googlecode.css +29 -88
- data/assets/highlight.js/styles/grayscale.css +101 -0
- data/assets/highlight.js/styles/gruvbox-dark.css +108 -0
- data/assets/highlight.js/styles/gruvbox-light.css +108 -0
- data/assets/highlight.js/styles/hopscotch.css +83 -0
- data/assets/highlight.js/styles/hybrid.css +22 -91
- data/assets/highlight.js/styles/idea.css +24 -53
- data/assets/highlight.js/styles/ir-black.css +73 -0
- data/assets/highlight.js/styles/kimbie.dark.css +24 -46
- data/assets/highlight.js/styles/kimbie.light.css +24 -46
- data/assets/highlight.js/styles/magula.css +19 -71
- data/assets/highlight.js/styles/mono-blue.css +22 -33
- data/assets/highlight.js/styles/monokai-sublime.css +83 -0
- data/assets/highlight.js/styles/monokai.css +23 -80
- data/assets/highlight.js/styles/obsidian.css +26 -92
- data/assets/highlight.js/styles/ocean.css +74 -0
- data/assets/highlight.js/styles/paraiso-dark.css +72 -0
- data/assets/highlight.js/styles/paraiso-light.css +72 -0
- data/assets/highlight.js/styles/pojoaque.css +29 -54
- data/assets/highlight.js/styles/purebasic.css +96 -0
- data/assets/highlight.js/styles/qtcreator_dark.css +83 -0
- data/assets/highlight.js/styles/qtcreator_light.css +83 -0
- data/assets/highlight.js/styles/railscasts.css +32 -111
- data/assets/highlight.js/styles/rainbow.css +34 -58
- data/assets/highlight.js/styles/routeros.css +108 -0
- data/assets/highlight.js/styles/school-book.css +72 -0
- data/assets/highlight.js/styles/solarized-dark.css +84 -0
- data/assets/highlight.js/styles/solarized-light.css +84 -0
- data/assets/highlight.js/styles/sunburst.css +28 -91
- data/assets/highlight.js/styles/tomorrow-night-blue.css +23 -43
- data/assets/highlight.js/styles/tomorrow-night-bright.css +23 -43
- data/assets/highlight.js/styles/tomorrow-night-eighties.css +23 -43
- data/assets/highlight.js/styles/tomorrow-night.css +23 -43
- data/assets/highlight.js/styles/tomorrow.css +23 -43
- data/assets/highlight.js/styles/vs.css +33 -59
- data/assets/highlight.js/styles/vs2015.css +115 -0
- data/assets/highlight.js/styles/xcode.css +28 -94
- data/assets/highlight.js/styles/xt256.css +92 -0
- data/assets/highlight.js/styles/zenburn.css +26 -65
- data/assets/index.html +186 -0
- data/assets/pictures/cover.jpg +0 -0
- data/assets/pictures/logo.svg +3 -0
- data/assets/pictures/picture.jpg +0 -0
- data/assets/reveal.js/css/print/paper.css +193 -167
- data/assets/reveal.js/css/print/pdf.css +20 -53
- data/assets/reveal.js/css/reveal.css +953 -1663
- data/assets/reveal.js/css/reveal.min.css +3 -3
- data/assets/reveal.js/css/reveal.scss +1319 -0
- data/assets/reveal.js/css/theme/README.md +2 -4
- data/assets/reveal.js/css/theme/beige.css +183 -60
- data/assets/reveal.js/css/theme/black.css +267 -0
- data/assets/reveal.js/css/theme/blood.css +190 -80
- data/assets/reveal.js/css/theme/league.css +273 -0
- data/assets/reveal.js/css/theme/moon.css +174 -51
- data/assets/reveal.js/css/theme/night.css +171 -42
- data/assets/reveal.js/css/theme/serif.css +187 -58
- data/assets/reveal.js/css/theme/simple.css +179 -50
- data/assets/reveal.js/css/theme/sky.css +176 -47
- data/assets/reveal.js/css/theme/solarized.css +174 -51
- data/assets/reveal.js/css/theme/source/beige.scss +1 -12
- data/assets/reveal.js/css/theme/source/black.scss +49 -0
- data/assets/reveal.js/css/theme/source/blood.scss +3 -15
- data/assets/reveal.js/css/theme/source/{default.scss → league.scss} +5 -13
- data/assets/reveal.js/css/theme/source/moon.scss +1 -12
- data/assets/reveal.js/css/theme/source/serif.scss +1 -1
- data/assets/reveal.js/css/theme/source/sky.scss +1 -1
- data/assets/reveal.js/css/theme/source/solarized.scss +1 -12
- data/assets/reveal.js/css/theme/source/white.scss +49 -0
- data/assets/reveal.js/css/theme/template/settings.scss +13 -4
- data/assets/reveal.js/css/theme/template/theme.scss +193 -14
- data/assets/reveal.js/css/theme/white.css +267 -0
- data/assets/reveal.js/js/reveal.js +1572 -446
- data/assets/reveal.js/js/reveal.min.js +4 -4
- data/assets/reveal.js/lib/css/zenburn.css +74 -71
- data/assets/reveal.js/lib/font/league-gothic/league-gothic.css +10 -0
- data/assets/reveal.js/lib/font/league-gothic/league-gothic.eot +0 -0
- data/assets/reveal.js/lib/font/league-gothic/league-gothic.ttf +0 -0
- data/assets/reveal.js/lib/font/league-gothic/league-gothic.woff +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/LICENSE +45 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
- data/assets/reveal.js/lib/font/source-sans-pro/source-sans-pro.css +39 -0
- data/assets/reveal.js/plugin/highlight/highlight.js +2 -4
- data/assets/reveal.js/plugin/leap/leap.js +4 -2
- data/assets/reveal.js/plugin/markdown/example.html +3 -3
- data/assets/reveal.js/plugin/markdown/markdown.js +10 -9
- data/assets/reveal.js/plugin/markdown/marked.js +2 -33
- data/assets/reveal.js/plugin/math/math.js +1 -1
- data/assets/reveal.js/plugin/notes/notes.html +321 -182
- data/assets/reveal.js/plugin/notes/notes.js +89 -45
- data/assets/reveal.js/plugin/notes-server/client.js +49 -46
- data/assets/reveal.js/plugin/notes-server/index.js +28 -21
- data/assets/reveal.js/plugin/notes-server/notes.html +351 -97
- data/assets/reveal.js/plugin/print-pdf/print-pdf.js +24 -20
- data/assets/reveal.js/plugin/zoom-js/zoom.js +78 -58
- data/assets/shower/shower.min.js +8 -0
- data/assets/shower/themes/material/LICENSE.md +21 -0
- data/assets/shower/themes/material/README.md +45 -0
- data/assets/shower/themes/material/fonts/COPYRIGHT.txt +1 -0
- data/assets/shower/themes/material/fonts/LICENSE.txt +202 -0
- data/assets/shower/themes/material/fonts/roboto-bold-italic.woff2 +0 -0
- data/assets/shower/themes/material/fonts/roboto-bold.woff2 +0 -0
- data/assets/shower/themes/material/fonts/roboto-italic.woff2 +0 -0
- data/assets/shower/themes/material/fonts/roboto-light.woff2 +0 -0
- data/assets/shower/themes/material/fonts/roboto-mono-regular.woff2 +0 -0
- data/assets/shower/themes/material/fonts/roboto-regular.woff2 +0 -0
- data/assets/shower/themes/material/index.html +488 -0
- data/assets/shower/themes/material/pictures/canvas.png +0 -0
- data/assets/shower/themes/material/pictures/exact.svg +3 -0
- data/assets/shower/themes/material/pictures/picture-1.svg +3 -0
- data/assets/shower/themes/material/pictures/picture-2.svg +3 -0
- data/assets/shower/themes/material/pictures/picture-3.svg +3 -0
- data/assets/shower/themes/material/pictures/square.svg +3 -0
- data/assets/shower/themes/material/pictures/tall.svg +3 -0
- data/assets/shower/themes/material/pictures/wide.svg +3 -0
- data/assets/shower/themes/material/styles/blocks/badge.css +65 -0
- data/assets/shower/themes/material/styles/blocks/caption.css +67 -0
- data/assets/shower/themes/material/styles/blocks/progress.css +37 -0
- data/assets/shower/themes/material/styles/blocks/region.css +29 -0
- data/assets/shower/themes/material/styles/fonts.css +64 -0
- data/assets/shower/themes/material/styles/shower/grid.svg +50 -0
- data/assets/shower/themes/material/styles/shower/shower-full.css +13 -0
- data/assets/shower/themes/material/styles/shower/shower-grid.css +13 -0
- data/assets/shower/themes/material/styles/shower/shower-list.css +30 -0
- data/assets/shower/themes/material/styles/shower/shower-print.css +11 -0
- data/assets/shower/themes/material/styles/shower/shower.css +39 -0
- data/assets/shower/themes/material/styles/slide/content/basic.css +23 -0
- data/assets/shower/themes/material/styles/slide/content/code.css +80 -0
- data/assets/shower/themes/material/styles/slide/content/footer.css +29 -0
- data/assets/shower/themes/material/styles/slide/content/inline.css +49 -0
- data/assets/shower/themes/material/styles/slide/content/lists.css +54 -0
- data/assets/shower/themes/material/styles/slide/content/quote.css +24 -0
- data/assets/shower/themes/material/styles/slide/content/table.css +53 -0
- data/assets/shower/themes/material/styles/slide/elements/columns.css +19 -0
- data/assets/shower/themes/material/styles/slide/elements/copyright.css +38 -0
- data/assets/shower/themes/material/styles/slide/elements/cover.css +25 -0
- data/assets/shower/themes/material/styles/slide/elements/next.css +9 -0
- data/assets/shower/themes/material/styles/slide/elements/place.css +63 -0
- data/assets/shower/themes/material/styles/slide/elements/shout.css +53 -0
- data/assets/shower/themes/material/styles/slide/modifiers/black.css +5 -0
- data/assets/shower/themes/material/styles/slide/modifiers/clear.css +11 -0
- data/assets/shower/themes/material/styles/slide/modifiers/white.css +5 -0
- data/assets/shower/themes/material/styles/slide/slide-full.css +16 -0
- data/assets/shower/themes/material/styles/slide/slide-list.css +68 -0
- data/assets/shower/themes/material/styles/slide/slide.css +56 -0
- data/assets/shower/themes/material/styles/styles.css +9 -0
- data/assets/shower/themes/ribbon/LICENSE.md +21 -0
- data/assets/shower/themes/ribbon/README.md +41 -0
- data/assets/shower/themes/ribbon/fonts/LICENSE.txt +44 -0
- data/assets/shower/themes/ribbon/fonts/pt-mono-regular.woff2 +0 -0
- data/assets/shower/themes/ribbon/fonts/pt-sans-bold-italic.woff2 +0 -0
- data/assets/shower/themes/ribbon/fonts/pt-sans-bold.woff2 +0 -0
- data/assets/shower/themes/ribbon/fonts/pt-sans-italic.woff2 +0 -0
- data/assets/shower/themes/ribbon/fonts/pt-sans-narrow-bold.woff2 +0 -0
- data/assets/shower/themes/ribbon/fonts/pt-sans-regular.woff2 +0 -0
- data/assets/shower/themes/ribbon/index.html +490 -0
- data/assets/shower/themes/ribbon/pictures/canvas.png +0 -0
- data/assets/shower/themes/ribbon/pictures/exact.svg +3 -0
- data/assets/shower/themes/ribbon/pictures/picture-1.svg +3 -0
- data/assets/shower/themes/ribbon/pictures/picture-2.svg +3 -0
- data/assets/shower/themes/ribbon/pictures/picture-3.svg +3 -0
- data/assets/shower/themes/ribbon/pictures/square.svg +3 -0
- data/assets/shower/themes/ribbon/pictures/tall.svg +3 -0
- data/assets/shower/themes/ribbon/pictures/wide.svg +3 -0
- data/assets/shower/themes/ribbon/styles/blocks/badge.css +63 -0
- data/assets/shower/themes/ribbon/styles/blocks/caption.css +63 -0
- data/assets/shower/themes/ribbon/styles/blocks/progress.css +46 -0
- data/assets/shower/themes/ribbon/styles/blocks/region.css +29 -0
- data/assets/shower/themes/ribbon/styles/fonts.css +64 -0
- data/assets/shower/themes/ribbon/styles/shower/grid.svg +40 -0
- data/assets/shower/themes/ribbon/styles/shower/shower-full.css +13 -0
- data/assets/shower/themes/ribbon/styles/shower/shower-grid.css +13 -0
- data/assets/shower/themes/ribbon/styles/shower/shower-list.css +30 -0
- data/assets/shower/themes/ribbon/styles/shower/shower-print.css +11 -0
- data/assets/shower/themes/ribbon/styles/shower/shower.css +32 -0
- data/assets/shower/themes/ribbon/styles/slide/content/basic.css +21 -0
- data/assets/shower/themes/ribbon/styles/slide/content/code.css +82 -0
- data/assets/shower/themes/ribbon/styles/slide/content/footer.css +29 -0
- data/assets/shower/themes/ribbon/styles/slide/content/inline.css +50 -0
- data/assets/shower/themes/ribbon/styles/slide/content/lists.css +55 -0
- data/assets/shower/themes/ribbon/styles/slide/content/quote.css +23 -0
- data/assets/shower/themes/ribbon/styles/slide/content/table.css +53 -0
- data/assets/shower/themes/ribbon/styles/slide/elements/columns.css +19 -0
- data/assets/shower/themes/ribbon/styles/slide/elements/copyright.css +38 -0
- data/assets/shower/themes/ribbon/styles/slide/elements/cover.css +25 -0
- data/assets/shower/themes/ribbon/styles/slide/elements/next.css +9 -0
- data/assets/shower/themes/ribbon/styles/slide/elements/place.css +63 -0
- data/assets/shower/themes/ribbon/styles/slide/elements/shout.css +54 -0
- data/assets/shower/themes/ribbon/styles/slide/modifiers/black.css +5 -0
- data/assets/shower/themes/ribbon/styles/slide/modifiers/clear.css +11 -0
- data/assets/shower/themes/ribbon/styles/slide/modifiers/white.css +5 -0
- data/assets/shower/themes/ribbon/styles/slide/ribbon.svg +1 -0
- data/assets/shower/themes/ribbon/styles/slide/slide-full.css +16 -0
- data/assets/shower/themes/ribbon/styles/slide/slide-list.css +68 -0
- data/assets/shower/themes/ribbon/styles/slide/slide.css +60 -0
- data/assets/shower/themes/ribbon/styles/styles.css +9 -0
- data/lib/slippery/presentation.rb +4 -0
- data/lib/slippery/processors/add_highlight.rb +3 -8
- data/lib/slippery/processors/reveal_js/add_reveal_js.rb +1 -1
- data/lib/slippery/processors/shower.rb +76 -0
- data/lib/slippery/rake_tasks.rb +8 -3
- data/lib/slippery/version.rb +1 -1
- data/lib/slippery.rb +1 -0
- data/slippery.gemspec +3 -3
- metadata +194 -56
- data/assets/highlight.js/highlight-0.8.default.min.css +0 -1
- data/assets/highlight.js/highlight-0.8.min.js +0 -1
- data/assets/highlight.js/styles/atelier-dune.dark.css +0 -95
- data/assets/highlight.js/styles/atelier-dune.light.css +0 -95
- data/assets/highlight.js/styles/atelier-forest.dark.css +0 -95
- data/assets/highlight.js/styles/atelier-forest.light.css +0 -95
- data/assets/highlight.js/styles/atelier-heath.dark.css +0 -95
- data/assets/highlight.js/styles/atelier-heath.light.css +0 -95
- data/assets/highlight.js/styles/atelier-lakeside.dark.css +0 -95
- data/assets/highlight.js/styles/atelier-lakeside.light.css +0 -95
- data/assets/highlight.js/styles/atelier-seaside.dark.css +0 -95
- data/assets/highlight.js/styles/atelier-seaside.light.css +0 -95
- data/assets/highlight.js/styles/brown_paper.css +0 -105
- data/assets/highlight.js/styles/ir_black.css +0 -110
- data/assets/highlight.js/styles/monokai_sublime.css +0 -148
- data/assets/highlight.js/styles/paraiso.dark.css +0 -95
- data/assets/highlight.js/styles/paraiso.light.css +0 -95
- data/assets/highlight.js/styles/school_book.css +0 -113
- data/assets/highlight.js/styles/solarized_dark.css +0 -109
- data/assets/highlight.js/styles/solarized_light.css +0 -109
- data/assets/reveal.js/css/theme/default.css +0 -148
- data/assets/reveal.js/lib/font/league_gothic-webfont.eot +0 -0
- data/assets/reveal.js/lib/font/league_gothic-webfont.svg +0 -230
- data/assets/reveal.js/lib/font/league_gothic-webfont.ttf +0 -0
- data/assets/reveal.js/lib/font/league_gothic-webfont.woff +0 -0
- data/assets/reveal.js/plugin/postmessage/example.html +0 -39
- data/assets/reveal.js/plugin/postmessage/postmessage.js +0 -42
- /data/assets/highlight.js/styles/{brown_papersq.png → brown-papersq.png} +0 -0
- /data/assets/highlight.js/styles/{school_book.png → school-book.png} +0 -0
- /data/assets/reveal.js/lib/font/{league_gothic_license → league-gothic/LICENSE} +0 -0
@@ -1,78 +1,122 @@
|
|
1
1
|
/**
|
2
2
|
* Handles opening of and synchronization with the reveal.js
|
3
3
|
* notes window.
|
4
|
+
*
|
5
|
+
* Handshake process:
|
6
|
+
* 1. This window posts 'connect' to notes window
|
7
|
+
* - Includes URL of presentation to show
|
8
|
+
* 2. Notes window responds with 'connected' when it is available
|
9
|
+
* 3. This window proceeds to send the current presentation state
|
10
|
+
* to the notes window
|
4
11
|
*/
|
5
12
|
var RevealNotes = (function() {
|
6
13
|
|
7
14
|
function openNotes() {
|
8
15
|
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
|
9
16
|
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
|
10
|
-
var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=
|
17
|
+
var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1100,height=700' );
|
11
18
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
/**
|
20
|
+
* Connect to the notes window through a postmessage handshake.
|
21
|
+
* Using postmessage enables us to work in situations where the
|
22
|
+
* origins differ, such as a presentation being opened from the
|
23
|
+
* file system.
|
24
|
+
*/
|
25
|
+
function connect() {
|
26
|
+
// Keep trying to connect until we get a 'connected' message back
|
27
|
+
var connectInterval = setInterval( function() {
|
28
|
+
notesPopup.postMessage( JSON.stringify( {
|
29
|
+
namespace: 'reveal-notes',
|
30
|
+
type: 'connect',
|
31
|
+
url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search,
|
32
|
+
state: Reveal.getState()
|
33
|
+
} ), '*' );
|
34
|
+
}, 500 );
|
17
35
|
|
18
|
-
|
19
|
-
|
36
|
+
window.addEventListener( 'message', function( event ) {
|
37
|
+
var data = JSON.parse( event.data );
|
38
|
+
if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) {
|
39
|
+
clearInterval( connectInterval );
|
40
|
+
onConnected();
|
41
|
+
}
|
42
|
+
} );
|
43
|
+
}
|
20
44
|
|
21
45
|
/**
|
22
46
|
* Posts the current slide data to the notes window
|
23
47
|
*/
|
24
48
|
function post() {
|
49
|
+
|
25
50
|
var slideElement = Reveal.getCurrentSlide(),
|
26
|
-
|
27
|
-
messageData;
|
28
|
-
|
29
|
-
var notes = slideElement.querySelector( 'aside.notes' ),
|
30
|
-
nextindexh,
|
31
|
-
nextindexv;
|
32
|
-
|
33
|
-
if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) {
|
34
|
-
nextindexh = slideIndices.h;
|
35
|
-
nextindexv = slideIndices.v + 1;
|
36
|
-
} else {
|
37
|
-
nextindexh = slideIndices.h + 1;
|
38
|
-
nextindexv = 0;
|
39
|
-
}
|
51
|
+
notesElement = slideElement.querySelector( 'aside.notes' );
|
40
52
|
|
41
|
-
messageData = {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
nextindexv : nextindexv,
|
48
|
-
markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false
|
53
|
+
var messageData = {
|
54
|
+
namespace: 'reveal-notes',
|
55
|
+
type: 'state',
|
56
|
+
notes: '',
|
57
|
+
markdown: false,
|
58
|
+
state: Reveal.getState()
|
49
59
|
};
|
50
60
|
|
61
|
+
// Look for notes defined in a slide attribute
|
62
|
+
if( slideElement.hasAttribute( 'data-notes' ) ) {
|
63
|
+
messageData.notes = slideElement.getAttribute( 'data-notes' );
|
64
|
+
}
|
65
|
+
|
66
|
+
// Look for notes defined in an aside element
|
67
|
+
if( notesElement ) {
|
68
|
+
messageData.notes = notesElement.innerHTML;
|
69
|
+
messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
|
70
|
+
}
|
71
|
+
|
51
72
|
notesPopup.postMessage( JSON.stringify( messageData ), '*' );
|
73
|
+
|
52
74
|
}
|
53
75
|
|
54
|
-
|
55
|
-
|
76
|
+
/**
|
77
|
+
* Called once we have established a connection to the notes
|
78
|
+
* window.
|
79
|
+
*/
|
80
|
+
function onConnected() {
|
81
|
+
|
82
|
+
// Monitor events that trigger a change in state
|
83
|
+
Reveal.addEventListener( 'slidechanged', post );
|
84
|
+
Reveal.addEventListener( 'fragmentshown', post );
|
85
|
+
Reveal.addEventListener( 'fragmenthidden', post );
|
86
|
+
Reveal.addEventListener( 'overviewhidden', post );
|
87
|
+
Reveal.addEventListener( 'overviewshown', post );
|
88
|
+
Reveal.addEventListener( 'paused', post );
|
89
|
+
Reveal.addEventListener( 'resumed', post );
|
90
|
+
|
91
|
+
// Post the initial state
|
56
92
|
post();
|
57
|
-
}, false );
|
58
|
-
}
|
59
93
|
|
60
|
-
|
61
|
-
|
62
|
-
|
94
|
+
}
|
95
|
+
|
96
|
+
connect();
|
63
97
|
}
|
64
98
|
|
65
|
-
|
66
|
-
document.addEventListener( 'keydown', function( event ) {
|
67
|
-
// Disregard the event if the target is editable or a
|
68
|
-
// modifier is present
|
69
|
-
if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
|
99
|
+
if( !/receiver/i.test( window.location.search ) ) {
|
70
100
|
|
71
|
-
|
72
|
-
|
101
|
+
// If the there's a 'notes' query set, open directly
|
102
|
+
if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) {
|
73
103
|
openNotes();
|
74
104
|
}
|
75
|
-
|
105
|
+
|
106
|
+
// Open the notes when the 's' key is hit
|
107
|
+
document.addEventListener( 'keydown', function( event ) {
|
108
|
+
// Disregard the event if the target is editable or a
|
109
|
+
// modifier is present
|
110
|
+
if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
|
111
|
+
|
112
|
+
if( event.keyCode === 83 ) {
|
113
|
+
event.preventDefault();
|
114
|
+
openNotes();
|
115
|
+
}
|
116
|
+
}, false );
|
117
|
+
|
118
|
+
}
|
76
119
|
|
77
120
|
return { open: openNotes };
|
121
|
+
|
78
122
|
})();
|
@@ -1,57 +1,60 @@
|
|
1
1
|
(function() {
|
2
|
+
|
2
3
|
// don't emit events from inside the previews themselves
|
3
|
-
if
|
4
|
-
|
5
|
-
var socket = io.connect(window.location.origin)
|
6
|
-
|
7
|
-
|
8
|
-
console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId);
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
if( window.location.search.match( /receiver/gi ) ) { return; }
|
5
|
+
|
6
|
+
var socket = io.connect( window.location.origin ),
|
7
|
+
socketId = Math.random().toString().slice( 2 );
|
8
|
+
|
9
|
+
console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId );
|
10
|
+
|
11
|
+
window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId );
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Posts the current slide data to the notes window
|
15
|
+
*/
|
16
|
+
function post() {
|
17
|
+
|
18
|
+
var slideElement = Reveal.getCurrentSlide(),
|
19
|
+
notesElement = slideElement.querySelector( 'aside.notes' );
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
var messageData = {
|
22
|
+
notes: '',
|
23
|
+
markdown: false,
|
24
|
+
socketId: socketId,
|
25
|
+
state: Reveal.getState()
|
25
26
|
};
|
26
|
-
socket.emit('fragmentchanged', fragmentData);
|
27
|
-
} );
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
if
|
36
|
-
|
37
|
-
|
38
|
-
} else {
|
39
|
-
nextindexh = event.indexh + 1;
|
40
|
-
nextindexv = 0;
|
28
|
+
// Look for notes defined in a slide attribute
|
29
|
+
if( slideElement.hasAttribute( 'data-notes' ) ) {
|
30
|
+
messageData.notes = slideElement.getAttribute( 'data-notes' );
|
31
|
+
}
|
32
|
+
|
33
|
+
// Look for notes defined in an aside element
|
34
|
+
if( notesElement ) {
|
35
|
+
messageData.notes = notesElement.innerHTML;
|
36
|
+
messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
|
41
37
|
}
|
42
38
|
|
43
|
-
|
44
|
-
var slideData = {
|
45
|
-
notes : notes ? notes.innerHTML : '',
|
46
|
-
indexh : event.indexh,
|
47
|
-
indexv : event.indexv,
|
48
|
-
nextindexh : nextindexh,
|
49
|
-
nextindexv : nextindexv,
|
50
|
-
socketId : socketId,
|
51
|
-
markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false
|
39
|
+
socket.emit( 'statechanged', messageData );
|
52
40
|
|
53
|
-
|
41
|
+
}
|
54
42
|
|
55
|
-
|
43
|
+
// When a new notes window connects, post our current state
|
44
|
+
socket.on( 'connect', function( data ) {
|
45
|
+
post();
|
56
46
|
} );
|
47
|
+
|
48
|
+
// Monitor events that trigger a change in state
|
49
|
+
Reveal.addEventListener( 'slidechanged', post );
|
50
|
+
Reveal.addEventListener( 'fragmentshown', post );
|
51
|
+
Reveal.addEventListener( 'fragmenthidden', post );
|
52
|
+
Reveal.addEventListener( 'overviewhidden', post );
|
53
|
+
Reveal.addEventListener( 'overviewshown', post );
|
54
|
+
Reveal.addEventListener( 'paused', post );
|
55
|
+
Reveal.addEventListener( 'resumed', post );
|
56
|
+
|
57
|
+
// Post the initial state
|
58
|
+
post();
|
59
|
+
|
57
60
|
}());
|
@@ -14,46 +14,53 @@ var opts = {
|
|
14
14
|
baseDir : __dirname + '/../../'
|
15
15
|
};
|
16
16
|
|
17
|
-
io.sockets.on('connection', function(socket) {
|
18
|
-
|
19
|
-
|
17
|
+
io.sockets.on( 'connection', function( socket ) {
|
18
|
+
|
19
|
+
socket.on( 'connect', function( data ) {
|
20
|
+
socket.broadcast.emit( 'connect', data );
|
20
21
|
});
|
21
|
-
|
22
|
-
|
22
|
+
|
23
|
+
socket.on( 'statechanged', function( data ) {
|
24
|
+
socket.broadcast.emit( 'statechanged', data );
|
23
25
|
});
|
26
|
+
|
24
27
|
});
|
25
28
|
|
26
|
-
app.configure(function() {
|
27
|
-
|
28
|
-
|
29
|
+
app.configure( function() {
|
30
|
+
|
31
|
+
[ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) {
|
32
|
+
app.use( '/' + dir, staticDir( opts.baseDir + dir ) );
|
29
33
|
});
|
34
|
+
|
30
35
|
});
|
31
36
|
|
32
|
-
app.get(
|
33
|
-
|
34
|
-
|
37
|
+
app.get('/', function( req, res ) {
|
38
|
+
|
39
|
+
res.writeHead( 200, { 'Content-Type': 'text/html' } );
|
40
|
+
fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res );
|
41
|
+
|
35
42
|
});
|
36
43
|
|
37
|
-
app.get(
|
44
|
+
app.get( '/notes/:socketId', function( req, res ) {
|
38
45
|
|
39
|
-
fs.readFile(opts.baseDir + 'plugin/notes-server/notes.html', function(err, data) {
|
40
|
-
res.send(Mustache.to_html(data.toString(), {
|
46
|
+
fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) {
|
47
|
+
res.send( Mustache.to_html( data.toString(), {
|
41
48
|
socketId : req.params.socketId
|
42
49
|
}));
|
43
50
|
});
|
44
|
-
|
51
|
+
|
45
52
|
});
|
46
53
|
|
47
54
|
// Actually listen
|
48
|
-
app.listen(opts.port || null);
|
55
|
+
app.listen( opts.port || null );
|
49
56
|
|
50
57
|
var brown = '\033[33m',
|
51
58
|
green = '\033[32m',
|
52
59
|
reset = '\033[0m';
|
53
60
|
|
54
|
-
var slidesLocation =
|
61
|
+
var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' );
|
55
62
|
|
56
|
-
console.log( brown +
|
57
|
-
console.log(
|
58
|
-
console.log(
|
59
|
-
console.log(
|
63
|
+
console.log( brown + 'reveal.js - Speaker Notes' + reset );
|
64
|
+
console.log( '1. Open the slides at ' + green + slidesLocation + reset );
|
65
|
+
console.log( '2. Click on the link your JS console to go to the notes page' );
|
66
|
+
console.log( '3. Advance through your slides and your notes will advance automatically' );
|