atome 0.5.7.3.6 → 0.5.7.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/documentation/deep learning/architecture.txt +4 -4
  4. data/documentation/deep learning/basic_infos.txt +2 -2
  5. data/documentation/deep learning/example_of_users_code.rb +43 -43
  6. data/documentation/installation/buiding_atome.md +2 -2
  7. data/lib/atome/atome.rb +1 -1
  8. data/lib/atome/extensions/atome.rb +22 -19
  9. data/lib/atome/genesis/atomes.rb +1 -1
  10. data/lib/atome/genesis/genesis.rb +19 -19
  11. data/lib/atome/genesis/particles/geometry.rb +3 -3
  12. data/lib/atome/genesis/particles/hierarchy.rb +56 -21
  13. data/lib/atome/genesis/particles/material.rb +13 -1
  14. data/lib/atome/genesis/particles/property.rb +27 -0
  15. data/lib/atome/genesis/particles/utility.rb +199 -91
  16. data/lib/atome/genesis/sparkle.rb +1 -1
  17. data/lib/atome/kernel/black_matter.rb +3 -0
  18. data/lib/atome/utilities/utilities.rb +19 -8
  19. data/lib/atome/version.rb +2 -1
  20. data/lib/molecules/intuition/tools.rb +30 -30
  21. data/lib/molecules/intuition/utilities.rb +169 -87
  22. data/lib/platform_specific/opal/extensions/object.rb +1 -1
  23. data/lib/renderers/html/html.rb +26 -1
  24. data/vendor/assets/application/examples/account.rb +35 -0
  25. data/vendor/assets/application/examples/actor&role.rb +23 -0
  26. data/vendor/assets/application/examples/animation.rb +1 -1
  27. data/vendor/assets/application/examples/applications.rb +11 -10
  28. data/vendor/assets/application/examples/atome.rb +1 -1
  29. data/vendor/assets/application/examples/attach.rb +7 -7
  30. data/vendor/assets/application/examples/attached.rb +13 -15
  31. data/vendor/assets/application/examples/basic_understanding.rb +1 -1
  32. data/vendor/assets/application/examples/buttons.rb +47 -0
  33. data/vendor/assets/application/examples/clear.rb +12 -12
  34. data/vendor/assets/application/examples/clones&monitoring.rb +1 -1
  35. data/vendor/assets/application/examples/delete.rb +19 -14
  36. data/vendor/assets/application/examples/detach.rb +8 -0
  37. data/vendor/assets/application/examples/dig.rb +1 -1
  38. data/vendor/assets/application/examples/display.rb +6 -6
  39. data/vendor/assets/application/examples/drag.rb +1 -1
  40. data/vendor/assets/application/examples/duplicate.rb +6 -6
  41. data/vendor/assets/application/examples/exchange.rb +17 -0
  42. data/vendor/assets/application/examples/generator_and_build.rb +3 -3
  43. data/vendor/assets/application/examples/hierarchy.rb +5 -5
  44. data/vendor/assets/application/examples/layout.rb +1 -1
  45. data/vendor/assets/application/examples/preset.rb +3 -3
  46. data/vendor/assets/application/examples/selected.rb +1 -1
  47. data/vendor/assets/application/examples/shapes.rb +1 -1
  48. data/vendor/assets/application/examples/size.rb +1 -1
  49. data/vendor/assets/application/examples/test.rb +0 -320
  50. data/vendor/assets/application/examples/tools.rb +136 -192
  51. data/vendor/assets/application/examples/unfasten.rb +17 -0
  52. data/vendor/assets/server/atome_server.rb +1 -0
  53. data/vendor/assets/server/eDen.rb +68 -71
  54. data/vendor/assets/src/index_server_wasm.html +4 -0
  55. data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
  56. data/vendor/assets/src/js/third_parties/three.min.js +1 -1
  57. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
  58. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
  59. metadata +8 -2
@@ -3,7 +3,7 @@ def detach_child(child)
3
3
  return unless child.attach
4
4
 
5
5
  parent = grab(child.attach)
6
- parent.attached.delete(@id)
6
+ parent.fasten.delete(@id)
7
7
 
8
8
  end
9
9
 
@@ -16,13 +16,13 @@ def attachment_common(child_id, parents_id, direction, &user_proc)
16
16
  parent_found = grab(parents_id)
17
17
  if direction == :attach
18
18
  if parent_found
19
- parent_found.attached ||= []
20
- parent_found.attached.push(@id) unless parent_found.attached.include?(@id)
19
+ parent_found.fasten ||= []
20
+ parent_found.fasten.push(@id) unless parent_found.fasten.include?(@id)
21
21
  detach_child(self)
22
22
  render(:attach, parents_id, &user_proc)
23
23
  else
24
24
  # we remove the current id from parent
25
- # grab(attach).attached.delete(@id)
25
+ # grab(attach).fasten.delete(@id)
26
26
  end
27
27
  else
28
28
  child_found = grab(child_id)
@@ -36,19 +36,41 @@ new({ particle: :attach, category: :hierarchy, type: :string, render: false }) d
36
36
  parents_id
37
37
  end
38
38
 
39
- new({ particle: :attached, category: :hierarchy, type: :string, render: false }) do |children_ids, &user_proc|
39
+ new({ particle: :fasten, category: :hierarchy, type: :string, render: false }) do |children_ids, &user_proc|
40
40
  children_ids = [children_ids] unless children_ids.instance_of?(Array)
41
41
  parents_id = @id
42
42
  children_ids.each do |children_id|
43
- attachment_common(children_id, parents_id, :attached, &user_proc)
43
+ attachment_common(children_id, parents_id, :fasten, &user_proc)
44
44
  end
45
45
  children_ids
46
46
  end
47
47
 
48
- new({ sanitizer: :attached }) do |children_ids|
48
+ new({ sanitizer: :fasten }) do |children_ids|
49
49
  children_ids
50
50
  end
51
51
 
52
+ new({ particle: :unfasten }) do |params|
53
+ params = fasten if params == :all
54
+ dup_params = params.dup
55
+ dup_params.each do |param|
56
+ if fasten.include?(param)
57
+ fasten.delete(param)
58
+ atome_to_unfasten = grab(param)
59
+ atome_to_unfasten_left = atome_to_unfasten.left
60
+ atome_to_unfasten_top = atome_to_unfasten.top
61
+ parent_top = top
62
+ parent_left = left
63
+ atome_to_unfasten.attach(:view)
64
+ atome_to_unfasten.left(atome_to_unfasten_left + parent_left)
65
+ atome_to_unfasten.top(atome_to_unfasten_top + parent_top)
66
+ end
67
+ end
68
+ end
69
+
70
+ new({ particle: :detach }) do |params|
71
+ grab(params).unfasten([id])
72
+ end
73
+
52
74
  new({ particle: :apply, category: :hierarchy, type: :string, render: false, store: false }) do |parents_ids, &user_proc|
53
75
  @apply ||= []
54
76
  parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
@@ -88,18 +110,31 @@ new({ particle: :affect, category: :hierarchy, type: :string, render: false }) d
88
110
  children_ids
89
111
  end
90
112
 
91
- new({ particle: :detached, category: :hierarchy, type: :string, store: false }) # unfastened
92
- new({ sanitizer: :detached }) do |values|
93
- # unfastened
94
- if values.instance_of? Array
95
- values.each do |value|
96
- detach_atome(value)
97
- end
98
- else
99
- detach_atome(values)
100
- # we sanitize the values so it always return an array to the renderer
101
- values = [values]
102
- end
103
- values
104
- end
113
+ # new({ particle: :detached, category: :hierarchy, type: :string, store: false }) # unfastened
114
+ # new({ sanitizer: :detached }) do |values|
115
+ # # unfastened
116
+ # if values.innew({ particle: :detached, category: :hierarchy, type: :string, store: false }) # unfastened
117
+ # # new({ sanitizer: :detached }) do |values|
118
+ # # # unfastened
119
+ # # if values.instance_of? Array
120
+ # # values.each do |value|
121
+ # # detach_atome(value)
122
+ # # end
123
+ # # else
124
+ # # detach_atome(values)
125
+ # # # we sanitize the values so it always return an array to the renderer
126
+ # # values = [values]
127
+ # # end
128
+ # # values
129
+ # # endstance_of? Array
130
+ # values.each do |value|
131
+ # detach_atome(value)
132
+ # end
133
+ # else
134
+ # detach_atome(values)
135
+ # # we sanitize the values so it always return an array to the renderer
136
+ # values = [values]
137
+ # end
138
+ # values
139
+ # end
105
140
  new({ particle: :collect, category: :hierarchy, type: :string })
@@ -73,7 +73,7 @@ new({ post: :remove }) do |params|
73
73
  end
74
74
  else
75
75
  # the systems send an id we have to remove it from parent too
76
- grab(params).attached.delete(id)
76
+ grab(params).fasten.delete(id)
77
77
  grab(params).affect.delete(id)
78
78
  end
79
79
  params
@@ -119,3 +119,15 @@ end
119
119
  new({ particle: :fill, category: :material, type: :array })
120
120
 
121
121
  new({ particle: :opacity, category: :material, type: :int })
122
+
123
+ new({ particle: :exchange }) do |params, &bloc|
124
+ params.each_key do |part_f|
125
+ part_to_remove = send(part_f)
126
+ if part_to_remove.instance_of?(Array)
127
+ part_to_remove.each do |part_to_r|
128
+ remove(part_to_r)
129
+ end
130
+ end
131
+ set(params)
132
+ end
133
+ end
@@ -147,3 +147,30 @@ new({ particle: :behavior, type: :symbol, category: :property })
147
147
  new({ particle: :orientation, type: :symbol, category: :property })
148
148
 
149
149
  new({ particle: :align , type: :symbol, category: :property })
150
+
151
+ new({ particle: :actor, store: false }) do |params|
152
+ @actor ||= {}
153
+ if params[:remove]
154
+ params[:remove].each do |atome_id, role|
155
+ @actor[role].delete(atome_id)
156
+ end
157
+ else
158
+ params.each do |atome_id, role|
159
+ grab(atome_id).role(role)
160
+ @actor[role] ||= []
161
+ @actor[role] << atome_id
162
+ end
163
+ end
164
+ end
165
+
166
+ new({ particle: :role, store: false }) do |params|
167
+ if params.instance_of? Hash
168
+ if params.keys[0] == :remove
169
+ @role.delete(params.values[0])
170
+ end
171
+ else
172
+ @role ||= []
173
+ @role << params
174
+ end
175
+ end
176
+
@@ -29,15 +29,16 @@ end
29
29
 
30
30
  # new({ particle: :broadcast })
31
31
 
32
- def delete_recursive(atome_id, force = false)
32
+
33
+ def delete_recursive(atome_id, force=false)
33
34
  return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system]) unless force
34
35
 
35
36
  parent_id_found = grab(atome_id).attach
36
37
  parent_found = grab(parent_id_found)
37
- new_array = parent_found.attached.dup
38
+ new_array = parent_found.fasten.dup
38
39
  new_array.delete(atome_id)
39
- parent_found.instance_variable_set('@attached', new_array)
40
- grab(atome_id).attached.each do |atome_id_found|
40
+ parent_found.instance_variable_set('@fasten', new_array)
41
+ grab(atome_id).fasten.each do |atome_id_found|
41
42
  delete_recursive(atome_id_found, force)
42
43
  end
43
44
  grab(atome_id).render(:delete, { :recursive => true })
@@ -46,105 +47,206 @@ def delete_recursive(atome_id, force = false)
46
47
  end
47
48
 
48
49
  new({ particle: :delete, category: :utility, type: :boolean, render: false }) do |params|
50
+ if params == true
49
51
 
50
- basic_system_object = %i[view eDen black_matter intuition copy atome
51
- user_view view_color shape_color
52
- box_color invisible_color text_color circle_color back_selection
53
- text_selection nil
54
- ]
55
-
56
- unless basic_system_object.include?(id) || id.nil?
57
-
58
- if params == true
59
- # We use the tag persistent to exclude color of system object and other default colors
60
- unless @tag && (@tag[:persistent] || @tag[:system])
61
- # if we are on a matrix we delete cells found & group found
62
- cells.delete(true)
63
- group.delete(true)
64
- # now we detach the atome from it's parent
65
- # now we init rendering
66
- render(:delete, params)
67
- # the machine delete the current atome from the universe
68
- id_found = @id.to_sym
69
- if @attach
70
- parent_found = grab(@attach)
71
- parent_found.attached.delete(id_found)
72
- end
73
- @affect&.each do |affected_atome|
74
- affected_found = grab(affected_atome)
75
- affected_found.apply.delete(id_found)
76
- affected_found.refresh
77
- end
78
-
79
- # Universe.delete(@aid)
80
- end
81
- elsif params.instance_of? Hash
52
+ # We use the tag persistent to exclude color of system object and other default colors
53
+ unless @tag && (@tag[:persistent] || @tag[:system])
82
54
  # if we are on a matrix we delete cells found & group found
83
55
  cells.delete(true)
84
56
  group.delete(true)
85
- if params[:recursive]
86
- unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
87
- attached.each do |atttached_atomes|
88
- delete_recursive(atttached_atomes)
89
- end
90
- # touch(:remove)
91
- # render(:delete, params)
92
- # Universe.delete(@aid)
93
- end
94
- elsif params[:force]
95
- attached.each do |atttached_atomes|
96
- # alert "attached : #{attached}"
97
- delete_recursive(atttached_atomes, true)
98
- end
99
- # touch(:remove)
100
- # render(:delete, params)
101
- # Universe.delete(@aid)
102
- else
103
- # the machine try to find the sub particle id and remove it eg a.delete(monitor: :my_monitor) remove the monitor
104
- # with id my_monitor
105
- params.each do |param, value|
106
- atome[param][value] = nil
57
+ # now we detach the atome from it's parent
58
+ # now we init rendering
59
+ render(:delete, params)
60
+ # the machine delete the current atome from the universe
61
+ id_found = @id.to_sym
62
+ if @attach
63
+ parent_found = grab(@attach)
64
+ parent_found.fasten.delete(id_found)
65
+ end
66
+ @affect&.each do |affected_atome|
67
+ affected_found = grab(affected_atome)
68
+ affected_found.apply.delete(id_found)
69
+ affected_found.refresh
70
+ end
71
+ Universe.delete(@aid)
72
+ end
73
+ # elsif params == :force
74
+ # cells.delete(true)
75
+ # group.delete(true)
76
+ # # now we detach the atome from it's parent
77
+ # # now we init rendering
78
+ # render(:delete, params)
79
+ # # the machine delete the current atome from the universe
80
+ # id_found = @id.to_sym
81
+ # if @attach
82
+ # parent_found = grab(@attach)
83
+ # parent_found.fasten.delete(id_found)
84
+ # end
85
+ # @affect&.each do |affected_atome|
86
+ # affected_found = grab(affected_atome)
87
+ # affected_found.apply.delete(id_found)
88
+ # affected_found.refresh
89
+ # end
90
+ # Universe.delete(@aid)
91
+ elsif params.instance_of? Hash
92
+ # if we are on a matrix we delete cells found & group found
93
+ cells.delete(true)
94
+ group.delete(true)
95
+ if params[:recursive]
96
+ unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
97
+ fasten.each do |atttached_atomes|
98
+ delete_recursive(atttached_atomes)
107
99
  end
100
+ touch(:remove)
101
+ render(:delete, params)
102
+ Universe.delete(@aid)
103
+ end
104
+ elsif params[:force]
105
+ fasten.each do |atttached_atomes|
106
+ # alert "fasten : #{fasten}"
107
+ delete_recursive(atttached_atomes, true)
108
108
  end
109
+ touch(:remove)
110
+ render(:delete, params)
111
+ # alert "Universe : #{Universe.atomes[@aid]}"
112
+ # alert "length = #{Universe.atomes.length}"
113
+ Universe.delete(@aid)
114
+ # alert "Universe : #{Universe.atomes.length}"
109
115
 
110
- elsif Universe.atome_list.include?(params)
111
- # we check if the params passed is an atome to treat it in a different way
112
- puts "write code here : #{apply} , #{attached}"
113
116
  else
114
- send(params, 0) unless params == :id
115
- end
116
- touch(:remove)
117
- drag(false)
118
- drop(false)
119
- on(false)
120
- keyboard(false)
121
- resize(:remove)
122
- overflow(:remove)
123
-
124
- render(:delete, params)
125
- Universe.delete(@aid)
126
-
127
- exclusions = %i[@history @renderers @type @tag @html]
128
-
129
- instance_variables.each do |i_var|
130
- unless exclusions.include?(i_var)
131
- instance_variable_set(i_var, nil)
117
+ # the machine try to find the sub particle id and remove it eg a.delete(monitor: :my_monitor) remove the monitor
118
+ # with id my_monitor
119
+ params.each do |param, value|
120
+ atome[param][value] = nil
132
121
  end
133
122
  end
134
123
 
135
- instance_variable_set('@renderers', [])
124
+ elsif Universe.atome_list.include?(params)
125
+ # we check if the params passed is an atome to treat it in a different way
126
+ puts "write code here : #{apply} , #{fasten}"
127
+ else
128
+ send(params, 0) unless params == :id
136
129
  end
137
-
138
130
  end
139
131
 
132
+
133
+ # def delete_recursive(atome_id, force = false)
134
+ # return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system]) unless force
135
+ #
136
+ # parent_id_found = grab(atome_id).attach
137
+ # parent_found = grab(parent_id_found)
138
+ # new_array = parent_found.fasten.dup
139
+ # new_array.delete(atome_id)
140
+ # parent_found.instance_variable_set('@fasten', new_array)
141
+ # grab(atome_id).fasten.each do |atome_id_found|
142
+ # delete_recursive(atome_id_found, force)
143
+ # end
144
+ # grab(atome_id).render(:delete, { :recursive => true })
145
+ # grab(atome_id).touch(:remove)
146
+ # Universe.delete(grab(atome_id).aid)
147
+ # end
148
+
149
+ # new({ particle: :delete, category: :utility, type: :boolean, render: false }) do |params|
150
+ #
151
+ # basic_system_object = %i[view eDen black_matter intuition copy atome
152
+ # user_view view_color shape_color
153
+ # box_color invisible_color text_color circle_color back_selection
154
+ # text_selection nil
155
+ # ]
156
+ #
157
+ # unless basic_system_object.include?(id) || id.nil?
158
+ # if params == true
159
+ # # We use the tag persistent to exclude color of system object and other default colors
160
+ # unless @tag && (@tag[:persistent] || @tag[:system])
161
+ # # if we are on a matrix we delete cells found & group found
162
+ # cells.delete(true)
163
+ # group.delete(true)
164
+ # # now we detach the atome from it's parent
165
+ # # now we init rendering
166
+ # render(:delete, params)
167
+ # # the machine delete the current atome from the universe
168
+ # id_found = @id.to_sym
169
+ # if @attach
170
+ # parent_found = grab(@attach)
171
+ # parent_found.fasten.delete(id_found)
172
+ # end
173
+ # @affect&.each do |affected_atome|
174
+ # affected_found = grab(affected_atome)
175
+ # affected_found.apply.delete(id_found)
176
+ # affected_found.refresh
177
+ # end
178
+ # # Universe.delete(@aid)
179
+ # end
180
+ # elsif params.instance_of? Hash
181
+ # # if we are on a matrix we delete cells found & group found
182
+ # cells.delete(true)
183
+ # group.delete(true)
184
+ # if params[:recursive]
185
+ # unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
186
+ # fasten.each do |atttached_atomes|
187
+ # delete_recursive(atttached_atomes)
188
+ # end
189
+ # # touch(:remove)
190
+ # # render(:delete, params)
191
+ # # Universe.delete(@aid)
192
+ # end
193
+ # elsif params[:force]
194
+ # fasten.each do |atttached_atomes|
195
+ # # alert "fasten : #{fasten}"
196
+ # delete_recursive(atttached_atomes, true)
197
+ # end
198
+ # # touch(:remove)
199
+ # # render(:delete, params)
200
+ # # Universe.delete(@aid)
201
+ #
202
+ # else
203
+ #
204
+ # # the machine try to find the sub particle id and remove it eg a.delete(monitor: :my_monitor) remove the monitor
205
+ # # with id my_monitor
206
+ # #
207
+ # params.each do |param, value|
208
+ # atome[param][value] = nil
209
+ # end
210
+ # end
211
+ #
212
+ # elsif Universe.atome_list.include?(params)
213
+ # # we check if the params passed is an atome to treat it in a different way
214
+ # puts "write code here : #{apply} , #{fasten}"
215
+ # else
216
+ # send(params, 0) unless params == :id
217
+ # end
218
+ # touch(:remove)
219
+ # drag(false)
220
+ # drop(false)
221
+ # on(false)
222
+ # keyboard(false)
223
+ # resize(:remove)
224
+ # overflow(:remove)
225
+ #
226
+ # render(:delete, params)
227
+ # Universe.delete(@aid)
228
+ #
229
+ # exclusions = %i[@history @renderers @type @tag @html]
230
+ #
231
+ # instance_variables.each do |i_var|
232
+ # unless exclusions.include?(i_var)
233
+ # instance_variable_set(i_var, nil)
234
+ # end
235
+ # end
236
+ #
237
+ # instance_variable_set('@renderers', [])
238
+ # end
239
+ #
240
+ # end
241
+
140
242
  new({ particle: :clear, category: :utility, type: :boolean })
