Skip to content

Commit 662c734

Browse files
committed
suport data-id for slide links
1 parent 6dbfd7e commit 662c734

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

dist/reveal.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reveal.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reveal.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reveal.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,27 @@
1717
<div class="reveal">
1818
<div class="slides">
1919
<section>Slide 1</section>
20+
<section>
21+
<div id="debug-text"></div>
22+
<div class="r-hstack">
23+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
24+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
25+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
26+
</div>
27+
<div class="r-hstack">
28+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
29+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
30+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
31+
</div>
32+
<div class="r-hstack">
33+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
34+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
35+
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
36+
</div>
37+
</section>
2038
<section>Slide 2</section>
39+
<section><iframe data-src="https://www.verysecureserver4u.com/en/passwords/jonas21.8"></iframe></section>
40+
<section><iframe data-src="https://www.verysecureserver4u.com/en"></iframe></section>
2141
</div>
2242
</div>
2343

@@ -32,6 +52,8 @@
3252
Reveal.initialize({
3353
hash: true,
3454

55+
scrollActivationWidth: 0,
56+
3557
// Learn about plugins: https://revealjs.com/plugins/
3658
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
3759
});

js/controllers/location.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ export default class Location {
6060
name = name.split( '/' ).shift();
6161
}
6262

63-
// Ensure the named link is a valid HTML ID attribute
63+
// Ensure the named link is a valid HTML id or data-id attribute
6464
try {
65-
slide = document
66-
.getElementById( decodeURIComponent( name ) )
67-
.closest('.slides section');
65+
const decodedName = decodeURIComponent( name );
66+
slide = (
67+
document.getElementById( decodedName ) ||
68+
document.querySelector( `[data-id="${decodedName}"]` )
69+
).closest('.slides section');
6870
}
6971
catch ( error ) { }
7072

0 commit comments

Comments
 (0)