crossnote 0.9.44 → 0.9.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/cjs/index.cjs +590 -379
- package/out/cli/index.cjs +3863 -911
- package/out/dependencies/README.md +46 -6
- package/out/dependencies/mermaid/mermaid.min.js +1475 -1475
- package/out/dependencies/pele/pele.global.js +150 -0
- package/out/dependencies/reveal/css/reveal.css +1 -8
- package/out/dependencies/reveal/css/theme/beige.css +1 -301
- package/out/dependencies/reveal/css/theme/black-contrast.css +1 -0
- package/out/dependencies/reveal/css/theme/black.css +1 -294
- package/out/dependencies/reveal/css/theme/blood.css +1 -323
- package/out/dependencies/reveal/css/theme/dracula.css +1 -0
- package/out/dependencies/reveal/css/theme/league.css +1 -303
- package/out/dependencies/reveal/css/theme/moon.css +1 -301
- package/out/dependencies/reveal/css/theme/night.css +1 -295
- package/out/dependencies/reveal/css/theme/serif.css +1 -297
- package/out/dependencies/reveal/css/theme/simple.css +1 -297
- package/out/dependencies/reveal/css/theme/sky.css +1 -304
- package/out/dependencies/reveal/css/theme/solarized.css +1 -298
- package/out/dependencies/reveal/css/theme/white-contrast.css +1 -0
- package/out/dependencies/reveal/css/theme/white.css +1 -294
- package/out/dependencies/reveal/js/reveal.js +39 -8
- package/out/dependencies/reveal/plugin/notes/notes.js +970 -1
- package/out/esm/index.mjs +604 -393
- package/out/server-app/server-app.css +1 -1
- package/out/server-app/server-app.js +10 -10
- package/out/styles/style-template.css +1 -1
- package/out/types/src/custom-markdown-it-features/admonition.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/callout.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/code-fences.d.ts +2 -2
- package/out/types/src/custom-markdown-it-features/colon-fenced-code-blocks.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/critic-markup.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/curly-bracket-attributes.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/emoji.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/html5-embed.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/linkify.d.ts +3 -0
- package/out/types/src/custom-markdown-it-features/math.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/sourcemap.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/tag.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/widget.d.ts +1 -1
- package/out/types/src/custom-markdown-it-features/wikilink.d.ts +1 -1
- package/out/types/src/lib/css-for-style.d.ts +1 -0
- package/out/types/src/lib/dangerous-urls.d.ts +1 -1
- package/out/types/src/lib/json-for-script.d.ts +1 -0
- package/out/types/src/lib/pele-bundle.d.ts +2 -0
- package/out/types/src/lib/pele.d.ts +14 -0
- package/out/types/src/markdown-engine/index.d.ts +8 -1
- package/out/types/src/markdown-engine/mathjax-config.d.ts +5 -0
- package/out/types/src/markdown-engine/mermaid-polyfill.d.ts +1 -1
- package/out/types/src/markdown-engine/page-markers.d.ts +4 -0
- package/out/types/src/markdown-engine/pele-export.d.ts +1 -0
- package/out/types/src/markdown-engine/presentation-export.d.ts +7 -0
- package/out/types/src/markdown-engine/presentation-notes.d.ts +2 -0
- package/out/types/src/markdown-engine/sanitize.d.ts +3 -0
- package/out/types/src/markdown-engine/toc.d.ts +1 -1
- package/out/types/src/markdown-engine/transformer.d.ts +7 -1
- package/out/types/src/notebook/index.d.ts +6 -6
- package/out/types/src/notebook/types.d.ts +5 -3
- package/out/types/src/renderers/pele.d.ts +4 -0
- package/out/types/src/webview/components/ContextMenu.d.ts +1 -0
- package/out/types/src/webview/lib/mermaid.d.ts +9 -0
- package/out/types/src/webview/lib/pele.d.ts +3 -0
- package/out/types/src/webview/lib/sanitize.d.ts +1 -0
- package/out/types/src/webview/lib/source-text-map.d.ts +2 -1
- package/out/types/test/browser/context-menu-harness.d.ts +1 -0
- package/out/types/test/browser/context-menu.spec.d.ts +1 -0
- package/out/types/test/browser/mathjax-config-sources.spec.d.ts +1 -0
- package/out/types/test/browser/mermaid-measure.spec.d.ts +1 -0
- package/out/types/test/browser/mermaid-polyfill.spec.d.ts +1 -0
- package/out/types/test/browser/mermaid-sanitize.spec.d.ts +1 -0
- package/out/types/test/browser/mouse-wheel-zoom.spec.d.ts +1 -0
- package/out/types/test/browser/pele.spec.d.ts +1 -0
- package/out/types/test/browser/presentation-print.spec.d.ts +1 -0
- package/out/types/test/browser/presentation.spec.d.ts +1 -0
- package/out/types/test/browser/preview-container-harness.d.ts +1 -0
- package/out/types/test/browser/sanitize-stable.spec.d.ts +1 -0
- package/out/types/test/browser/scroll-sync.spec.d.ts +1 -0
- package/out/types/test/browser/sidebar-position.spec.d.ts +1 -0
- package/out/types/test/config-escaping.test.d.ts +1 -0
- package/out/types/test/ebook-export.test.d.ts +1 -0
- package/out/types/test/ebook-images.test.d.ts +1 -0
- package/out/types/test/fixtures/mutating-markup.d.ts +4 -0
- package/out/types/test/fixtures/pele-diagrams.d.ts +6 -0
- package/out/types/test/fixtures/pele-hostile.d.ts +2 -0
- package/out/types/test/front-matter-escaping.test.d.ts +1 -0
- package/out/types/test/html5-embed.test.d.ts +1 -0
- package/out/types/test/import-fragment-own-headings.test.d.ts +1 -0
- package/out/types/test/indented-code-import.test.d.ts +1 -0
- package/out/types/test/linkify.test.d.ts +1 -0
- package/out/types/test/markdown-export-toc.test.d.ts +1 -0
- package/out/types/test/markdown-it.test.d.ts +1 -0
- package/out/types/test/mathjax-config-file.test.d.ts +1 -0
- package/out/types/test/mathjax-diagram-sources.test.d.ts +1 -0
- package/out/types/test/mutation-xss.test.d.ts +1 -0
- package/out/types/test/note-trust.test.d.ts +1 -0
- package/out/types/test/page-markers.test.d.ts +1 -0
- package/out/types/test/pandoc-export-slide-markers.test.d.ts +1 -0
- package/out/types/test/pandoc-fragment-import-lines.test.d.ts +1 -0
- package/out/types/test/parser-hook-trust.test.d.ts +1 -0
- package/out/types/test/pele-diagrams.test.d.ts +1 -0
- package/out/types/test/pele-export.test.d.ts +1 -0
- package/out/types/test/pele-preview-script.test.d.ts +1 -0
- package/out/types/test/pele-renderer.test.d.ts +1 -0
- package/out/types/test/pele-vendor.test.d.ts +1 -0
- package/out/types/test/presentation-export-script.test.d.ts +1 -0
- package/out/types/test/presentation-export.test.d.ts +1 -0
- package/out/types/test/presentation-preview-script.test.d.ts +1 -0
- package/out/types/test/presentation-slides.test.d.ts +1 -0
- package/out/types/test/reveal-vendor.test.d.ts +1 -0
- package/out/types/test/sanitize-stable.test.d.ts +1 -0
- package/out/types/test/sidebar-toc.test.d.ts +1 -0
- package/out/types/test/toc-bracket.test.d.ts +1 -0
- package/out/types/test/webview-mermaid-render.test.d.ts +1 -0
- package/out/types/test/webview-pele-render.test.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/out/webview/backlinks.css +1 -1
- package/out/webview/backlinks.js +4 -4
- package/out/webview/graph-view.css +1 -1
- package/out/webview/preview.css +1 -1
- package/out/webview/preview.js +201 -201
- package/package.json +5 -5
- package/out/dependencies/reveal/css/print/paper.css +0 -203
- package/out/dependencies/reveal/css/print/pdf.css +0 -164
- package/out/dependencies/reveal/css/reset.css +0 -30
- package/out/dependencies/reveal/css/theme/README.md +0 -21
- package/out/dependencies/reveal/lib/css/zenburn.css +0 -80
- package/out/dependencies/reveal/lib/font/league-gothic/LICENSE +0 -2
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.css +0 -10
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.eot +0 -0
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.ttf +0 -0
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/LICENSE +0 -45
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro.css +0 -39
- package/out/dependencies/reveal/lib/js/classList.js +0 -2
- package/out/dependencies/reveal/lib/js/head.min.js +0 -6
- package/out/dependencies/reveal/lib/js/html5shiv.js +0 -7
- package/out/dependencies/reveal/plugin/multiplex/client.js +0 -13
- package/out/dependencies/reveal/plugin/multiplex/index.js +0 -64
- package/out/dependencies/reveal/plugin/multiplex/master.js +0 -34
- package/out/dependencies/reveal/plugin/multiplex/package.json +0 -19
- package/out/dependencies/reveal/plugin/notes/notes.html +0 -792
- package/out/dependencies/reveal/plugin/notes/plugin.js +0 -261
- package/out/dependencies/reveal/plugin/notes/speaker-view.html +0 -891
- package/out/dependencies/reveal/plugin/notes-server/client.js +0 -65
- package/out/dependencies/reveal/plugin/notes-server/index.js +0 -69
- package/out/dependencies/reveal/plugin/notes-server/notes.html +0 -585
- package/out/dependencies/reveal/plugin/print-pdf/print-pdf.js +0 -67
- package/out/dependencies/reveal/plugin/search/plugin.js +0 -243
- package/out/dependencies/reveal/plugin/search/search.js +0 -7
- package/out/dependencies/reveal/plugin/zoom/plugin.js +0 -264
- package/out/dependencies/reveal/plugin/zoom/zoom.js +0 -11
- package/out/dependencies/reveal/plugin/zoom-js/zoom.js +0 -272
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
|
|
3
|
-
// don't emit events from inside the previews themselves
|
|
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' );
|
|
20
|
-
|
|
21
|
-
var messageData = {
|
|
22
|
-
notes: '',
|
|
23
|
-
markdown: false,
|
|
24
|
-
socketId: socketId,
|
|
25
|
-
state: Reveal.getState()
|
|
26
|
-
};
|
|
27
|
-
|
|
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';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
socket.emit( 'statechanged', messageData );
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// When a new notes window connects, post our current state
|
|
44
|
-
socket.on( 'new-subscriber', function( data ) {
|
|
45
|
-
post();
|
|
46
|
-
} );
|
|
47
|
-
|
|
48
|
-
// When the state changes from inside of the speaker view
|
|
49
|
-
socket.on( 'statechanged-speaker', function( data ) {
|
|
50
|
-
Reveal.setState( data.state );
|
|
51
|
-
} );
|
|
52
|
-
|
|
53
|
-
// Monitor events that trigger a change in state
|
|
54
|
-
Reveal.addEventListener( 'slidechanged', post );
|
|
55
|
-
Reveal.addEventListener( 'fragmentshown', post );
|
|
56
|
-
Reveal.addEventListener( 'fragmenthidden', post );
|
|
57
|
-
Reveal.addEventListener( 'overviewhidden', post );
|
|
58
|
-
Reveal.addEventListener( 'overviewshown', post );
|
|
59
|
-
Reveal.addEventListener( 'paused', post );
|
|
60
|
-
Reveal.addEventListener( 'resumed', post );
|
|
61
|
-
|
|
62
|
-
// Post the initial state
|
|
63
|
-
post();
|
|
64
|
-
|
|
65
|
-
}());
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var http = require('http');
|
|
2
|
-
var express = require('express');
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
var io = require('socket.io');
|
|
5
|
-
var Mustache = require('mustache');
|
|
6
|
-
|
|
7
|
-
var app = express();
|
|
8
|
-
var staticDir = express.static;
|
|
9
|
-
var server = http.createServer(app);
|
|
10
|
-
|
|
11
|
-
io = io(server);
|
|
12
|
-
|
|
13
|
-
var opts = {
|
|
14
|
-
port : 1947,
|
|
15
|
-
baseDir : __dirname + '/../../'
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
io.on( 'connection', function( socket ) {
|
|
19
|
-
|
|
20
|
-
socket.on( 'new-subscriber', function( data ) {
|
|
21
|
-
socket.broadcast.emit( 'new-subscriber', data );
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
socket.on( 'statechanged', function( data ) {
|
|
25
|
-
delete data.state.overview;
|
|
26
|
-
socket.broadcast.emit( 'statechanged', data );
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
socket.on( 'statechanged-speaker', function( data ) {
|
|
30
|
-
delete data.state.overview;
|
|
31
|
-
socket.broadcast.emit( 'statechanged-speaker', data );
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
[ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) {
|
|
37
|
-
app.use( '/' + dir, staticDir( opts.baseDir + dir ) );
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
app.get('/', function( req, res ) {
|
|
41
|
-
|
|
42
|
-
res.writeHead( 200, { 'Content-Type': 'text/html' } );
|
|
43
|
-
fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res );
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
app.get( '/notes/:socketId', function( req, res ) {
|
|
48
|
-
|
|
49
|
-
fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) {
|
|
50
|
-
res.send( Mustache.to_html( data.toString(), {
|
|
51
|
-
socketId : req.params.socketId
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Actually listen
|
|
58
|
-
server.listen( opts.port || null );
|
|
59
|
-
|
|
60
|
-
var brown = '\033[33m',
|
|
61
|
-
green = '\033[32m',
|
|
62
|
-
reset = '\033[0m';
|
|
63
|
-
|
|
64
|
-
var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' );
|
|
65
|
-
|
|
66
|
-
console.log( brown + 'reveal.js - Speaker Notes' + reset );
|
|
67
|
-
console.log( '1. Open the slides at ' + green + slidesLocation + reset );
|
|
68
|
-
console.log( '2. Click on the link in your JS console to go to the notes page' );
|
|
69
|
-
console.log( '3. Advance through your slides and your notes will advance automatically' );
|
|
@@ -1,585 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
|
|
6
|
-
<title>reveal.js - Slide Notes</title>
|
|
7
|
-
|
|
8
|
-
<style>
|
|
9
|
-
body {
|
|
10
|
-
font-family: Helvetica;
|
|
11
|
-
font-size: 18px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
#current-slide,
|
|
15
|
-
#upcoming-slide,
|
|
16
|
-
#speaker-controls {
|
|
17
|
-
padding: 6px;
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
-moz-box-sizing: border-box;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#current-slide iframe,
|
|
23
|
-
#upcoming-slide iframe {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
border: 1px solid #ddd;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#current-slide .label,
|
|
30
|
-
#upcoming-slide .label {
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 10px;
|
|
33
|
-
left: 10px;
|
|
34
|
-
z-index: 2;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.overlay-element {
|
|
38
|
-
height: 34px;
|
|
39
|
-
line-height: 34px;
|
|
40
|
-
padding: 0 10px;
|
|
41
|
-
text-shadow: none;
|
|
42
|
-
background: rgba( 220, 220, 220, 0.8 );
|
|
43
|
-
color: #222;
|
|
44
|
-
font-size: 14px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.overlay-element.interactive:hover {
|
|
48
|
-
background: rgba( 220, 220, 220, 1 );
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
#current-slide {
|
|
52
|
-
position: absolute;
|
|
53
|
-
width: 60%;
|
|
54
|
-
height: 100%;
|
|
55
|
-
top: 0;
|
|
56
|
-
left: 0;
|
|
57
|
-
padding-right: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
#upcoming-slide {
|
|
61
|
-
position: absolute;
|
|
62
|
-
width: 40%;
|
|
63
|
-
height: 40%;
|
|
64
|
-
right: 0;
|
|
65
|
-
top: 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* Speaker controls */
|
|
69
|
-
#speaker-controls {
|
|
70
|
-
position: absolute;
|
|
71
|
-
top: 40%;
|
|
72
|
-
right: 0;
|
|
73
|
-
width: 40%;
|
|
74
|
-
height: 60%;
|
|
75
|
-
overflow: auto;
|
|
76
|
-
font-size: 18px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.speaker-controls-time.hidden,
|
|
80
|
-
.speaker-controls-notes.hidden {
|
|
81
|
-
display: none;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.speaker-controls-time .label,
|
|
85
|
-
.speaker-controls-notes .label {
|
|
86
|
-
text-transform: uppercase;
|
|
87
|
-
font-weight: normal;
|
|
88
|
-
font-size: 0.66em;
|
|
89
|
-
color: #666;
|
|
90
|
-
margin: 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.speaker-controls-time {
|
|
94
|
-
border-bottom: 1px solid rgba( 200, 200, 200, 0.5 );
|
|
95
|
-
margin-bottom: 10px;
|
|
96
|
-
padding: 10px 16px;
|
|
97
|
-
padding-bottom: 20px;
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.speaker-controls-time .reset-button {
|
|
102
|
-
opacity: 0;
|
|
103
|
-
float: right;
|
|
104
|
-
color: #666;
|
|
105
|
-
text-decoration: none;
|
|
106
|
-
}
|
|
107
|
-
.speaker-controls-time:hover .reset-button {
|
|
108
|
-
opacity: 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.speaker-controls-time .timer,
|
|
112
|
-
.speaker-controls-time .clock {
|
|
113
|
-
width: 50%;
|
|
114
|
-
font-size: 1.9em;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.speaker-controls-time .timer {
|
|
118
|
-
float: left;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.speaker-controls-time .clock {
|
|
122
|
-
float: right;
|
|
123
|
-
text-align: right;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.speaker-controls-time span.mute {
|
|
127
|
-
color: #bbb;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.speaker-controls-notes {
|
|
131
|
-
padding: 10px 16px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.speaker-controls-notes .value {
|
|
135
|
-
margin-top: 5px;
|
|
136
|
-
line-height: 1.4;
|
|
137
|
-
font-size: 1.2em;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/* Layout selector */
|
|
141
|
-
#speaker-layout {
|
|
142
|
-
position: absolute;
|
|
143
|
-
top: 10px;
|
|
144
|
-
right: 10px;
|
|
145
|
-
color: #222;
|
|
146
|
-
z-index: 10;
|
|
147
|
-
}
|
|
148
|
-
#speaker-layout select {
|
|
149
|
-
position: absolute;
|
|
150
|
-
width: 100%;
|
|
151
|
-
height: 100%;
|
|
152
|
-
top: 0;
|
|
153
|
-
left: 0;
|
|
154
|
-
border: 0;
|
|
155
|
-
box-shadow: 0;
|
|
156
|
-
cursor: pointer;
|
|
157
|
-
opacity: 0;
|
|
158
|
-
|
|
159
|
-
font-size: 1em;
|
|
160
|
-
background-color: transparent;
|
|
161
|
-
|
|
162
|
-
-moz-appearance: none;
|
|
163
|
-
-webkit-appearance: none;
|
|
164
|
-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
#speaker-layout select:focus {
|
|
168
|
-
outline: none;
|
|
169
|
-
box-shadow: none;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.clear {
|
|
173
|
-
clear: both;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* Speaker layout: Wide */
|
|
177
|
-
body[data-speaker-layout="wide"] #current-slide,
|
|
178
|
-
body[data-speaker-layout="wide"] #upcoming-slide {
|
|
179
|
-
width: 50%;
|
|
180
|
-
height: 45%;
|
|
181
|
-
padding: 6px;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
body[data-speaker-layout="wide"] #current-slide {
|
|
185
|
-
top: 0;
|
|
186
|
-
left: 0;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
body[data-speaker-layout="wide"] #upcoming-slide {
|
|
190
|
-
top: 0;
|
|
191
|
-
left: 50%;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
body[data-speaker-layout="wide"] #speaker-controls {
|
|
195
|
-
top: 45%;
|
|
196
|
-
left: 0;
|
|
197
|
-
width: 100%;
|
|
198
|
-
height: 50%;
|
|
199
|
-
font-size: 1.25em;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/* Speaker layout: Tall */
|
|
203
|
-
body[data-speaker-layout="tall"] #current-slide,
|
|
204
|
-
body[data-speaker-layout="tall"] #upcoming-slide {
|
|
205
|
-
width: 45%;
|
|
206
|
-
height: 50%;
|
|
207
|
-
padding: 6px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
body[data-speaker-layout="tall"] #current-slide {
|
|
211
|
-
top: 0;
|
|
212
|
-
left: 0;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
body[data-speaker-layout="tall"] #upcoming-slide {
|
|
216
|
-
top: 50%;
|
|
217
|
-
left: 0;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
body[data-speaker-layout="tall"] #speaker-controls {
|
|
221
|
-
padding-top: 40px;
|
|
222
|
-
top: 0;
|
|
223
|
-
left: 45%;
|
|
224
|
-
width: 55%;
|
|
225
|
-
height: 100%;
|
|
226
|
-
font-size: 1.25em;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/* Speaker layout: Notes only */
|
|
230
|
-
body[data-speaker-layout="notes-only"] #current-slide,
|
|
231
|
-
body[data-speaker-layout="notes-only"] #upcoming-slide {
|
|
232
|
-
display: none;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
body[data-speaker-layout="notes-only"] #speaker-controls {
|
|
236
|
-
padding-top: 40px;
|
|
237
|
-
top: 0;
|
|
238
|
-
left: 0;
|
|
239
|
-
width: 100%;
|
|
240
|
-
height: 100%;
|
|
241
|
-
font-size: 1.25em;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
</style>
|
|
245
|
-
</head>
|
|
246
|
-
|
|
247
|
-
<body>
|
|
248
|
-
|
|
249
|
-
<div id="current-slide"></div>
|
|
250
|
-
<div id="upcoming-slide"><span class="overlay-element label">Upcoming</span></div>
|
|
251
|
-
<div id="speaker-controls">
|
|
252
|
-
<div class="speaker-controls-time">
|
|
253
|
-
<h4 class="label">Time <span class="reset-button">Click to Reset</span></h4>
|
|
254
|
-
<div class="clock">
|
|
255
|
-
<span class="clock-value">0:00 AM</span>
|
|
256
|
-
</div>
|
|
257
|
-
<div class="timer">
|
|
258
|
-
<span class="hours-value">00</span><span class="minutes-value">:00</span><span class="seconds-value">:00</span>
|
|
259
|
-
</div>
|
|
260
|
-
<div class="clear"></div>
|
|
261
|
-
</div>
|
|
262
|
-
|
|
263
|
-
<div class="speaker-controls-notes hidden">
|
|
264
|
-
<h4 class="label">Notes</h4>
|
|
265
|
-
<div class="value"></div>
|
|
266
|
-
</div>
|
|
267
|
-
</div>
|
|
268
|
-
<div id="speaker-layout" class="overlay-element interactive">
|
|
269
|
-
<span class="speaker-layout-label"></span>
|
|
270
|
-
<select class="speaker-layout-dropdown"></select>
|
|
271
|
-
</div>
|
|
272
|
-
|
|
273
|
-
<script src="/socket.io/socket.io.js"></script>
|
|
274
|
-
<script src="/plugin/markdown/marked.js"></script>
|
|
275
|
-
|
|
276
|
-
<script>
|
|
277
|
-
(function() {
|
|
278
|
-
|
|
279
|
-
var notes,
|
|
280
|
-
notesValue,
|
|
281
|
-
currentState,
|
|
282
|
-
currentSlide,
|
|
283
|
-
upcomingSlide,
|
|
284
|
-
layoutLabel,
|
|
285
|
-
layoutDropdown,
|
|
286
|
-
connected = false;
|
|
287
|
-
|
|
288
|
-
var socket = io.connect( window.location.origin ),
|
|
289
|
-
socketId = '{{socketId}}';
|
|
290
|
-
|
|
291
|
-
var SPEAKER_LAYOUTS = {
|
|
292
|
-
'default': 'Default',
|
|
293
|
-
'wide': 'Wide',
|
|
294
|
-
'tall': 'Tall',
|
|
295
|
-
'notes-only': 'Notes only'
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
socket.on( 'statechanged', function( data ) {
|
|
299
|
-
|
|
300
|
-
// ignore data from sockets that aren't ours
|
|
301
|
-
if( data.socketId !== socketId ) { return; }
|
|
302
|
-
|
|
303
|
-
if( connected === false ) {
|
|
304
|
-
connected = true;
|
|
305
|
-
|
|
306
|
-
setupKeyboard();
|
|
307
|
-
setupNotes();
|
|
308
|
-
setupTimer();
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
handleStateMessage( data );
|
|
313
|
-
|
|
314
|
-
} );
|
|
315
|
-
|
|
316
|
-
setupLayout();
|
|
317
|
-
|
|
318
|
-
// Load our presentation iframes
|
|
319
|
-
setupIframes();
|
|
320
|
-
|
|
321
|
-
// Once the iframes have loaded, emit a signal saying there's
|
|
322
|
-
// a new subscriber which will trigger a 'statechanged'
|
|
323
|
-
// message to be sent back
|
|
324
|
-
window.addEventListener( 'message', function( event ) {
|
|
325
|
-
|
|
326
|
-
var data = JSON.parse( event.data );
|
|
327
|
-
|
|
328
|
-
if( data && data.namespace === 'reveal' ) {
|
|
329
|
-
if( /ready/.test( data.eventName ) ) {
|
|
330
|
-
socket.emit( 'new-subscriber', { socketId: socketId } );
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// Messages sent by reveal.js inside of the current slide preview
|
|
335
|
-
if( data && data.namespace === 'reveal' ) {
|
|
336
|
-
if( /slidechanged|fragmentshown|fragmenthidden|overviewshown|overviewhidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
|
|
337
|
-
socket.emit( 'statechanged-speaker', { state: data.state } );
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
} );
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Called when the main window sends an updated state.
|
|
345
|
-
*/
|
|
346
|
-
function handleStateMessage( data ) {
|
|
347
|
-
|
|
348
|
-
// Store the most recently set state to avoid circular loops
|
|
349
|
-
// applying the same state
|
|
350
|
-
currentState = JSON.stringify( data.state );
|
|
351
|
-
|
|
352
|
-
// No need for updating the notes in case of fragment changes
|
|
353
|
-
if ( data.notes ) {
|
|
354
|
-
notes.classList.remove( 'hidden' );
|
|
355
|
-
if( data.markdown ) {
|
|
356
|
-
notesValue.innerHTML = marked( data.notes );
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
notesValue.innerHTML = data.notes;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
notes.classList.add( 'hidden' );
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// Update the note slides
|
|
367
|
-
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
|
|
368
|
-
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
|
|
369
|
-
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'next' }), '*' );
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
// Limit to max one state update per X ms
|
|
374
|
-
handleStateMessage = debounce( handleStateMessage, 200 );
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Forward keyboard events to the current slide window.
|
|
378
|
-
* This enables keyboard events to work even if focus
|
|
379
|
-
* isn't set on the current slide iframe.
|
|
380
|
-
*/
|
|
381
|
-
function setupKeyboard() {
|
|
382
|
-
|
|
383
|
-
document.addEventListener( 'keydown', function( event ) {
|
|
384
|
-
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
|
|
385
|
-
} );
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Creates the preview iframes.
|
|
391
|
-
*/
|
|
392
|
-
function setupIframes() {
|
|
393
|
-
|
|
394
|
-
var params = [
|
|
395
|
-
'receiver',
|
|
396
|
-
'progress=false',
|
|
397
|
-
'history=false',
|
|
398
|
-
'transition=none',
|
|
399
|
-
'backgroundTransition=none'
|
|
400
|
-
].join( '&' );
|
|
401
|
-
|
|
402
|
-
var currentURL = '/?' + params + '&postMessageEvents=true';
|
|
403
|
-
var upcomingURL = '/?' + params + '&controls=false';
|
|
404
|
-
|
|
405
|
-
currentSlide = document.createElement( 'iframe' );
|
|
406
|
-
currentSlide.setAttribute( 'width', 1280 );
|
|
407
|
-
currentSlide.setAttribute( 'height', 1024 );
|
|
408
|
-
currentSlide.setAttribute( 'src', currentURL );
|
|
409
|
-
document.querySelector( '#current-slide' ).appendChild( currentSlide );
|
|
410
|
-
|
|
411
|
-
upcomingSlide = document.createElement( 'iframe' );
|
|
412
|
-
upcomingSlide.setAttribute( 'width', 640 );
|
|
413
|
-
upcomingSlide.setAttribute( 'height', 512 );
|
|
414
|
-
upcomingSlide.setAttribute( 'src', upcomingURL );
|
|
415
|
-
document.querySelector( '#upcoming-slide' ).appendChild( upcomingSlide );
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Setup the notes UI.
|
|
421
|
-
*/
|
|
422
|
-
function setupNotes() {
|
|
423
|
-
|
|
424
|
-
notes = document.querySelector( '.speaker-controls-notes' );
|
|
425
|
-
notesValue = document.querySelector( '.speaker-controls-notes .value' );
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Create the timer and clock and start updating them
|
|
431
|
-
* at an interval.
|
|
432
|
-
*/
|
|
433
|
-
function setupTimer() {
|
|
434
|
-
|
|
435
|
-
var start = new Date(),
|
|
436
|
-
timeEl = document.querySelector( '.speaker-controls-time' ),
|
|
437
|
-
clockEl = timeEl.querySelector( '.clock-value' ),
|
|
438
|
-
hoursEl = timeEl.querySelector( '.hours-value' ),
|
|
439
|
-
minutesEl = timeEl.querySelector( '.minutes-value' ),
|
|
440
|
-
secondsEl = timeEl.querySelector( '.seconds-value' );
|
|
441
|
-
|
|
442
|
-
function _updateTimer() {
|
|
443
|
-
|
|
444
|
-
var diff, hours, minutes, seconds,
|
|
445
|
-
now = new Date();
|
|
446
|
-
|
|
447
|
-
diff = now.getTime() - start.getTime();
|
|
448
|
-
hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
|
|
449
|
-
minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
|
|
450
|
-
seconds = Math.floor( ( diff / 1000 ) % 60 );
|
|
451
|
-
|
|
452
|
-
clockEl.innerHTML = now.toLocaleTimeString( 'en-US', { hour12: true, hour: '2-digit', minute:'2-digit' } );
|
|
453
|
-
hoursEl.innerHTML = zeroPadInteger( hours );
|
|
454
|
-
hoursEl.className = hours > 0 ? '' : 'mute';
|
|
455
|
-
minutesEl.innerHTML = ':' + zeroPadInteger( minutes );
|
|
456
|
-
minutesEl.className = minutes > 0 ? '' : 'mute';
|
|
457
|
-
secondsEl.innerHTML = ':' + zeroPadInteger( seconds );
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
// Update once directly
|
|
462
|
-
_updateTimer();
|
|
463
|
-
|
|
464
|
-
// Then update every second
|
|
465
|
-
setInterval( _updateTimer, 1000 );
|
|
466
|
-
|
|
467
|
-
timeEl.addEventListener( 'click', function() {
|
|
468
|
-
start = new Date();
|
|
469
|
-
_updateTimer();
|
|
470
|
-
return false;
|
|
471
|
-
} );
|
|
472
|
-
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Sets up the speaker view layout and layout selector.
|
|
477
|
-
*/
|
|
478
|
-
function setupLayout() {
|
|
479
|
-
|
|
480
|
-
layoutDropdown = document.querySelector( '.speaker-layout-dropdown' );
|
|
481
|
-
layoutLabel = document.querySelector( '.speaker-layout-label' );
|
|
482
|
-
|
|
483
|
-
// Render the list of available layouts
|
|
484
|
-
for( var id in SPEAKER_LAYOUTS ) {
|
|
485
|
-
var option = document.createElement( 'option' );
|
|
486
|
-
option.setAttribute( 'value', id );
|
|
487
|
-
option.textContent = SPEAKER_LAYOUTS[ id ];
|
|
488
|
-
layoutDropdown.appendChild( option );
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
// Monitor the dropdown for changes
|
|
492
|
-
layoutDropdown.addEventListener( 'change', function( event ) {
|
|
493
|
-
|
|
494
|
-
setLayout( layoutDropdown.value );
|
|
495
|
-
|
|
496
|
-
}, false );
|
|
497
|
-
|
|
498
|
-
// Restore any currently persisted layout
|
|
499
|
-
setLayout( getLayout() );
|
|
500
|
-
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Sets a new speaker view layout. The layout is persisted
|
|
505
|
-
* in local storage.
|
|
506
|
-
*/
|
|
507
|
-
function setLayout( value ) {
|
|
508
|
-
|
|
509
|
-
var title = SPEAKER_LAYOUTS[ value ];
|
|
510
|
-
|
|
511
|
-
layoutLabel.innerHTML = 'Layout' + ( title ? ( ': ' + title ) : '' );
|
|
512
|
-
layoutDropdown.value = value;
|
|
513
|
-
|
|
514
|
-
document.body.setAttribute( 'data-speaker-layout', value );
|
|
515
|
-
|
|
516
|
-
// Persist locally
|
|
517
|
-
if( window.localStorage ) {
|
|
518
|
-
window.localStorage.setItem( 'reveal-speaker-layout', value );
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Returns the ID of the most recently set speaker layout
|
|
525
|
-
* or our default layout if none has been set.
|
|
526
|
-
*/
|
|
527
|
-
function getLayout() {
|
|
528
|
-
|
|
529
|
-
if( window.localStorage ) {
|
|
530
|
-
var layout = window.localStorage.getItem( 'reveal-speaker-layout' );
|
|
531
|
-
if( layout ) {
|
|
532
|
-
return layout;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// Default to the first record in the layouts hash
|
|
537
|
-
for( var id in SPEAKER_LAYOUTS ) {
|
|
538
|
-
return id;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
function zeroPadInteger( num ) {
|
|
544
|
-
|
|
545
|
-
var str = '00' + parseInt( num );
|
|
546
|
-
return str.substring( str.length - 2 );
|
|
547
|
-
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Limits the frequency at which a function can be called.
|
|
552
|
-
*/
|
|
553
|
-
function debounce( fn, ms ) {
|
|
554
|
-
|
|
555
|
-
var lastTime = 0,
|
|
556
|
-
timeout;
|
|
557
|
-
|
|
558
|
-
return function() {
|
|
559
|
-
|
|
560
|
-
var args = arguments;
|
|
561
|
-
var context = this;
|
|
562
|
-
|
|
563
|
-
clearTimeout( timeout );
|
|
564
|
-
|
|
565
|
-
var timeSinceLastCall = Date.now() - lastTime;
|
|
566
|
-
if( timeSinceLastCall > ms ) {
|
|
567
|
-
fn.apply( context, args );
|
|
568
|
-
lastTime = Date.now();
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
timeout = setTimeout( function() {
|
|
572
|
-
fn.apply( context, args );
|
|
573
|
-
lastTime = Date.now();
|
|
574
|
-
}, ms - timeSinceLastCall );
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
})();
|
|
582
|
-
</script>
|
|
583
|
-
|
|
584
|
-
</body>
|
|
585
|
-
</html>
|