141
243
 
142
244
  new({ post: :clear }) do
143
- attached_found = []
144
- attached.each do |attached_id_found|
145
- attached_found << attached_id_found
245
+ fasten_found = []
246
+ fasten.each do |fasten_id_found|
247
+ fasten_found << fasten_id_found
146
248
  end
147
- attached_found.each do |child_id_found|
249
+ fasten_found.each do |child_id_found|
148
250
  child_found = grab(child_id_found)
149
251
  # we exclude system objects
150
252
  child_found&.delete(true) unless child_found.tag && child_found.tag[:system]
@@ -223,18 +325,18 @@ new({ particle: :duplicate, category: :utility, type: :string, store: false }) d
223
325
  else
224
326
  0
225
327
  end
226
- attached_atomes = []
227
- attached_found = attached.dup
228
- attached_found.each do |child_id_found|
328
+ fasten_atomes = []
329
+ fasten_found = fasten.dup
330
+ fasten_found.each do |child_id_found|
229
331
  child_found = grab(child_id_found)
230
332
  if child_found
231
333
  new_child = child_found.duplicate({})
232
- attached_atomes << new_child.id
334
+ fasten_atomes << new_child.id
233
335
  end
234
336
  end
235
- params[:attached] = attached_atomes
337
+ params[:fasten] = fasten_atomes
236
338
  infos_found = infos.dup
237
- keys_to_delete = %i[history callback duplicate copy paste touch_code html attached aid]
339
+ keys_to_delete = %i[history callback duplicate copy paste touch_code html fasten aid]
238
340
  keys_to_delete.each { |key| infos_found.delete(key) }
239
341
  new_atome_id = "#{@id}_copy_#{copy_number}".to_sym
240
342
  infos_found[:id] = new_atome_id
@@ -331,3 +433,9 @@ new({ particle: :state, category: :utility, type: :symbol })
331
433
  new({ particle: :record, category: :utility, type: :hash })
332
434
  new({ particle: :preview, category: :utility, type: :hash })
333
435
 
436
+ # new(particle: :update) do |params| # specific to buttons molecule for now
437
+ # old_data= data
438
+ # delete({recursive: true})
439
+ # new_content=old_data.merge(params)
440
+ # buttons(new_content)
441
+ # end
@@ -191,7 +191,7 @@ def init_database
191
191
 
192
192
 
193
193
  # now we send localstorage content to the server
194
- puts "sending localstorage"
194
+ # puts "sending localstorage"
195
195
  Atome.send_localstorage_content
196
196
 
197
197
  end
@@ -1,9 +1,12 @@
1
+
1
2
  class Black_matter
2
3
  class << self
3
4
  def encode(string)
5
+ string=string.to_s
4
6
  JS.global.sha256(string.to_s)
5
7
  end
6
8
 
9
+
7
10
  def check_password(input_password, stored_hash)
8
11
  input_hash = encode(input_password)
9
12
  input_hash == stored_hash
@@ -327,7 +327,7 @@ class Atome
327
327
  Atome.define_method("#{element}_callback") do |return_params|
328
328
  # we test if instance_variable_get("@#{element}_code") is a hash for the can se the particle value is a hash
329
329
  proc_found = if instance_variable_get("@#{element}_code").instance_of? Hash
330
- # Then we get the first item of the hash because the proc is attached to it
330
+ # Then we get the first item of the hash because the proc is fasten to it
331
331
  instance_variable_get("@#{element}_code").values.first
332
332
  # instance_exec(@callback[element], proc_found)if proc_found.is_a? Proc
333
333
  else
@@ -430,11 +430,12 @@ class Atome
430
430
  end
431
431
  end
432
432
 
433
- def detach_atome(atome_id_to_detach)
434
- atome_to_detach = grab(atome_id_to_detach)
435
- # TODO: remove the condition below and find why it try to detach an atome that doesn't exist
436
- nil unless atome_to_detach
437
- end
433
+ # def detach_atome(atome_id_to_detach)
434
+ # alert :uuu
435
+ # atome_to_detach = grab(atome_id_to_detach)
436
+ # # TODO: remove the condition below and find why it try to detach an atome that doesn't exist
437
+ # nil unless atome_to_detach
438
+ # end
438
439
 
439
440
  def debug(msg)
440
441
  puts msg
@@ -459,8 +460,8 @@ class Atome
459
460
  remove({ category: attach })
460
461
  category(:atome)
461
462
  attach(grand_parent)
462
- # we delete the parent (the layout) if it no more children attached
463
- if parent_found.attached.length == 0
463
+ # we delete the parent (the layout) if it no more children fasten
464
+ if parent_found.fasten.length == 0
464
465
  parent_found.delete(true)
465
466
  end
466
467
  end
@@ -503,12 +504,22 @@ class Atome
503
504
  # puts "sanitizer temp patch when an atome is passed instead of an id"
504
505
  # @id
505
506
  # end
507
+ # def transform_to_string_keys_and_values(hash)
508
+ # hash.transform_keys(&:to_s).transform_values do |value|
509
+ # if value.is_a?(Hash)
510
+ # transform_to_string_keys_and_values(value)
511
+ # else
512
+ # value.to_s
513
+ # end
514
+ # end
515
+ # end
506
516
 
507
517
  def sync(params, &bloc)
508
518
  params = { data: params } unless params.instance_of? Hash
509
519
  message_id = "msg_#{Universe.messages.length}"
510
520
  params[:message_id] = message_id
511
521
  Universe.store_messages({ msg_nb: message_id, proc: bloc })
522
+ # params = transform_to_string_keys_and_values(params)
512
523
  html.send_message(params)
513
524
  end
514
525
 
data/lib/atome/version.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # return atome version
4
+
4
5
  class Atome
5
- VERSION = '0.5.7.3.6'
6
+ VERSION = '0.5.7.3.9'
6
7
  end