Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grains
grains-web
Commits
938eccee
Commit
938eccee
authored
May 09, 2017
by
Jens-Christian Fischer
Browse files
Consistent naming of Viusals channel
parent
8388f0d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
web/channels/user_socket.ex
View file @
938eccee
...
...
@@ -12,7 +12,7 @@ defmodule Grains.UserSocket do
channel
"presence:*"
,
Grains
.
PresenceChannel
channel
"osc"
,
Grains
.
OscChannel
channel
"visual"
,
Grains
.
VisualsChannel
channel
"visual
s:*
"
,
Grains
.
VisualsChannel
## Transports
transport
:websocket
,
Phoenix
.
Transports
.
WebSocket
...
...
web/static/js/app.js
View file @
938eccee
...
...
@@ -101,7 +101,7 @@ room.join().receive("ok", resp => {
})
.
receive
(
"
error
"
,
reason
=>
console
.
log
(
"
presence join failed
"
,
reason
))
let
visuals
=
socket
.
channel
(
"
visuals
"
,
{});
let
visuals
=
socket
.
channel
(
"
visuals
:data
"
,
{});
visuals
.
on
(
"
velocity
"
,
state
=>
{
console
.
log
(
"
velocity:
"
,
state
);
...
...
@@ -111,7 +111,7 @@ visuals.on("acceleratoin", state => {
console
.
log
(
"
acceleration:
"
,
state
);
});
visual
.
join
().
receive
(
"
ok
"
,
resp
=>
{
visual
s
.
join
().
receive
(
"
ok
"
,
resp
=>
{
console
.
log
(
"
visual joined
"
);
})
.
receive
(
"
error
"
,
reason
=>
console
.
log
(
"
visual join failed
"
,
reason
))
...
...
web/static/js/presencesketch.js
View file @
938eccee
...
...
@@ -177,6 +177,8 @@ let PresenceSketch = {
addBoids
(
joins
)
{
if
!
(
PresenceSketch
.
p5
)
{
return
;
};
_
.
each
(
joins
,
function
(
val
,
name
)
{
if
(
name
)
{
...
...
@@ -189,6 +191,7 @@ let PresenceSketch = {
removeBoids
(
leaves
)
{
if
!
(
PresenceSketch
.
p5
)
{
return
;
};
_
.
each
(
leaves
,
function
(
val
,
name
)
{
delete
PresenceSketch
.
boids
[
name
];
});
...
...
@@ -198,6 +201,7 @@ let PresenceSketch = {
syncBoids
(
currentActive
)
{
if
!
(
PresenceSketch
.
p5
)
{
return
;
};
console
.
log
(
"
sync
"
);
_
.
each
(
currentActive
,
function
(
p
)
{
console
.
log
(
p
.
user
);
...
...
Write
Preview
Supports
Markdown
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