Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
2
2015-12-uni-ffm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CmS
2015-12-uni-ffm
Commits
3eb7038a
Commit
3eb7038a
authored
10 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Patches
Plain Diff
sync server-side speaker notes after notes window opens
parent
5e85f02e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugin/notes-server/client.js
+6
-1
6 additions, 1 deletion
plugin/notes-server/client.js
plugin/notes-server/index.js
+6
-2
6 additions, 2 deletions
plugin/notes-server/index.js
plugin/notes-server/notes.html
+14
-2
14 additions, 2 deletions
plugin/notes-server/notes.html
with
26 additions
and
5 deletions
plugin/notes-server/client.js
+
6
−
1
View file @
3eb7038a
...
@@ -36,10 +36,15 @@
...
@@ -36,10 +36,15 @@
messageData
.
markdown
=
typeof
notesElement
.
getAttribute
(
'
data-markdown
'
)
===
'
string
'
;
messageData
.
markdown
=
typeof
notesElement
.
getAttribute
(
'
data-markdown
'
)
===
'
string
'
;
}
}
socket
.
emit
(
'
state
'
,
messageData
);
socket
.
emit
(
'
state
changed
'
,
messageData
);
}
}
// When a new notes window connects, post our current state
socket
.
on
(
'
connect
'
,
function
(
data
)
{
post
();
}
);
// Monitor events that trigger a change in state
// Monitor events that trigger a change in state
Reveal
.
addEventListener
(
'
slidechanged
'
,
post
);
Reveal
.
addEventListener
(
'
slidechanged
'
,
post
);
Reveal
.
addEventListener
(
'
fragmentshown
'
,
post
);
Reveal
.
addEventListener
(
'
fragmentshown
'
,
post
);
...
...
This diff is collapsed.
Click to expand it.
plugin/notes-server/index.js
+
6
−
2
View file @
3eb7038a
...
@@ -16,8 +16,12 @@ var opts = {
...
@@ -16,8 +16,12 @@ var opts = {
io
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
io
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
socket
.
on
(
'
state
'
,
function
(
state
)
{
socket
.
on
(
'
connect
'
,
function
(
data
)
{
socket
.
broadcast
.
emit
(
'
state
'
,
state
);
socket
.
broadcast
.
emit
(
'
connect
'
,
data
);
});
socket
.
on
(
'
statechanged
'
,
function
(
data
)
{
socket
.
broadcast
.
emit
(
'
statechanged
'
,
data
);
});
});
});
});
...
...
This diff is collapsed.
Click to expand it.
plugin/notes-server/notes.html
+
14
−
2
View file @
3eb7038a
...
@@ -187,7 +187,7 @@
...
@@ -187,7 +187,7 @@
var
socket
=
io
.
connect
(
window
.
location
.
origin
),
var
socket
=
io
.
connect
(
window
.
location
.
origin
),
socketId
=
'
{{socketId}}
'
;
socketId
=
'
{{socketId}}
'
;
socket
.
on
(
'
state
'
,
function
(
data
)
{
socket
.
on
(
'
state
changed
'
,
function
(
data
)
{
// ignore data from sockets that aren't ours
// ignore data from sockets that aren't ours
if
(
data
.
socketId
!==
socketId
)
{
return
;
}
if
(
data
.
socketId
!==
socketId
)
{
return
;
}
...
@@ -206,6 +206,18 @@
...
@@ -206,6 +206,18 @@
}
);
}
);
window
.
addEventListener
(
'
message
'
,
function
(
event
)
{
var
data
=
JSON
.
parse
(
event
.
data
);
if
(
data
&&
data
.
namespace
===
'
reveal
'
)
{
if
(
/ready/
.
test
(
data
.
eventName
)
)
{
socket
.
emit
(
'
connect
'
,
{
socketId
:
socketId
}
);
}
}
}
);
/**
/**
* Called when the main window sends an updated state.
* Called when the main window sends an updated state.
*/
*/
...
@@ -266,7 +278,7 @@
...
@@ -266,7 +278,7 @@
].
join
(
'
&
'
);
].
join
(
'
&
'
);
var
hash
=
'
#/
'
+
data
.
state
.
indexh
+
'
/
'
+
data
.
state
.
indexv
;
var
hash
=
'
#/
'
+
data
.
state
.
indexh
+
'
/
'
+
data
.
state
.
indexv
;
var
currentURL
=
'
/?
'
+
params
+
hash
;
var
currentURL
=
'
/?
'
+
params
+
'
&postMessageEvents=true
'
+
hash
;
var
upcomingURL
=
'
/?
'
+
params
+
'
&controls=false
'
+
hash
;
var
upcomingURL
=
'
/?
'
+
params
+
'
&controls=false
'
+
hash
;
currentSlide
=
document
.
createElement
(
'
iframe
'
);
currentSlide
=
document
.
createElement
(
'
iframe
'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment