atome 0.5.6.7.3 → 0.5.6.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atome/genesis/sparkle.rb +6 -3
- data/lib/atome/kernel/universe.rb +11 -6
- data/lib/atome/utilities/utilities.rb +3 -0
- data/lib/atome/version.rb +1 -1
- data/lib/atome.rb +1 -0
- data/lib/atome_relative.rb +1 -0
- data/lib/molecules/intuition/sliders.rb +32 -45
- data/vendor/assets/application/examples/localstorage.rb +1 -1
- data/vendor/assets/application/examples/sliders.rb +6 -0
- data/vendor/assets/application/examples/tools.rb +1 -1
- data/vendor/assets/src/index.html +2 -1
- data/vendor/assets/src/index_server_wasm.html +2 -1
- data/vendor/assets/src/index_wasm.html +2 -1
- data/vendor/assets/src/js/atome/specific/opal.js +0 -1
- data/vendor/assets/src/js/atome/specific/wasm.js +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 133a51a9b05e6523fd8d58e95d5dc81231f42d9eb7de62e6d9f1250cffb536e9
|
4
|
+
data.tar.gz: 36b89d41fe7889bd664d0d76cf867e5511d62373106969144cd5135a618e2dee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ab1e800d4ece217f908f45f6eae699277e0abc29bb8913deb2cd3d94cea2ee3846f02e742e32e5724ee17cc890e815940669c3c3cbe48cd8a1f6cf5ac7eb0c
|
7
|
+
data.tar.gz: b627d51e6ad6af8bc9d13713e867f3bc78613a6d3369dfa016d19ebd7a7b51013e5d00f7beb106d2648b1d6abfdab64b84ae1810474aa8b79f6127d77a7cfbca
|
@@ -110,6 +110,7 @@ def atome_infos
|
|
110
110
|
puts "users: #{Universe.users}"
|
111
111
|
puts "current user: #{Universe.current_user}"
|
112
112
|
puts "machine: #{Universe.current_machine}"
|
113
|
+
puts "connected: #{Universe.connected}"
|
113
114
|
end
|
114
115
|
|
115
116
|
# help and example below :
|
@@ -142,12 +143,13 @@ def atome_genesis
|
|
142
143
|
puts "server: #{server}"
|
143
144
|
|
144
145
|
if server.start_with?('http')
|
146
|
+
Universe.connected = true
|
145
147
|
A.server({ address: 'localhost:9292', type: 'ws' })
|
146
148
|
A.init_websocket do |msg|
|
147
149
|
puts "websocket initialised #{msg}"
|
148
150
|
end
|
151
|
+
Universe.allow_sync = true
|
149
152
|
end
|
150
|
-
|
151
153
|
end
|
152
154
|
|
153
155
|
def init_database # this method is call from JS (atome/communication) at WS connection
|
@@ -208,5 +210,6 @@ def user_login
|
|
208
210
|
|
209
211
|
end
|
210
212
|
|
211
|
-
Universe.
|
212
|
-
|
213
|
+
Universe.allow_localstorage = true # to stop data to be stored in localstorage
|
214
|
+
# Universe.allow_sync= false # to stop data to be sync on server
|
215
|
+
touch_allow(false) # this lock the system right click in web view
|
@@ -18,12 +18,14 @@ class Universe
|
|
18
18
|
@users = {}
|
19
19
|
@help = {}
|
20
20
|
@example = {}
|
21
|
-
@
|
21
|
+
@allow_localstorage = false
|
22
|
+
@allow_sync = false
|
23
|
+
@connected= false
|
22
24
|
@database_ready = false
|
23
25
|
# @historicize=false
|
24
26
|
class << self
|
25
27
|
attr_reader :atomes, :atomes_ids, :renderer_list, :atome_list, :particle_list, :classes, :counter, :atomes_specificities
|
26
|
-
attr_accessor :
|
28
|
+
attr_accessor :connected,:allow_sync, :allow_localstorage, :database_ready
|
27
29
|
|
28
30
|
def messages
|
29
31
|
@messages
|
@@ -246,10 +248,13 @@ class Universe
|
|
246
248
|
|
247
249
|
def historicize(id, operation, element, params)
|
248
250
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
251
|
+
if @allow_sync && Universe.connected
|
252
|
+
A.sync({ action: :historicize, data: { table: :user } })
|
253
|
+
end
|
254
|
+
|
255
|
+
# if @allow_localstorage && @database_ready
|
256
|
+
if @allow_localstorage
|
257
|
+
|
253
258
|
operation_timing = Time.now.strftime("%Y%m%d%H%M%S%3N") + @increment.to_s
|
254
259
|
@increment += 1
|
255
260
|
@increment = @increment % 100
|
data/lib/atome/version.rb
CHANGED
data/lib/atome.rb
CHANGED
data/lib/atome_relative.rb
CHANGED
@@ -1,49 +1,36 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
button = box({smooth: 6,left: 55,top: 160, color:{red: 0.3, green: 0.3, blue: 0.3},id: :my_box})
|
4
|
-
button.shadow({
|
5
|
-
id: :s1,
|
6
|
-
left: 3, top: 3, blur: 9,
|
7
|
-
invert: true,
|
8
|
-
red: 0, green: 0, blue: 0, alpha: 0.7
|
9
|
-
})
|
10
|
-
button.touch(true) do
|
11
|
-
button.controller(:hello)
|
12
|
-
end
|
13
|
-
slider=box({ width: 333, height: 25, top: 45, left: 55, smooth: 9, color:{red: 0.3, green: 0.3, blue: 0.3}})
|
14
|
-
slider.shadow({
|
15
|
-
id: :s2,
|
16
|
-
left: 3, top: 3, blur: 9,
|
17
|
-
invert: true,
|
18
|
-
red: 0, green: 0, blue: 0, alpha: 0.7
|
19
|
-
})
|
20
|
-
cursor= slider.circle({width: 30, height: 30, left: 2, top: 1, color:{red: 0.3, green: 0.3, blue: 0.3}})
|
21
|
-
|
22
|
-
cursor.left(0)
|
23
|
-
cursor.top(0)
|
24
|
-
cursor.shadow({
|
25
|
-
id: :s4,
|
26
|
-
left: 1, top: 1, blur: 3,
|
27
|
-
option: :natural,
|
28
|
-
red: 0, green: 0, blue: 0, alpha: 0.6
|
29
|
-
})
|
30
|
-
label=text({data: 0, top: 69, left: 69, component: { size: 12 }, color: :gray})
|
31
|
-
cursor.drag({ restrict: {max:{ left: 309, top: 0}} }) do |event|
|
32
|
-
puts cursor.left
|
33
|
-
value = cursor.left/309*100
|
34
|
-
label.data(value)
|
35
|
-
cursor.controller({ action: :setModuleParameterValue, params: { moduleId: 6456549897,parameterId: 9846546, value: value} })
|
36
3
|
|
4
|
+
module Molecule
|
5
|
+
def slider(params,&bloc)
|
6
|
+
slider_width=params[:width] || 333
|
7
|
+
cursor_width=33
|
8
|
+
cursor_height=33
|
9
|
+
left_pos=params[:left] || 0
|
10
|
+
top_pos=params[:top] || 0
|
11
|
+
attach_to= params[:attach] || :view
|
12
|
+
cursor_left=0
|
13
|
+
cursor_top=0
|
14
|
+
slider=grab(attach_to).box({ top: top_pos, left: left_pos,width: slider_width, height: 25, smooth: 9, color:{red: 0.3, green: 0.3, blue: 0.3}})
|
15
|
+
slider.shadow({
|
16
|
+
id: :s2,
|
17
|
+
left: 3, top: 3, blur: 9,
|
18
|
+
invert: true,
|
19
|
+
red: 0, green: 0, blue: 0, alpha: 0.7
|
20
|
+
})
|
21
|
+
cursor= slider.circle({width: cursor_width, height: cursor_height, left: 2, top: 1, color:{red: 0.3, green: 0.3, blue: 0.3}})
|
22
|
+
cursor.left(cursor_left)
|
23
|
+
cursor.top(cursor_top)
|
24
|
+
cursor.shadow({
|
25
|
+
id: :s4,
|
26
|
+
left: 1, top: 1, blur: 3,
|
27
|
+
option: :natural,
|
28
|
+
red: 0, green: 0, blue: 0, alpha: 0.6
|
29
|
+
})
|
30
|
+
cursor.drag({ restrict: {max:{ left: slider_width-cursor_width, top: 0}} }) do |_event|
|
31
|
+
value = (cursor.left+cursor.width)/slider_width*100
|
32
|
+
bloc.call(value)
|
33
|
+
end
|
34
|
+
slider
|
35
|
+
end
|
37
36
|
end
|
38
|
-
support=box({top: 300, left: 55, width: 300, height: 40, smooth: 9, color:{red: 0.3, green: 0.3, blue: 0.3}, id: :support })
|
39
|
-
support.shadow({
|
40
|
-
id: :s3,
|
41
|
-
left: 3, top: 3, blur: 9,
|
42
|
-
invert: true,
|
43
|
-
red: 0, green: 0, blue: 0, alpha: 0.7
|
44
|
-
})
|
45
|
-
support.import(true) do |content|
|
46
|
-
puts "add code here, content: #{content}"
|
47
|
-
end
|
48
|
-
|
49
|
-
in_box=input_box
|
@@ -34,7 +34,8 @@
|
|
34
34
|
require '/utilities/host_mode'
|
35
35
|
require '/lib/atome_relative'
|
36
36
|
require './index'
|
37
|
-
atome_infos
|
37
|
+
#atome_infos
|
38
|
+
atome_genesis
|
38
39
|
</script>
|
39
40
|
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
40
41
|
<script type="text/javascript">
|
@@ -39,7 +39,8 @@
|
|
39
39
|
require '/utilities/host_mode'
|
40
40
|
require '/lib/atome_relative'
|
41
41
|
require './index'
|
42
|
-
|
42
|
+
atome_genesis
|
43
|
+
#atome_infos
|
43
44
|
</script>
|
44
45
|
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
45
46
|
<script type="text/javascript">
|
@@ -6,6 +6,10 @@ function controller_message(msg) {
|
|
6
6
|
rubyVM.eval(rubycode);
|
7
7
|
}
|
8
8
|
|
9
|
+
// window.addEventListener('load', function () {
|
10
|
+
// // Opal.Object.$atome_genesis();
|
11
|
+
// rubyVMCallback('atome_genesis');
|
12
|
+
// })
|
9
13
|
|
10
14
|
const communication = {
|
11
15
|
// websocket: null,// websocket init for server
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.6.7.
|
4
|
+
version: 0.5.6.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Eric Godard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: artoo
|
@@ -622,6 +622,7 @@ files:
|
|
622
622
|
- vendor/assets/application/examples/shapes.rb
|
623
623
|
- vendor/assets/application/examples/shortcut.rb
|
624
624
|
- vendor/assets/application/examples/size.rb
|
625
|
+
- vendor/assets/application/examples/sliders.rb
|
625
626
|
- vendor/assets/application/examples/smooth.rb
|
626
627
|
- vendor/assets/application/examples/style.rb
|
627
628
|
- vendor/assets/application/examples/sub_atome_manipulation.rb
|