App-revealup
view release on metacpan or search on metacpan
share/revealjs/test/test-plugins.html view on Meta::CPAN
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - Test Plugins</title>
<link rel="stylesheet" href="../dist/reveal.css">
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
<script src="../node_modules/qunit/qunit/qunit.js"></script>
</head>
<body style="overflow: auto;">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div class="reveal" style="display: none;">
<div class="slides">
<section>Slide content</section>
</div>
</div>
<script src="../dist/reveal.js"></script>
<script>
QUnit.module( 'Plugins' );
var initCounter = { PluginB: 0, PluginC: 0, PluginD: 0 };
// Plugin with no init method
var PluginA = { id: 'PluginA' };
// Plugin with init method
var PluginB = { id: 'PluginB', init: function() {
initCounter['PluginB'] += 1;
} };
// Async plugin with init method
var PluginC = { id: 'PluginC', init: function() {
return new Promise(function( resolve ) {
setTimeout( () => {
initCounter['PluginC'] += 1;
resolve();
}, 1000 );
});
} };
// Plugin initialized after reveal.js is ready
var PluginD = { id: 'PluginD', init: function() {
initCounter['PluginD'] += 1;
} };
var PluginE = { id: 'PluginE' };
var reveal = new Reveal( document.querySelector( '.reveal' ), {
plugins: [ PluginA ]
} );
reveal.registerPlugin( PluginB );
( run in 0.561 second using v1.01-cache-2.11-cpan-d8267643d1d )