Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Seales
Kubernetes Presentation
Commits
21561774
Commit
21561774
authored
Nov 09, 2015
by
Hakim El Hattab
Browse files
server notes sync slide changes both ways, fixes #1425
parent
4be55f86
Changes
3
Show whitespace changes
Inline
Side-by-side
plugin/notes-server/client.js
View file @
21561774
...
...
@@ -45,6 +45,11 @@
post
();
}
);
// When the state changes from inside of the speaker view
socket
.
on
(
'
statechanged-speaker
'
,
function
(
data
)
{
Reveal
.
setState
(
data
.
state
);
}
);
// Monitor events that trigger a change in state
Reveal
.
addEventListener
(
'
slidechanged
'
,
post
);
Reveal
.
addEventListener
(
'
fragmentshown
'
,
post
);
...
...
plugin/notes-server/index.js
View file @
21561774
...
...
@@ -26,6 +26,10 @@ io.on( 'connection', function( socket ) {
socket
.
broadcast
.
emit
(
'
statechanged
'
,
data
);
});
socket
.
on
(
'
statechanged-speaker
'
,
function
(
data
)
{
socket
.
broadcast
.
emit
(
'
statechanged-speaker
'
,
data
);
});
});
[
'
css
'
,
'
js
'
,
'
images
'
,
'
plugin
'
,
'
lib
'
].
forEach
(
function
(
dir
)
{
...
...
plugin/notes-server/notes.html
View file @
21561774
...
...
@@ -221,6 +221,13 @@
}
}
// Messages sent by reveal.js inside of the current slide preview
if
(
data
&&
data
.
namespace
===
'
reveal
'
)
{
if
(
/slidechanged|fragmentshown|fragmenthidden|overviewshown|overviewhidden|paused|resumed/
.
test
(
data
.
eventName
)
&&
currentState
!==
JSON
.
stringify
(
data
.
state
)
)
{
socket
.
emit
(
'
statechanged-speaker
'
,
{
state
:
data
.
state
}
);
}
}
}
);
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment