added multiplex
This commit is contained in:
@@ -1 +1,3 @@
|
||||
# PmWiki-Reveal
|
||||
|
||||
See http://www.pmwiki.org/wiki/Cookbook/Reveal for details
|
||||
|
||||
88
reveal.php
88
reveal.php
@@ -9,15 +9,17 @@
|
||||
|
||||
Using:
|
||||
Include this (reveal.php) file in your config.php.
|
||||
Create a page using html/htmlend <section> to define slides and then
|
||||
Create a page using section to define slides and then
|
||||
access the page with action=reveal
|
||||
|
||||
If you defined a master/client keypair configure them further in the multiplex parameters
|
||||
|
||||
*/
|
||||
|
||||
Markup('section','fulltext','/\(:section:\)/e',"Keep('<section>')");
|
||||
Markup('sectionend','fulltext','/\(:sectionend:\)/e',"Keep('</section>')");
|
||||
|
||||
SDV($HandleActions['reveal'],'HandleSlides');
|
||||
SDV($HandleActions['reveal'],'HandleRevealSlides');
|
||||
|
||||
SDV($SlideShowFmt, '<!doctype html>
|
||||
<html lang="en">
|
||||
@@ -34,14 +36,32 @@ $Slide
|
||||
</div>
|
||||
<script src="$FarmPubDirUrl/reveal.js-master/js/reveal.js"></script>
|
||||
<script>
|
||||
Reveal.initialize();
|
||||
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...
|
||||
]
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
');
|
||||
|
||||
|
||||
function HandleSlides($pagename, $auth = 'read') {
|
||||
function HandleRevealSlides($pagename, $auth = 'read') {
|
||||
global $SlideShowFmt,$FmtV,$ScriptUrl,$Group,$Name;
|
||||
|
||||
$page = RetrieveAuthPage($pagename, $auth, false, READPAGE_CURRENT);
|
||||
@@ -53,4 +73,64 @@ function HandleSlides($pagename, $auth = 'read') {
|
||||
exit();
|
||||
}
|
||||
|
||||
/* 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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user