Skip to content

Commit

Permalink
Merge branch 'master' of github.com:phdenzel/reveal.js
Browse files Browse the repository at this point in the history
* 'master' of github.com:phdenzel/reveal.js:
  remove doppler
  fix merge error, closes hakimel#3277
  prevent extra \n at end of single notes hakimel#3010
  fix issue were auto-animate could interfere with inherited line-height
  fix issue with past/future vertical slides remaining visible in Safari 15.4 (closes hakimel#3164)
  update browserlist from '> 0.5%, IE 11, not dead' to '> 2%, not dead' hakimel#2985
  Add generated files
  Support multiple aside notes elements per slide
  • Loading branch information
phdenzel committed Jan 9, 2023
2 parents 1776005 + 5d13886 commit e6d136f
Show file tree
Hide file tree
Showing 25 changed files with 105 additions and 59 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ Hakim's open source work is supported by <a href="https://github.com/sponsors/ha
</div>
</a>
</td>
<td align="center">
<a href="https://www.doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=revealjs&utm_source=github">
<div>
<img src="https://user-images.githubusercontent.com/629429/151510865-9fd454f1-fd8c-4df4-b227-a54b87313db4.png" width="290" alt="Doppler">
</div>
<b>All your environment variables, in one place</b>
<div>
<sub>Stop struggling with scattered API keys, hacking together home-brewed tools, and avoiding access controls. Keep your team and servers in sync with Doppler.</sup>
</div>
</a>
</td>
</table>
</div>

Expand Down
2 changes: 2 additions & 0 deletions css/reveal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,8 @@ $controlsArrowAngleActive: 36deg;

.reveal .slides>section.past,
.reveal .slides>section.future,
.reveal .slides>section.past>section,
.reveal .slides>section.future>section,
.reveal .slides>section>section.past,
.reveal .slides>section>section.future {
opacity: 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/reveal.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
<div class="reveal">
<div class="slides">
<section>Slide 1</section>
<section>Slide 2</section>
<section>Slide 2
<aside class="notes">
<p>Some notes</p>
</aside>
<p>Some slide text</p>
<aside class="notes">
<p>and some more notes</p>
</aside>
</section>
</div>
</div>

Expand Down
10 changes: 8 additions & 2 deletions js/controllers/autoanimate.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,14 @@ export default class AutoAnimate {
value = { value: style.to, explicitValue: true };
}
else {
value = computedStyles[style.property];
// Use a unitless value for line-height so that it inherits properly
if( style.property === 'line-height' ) {
value = parseFloat( computedStyles['line-height'] ) / parseFloat( computedStyles['font-size'] );
}

if( isNaN(value) ) {
value = computedStyles[style.property];
}
}

if( value !== '' ) {
Expand Down Expand Up @@ -475,7 +482,6 @@ export default class AutoAnimate {
} );

pairs.forEach( pair => {

// Disable scale transformations on text nodes, we transition
// each individual text property instead
if( matches( pair.from, textNodes ) ) {
Expand Down
12 changes: 6 additions & 6 deletions js/controllers/notes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Handles the showing and
* Handles the showing of speaker notes
*/
export default class Notes {

Expand Down Expand Up @@ -89,7 +89,7 @@ export default class Notes {
* Retrieves the speaker notes from a slide. Notes can be
* defined in two ways:
* 1. As a data-notes attribute on the slide <section>
* 2. As an <aside class="notes"> inside of the slide
* 2. With <aside class="notes"> elements inside the slide
*
* @param {HTMLElement} [slide=currentSlide]
* @return {(string|null)}
Expand All @@ -101,10 +101,10 @@ export default class Notes {
return slide.getAttribute( 'data-notes' );
}

// ... or using an <aside class="notes"> element
let notesElement = slide.querySelector( 'aside.notes' );
if( notesElement ) {
return notesElement.innerHTML;
// ... or using <aside class="notes"> elements
let notesElements = slide.querySelectorAll( 'aside.notes' );
if( notesElements ) {
return Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' );
}

return null;
Expand Down
28 changes: 17 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"sass": "^1.39.2",
"yargs": "^15.1.0"
},
"browserslist": "> 0.5%, IE 11, not dead",
"browserslist": "> 2%, not dead",
"eslintConfig": {
"env": {
"browser": true,
Expand Down
4 changes: 2 additions & 2 deletions plugin/highlight/highlight.esm.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugin/highlight/highlight.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion plugin/markdown/markdown.esm.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion plugin/markdown/markdown.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion plugin/math/math.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/math/math.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/notes/notes.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/notes/notes.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions plugin/notes/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const Plugin = () => {
function post( event ) {

let slideElement = deck.getCurrentSlide(),
notesElement = slideElement.querySelector( 'aside.notes' ),
notesElements = slideElement.querySelectorAll( 'aside.notes' ),
fragmentElement = slideElement.querySelector( '.current-fragment' );

let messageData = {
Expand All @@ -130,21 +130,25 @@ const Plugin = () => {
if( fragmentElement ) {
let fragmentNotes = fragmentElement.querySelector( 'aside.notes' );
if( fragmentNotes ) {
notesElement = fragmentNotes;
messageData.notes = fragmentNotes.innerHTML;
messageData.markdown = typeof fragmentNotes.getAttribute( 'data-markdown' ) === 'string';

// Ignore other slide notes
notesElements = null;
}
else if( fragmentElement.hasAttribute( 'data-notes' ) ) {
messageData.notes = fragmentElement.getAttribute( 'data-notes' );
messageData.whitespace = 'pre-wrap';

// In case there are slide notes
notesElement = null;
notesElements = null;
}
}

// Look for notes defined in an aside element
if( notesElement ) {
messageData.notes = notesElement.innerHTML;
messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
if( notesElements ) {
messageData.notes = Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' );
messageData.markdown = typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';
}

speakerWindow.postMessage( JSON.stringify( messageData ), '*' );
Expand Down
Loading

0 comments on commit e6d136f

Please sign in to comment.