You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PmWiki-Reveal/reveal.php

138 lines
4.4 KiB

8 years ago
<?php
/*
Fabien Benetou
Based on http://www.pmwiki.org/wiki/Cookbook/SlideShow
Installing:
Download reveal.js and uncompress it to pub/reveal folder in your "Farm" directory
Using:
Include this (reveal.php) file in your config.php.
8 years ago
Create a page using section to define slides and then
8 years ago
access the page with action=reveal
8 years ago
If you defined a master/client keypair configure them further in the multiplex parameters
8 years ago
*/
Markup('section','fulltext','/\(:section:\)/e',"Keep('<section>')");
Markup('sectionend','fulltext','/\(:sectionend:\)/e',"Keep('</section>')");
Markup('sectionextended','fulltext','/\(:sectionextended (.*?):\)/e',"Keep('<section $1>')");
8 years ago
8 years ago
SDV($HandleActions['reveal'],'HandleRevealSlides');
8 years ago
SDV($SlideShowFmt, '<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - Barebones</title>
<link rel="stylesheet" href="$FarmPubDirUrl/reveal.js-master/css/reveal.css" type="text/css" />
</head>
<body>
<div class="reveal">
<div class="slides">
$Slide
</div>
</div>
<script src="$FarmPubDirUrl/reveal.js-master/js/reveal.js"></script>
<script>
8 years ago
Reveal.initialize({
// other options...
multiplex: {
// Example values. To generate your own, see the socket.io server instructions.
secret: null, // Obtained from the socket.io server. Gives this (the master) control of the presentation
id: "", // Obtained from socket.io server
url: "https://reveal-js-multiplex-ccjbegmaii.now.sh" // Location of socket.io server
},
// Don"t forget to add the dependencies
dependencies: [
{ src: "//cdn.socket.io/socket.io-1.3.5.js", async: true },
{ src: "/pub/reveal.js-master/plugin/multiplex/client.js", async: true },
// other dependencies...
]
});
8 years ago
</script>
</body>
</html>
');
8 years ago
function HandleRevealSlides($pagename, $auth = 'read') {
8 years ago
global $SlideShowFmt,$FmtV,$ScriptUrl,$Group,$Name;
$page = RetrieveAuthPage($pagename, $auth, false, READPAGE_CURRENT);
if (!$page) Abort("?cannot read $pagename");
$FmtV['$Slide'] = MarkupToHTML($pagename, $page['text']);
FmtPageName($SlideShowFmt, $pagename);
PrintFmt($pagename,$SlideShowFmt);
exit();
}
8 years ago
/* For master control of slides (ALL presentations!)
{"secret":"14731768290817665483","socketId":"1ff0f582dc396a71"}
Example of working control
http://fabien.benetou.fr/pub/home/testingrevealremote/
*/
SDV($HandleActions['revealcontrol'],'ControlSlides');
SDV($SlideShowFmtControl, '<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - Barebones</title>
<link rel="stylesheet" href="$FarmPubDirUrl/reveal.js-master/css/reveal.css" type="text/css" />
</head>
<body>
<div class="reveal">
<div class="slides">
$Slide
</div>
</div>
<script src="$FarmPubDirUrl/reveal.js-master/js/reveal.js"></script>
<script>
Reveal.initialize({
// other options...
multiplex: {
// Example values. To generate your own, see the socket.io server instructions.
secret: "", // Obtained from the socket.io server. Gives this (the master) control of the presentation
id: "", // Obtained from socket.io server
url: "https://reveal-js-multiplex-ccjbegmaii.now.sh" // Location of socket.io server
},
// Don"t forget to add the dependencies
dependencies: [
{ src: "//cdn.socket.io/socket.io-1.3.5.js", async: true },
{ src: "/pub/reveal.js-master/plugin/multiplex/master.js", async: true },
// other dependencies...
]
});
</script>
</body>
</html>
');
function ControlSlides($pagename, $auth = 'read') {
global $SlideShowFmtControl,$FmtV,$ScriptUrl,$Group,$Name;
$page = RetrieveAuthPage($pagename, $auth, false, READPAGE_CURRENT);
if (!$page) Abort("?cannot read $pagename");
$FmtV['$Slide'] = MarkupToHTML($pagename, $page['text']);
FmtPageName($SlideShowFmtControl, $pagename);
PrintFmt($pagename,$SlideShowFmtControl);
exit();
}
8 years ago
?>