atome 0.5.7.3.9 → 0.5.7.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/atome/atome.rb +24 -56
  3. data/lib/atome/extensions/atome.rb +10 -59
  4. data/lib/atome/extensions/sha.rb +7 -7
  5. data/lib/atome/genesis/genesis.rb +0 -89
  6. data/lib/atome/genesis/particles/communication.rb +1 -1
  7. data/lib/atome/genesis/particles/event.rb +0 -8
  8. data/lib/atome/genesis/particles/geometry.rb +0 -1
  9. data/lib/atome/genesis/particles/hierarchy.rb +0 -34
  10. data/lib/atome/genesis/particles/identity.rb +0 -30
  11. data/lib/atome/genesis/particles/material.rb +0 -11
  12. data/lib/atome/genesis/particles/property.rb +14 -16
  13. data/lib/atome/genesis/particles/security.rb +0 -45
  14. data/lib/atome/genesis/particles/utility.rb +17 -185
  15. data/lib/atome/genesis/sparkle.rb +3 -12
  16. data/lib/atome/kernel/black_matter.rb +0 -1
  17. data/lib/atome/kernel/universe.rb +5 -45
  18. data/lib/atome/presets/atome.rb +0 -22
  19. data/lib/atome/version.rb +1 -1
  20. data/lib/molecules/init.rb +0 -14
  21. data/lib/molecules/intuition/tools.rb +3 -22
  22. data/lib/molecules/intuition/utilities.rb +121 -77
  23. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
  24. data/lib/platform_specific/opal/extensions/color.rb +0 -5
  25. data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
  26. data/lib/platform_specific/opal/extensions/ping.rb +11 -20
  27. data/lib/renderers/html/effect.rb +0 -11
  28. data/lib/renderers/html/event.rb +0 -7
  29. data/lib/renderers/html/geometry.rb +0 -31
  30. data/lib/renderers/html/html.rb +13 -134
  31. data/lib/renderers/html/material.rb +0 -22
  32. data/lib/renderers/html/spatial.rb +0 -9
  33. data/lib/renderers/html/utility.rb +5 -8
  34. data/lib/renderers/renderer.rb +0 -1
  35. data/vendor/assets/application/examples/applications.rb +19 -71
  36. data/vendor/assets/application/examples/buttons.rb +5 -4
  37. data/vendor/assets/application/examples/unfasten.rb +15 -9
  38. data/vendor/assets/application/index.rb +1 -1
  39. data/vendor/assets/server/capture.rb +0 -1
  40. data/vendor/assets/server/database.rb +0 -1
  41. data/vendor/assets/server/eDen.rb +5 -80
  42. data/vendor/assets/src/index_server_wasm.html +0 -3
  43. data/vendor/assets/src/index_wasm.html +0 -6
  44. metadata +2 -6
  45. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  46. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  47. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  48. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
@@ -3,8 +3,7 @@
3
3
  a = application({
4
4
  id: :arp,
5
5
  margin: 3,
6
- # circle: { id: :test, color: :red },
7
- # menu: { width: 220, height: 33, depth: 333, color: :black },
6
+ spacing: 6
8
7
  })
9
8
 
10
9
  page1_code = lambda do |back|
@@ -16,10 +15,6 @@ verif = lambda do
16
15
  b.touch(true) do
17
16
  alert grab(:mod_1).touch
18
17
  end
19
-
20
- # a=grab('page2').circle({id: :heu, color: :black})
21
- # a.color(:red)
22
- # alert 'ok'
23
18
  end
24
19
 
25
20
  page1 = {
@@ -30,7 +25,6 @@ page1 = {
30
25
  header: { color: :yellow },
31
26
  left_side_bar: { color: :yellowgreen },
32
27
  right_side_bar: { color: :blue },
33
- # box: { id: :mod_1, touch: {tap: true, code: page1_code} }
34
28
  }
35
29
 
36
30
  color({ id: :titi, red: 1 })
@@ -39,83 +33,37 @@ page2 = { id: :page2,
39
33
  menu: false,
40
34
  run: verif,
41
35
  box: { id: :mod_1, left: 333, top: 123, touch: { down: true, code: page1_code } }
42
-
43
36
  }
44
37
 
45
-
46
-
47
38
  page0 = { id: :page0,
48
39
  color: :purple,
49
-
50
40
  }
41
+
51
42
  a.page(page0)
52
43
  a.page(page1)
53
44
  a.page(page2)
54
45
  a.page({ id: :page3,
55
46
  color: :red,
56
- # run: verif,
57
- # box: { id: :mod_1,left: 333, touch: {tap: :down, code: page1_code} }
58
47
  })
59
- # wait 1 do
60
- # a.page(page2)
61
- # wait 1 do
62
- # a.page(page1)
63
- # puts 'second load'
64
- # wait 5 do
65
- # a.page(page3)
66
- # wait 5 do
67
- # a.page(page2)
68
- # puts 'third load'
69
- # end
70
- # end
71
- # end
72
- # end
73
- # c=grab(:page1).circle({left: 99})
74
- # c.touch(true) do
75
- # alert grab(:mod_1).inspect
76
- # end
77
48
 
78
- # wait 1 do
79
- # a.page(page2)
80
- # end
81
- # wait 2 do
82
- # a.page(page1)
83
- # end
84
- #
85
- # wait 3 do
86
- # a.page(page2)
87
- # end
88
- #
89
- # # wait 5 do
90
- # # a.page(page0)
91
- # # end
92
- # #
93
- # # wait 6 do
94
- # # a.page(page1)
95
- # # end
96
49
 
97
- # wait 4 do
98
- # cc=box
99
- # cc.touch(true) do
100
- # alert grab(:heu).inspect
101
- # end
102
- # end
103
50
 
104
- # a=lambda do |_val|
105
- # grab(:testing).color(:red)
106
- # wait 1 do
107
- # grab(:testing).delete({recursive: true})
108
- # end
109
- # end
110
- #
111
- # c=circle
112
- # c.touch(true) do
113
- # b=box({id: :testing, left: 99})
114
- # b.touch({ tap: true , code: a})
115
- # end
116
- # wait 1 do
117
- a.show(:page1)
118
- # # alert :kool
119
- # end
51
+ menu_f=a.menu
52
+ menus_found= menu_f.fasten # replace fasten for entries
53
+ puts a.pages
54
+ puts " pages => #{a.pages}"
55
+ puts " menus_found => #{menus_found}"
56
+
57
+ bloc_to_add= {height: 156, color: :green}
58
+ bloc_to_add2= {height: 99, color: :blue}
59
+ bloc_to_add3= {height: 333, color: :orange}
60
+ a.insert({page3: {block1: bloc_to_add , block2: bloc_to_add2, block3: bloc_to_add3}})
61
+ puts " blocks => #{a.blocks}"
62
+ wait 3 do
63
+ # how to remove blocks
64
+ a.extract({page3: :block1})
65
+ end
66
+
67
+ a.show(:page3)
120
68
 
121
69
 
@@ -1,9 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
-
5
- ############
6
-
3
+ box({color: :gray, width: 666, height: 666})
7
4
  box({ id: :the_box, drag: true, color: { alpha: 2 } })
8
5
 
9
6
  menu1_code = lambda do
@@ -44,4 +41,8 @@ c.touch(:down) do
44
41
  end
45
42
 
46
43
 
44
+ wait 2 do
45
+ grab(:menu1).remove_menu_item(:item_2)
46
+ end
47
+
47
48
  # TODO: remove menu_item ,reset_menu, reorder, delete
@@ -1,17 +1,23 @@
1
1
  # frozen_string_literal: true
2
-
3
-
4
- b = box({ drag: true, id: :the_b })
2
+ b = box({ drag: true, id: :the_b, top: 63, left: 63 })
5
3
  c = b.circle({ left: 99, id: :the_c })
6
- t = b.text({ data: :hello, left: 44, top: 44, id: :the_t })
4
+ b.box({left: 99, top: 99, width: 33, height: 33, id: :second_one})
5
+ t = b.text({ data: 'touch the circle', left: 44, top: 44, id: :the_t })
7
6
  c.touch(:down) do
8
7
  b.unfasten([c.id])
9
8
  b.color(:green)
10
9
  t.data('circle unfasten')
11
- wait 3 do
12
- b.color(:red)
13
- t.data('unfasten all attached atomes')
14
- b.unfasten(:all)
10
+ grab(:infos).data("number of item(s) fasten to the box : #{b.fasten}")
11
+ wait 2 do
12
+ grab(:second_one).delete((true))
13
+ grab(:infos).data("number of item(s) fasten to the box : #{b.fasten}")
14
+ wait 2 do
15
+ b.color(:red)
16
+ t.data('unfasten all attached atomes')
17
+ b.unfasten(:all)
18
+ grab(:infos).data("number of item fasten to the box : #{b.fasten}")
19
+ end
15
20
  end
21
+ end
16
22
 
17
- end
23
+ text({id: :infos,left: 155, data: "number of item fasten to the box : #{b.fasten}"})
@@ -6,4 +6,4 @@ box({id: :my_box})
6
6
  # open the console in your browser ou your native app and should see the text below
7
7
  puts "hello world"
8
8
 
9
- # require './required_example'
9
+ # require './required_example/blur'
@@ -6,5 +6,4 @@ File.open("#{path}#{name}.txt", 'w') do |f|
6
6
  f.write("Le nom du fichier #{name}\n")
7
7
  end
8
8
 
9
- # `gphoto2 --capture-image-and-download --filename "../src/medias/images/photos/verif.jpg"`
10
9
  `gphoto2 --capture-image-and-download --filename "#{path}#{name}.jpg"`
@@ -49,7 +49,6 @@ class Database
49
49
  end
50
50
 
51
51
 
52
-
53
52
  end
54
53
 
55
54
  end
@@ -33,11 +33,6 @@ class EDen
33
33
  { data: { message: `#{data}` }, message_id: message_id }
34
34
  end
35
35
 
36
- # def sanitize_email(email)
37
- # invalid_chars_pattern = /[^a-zA-Z0-9.-@]+/
38
- # email.gsub(invalid_chars_pattern, '')
39
- # end
40
-
41
36
  def metadata(msg, pid, message_id, ws)
42
37
 
43
38
  path = msg[:output_file]
@@ -58,7 +53,6 @@ class EDen
58
53
  custom_data = data.to_json
59
54
  comment_metadata = "-metadata comment=#{custom_data.shellescape}"
60
55
 
61
- # input_file = path
62
56
  temp_output_file = "./temp_#{File.basename(path)}"
63
57
  ffmpeg_cmd = "ffmpeg -i #{path.shellescape} #{comment_metadata} -codec copy #{temp_output_file.shellescape}"
64
58
 
@@ -77,19 +71,11 @@ class EDen
77
71
 
78
72
  def finished(msg, pid, message_id, ws)
79
73
 
80
- path = msg[:output_file]
81
- # metadata = msg[:metadata]
82
-
83
- # custom_data = metadata.to_json
84
- # comment_metadata = "-metadata comment=#{custom_data.shellescape}"
85
74
 
86
- input_file = path
87
- # temp_output_file = "./temp_#{File.basename(input_file)}"
88
-
89
- ##### write tag
75
+ # write tag
90
76
  metadata(msg, pid, message_id, ws)
91
77
 
92
- ##### read tag
78
+ # read tag
93
79
  msg[:read] = true
94
80
  metadata(msg, pid, message_id, ws)
95
81
 
@@ -102,7 +88,6 @@ class EDen
102
88
  begin
103
89
  Process.getpgid(pid) # Vérifier si le processus est toujours actif
104
90
  Process.kill("SIGINT", pid)
105
- # puts "Recording stopped.#{pid} : #{pid.class}"
106
91
  rescue Errno::ESRCH # Le processus n'existe pas
107
92
  puts "Recording already stopped or PID not found."
108
93
  end
@@ -133,7 +118,6 @@ class EDen
133
118
  stdin, stdout, stderr, wait_thr = Open3.popen3(command)
134
119
  pid = wait_thr.pid # Sauvegarder le PID du processus ffmpeg
135
120
  msg = { output_file: output_file, media: :audio, record: :stop, data: data }
136
- # puts "pid class : #{pid.class}"
137
121
  Thread.new { wait_thr.join; finished(msg, pid, message_id, ws) }
138
122
  elsif media == 'video'
139
123
  resolution = "1280x720"
@@ -148,8 +132,7 @@ class EDen
148
132
  msg = { output_file: output_file, media: :video, record: :stop, data: data }
149
133
  Thread.new { wait_thr.join; finished(msg, pid, message_id, ws) }
150
134
  else
151
- # nothing here
152
-
135
+ #
153
136
  end
154
137
 
155
138
  { pid: pid, return: "path : #{path} record : #{media} received : duration #{duration} : name: #{name}, pid: #{pid}", message_id: message_id }
@@ -172,53 +155,14 @@ class EDen
172
155
  end
173
156
  end
174
157
 
175
- #
176
- # def authorization(data, message_id, ws)
177
- # # database connexion :
178
- # db = db_access
179
- # # retrieving data from the 'security' table
180
- # security_items = db[:user]
181
- # # retrieving sent data
182
- # user_password = data["particles"]["password"]
183
- # # database search
184
- # user_exists = security_items.where(password: user_password).first
185
- #
186
- # if !user_exists
187
- # puts "no user or password lost"
188
- # @@mail = nil
189
- # puts "authorization @@mail du else : #{@@mail}"
190
- # return { return: 'Password recu', message_id: message_id }
191
- # else
192
- # puts "user_exists : #{user_exists}"
193
- # @@pass = user_password
194
- # puts "authorization @@pass : #{@@pass}"
195
- # puts "authorization @@mail du else : #{@@mail}"
196
- # if @@mail && @@pass
197
- # puts "authorization @@pass v2 : #{@@pass}"
198
- # puts "authorization @@mail du else v2 : #{@@mail}"
199
- # # reset variables containing mail and password
200
- # @@mail = nil
201
- # @@pass = nil
202
- # # return { return: 'Password trouvé, cherche mdp', password_authorized: false, message_id: message_id }
203
- # return { return: 'logged', password_authorized: true, user_id: user_exists[:user_id], message_id: message_id }
204
- # # Send the user account template
205
- # else
206
- # return { return: 'Password trouvé, cherche mdp', password_authorized: false, message_id: message_id }
207
- # end
208
- # end
209
- # end
210
158
 
211
159
  def localstorage(data, message_id, ws)
212
- # return test
213
- # ws.send(return_message.to_json)
214
- return { return: 'localstorage content received', authorized: true, message_id: message_id }
160
+ { return: 'localstorage content received', authorized: true, message_id: message_id }
215
161
 
216
162
  end
217
163
 
218
164
  def historicize(data, message_id, ws)
219
- # return test
220
- # ws.send(return_message.to_json)
221
- return { return: 'item to historicize received', authorized: true, message_id: message_id }
165
+ { return: 'item to historicize received', authorized: true, message_id: message_id }
222
166
 
223
167
  end
224
168
 
@@ -232,7 +176,6 @@ class EDen
232
176
  def create_db_table(data, message_id, ws)
233
177
  table = data['table']
234
178
  type = data['type']
235
- primary = data['primary']
236
179
  Database.create_table(table, type)
237
180
  { data: { message: "table #{table} added" }, message_id: message_id }
238
181
  end
@@ -252,24 +195,6 @@ class EDen
252
195
  end
253
196
 
254
197
  def account_creation(data, message_id, ws)
255
-
256
- # imap = Net::IMAP.new('imap.ionos.fr', 993, true)
257
- # imap.login('jeezs@jeezs.net', 'Rhezurhect1on!')
258
- # imap.select('INBOX')
259
-
260
- # # Cherche les emails non lus
261
- # imap.search(["UNSEEN"]).each do |message_id|
262
- # # Récupère l'email
263
- # envelope = imap.fetch(message_id, "ENVELOPE")[0].attr["ENVELOPE"]
264
- # puts "From: #{envelope.from[0].name}"
265
- # puts "Subject: #{envelope.subject}"
266
- #
267
- # # Marque l'email comme lu
268
- # imap.store(message_id, "+FLAGS", [:Seen])
269
- # end
270
- #
271
- # imap.logout
272
- # imap.disconnect
273
198
  { data: { message: "envoi de validation a #{data['email']}" }, message_id: message_id }
274
199
  end
275
200
 
@@ -62,8 +62,5 @@
62
62
  }
