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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 363b43b98c73c072bcd284e79e3903ce50f7aaa28b2ce8ae448862533c3ea355
4
- data.tar.gz: b14b4c7f34e5fd98a83afaf1bfec698df673e8183ec056551dcbbf15c0287be1
3
+ metadata.gz: 133a51a9b05e6523fd8d58e95d5dc81231f42d9eb7de62e6d9f1250cffb536e9
4
+ data.tar.gz: 36b89d41fe7889bd664d0d76cf867e5511d62373106969144cd5135a618e2dee
5
5
  SHA512:
6
- metadata.gz: 7d3dbb34d73af5b09479b1dbef64365aaf509acd3cb7859d185e4ec79f5479b58cdbb2f15fb170b8ab8765fc7265915fe4aff04b0e419709d1835b4157bcb053
7
- data.tar.gz: c1dd6f6ad63ee105768e565f345301c028c2cb8294ea872c8c6403f56402d4d48d8ecd705e0d0588234e36e6158a2c97079f2b25573ee7646619a3e28967b542
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.allow_history = true
212
- touch_allow(false) # this lock the system right click in web view
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
- @allow_history = false
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 :allow_history, :database_ready
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
- # if @allow_history && @database_ready
250
- if @allow_history
251
- # A.sync({ action: :historicize, data: { table: :user } }) do |_db_state|
252
- # end
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
@@ -490,6 +490,9 @@ class Atome
490
490
  end
491
491
  current_state
492
492
  end
493
+
494
+
495
+
493
496
  end
494
497
 
495
498
 
data/lib/atome/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.7.3'
5
+ VERSION = '0.5.6.7.5'
6
6
  end
data/lib/atome.rb CHANGED
@@ -36,3 +36,4 @@ require 'renderers/server/index'
36
36
  require 'atome/utilities/sanitizer'
37
37
  require 'atome/genesis/sparkle'
38
38
  require 'molecules/init'
39
+ require 'molecules/intuition/sliders'
@@ -35,3 +35,4 @@ require_relative './renderers/server/index_relative'
35
35
  require_relative './atome/utilities/sanitizer'
36
36
  require_relative './atome/genesis/sparkle'
37
37
  require_relative './molecules/init'
38
+ require_relative './molecules/intuition/sliders'
@@ -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
@@ -13,7 +13,7 @@ end
13
13
 
14
14
  b.touch(:long) do
15
15
  b.color(:red)
16
- Universe.allow_history = false
16
+ Universe.allow_localstorage = false
17
17
 
18
18
  end
19
19
 
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ label=text({data: 0, top: 69, left: 69,attach: :intuition, component: { size: 12 }, color: :gray})
3
+
4
+ A.slider({width: 333} ) do |value|
5
+ label.data("(#{value})")
6
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Universe.allow_history = false
3
+ # Universe.allow_localstorage = false
4
4
 
5
5
  color({ id: :creation_layer_col, alpha: 1 })
6
6
 
@@ -40,7 +40,8 @@
40
40
  require '/lib/atome_relative'
41
41
  require './index'
42
42
  #puts Universe.host
43
- atome_infos
43
+ atome_genesis
44
+ #atome_infos
44
45
  </script>
45
46
  <script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
46
47
  <script type="text/javascript">
@@ -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
- atome_infos
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">
@@ -19,7 +19,6 @@ function loadApplicationJs() {
19
19
 
20
20
  window.addEventListener('load', function () {
21
21
  Opal.Object.$atome_genesis();
22
-
23
22
  })
24
23
 
25
24
 
@@ -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.3
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-14 00:00:00.000000000 Z
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