cubism 0.1.0.pre5 → 0.1.0.pre6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a5083117c16883fd1794f09ed204481d6adfef8143c2f243d56030aa438054
|
4
|
+
data.tar.gz: f40048d57269c6bf2d4fc4c8cdfb91f4e4021da157c35fcf0f0b8d46c59f8929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d6410ee9e19694330c836a8580de898ef4ccb560fcdd562ff1f199d83db357538952809f156d1eb29991f15d7a925dbb4cd97bacf0b498a8e037d2187de537d
|
7
|
+
data.tar.gz: 400663fdce10836259b1affe8197e2c57da63358912529b4ff79bddbe052ac16251e1032b904a921467fd1290ea11100b16764c9ce61b6eaaeab9d634cf83401
|
@@ -3,7 +3,7 @@ class Cubism::PresenceChannel < ActionCable::Channel::Base
|
|
3
3
|
|
4
4
|
def subscribed
|
5
5
|
if resource.present?
|
6
|
-
|
6
|
+
stream_from params[:element_id]
|
7
7
|
resource.cubicle_element_ids << element_id
|
8
8
|
resource.excluded_user_id_for_element_id[element_id] = user.id if exclude_current_user?
|
9
9
|
else
|
@@ -4,7 +4,8 @@ class Cubism::PresenceChannel < ActionCable::Channel::Base
|
|
4
4
|
def subscribed
|
5
5
|
if resource.present?
|
6
6
|
stream_for resource
|
7
|
-
resource.
|
7
|
+
resource.cubicle_element_ids << element_id
|
8
|
+
resource.excluded_user_id_for_element_id[element_id] = user.id if exclude_current_user?
|
8
9
|
else
|
9
10
|
reject
|
10
11
|
end
|
@@ -13,6 +14,16 @@ class Cubism::PresenceChannel < ActionCable::Channel::Base
|
|
13
14
|
def unsubscribed
|
14
15
|
return unless resource.present?
|
15
16
|
|
17
|
+
resource.cubicle_element_ids.remove(element_id)
|
18
|
+
resource.excluded_user_id_for_element_id.delete(element_id)
|
19
|
+
disappear
|
20
|
+
end
|
21
|
+
|
22
|
+
def appear
|
23
|
+
resource.present_users.add(user.id)
|
24
|
+
end
|
25
|
+
|
26
|
+
def disappear
|
16
27
|
resource.present_users.remove(user.id)
|
17
28
|
end
|
18
29
|
|
@@ -26,4 +37,16 @@ class Cubism::PresenceChannel < ActionCable::Channel::Base
|
|
26
37
|
def user
|
27
38
|
GlobalID::Locator.locate_signed(params[:user])
|
28
39
|
end
|
40
|
+
|
41
|
+
def exclude_current_user?
|
42
|
+
params[:exclude_current_user]
|
43
|
+
end
|
44
|
+
|
45
|
+
def element_id
|
46
|
+
params[:element_id]
|
47
|
+
end
|
48
|
+
|
49
|
+
def url
|
50
|
+
params[:url]
|
51
|
+
end
|
29
52
|
end
|
data/lib/cubism/broadcaster.rb
CHANGED
@@ -18,10 +18,10 @@ module Cubism
|
|
18
18
|
view_context = Cubism.store[block_key].context
|
19
19
|
html = view_context.capture(users_for(resource, element_id), &block)
|
20
20
|
|
21
|
-
cable_ready[
|
21
|
+
cable_ready[element_id].inner_html(
|
22
22
|
selector: "cubicle-element##{element_id}[identifier='#{signed_stream_identifier(resource.to_global_id.to_s)}']",
|
23
23
|
html: html
|
24
|
-
).
|
24
|
+
).broadcast
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
data/lib/cubism/broadcaster.rb~
CHANGED
data/lib/cubism/version.rb
CHANGED
data/lib/cubism/version.rb~
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cubism
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Rubisch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|