Some checks failed
Gitea Actions Demo Training / Explore-Gitea-Actions (push) Failing after 14s
21 lines
445 B
JavaScript
21 lines
445 B
JavaScript
/* This snippet is loaded from the workshop HTML file.
|
|
* It sets up callbacks to synchronize the local slide
|
|
* number with the remote pub/sub server.
|
|
*/
|
|
|
|
var socket = io();
|
|
var leader = true;
|
|
|
|
slideshow.on('showSlide', function (slide) {
|
|
if (leader) {
|
|
var n = slide.getSlideIndex()+1;
|
|
socket.emit('slide change', n);
|
|
}
|
|
});
|
|
|
|
socket.on('slide change', function (n) {
|
|
leader = false;
|
|
slideshow.gotoSlide(n);
|
|
leader = true;
|
|
});
|