63
63
  }, {passive: false});
64
64
 
65
-
66
-
67
-
68
65
  </script>
69
66
  </html>
@@ -22,12 +22,6 @@
22
22
  <script type="text/javascript" src="js/third_parties/papaparse.min.js" defer></script>
23
23
  <script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
24
24
  <script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
25
- <!-- <script>-->
26
- <!-- // to prevent right click-->
27
- <!-- document.addEventListener("contextmenu", function (e) {-->
28
- <!-- e.preventDefault();-->
29
- <!-- });-->
30
- <!-- </script>-->
31
25
  <title>atome</title>
32
26
  </head>
33
27
  <body id='user_view' class='atome'>
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.7.3.9
4
+ version: 0.5.7.4.2
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-06-16 00:00:00.000000000 Z
11
+ date: 2024-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -475,10 +475,7 @@ files:
475
475
  - lib/atome/utilities/utilities.rb
476
476
  - lib/atome/version.rb
477
477
  - lib/atome_relative.rb
478
- - lib/molecules/_deprecated_examples/site.rb
479
478
  - lib/molecules/init.rb
480
- - lib/molecules/intuition/_deprecated_inputs.rb
481
- - lib/molecules/intuition/_deprecated_toolbox.rb
482
479
  - lib/molecules/intuition/tools.rb
