test and examples for multiple reveal.js instances on one page
This commit is contained in:
parent
9ebf6249e7
commit
f26fc20b55
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* reveal.js 4.0.0-dev (Wed Mar 18 2020)
|
||||
* reveal.js 4.0.0-dev (Mon Apr 06 2020)
|
||||
* https://revealjs.com
|
||||
* MIT licensed
|
||||
*
|
||||
|
|
|
@ -149,6 +149,8 @@ gulp.task('serve', () => {
|
|||
|
||||
gulp.watch(['js/**'], gulp.series('js', 'test'))
|
||||
|
||||
gulp.watch(['test/*.html'], gulp.series('test'))
|
||||
|
||||
gulp.watch([
|
||||
'css/theme/source/*.{sass,scss}',
|
||||
'css/theme/template/*.{sass,scss}',
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../../dist/theme/default.css" id="theme">
|
||||
<link rel="stylesheet" href="../../dist/theme/white.css" id="theme">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Multiple Instances</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../../dist/theme/white.css" id="theme">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div style="display: flex; flex-direction: row;">
|
||||
<div class="deck1" style="width: 100%; height: 50vh; padding: 10px;">
|
||||
<div class="reveal">
|
||||
<div class="slides">
|
||||
<section>1.1</section>
|
||||
<section>1.2</section>
|
||||
<section>1.3</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="deck2" style="width: 100%; height: 50vh; padding: 10px;">
|
||||
<div class="reveal">
|
||||
<div class="slides">
|
||||
<section>2.1</section>
|
||||
<section>2.2</section>
|
||||
<section>2.3</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../../dist/reveal.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ) );
|
||||
r1.initialize();
|
||||
|
||||
let r2 = new Reveal( document.querySelector( '.deck2 .reveal' ) );
|
||||
r2.initialize();
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,71 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Iframes</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="qunit-2.5.0.css">
|
||||
<script src="qunit-2.5.0.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<div class="deck1">
|
||||
<div class="reveal" style="display: none;">
|
||||
<div class="slides">
|
||||
<section>1.1</section>
|
||||
<section>1.2</section>
|
||||
<section>1.3</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="deck2">
|
||||
<div class="reveal" style="display: none;">
|
||||
<div class="slides">
|
||||
<section>2.1</section>
|
||||
<section>2.2</section>
|
||||
<section>2.3</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.min.js"></script>
|
||||
<script>
|
||||
|
||||
QUnit.module( 'Multiple reveal.js instances' );
|
||||
|
||||
let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), {
|
||||
embedded: true
|
||||
} );
|
||||
r1.initialize();
|
||||
|
||||
let r2 = new Reveal( document.querySelector( '.deck2 .reveal' ), {
|
||||
embedded: true
|
||||
} );
|
||||
r2.initialize();
|
||||
|
||||
QUnit.test( 'Can make independent changes', function( assert ) {
|
||||
|
||||
r1.slide(1);
|
||||
r2.slide(2);
|
||||
assert.strictEqual( r1.getCurrentSlide().textContent, '1.2' );
|
||||
assert.strictEqual( r2.getCurrentSlide().textContent, '2.3' );
|
||||
|
||||
r2.toggleOverview( true );
|
||||
assert.strictEqual( r1.isOverview(), false );
|
||||
assert.strictEqual( r2.isOverview(), true );
|
||||
r2.toggleOverview( false );
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue