...
 
Commits (99)
......@@ -8,6 +8,7 @@ out/
log/*.log
tmp/**
node_modules/
package-lock.json
.sass-cache
css/reveal.min.css
js/reveal.min.js
\ No newline at end of file
js/reveal.min.js
language: node_js
node_js:
- 4
before_script:
- npm install -g grunt-cli
after_script:
- grunt retire
- npm run build -- retire
......@@ -15,7 +15,7 @@ module.exports = function(grunt) {
' * http://revealjs.com\n' +
' * MIT licensed\n' +
' *\n' +
' * Copyright (C) 2017 Hakim El Hattab, http://hakim.se\n' +
' * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n' +
' */'
},
......@@ -26,7 +26,7 @@ module.exports = function(grunt) {
uglify: {
options: {
banner: '<%= meta.banner %>\n',
screwIE8: false
ie8: true
},
build: {
src: 'js/reveal.js',
......@@ -78,6 +78,7 @@ module.exports = function(grunt) {
eqnull: true,
browser: true,
expr: true,
loopfunc: true,
globals: {
head: false,
module: false,
......@@ -164,7 +165,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks( 'grunt-retire' );
grunt.loadNpmTasks( 'grunt-sass' );
grunt.loadNpmTasks( 'grunt-zip' );
// Default task
grunt.registerTask( 'default', [ 'css', 'js' ] );
......
Copyright (C) 2017 Hakim El Hattab, http://hakim.se, and reveal.js contributors
Copyright (C) 2018 Hakim El Hattab, http://hakim.se, and reveal.js contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
This diff is collapsed.
{
"name": "reveal.js",
"version": "3.6.0",
"version": "3.7.0",
"main": [
"js/reveal.js",
"css/reveal.css"
......
......@@ -72,15 +72,8 @@ ul, ol, div, p {
overflow: visible;
display: block;
-webkit-perspective: none;
-moz-perspective: none;
-ms-perspective: none;
perspective: none;
-webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */
-moz-perspective-origin: 50% 50%;
-ms-perspective-origin: 50% 50%;
perspective-origin: 50% 50%;
perspective: none;
perspective-origin: 50% 50%;
}
.reveal .slides .pdf-page {
......@@ -103,15 +96,8 @@ ul, ol, div, p {
opacity: 1 !important;
-webkit-transform-style: flat !important;
-moz-transform-style: flat !important;
-ms-transform-style: flat !important;
transform-style: flat !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
transform: none !important;
transform-style: flat !important;
transform: none !important;
}
.reveal section.stack {
......
......@@ -3,7 +3,7 @@
* http://revealjs.com
* MIT licensed
*
* Copyright (C) 2017 Hakim El Hattab, http://hakim.se
* Copyright (C) 2018 Hakim El Hattab, http://hakim.se
*/
/*********************************************
* RESET STYLES
......@@ -127,13 +127,25 @@ body {
-webkit-transform: translate(0, 0);
transform: translate(0, 0); }
.reveal .slides section .fragment.fade-in-then-out,
.reveal .slides section .fragment.current-visible {
opacity: 0;
visibility: hidden; }
.reveal .slides section .fragment.fade-in-then-out.current-fragment,
.reveal .slides section .fragment.current-visible.current-fragment {
opacity: 1;
visibility: inherit; }
.reveal .slides section .fragment.fade-in-then-semi-out {
opacity: 0;
visibility: hidden; }
.reveal .slides section .fragment.fade-in-then-semi-out.visible {
opacity: 0.5;
visibility: inherit; }
.reveal .slides section .fragment.fade-in-then-semi-out.current-fragment {
opacity: 1;
visibility: inherit; }
.reveal .slides section .fragment.highlight-red,
.reveal .slides section .fragment.highlight-current-red,
.reveal .slides section .fragment.highlight-green,
......@@ -448,7 +460,7 @@ body {
* SLIDE NUMBER
*********************************************/
.reveal .slide-number {
position: fixed;
position: absolute;
display: block;
right: 8px;
bottom: 8px;
......@@ -460,6 +472,9 @@ body {
background-color: rgba(0, 0, 0, 0.4);
padding: 5px; }
.reveal .slide-number a {
color: currentColor; }
.reveal .slide-number-delimiter {
margin: 0 3px; }
......@@ -528,7 +543,8 @@ body {
.reveal .slides > section.stack {
padding-top: 0;
padding-bottom: 0; }
padding-bottom: 0;
pointer-events: none; }
.reveal .slides > section.present,
.reveal .slides > section > section.present {
......@@ -948,6 +964,21 @@ body {
z-index: 100;
transition: all 1s ease; }
.reveal .pause-overlay .resume-button {
position: absolute;
bottom: 20px;
right: 20px;
color: #ccc;
border-radius: 2px;
padding: 6px 14px;
border: 2px solid #ccc;
font-size: 16px;
background: transparent;
cursor: pointer; }
.reveal .pause-overlay .resume-button:hover {
color: #fff;
border-color: #fff; }
.reveal.paused .pause-overlay {
visibility: visible;
opacity: 1; }
......@@ -1011,10 +1042,15 @@ body {
visibility: hidden;
overflow: hidden;
background-color: transparent;
transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
.reveal .slide-background-content {
position: absolute;
width: 100%;
height: 100%;
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
background-size: cover; }
.reveal .slide-background.stack {
display: block; }
......
......@@ -3,7 +3,7 @@
* http://revealjs.com
* MIT licensed
*
* Copyright (C) 2017 Hakim El Hattab, http://hakim.se
* Copyright (C) 2018 Hakim El Hattab, http://hakim.se
*/
......@@ -160,6 +160,7 @@ body {
}
}
.reveal .slides section .fragment.fade-in-then-out,
.reveal .slides section .fragment.current-visible {
opacity: 0;
visibility: hidden;
......@@ -170,6 +171,21 @@ body {
}
}
.reveal .slides section .fragment.fade-in-then-semi-out {
opacity: 0;
visibility: hidden;
&.visible {
opacity: 0.5;
visibility: inherit;
}
&.current-fragment {
opacity: 1;
visibility: inherit;
}
}
.reveal .slides section .fragment.highlight-red,
.reveal .slides section .fragment.highlight-current-red,
.reveal .slides section .fragment.highlight-green,
......@@ -540,7 +556,7 @@ $controlsArrowAngleActive: 36deg;
*********************************************/
.reveal .slide-number {
position: fixed;
position: absolute;
display: block;
right: 8px;
bottom: 8px;
......@@ -553,6 +569,10 @@ $controlsArrowAngleActive: 36deg;
padding: 5px;
}
.reveal .slide-number a {
color: currentColor;
}
.reveal .slide-number-delimiter {
margin: 0 3px;
}
......@@ -636,6 +656,7 @@ $controlsArrowAngleActive: 36deg;
.reveal .slides>section.stack {
padding-top: 0;
padding-bottom: 0;
pointer-events: none;
}
.reveal .slides>section.present,
......@@ -1013,6 +1034,25 @@ $controlsArrowAngleActive: 36deg;
z-index: 100;
transition: all 1s ease;
}
.reveal .pause-overlay .resume-button {
position: absolute;
bottom: 20px;
right: 20px;
color: #ccc;
border-radius: 2px;
padding: 6px 14px;
border: 2px solid #ccc;
font-size: 16px;
background: transparent;
cursor: pointer;
&:hover {
color: #fff;
border-color: #fff;
}
}
.reveal.paused .pause-overlay {
visibility: visible;
opacity: 1;
......@@ -1086,11 +1126,18 @@ $controlsArrowAngleActive: 36deg;
overflow: hidden;
background-color: rgba( 0, 0, 0, 0 );
transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
}
.reveal .slide-background-content {
position: absolute;
width: 100%;
height: 100%;
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
}
.reveal .slide-background.stack {
......
......@@ -34,8 +34,8 @@ body {
background: rgba(79, 64, 28, 0.99);
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -193,10 +193,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -266,3 +268,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #f7f3de; } }
......@@ -30,8 +30,8 @@ body {
background: #bee4fd;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -189,10 +189,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -262,3 +264,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #222; } }
......@@ -33,8 +33,8 @@ body {
background: #a23;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -192,10 +192,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -266,6 +268,13 @@ body {
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #222; } }
.reveal p {
font-weight: 300;
text-shadow: 1px 1px #222; }
......
......@@ -36,8 +36,8 @@ body {
background: #FF5E99;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -195,10 +195,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -268,3 +270,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #2b2b2b; } }
......@@ -34,8 +34,8 @@ body {
background: #d33682;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -193,10 +193,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -266,3 +268,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #002b36; } }
......@@ -28,8 +28,8 @@ body {
background: #e7ad52;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -187,10 +187,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -260,3 +262,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #111; } }
......@@ -30,8 +30,8 @@ body {
background: #26351C;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -189,10 +189,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -262,3 +264,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #F0F1EB; } }
......@@ -33,8 +33,8 @@ body {
background: rgba(0, 0, 0, 0.99);
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -192,10 +192,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -265,3 +267,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #fff; } }
......@@ -37,8 +37,8 @@ body {
background: #134674;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -196,10 +196,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -269,3 +271,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #f7fbfc; } }
......@@ -34,8 +34,8 @@ body {
background: #d33682;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -193,10 +193,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -266,3 +268,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #fdf6e3; } }
......@@ -28,8 +28,8 @@ body {
text-shadow: none;
}
.reveal .slides>section,
.reveal .slides>section>section {
.reveal .slides section,
.reveal .slides section>section {
line-height: 1.3;
font-weight: inherit;
}
......@@ -217,9 +217,11 @@ body {
.reveal sup {
vertical-align: super;
font-size: smaller;
}
.reveal sub {
vertical-align: sub;
font-size: smaller;
}
.reveal small {
......@@ -310,7 +312,14 @@ body {
.reveal .progress span {
-webkit-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
-moz-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
}
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: $backgroundColor;
}
}
......@@ -30,8 +30,8 @@ body {
background: #98bdef;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
.reveal .slides section,
.reveal .slides section > section {
line-height: 1.3;
font-weight: inherit; }
......@@ -189,10 +189,12 @@ body {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
vertical-align: super;
font-size: smaller; }
.reveal sub {
vertical-align: sub; }
vertical-align: sub;
font-size: smaller; }
.reveal small {
display: inline-block;
......@@ -262,3 +264,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
/*********************************************
* PRINT BACKGROUND
*********************************************/
@media print {
.backgrounds {
background-color: #fff; } }
......@@ -139,8 +139,14 @@
<p class="fragment grow">grow</p>
<p class="fragment shrink">shrink</p>
<p class="fragment fade-out">fade-out</p>
<p class="fragment fade-up">fade-up (also down, left and right!)</p>
<p class="fragment current-visible">current-visible</p>
<p>
<span style="display: inline-block;" class="fragment fade-right">fade-right, </span>
<span style="display: inline-block;" class="fragment fade-up">up, </span>
<span style="display: inline-block;" class="fragment fade-down">down, </span>
<span style="display: inline-block;" class="fragment fade-left">left</span>
</p>
<p class="fragment fade-in-then-out">fade-in-then-out</p>
<p class="fragment fade-in-then-semi-out">fade-in-then-semi-out</p>
<p>Highlight <span class="fragment highlight-red">red</span> <span class="fragment highlight-blue">blue</span> <span class="fragment highlight-green">green</span></p>
</section>
</section>
......
This diff is collapsed.
This diff is collapsed.
{
"name": "reveal.js",
"version": "3.6.0",
"version": "3.7.0",
"description": "The HTML Presentation Framework",
"homepage": "http://revealjs.com",
"subdomain": "revealjs",
......@@ -23,15 +23,15 @@
"node": ">=4.0.0"
},
"devDependencies": {
"express": "^4.15.2",
"express": "^4.16.2",
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-cli": "^1.2.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-cssmin": "^2.1.0",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-qunit": "~1.2.0",
"grunt-contrib-uglify": "^2.3.0",
"grunt-contrib-qunit": "^2.0.0",
"grunt-contrib-uglify": "^3.3.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-sass": "^2.0.0",
"grunt-retire": "^1.0.7",
......
......@@ -9,15 +9,15 @@ var RevealMath = window.RevealMath || (function(){
var options = Reveal.getConfig().math || {};
options.mathjax = options.mathjax || 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js';
options.config = options.config || 'TeX-AMS_HTML-full';
options.tex2jax = options.tex2jax || {
inlineMath: [['$','$'],['\\(','\\)']] ,
skipTags: ['script','noscript','style','textarea','pre'] };
loadScript( options.mathjax + '?config=' + options.config, function() {
MathJax.Hub.Config({
messageStyle: 'none',
tex2jax: {
inlineMath: [['$','$'],['\\(','\\)']] ,
skipTags: ['script','noscript','style','textarea','pre']
},
tex2jax: options.tex2jax,
skipStartupTypeset: true
});
......
......@@ -34,6 +34,22 @@
z-index: 2;
}
#connection-status {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 20;
padding: 30% 20% 20% 20%;
font-size: 18px;
color: #222;
background: #fff;
text-align: center;
box-sizing: border-box;
line-height: 1.4;
}
.overlay-element {
height: 34px;
line-height: 34px;
......@@ -288,6 +304,8 @@
<body>
<div id="connection-status">Loading speaker view...</div>
<div id="current-slide"></div>
<div id="upcoming-slide"><span class="overlay-element label">Upcoming</span></div>
<div id="speaker-controls">
......@@ -340,8 +358,16 @@
setupLayout();
var connectionStatus = document.querySelector( '#connection-status' );
var connectionTimeout = setTimeout( function() {
connectionStatus.innerHTML = 'Error connecting to main window.<br>Please try closing and reopening the speaker view.';
}, 5000 );
window.addEventListener( 'message', function( event ) {
clearTimeout( connectionTimeout );
connectionStatus.style.display = 'none';
var data = JSON.parse( event.data );
// The overview mode is only useful to the reveal.js instance
......@@ -427,10 +453,17 @@
* Forward keyboard events to the current slide window.
* This enables keyboard events to work even if focus
* isn't set on the current slide iframe.
*
* Block F5 default handling, it reloads and disconnects
* the speaker notes window.
*/
function setupKeyboard() {
document.addEventListener( 'keydown', function( event ) {
if( event.keyCode === 116 || ( event.metaKey && event.keyCode === 82 ) ) {
event.preventDefault();
return false;
}
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
} );
......
......@@ -21,8 +21,13 @@ var RevealNotes = (function() {
var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
if( !notesPopup ) {
alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
return;
}
// Allow popup window access to Reveal API
notesPopup.Reveal = this.Reveal;
notesPopup.Reveal = window.Reveal;
/**
* Connect to the notes window through a postmessage handshake.
......@@ -131,22 +136,9 @@ var RevealNotes = (function() {
}
// Open the notes when the 's' key is hit
document.addEventListener( 'keydown', function( event ) {
// Disregard the event if the target is editable or a
// modifier is present
if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
// Disregard the event if keyboard is disabled
if ( Reveal.getConfig().keyboard === false ) return;
if( event.keyCode === 83 ) {
event.preventDefault();
openNotes();
}
}, false );
// Show our keyboard shortcut in the reveal.js help overlay
if( window.Reveal ) Reveal.registerKeyboardShortcut( 'S', 'Speaker notes view' );
Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() {
openNotes();
} );
}
......
......@@ -42,28 +42,26 @@ probePage.open( inputFile, function( status ) {
printPage.open( inputFile, function( status ) {
console.log( 'Export PDF: Preparing pdf [3/4]')
printPage.evaluate(function() {
printPage.evaluate( function() {
Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom );
});
} );
} );
printPage.onCallback = function(data) {
printPage.onCallback = function( data ) {
// For some reason we need to "jump the queue" for syntax highlighting to work.
// See: http://stackoverflow.com/a/3580132/129269
setTimeout(function() {
setTimeout( function() {
console.log( 'Export PDF: Writing file [4/4]' );
printPage.render( outputFile );
console.log( 'Export PDF: Finished successfully!' );
phantom.exit();
}, 0);
}, 0 );
};
}
else {
console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' );
phantom.exit(1);
console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' );
phantom.exit( 1 );
}
}
} );
......@@ -19,92 +19,92 @@ var RevealSearch = (function() {
function Hilitor(id, tag)
{
var targetNode = document.getElementById(id) || document.body;
var hiliteTag = tag || "EM";
var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM)$");
var colors = ["#ff6", "#a0ffff", "#9f9", "#f99", "#f6f"];
var wordColor = [];
var colorIdx = 0;
var matchRegex = "";
var matchingSlides = [];
this.setRegex = function(input)
{
input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
matchRegex = new RegExp("(" + input + ")","i");
}
this.getRegex = function()
{
return matchRegex.toString().replace(/^\/\\b\(|\)\\b\/i$/g, "").replace(/\|/g, " ");
}
// recursively apply word highlighting
this.hiliteWords = function(node)
{
if(node == undefined || !node) return;
if(!matchRegex) return;
if(skipTags.test(node.nodeName)) return;
if(node.hasChildNodes()) {
for(var i=0; i < node.childNodes.length; i++)
this.hiliteWords(node.childNodes[i]);
}
if(node.nodeType == 3) { // NODE_TEXT
if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) {
//find the slide's section element and save it in our list of matching slides
var secnode = node;
while (secnode != null && secnode.nodeName != 'SECTION') {
secnode = secnode.parentNode;
}
var slideIndex = Reveal.getIndices(secnode);
var slidelen = matchingSlides.length;
var alreadyAdded = false;
for (var i=0; i < slidelen; i++) {
if ( (matchingSlides[i].h === slideIndex.h) && (matchingSlides[i].v === slideIndex.v) ) {
alreadyAdded = true;
}
}
if (! alreadyAdded) {
matchingSlides.push(slideIndex);
}
if(!wordColor[regs[0].toLowerCase()]) {
wordColor[regs[0].toLowerCase()] = colors[colorIdx++ % colors.length];
}
var match = document.createElement(hiliteTag);
match.appendChild(document.createTextNode(regs[0]));
match.style.backgroundColor = wordColor[regs[0].toLowerCase()];
match.style.fontStyle = "inherit";
match.style.color = "#000";
var after = node.splitText(regs.index);
after.nodeValue = after.nodeValue.substring(regs[0].length);
node.parentNode.insertBefore(match, after);
}
}
};
// remove highlighting
this.remove = function()
{
var arr = document.getElementsByTagName(hiliteTag);
while(arr.length && (el = arr[0])) {
el.parentNode.replaceChild(el.firstChild, el);
}
};
// start highlighting at target node
this.apply = function(input)
{
if(input == undefined || !input) return;
this.remove();
this.setRegex(input);
this.hiliteWords(targetNode);
return matchingSlides;
};
var targetNode = document.getElementById(id) || document.body;
var hiliteTag = tag || "EM";
var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM)$");
var colors = ["#ff6", "#a0ffff", "#9f9", "#f99", "#f6f"];
var wordColor = [];
var colorIdx = 0;
var matchRegex = "";
var matchingSlides = [];
this.setRegex = function(input)
{
input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
matchRegex = new RegExp("(" + input + ")","i");
}
this.getRegex = function()
{
return matchRegex.toString().replace(/^\/\\b\(|\)\\b\/i$/g, "").replace(/\|/g, " ");
}
// recursively apply word highlighting
this.hiliteWords = function(node)
{
if(node == undefined || !node) return;
if(!matchRegex) return;
if(skipTags.test(node.nodeName)) return;
if(node.hasChildNodes()) {
for(var i=0; i < node.childNodes.length; i++)
this.hiliteWords(node.childNodes[i]);
}
if(node.nodeType == 3) { // NODE_TEXT
if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) {
//find the slide's section element and save it in our list of matching slides
var secnode = node;
while (secnode != null && secnode.nodeName != 'SECTION') {
secnode = secnode.parentNode;
}
var slideIndex = Reveal.getIndices(secnode);
var slidelen = matchingSlides.length;
var alreadyAdded = false;
for (var i=0; i < slidelen; i++) {
if ( (matchingSlides[i].h === slideIndex.h) && (matchingSlides[i].v === slideIndex.v) ) {
alreadyAdded = true;
}
}
if (! alreadyAdded) {
matchingSlides.push(slideIndex);
}
if(!wordColor[regs[0].toLowerCase()]) {
wordColor[regs[0].toLowerCase()] = colors[colorIdx++ % colors.length];
}
var match = document.createElement(hiliteTag);
match.appendChild(document.createTextNode(regs[0]));
match.style.backgroundColor = wordColor[regs[0].toLowerCase()];
match.style.fontStyle = "inherit";
match.style.color = "#000";
var after = node.splitText(regs.index);
after.nodeValue = after.nodeValue.substring(regs[0].length);
node.parentNode.insertBefore(match, after);
}
}
};
// remove highlighting
this.remove = function()
{
var arr = document.getElementsByTagName(hiliteTag);
while(arr.length && (el = arr[0])) {
el.parentNode.replaceChild(el.firstChild, el);
}
};
// start highlighting at target node
this.apply = function(input)
{
if(input == undefined || !input) return;
this.remove();
this.setRegex(input);