483
480
  - lib/molecules/intuition/utilities.rb
484
481
  - lib/platform_specific/opal/atome_opal_extensions.rb
@@ -487,7 +484,6 @@ files:
487
484
  - lib/platform_specific/opal/extensions/js.rb
488
485
  - lib/platform_specific/opal/extensions/object.rb
489
486
  - lib/platform_specific/opal/extensions/ping.rb
490
- - lib/platform_specific/opal/extensions/sha.rb
491
487
  - lib/platform_specific/opal/opal.rb
492
488
  - lib/platform_specific/opal/opal_parser.rb
493
489
  - lib/platform_specific/wasm/atome_wasm_extensions.rb
@@ -1,34 +0,0 @@
1
-
2
- new(application: {name: :compose })
3
-
4
-
5
- grab(:toto).color(:cyan)
6
-
7
- def layout
8
- compose_back=box
9
-
10
- compose_back.color({ alpha: 0 })
11
- media_reader=compose_back.box({left: 99, width: 250, height: 250, top: 99})
12
- viewer_1=compose_back.box({left: 360, width: 250, height: 250, top: 99})
13
- viewer_2=compose_back.box({left: 690, width: 250, height: 250, top: 99})
14
- timeline=compose_back.box({left: 99, width: 250, height: 250, top: 399})
15
- login=compose_back.text(:log)
16
- login.touch(true) do
17
- compose_back.delete(true)
18
- # grab(:view).clear(true)
19
- form
20
- end
21
-
22
- end
23
-
24
- def form
25
- form1=box
26
- form1.text(:login)
27
-
28
- form1.touch(true) do
29
- form1.delete(true)
30
- layout
31
- end
32
-
33
- end
34
- form
@@ -1,111 +0,0 @@
1
- # # frozen_string_literal: true
2
- #
3
- # # def atome_common(atome_preset, params)
4
- # # basic_params = { renderers: [] }
5
- # # # TODO : remove Essentials.default_params[atome_preset] || {} as it is
6
- # # # applied twice because preset is now a particle
7
- # # preset_params = Essentials.default_params[atome_preset] || {}
8
- # #
9
- # # basic_params[:type] = preset_params[:type] || :element
10
- # # basic_params[:id] = params[:id] || identity_generator(atome_preset)
11
- # # basic_params[:renderers] = @renderers || preset_params[:renderers]
12
- # # essential_params = basic_params.merge(preset_params)
13
- # # reordered_params = essential_params.reject { |key, _| params.has_key?(key) }
14
- # # params = reordered_params.merge(params)
15
- # #
16
- # # # condition to handle color/shadow/paint atomes that shouldn't be attach to view
17
- # # # TODO : add category for atome( material/physical vs modifier : color, shadow, .. vs shape, image ..)
18
- # # # then add condition same things fo code in genesis new_atome
19
- # # if %i[color shadow paint].include?(atome_preset)
20
- # # unless params[:affect]
21
- # # params[:affect] = if @id == :view
22
- # # [:black_matter]
23
- # # else
24
- # # [@id]
25
- # # end
26
- # # end
27
- # # else
28
- # # params[:attach] = params[:attach] || @id || :view
29
- # # end
30
- # # params
31
- # # end
32
- # #
33
- # # def preset_common(params, &bloc)
34
- # # # if an atome with current id exist we update the ID in the params
35
- # # params[:id] = "#{params[:id]}_#{Universe.atomes.length}" if grab(params[:id])
36
- # # Atome.new(params, &bloc)
37
- # # end
38
- # # class EVe < Atome
39
- # class EVe < Atome
40
- # def initialize
41
- # @atomes = {}
42
- # end
43
- #
44
- # def atome(atome_to_find)
45
- # @atomes[atome_to_find]
46
- # end
47
- #
48
- # def input_box(params = {}, &bloc)
49
- # height_wanted = 15
50
- # width_wanted = 222
51
- # input_back = Atome.new(
52
- # { renderers: [:html], id: :input_back, type: :shape, attach: :view, apply: [:shape_color],
53
- # left: 120, top: 120,data: '', width: width_wanted, height: height_wanted + height_wanted * 20 / 100, smooth: 6 })
54
- #
55
- # @atomes[:input_back] = input_back
56
- #
57
- # Atome.new(
58
- # { renderers: [:html], id: :input_text_color, type: :color, tag: ({ system: true, persistent: true }),
59
- # red: 0.1, green: 0.1, blue: 0.1, alpha: 1 }
60
- # )
61
- #
62
- # text_input = Atome.new(
63
- # { renderers: [:html], id: :input_text, type: :text, apply: [:input_text_color], component: { size: height_wanted },
64
- # data: :input, left: height_wanted * 20 / 100, top: 0, edit: true, attach: :input_back, height: height_wanted, position: :absolute })
65
- #
66
- # text_input.touch(true) do
67
- # text_input.component({ selected: { color: 'rgba(0,0,0,0.3)', text: :orange } })
68
- # end
69
- #
70
- # text_input.keyboard(:down) do |native_event|
71
- # event = Native(native_event)
72
- # if event[:keyCode].to_s == '13'
73
- # # we prevent the input
74
- # event.preventDefault()
75
- # end
76
- #
77
- # end
78
- #
79
- # text_input.keyboard(:up) do |native_event|
80
- # input_back.data=text_input.data
81
- # end
82
- # @atomes[:input_text] = text_input
83
- #
84
- # input_back
85
- # end
86
- #
87
- # end
88
- #
89
- # def input(params = {}, &proc)
90
- # text_color = :white
91
- # text_size = 12
92
- # back_color = :gray
93
- # width = 2000
94
- # in_b = EVe.new()
95
- # in_b.input_box
96
- # end
97
- #
98
- # i= input
99
- #
100
- # b=box({top: 0, left: 0, width: 33, height: 33})
101
- # b.touch(true) do
102
- # puts "i.data : #{i.data}"
103
- # end
104
- # i.left(66)
105
- # i.color(:white)
106
- # i.text.left(55)
107
- #
108
- #
109
- #
110
- #
111
- #