atome 0.5.7.3.5 → 0.5.7.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) 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 +28 -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 +272 -109
  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 +121 -0
  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/scheduler.rb +0 -1
  47. data/vendor/assets/application/examples/selected.rb +1 -1
  48. data/vendor/assets/application/examples/shapes.rb +1 -1
  49. data/vendor/assets/application/examples/size.rb +1 -1
  50. data/vendor/assets/application/examples/test.rb +0 -320
  51. data/vendor/assets/application/examples/tools.rb +136 -192
  52. data/vendor/assets/application/examples/unfasten.rb +17 -0
  53. data/vendor/assets/server/atome_server.rb +1 -0
  54. data/vendor/assets/server/eDen.rb +68 -71
  55. data/vendor/assets/src/index_server_wasm.html +4 -0
  56. data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
  57. data/vendor/assets/src/js/third_parties/three.min.js +1 -1
  58. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
  59. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
  60. metadata +9 -2
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- new({ tool: :blur }) do |params|
4
+
5
+ new({ tool: :combined }) do |params|
5
6
 
6
7
  active_code = lambda {
7
8
  puts :alteration_tool_code_activated
@@ -20,7 +21,7 @@ new({ tool: :blur }) do |params|
20
21
  }
21
22
 
22
23
  zone_spe = lambda { |current_tool|
23
- puts "current tool is : #{:current_tool} now creating specific zone"
24
+ # puts "current tool is : #{:current_tool} now creating specific zone"
24
25
  # b = box({ width: 33, height: 12 })
25
26
  # b.text({ data: :all })
26
27
 
@@ -29,10 +30,12 @@ new({ tool: :blur }) do |params|
29
30
  {
30
31
  activation: active_code,
31
32
  inactivation: inactive_code,
33
+ # alteration: { width: 22, blur: 3 },
32
34
  alteration: { width: 22, blur: 3 },
33
35
  pre: pre_code,
34
36
  post: post_code,
35
37
  zone: zone_spe,
38
+ icon: :color,
36
39
  int8: { french: :couleur, english: :color, german: :colorad } }
37
40
 
38
41
  end
@@ -65,240 +68,181 @@ new({ tool: :box }) do |params|
65
68
 
66
69
  end
67
70
 
68
- new({ tool: :drag }) do |params|
69
-
71
+ new({ tool: :project }) do
70
72
  active_code = lambda {
73
+
74
+ alert :get_projects_now
75
+ # if Atome.selection.instance_of? Array
76
+ # end
71
77
  # Atome.selection.each do |atome_id_to_treat|
72
- # # reinit first to avoid multiple drag event
73
- # grab(atome_id_to_treat).drag(false)
78
+ # # # # reinit first to avoid multiple drag event
79
+ # # # grab(atome_id_to_treat).drag(false)
74
80
  # end
75
81
  # drag_remove
76
82
  # puts :alteration_tool_code_activated
77
83
  }
84
+ { activation: active_code }
85
+ end
78
86
 
79
- inactive_code = lambda { |param|
80
- # puts :alteration_tool_code_inactivated
81
- }
82
- pre_code = lambda { |params|
83
- atome_target = params[:atome_touched]
84
- # puts "==> #{atome_target.drag}"
85
- if atome_target.drag
86
- atome_target.drag(false)
87
- else
88
- atome_target.drag(true)
87
+ new({ tool: :move }) do
88
+ move_active_code = lambda {
89
+ all=grab(:view).fasten
90
+ @previous_selected_atomes=[]
91
+ @previous_draggable_atomes=[]
92
+ all.each do |at_f|
93
+ if grab(at_f).drag
94
+ @previous_draggable_atomes << at_f
95
+ end
96
+ if grab(at_f).selected
97
+ @previous_selected_atomes << at_f
98
+ else
99
+ grab(at_f).selected(true)
100
+ end
89
101
  end
90
-
91
- }
92
- post_code = lambda { |params|
93
- # puts "post_creation_code,atome_touched: #{params}"
94
-
95
102
  }
96
-
97
- zone_spe = lambda { |current_tool|
98
- # puts "current tool is : #{current_tool} now creating specific zone"
99
- # b = box({ width: 33, height: 12 })
100
- # b.text({ data: :all })
101
-
103
+ move_code = lambda {
104
+ drag(true)
102
105
  }
106
+ move_inactive_code = lambda { |data|
107
+ all=grab(:view).fasten
108
+ all.each do |at_f|
109
+ unless @previous_selected_atomes.include?(at_f)
110
+ grab(at_f).selected(false)
111
+ end
112
+ end
113
+ data[:treated].each do |atome_f|
114
+ unless @previous_draggable_atomes.include?(atome_f.id)
115
+ atome_f.drag(false)
116
+ end
103
117
 
104
- {
105
- activation: active_code,
106
- inactivation: inactive_code,
107
- # alteration: { drag: true },
108
- pre: pre_code,
109
- post: post_code,
110
- zone: zone_spe,
111
- int8: { french: :drag, english: :drag, german: :drag } }
112
-
113
- end
114
-
115
- new({ tool: :select }) do |params|
116
- pre_code = lambda { |param|
117
- atome_touched = param[:atome_touched]
118
- current_tool = param[:current_tool]
119
- if atome_touched.selected
120
- atome_touched.selected(false)
121
- current_tool.data[:allow_alteration] = false
122
- else
123
- # alert atome_touched.selected
124
- # alert Atome.selection
125
- atome_touched.selected(true)
126
- # alert atome_touched.selected
127
-
128
- current_tool.data[:allow_alteration] = true
129
118
  end
130
119
  }
131
- {
132
- pre: pre_code,
133
- alteration: { selected: true },
134
- int8: { french: :select, english: :select, german: :select }
135
- }
136
- end
137
120
 
138
- new({ tool: :rotate }) do
139
- { alteration: { height: 150, rotate: 45 } }
121
+ { activation: move_active_code,
122
+ alteration: { event: move_code },
123
+ inactivation: move_inactive_code}
140
124
  end
141
125
 
142
- new({ tool: :move }) do |params|
143
- active_code = lambda {
144
- # if Atome.selection.instance_of? Array
145
- # end
146
- Atome.selection.each do |atome_id_to_treat|
147
- # # # reinit first to avoid multiple drag event
148
- # # grab(atome_id_to_treat).drag(false)
126
+ new({ tool: :drag }) do
127
+ drag_active_code = lambda {
128
+ all=grab(:view).fasten
129
+ @previous_selected_atomes=[]
130
+ all.each do |at_f|
131
+ if grab(at_f).selected
132
+ @previous_selected_atomes << at_f
133
+ else
134
+ grab(at_f).selected(true)
135
+ end
149
136
  end
150
- # drag_remove
151
- # puts :alteration_tool_code_activated
152
137
  }
153
138
 
154
- inactive_code = lambda { |params|
155
- # we remove drag
156
- params[:treated].each do |atome_f|
157
- atome_f.drag(false)
139
+ drag_inactive_code = lambda { |_data|
140
+ all=grab(:view).fasten
141
+ all.each do |at_f|
142
+ unless @previous_selected_atomes.include?(at_f)
143
+ grab(at_f).selected(false)
144
+ end
158
145
  end
159
- # puts :alteration_tool_code_inactivated
160
-
161
146
  }
162
- pre_code = lambda { |params|
163
- atome_target = params[:atome_touched]
164
- # puts "==> #{atome_target.drag}"
165
- if atome_target.drag
166
- # atome_target.drag(false)
167
- else
168
- atome_target.drag(true)
147
+ move_code = lambda {
148
+ drag(true) do
149
+ puts left
169
150
  end
170
-
171
151
  }
172
- post_code = lambda { |params|
173
152
 
174
- # puts "post_creation_code,atome_touched: #{params}"
153
+ { activation: drag_active_code, alteration: { event: move_code }, inactivation: drag_inactive_code }
154
+ end
175
155
 
156
+ new({ tool: :touch }) do
157
+ move_code = lambda {
158
+ touch(:down) do
159
+ color(:red)
160
+ end
176
161
  }
162
+ { alteration: { event: move_code } }
163
+ end
177
164
 
178
- zone_spe = lambda { |current_tool|
179
- # puts "current tool is : #{current_tool} now creating specific zone"
180
- # b = box({ width: 33, height: 12 })
181
- # b.text({ data: :all })
165
+ select_code=lambda{
182
166
 
183
- }
167
+ if selected
168
+ selected(false)
169
+ else
170
+ selected(true)
171
+ end
172
+ # alternate({ selected: true}, {selected: false})
173
+
174
+ }
175
+ new({ tool: :select }) do
176
+
177
+ # { alteration: { selected: true }}
178
+ { alteration: { event: select_code }}
184
179
 
185
- {
186
- activation: active_code,
187
- inactivation: inactive_code,
188
- # alteration: { drag: true },
189
- pre: pre_code,
190
- post: post_code,
191
- zone: zone_spe,
192
- int8: { french: :drag, english: :drag, german: :drag } }
193
180
 
194
181
  end
195
182
 
196
- new({ tool: :project }) do
183
+ new({ tool: :toolbox1 }) do
197
184
  active_code = lambda {
198
-
199
- alert :get_projects_now
200
- # if Atome.selection.instance_of? Array
201
- # end
202
- # Atome.selection.each do |atome_id_to_treat|
203
- # # # # reinit first to avoid multiple drag event
204
- # # # grab(atome_id_to_treat).drag(false)
205
- # end
206
- # drag_remove
207
- # puts :alteration_tool_code_activated
185
+ toolbox({ tools: [:combined], toolbox: { orientation: :ew, left: 90, bottom: 9, spacing: 9 } })
208
186
  }
209
187
  { activation: active_code }
210
188
  end
211
189
 
212
- new({tool: :test}) do
190
+ new({ tool: :color }) do
213
191
  active_code = lambda {
214
- b=grab(:view).box({})
215
- b.touch(true) do
216
- alert :kool
192
+ puts 'color activated1'
193
+ }
194
+ color_code = lambda {
195
+ # color(:green)
196
+ # tools_values
197
+ }
198
+ inactive_code = lambda { |data|
199
+ data[:treated].each do |atome_f|
200
+ # atome_f.drag(false)
201
+ # atome_f.color(:green)
217
202
  end
218
203
  }
219
- # active_code=:tito
220
- { activation: active_code }
221
- end
222
-
223
204
 
224
- Universe.tools_root=[:box, :blur, :drag, :rotate, :select, :move,:project]
225
- # Universe.tools_root=[:test]
226
- Atome.init_intuition
205
+ { activation: active_code,
206
+ alteration: { event: color_code },
207
+ inactivation: inactive_code,
208
+ target: :color,
209
+ particles: { red: 0, green: 0.5, blue: 1, alpha: 1 }}
210
+ end
227
211
 
212
+ new({ tool: :crash_test }) do
213
+ active_code = lambda {
214
+ puts 'color activated1'
215
+ }
216
+ color_code = lambda {
217
+ # color(:green)
218
+ # tools_values
219
+ }
220
+ inactive_code = lambda { |data|
221
+ data[:treated].each do |atome_f|
222
+ end
223
+ }
228
224
 
225
+ {
226
+ alteration: { width: 22},
227
+ }
228
+ end
229
229
 
230
- # ################### check below
231
-
232
- # b = box({ left: 123, top: 66, selected: false, id: :the_box, color: :green })
233
- # b.touch(:down) do
234
- # puts " on touch : #{Universe.allow_localstorage}"
235
- # end
236
- # b.resize(true) do
237
- # puts :good!
238
- # end
239
- # the_circ = circle({ left: 123, top: 120, selected: false, id: :the_circle })
240
- #
241
- # the_circ.touch(:down) do |params|
242
- # puts " down : params: #{params}, id: #{the_circ.id}"
243
- # end
244
- #
245
- # the_circ.touch(:up) do
246
- # puts "up :kool"
247
- # end
248
- # the_circ.drag(true) do
249
- # puts "drag : now"
250
- # end
251
- #
252
- # bb = box({ left: 333, width: 120, selected: false, id: :big_box })
253
- #
254
- # b = box({ id: :the_big_boxy })
255
-
256
- #################@
257
- # text({ data: :hello, selected: true, left: 120, id: :texting, blur: 12 })
258
- # text({data: :hello, left: 120, id: :texting})
259
- # Universe.tools.each_with_index do |(tool_name, bloc), index|
260
- # Atome.instance_exec(&bloc) if bloc.is_a?(Proc)
261
- # # alert "#{tool_name} : #{tool_content}"
262
- # # alert b.id
263
- # end
264
-
265
- # wait 2 do
266
- # # c.preset( {:box=>{:width=>39, :height=>39, :apply=>[:box_color], :left=>0, :top=>0}} )
267
- # c.preset( :box )
268
- # end
269
- # b=box({left: 333, top: 333})
270
- # b.touch(true) do
271
- # alert Atome.selection
272
- # end
273
- # grab(:the_texting).color(:white)
274
- # grab(:the_texting).left(33)
275
- # grab(:the_texting).top(133)
276
- # grab(:the_texting).width(133)
277
- # grab(:the_texting).top(133)
278
- # grab(:the_texting).data(:kool)
279
- # grab(:the_texting).type(:text)
280
- # grab(:the_texting).rotate(:text)
281
-
282
- # b=box
283
- # b.touch(true) do
284
- # puts :ok
285
- # # alert b.instance_variable_get('@touch')
286
- # # alert b.instance_variable_get('@touch_code')
287
- # b.touch(false)
288
- # wait 3 do
289
- # puts :ready
290
- # b.touch(true) do
291
- # puts :kool
292
- # end
293
- # # alert b.touch
294
- # # alert b.instance_variable_get('@touch')
295
- # # alert b.instance_variable_get('@touch_code')
296
- # end
297
- # end
298
-
299
- # A.html.record
300
-
301
- # A.html.record
230
+ # Universe.tools_root= {tools: [:blur, :box, :test, :toolbox1],toolbox: { orientation: :ew, left:90 , bottom: 9, spacing: 9} }
231
+ Universe.tools_root = {id: :root_tools, tools: [:select,:crash_test, :box, :drag, :touch,:color, :move, :toolbox1], toolbox: { orientation: :ew, left: 9, bottom: 9, spacing: 9 } }
232
+ puts "above we added an id because each tool may be in many toolbox and have an uniq ID"
233
+ Atome.init_intuition
302
234
 
235
+ b = box({ id: :the_test__box, selected: true })
236
+ c=circle({ left: 90, id: :the_test_circle, selected: false })
237
+ c.drag(true) do
238
+ puts "moving"
239
+ end
240
+ b.touch(true) do
241
+ if b.width == 170
242
+ b.width(55)
243
+ else
244
+ b.width(170)
245
+ end
303
246
 
247
+ end
304
248
 
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ b = box({ drag: true, id: :the_b })
5
+ c = b.circle({ left: 99, id: :the_c })
6
+ t = b.text({ data: :hello, left: 44, top: 44, id: :the_t })
7
+ c.touch(:down) do
8
+ b.unfasten([c.id])
9
+ b.color(:green)
10
+ t.data('circle unfasten')
11
+ wait 3 do
12
+ b.color(:red)
13
+ t.data('unfasten all attached atomes')
14
+ b.unfasten(:all)
15
+ end
16
+
17
+ end
@@ -10,6 +10,7 @@ require 'faye/websocket'
10
10
  require 'geocoder'
11
11
  require 'json'
12
12
  require 'mail'
13
+ require 'net/imap'
13
14
  require 'net/ping'
14
15
  require 'roda'
15
16
  require 'rufus-scheduler'
@@ -4,14 +4,8 @@
4
4
 
5
5
  class EDen
6
6
 
7
- @@mail = nil
8
- @@pass = nil
9
-
10
7
  class << self
11
8
 
12
- @@mail = nil
13
- @@pass = nil
14
-
15
9
  def db_access
16
10
  Database.db_access
17
11
  end
@@ -32,17 +26,17 @@ class EDen
32
26
  email_exists_response = !user.nil?
33
27
  puts "email_exists_response : #{email_exists_response}"
34
28
  # response return
35
- { data: {email_exist: email_exists_response}, message_id: message_id }
29
+ { data: { email_exist: email_exists_response }, message_id: message_id }
36
30
  end
37
31
 
38
32
  def terminal(data, message_id, ws)
39
33
  { data: { message: `#{data}` }, message_id: message_id }
40
34
  end
41
35
 
42
- def sanitize_email(email)
43
- invalid_chars_pattern = /[^a-zA-Z0-9.-@]+/
44
- email.gsub(invalid_chars_pattern, '')
45
- end
36
+ # def sanitize_email(email)
37
+ # invalid_chars_pattern = /[^a-zA-Z0-9.-@]+/
38
+ # email.gsub(invalid_chars_pattern, '')
39
+ # end
46
40
 
47
41
  def metadata(msg, pid, message_id, ws)
48
42
 
@@ -78,7 +72,6 @@ class EDen
78
72
  end
79
73
  end
80
74
 
81
-
82
75
  ws.send({ :pid => pid, :return => msg, :message_id => message_id }.to_json)
83
76
  end
84
77
 
@@ -97,11 +90,9 @@ class EDen
97
90
  metadata(msg, pid, message_id, ws)
98
91
 
99
92
  ##### read tag
100
- msg[:read]=true
93
+ msg[:read] = true
101
94
  metadata(msg, pid, message_id, ws)
102
95
 
103
-
104
-
105
96
  ws.send({ :pid => pid, :return => msg, :message_id => message_id }.to_json)
106
97
  end
107
98
 
@@ -171,66 +162,51 @@ class EDen
171
162
  identity_items = db[:user]
172
163
  # retrieving sent data
173
164
  user_email = data["particles"]["email"]
174
- # data cleansing of superfluous characters
175
- sanitized_email = sanitize_email(user_email)
165
+ user_pass = data["particles"]["password"]
176
166
  # database search
177
- mail_exists = identity_items.where(email: sanitized_email).first
178
- # mail_exists = identity_items.where(email: user_email).first
179
- puts 'ok'
180
- if !mail_exists
181
- @@pass = nil
182
- puts "authentication @@pass : #{@@pass}"
183
- { return: 'Email non trouvé, erreur', message_id: message_id }
167
+ user_exist = identity_items.where(email: user_email, password: user_pass).first
168
+ if !user_exist
169
+ { return: 'identifiants incorrects ou compte inexistant', message_id: message_id }
184
170
  else
185
- @@mail = user_email
186
- puts "authentication @@mail du else : #{@@mail}"
187
- puts "authentication @@pass du else : #{@@pass}"
188
- if @@mail && @@pass
189
- puts "authentication @@mail du else v2 : #{@@mail}"
190
- puts "authentication @@pass du else v2 : #{@@pass}"
191
- @@mail = nil
192
- @@pass = nil
193
- return { return: 'logged', mail_authorized: true, user_id: mail_exists[:user_id], message_id: message_id }
194
- # Send the user account template
195
- else
196
- return { return: 'Email trouvé, cherche mdp', mail_authorized: false, message_id: message_id }
197
- end
171
+ { return: "utilisateur loggé : #{user_exist.inspect}", mail_authorized: true, message_id: message_id }
198
172
  end
199
173
  end
200
174
 
201
- def authorization(data, message_id, ws)
202
- # database connexion :
203
- db = db_access
204
- # retrieving data from the 'security' table
205
- security_items = db[:user]
206
- # retrieving sent data
207
- user_password = data["particles"]["password"]
208
- # database search
209
- user_exists = security_items.where(password: user_password).first
210
- puts "user_exists : #{user_exists}"
211
-
212
- if !user_exists
213
- @@mail = nil
214
- puts "authorization @@mail du else : #{@@mail}"
215
- return { return: 'Password non trouvé, erreur', message_id: message_id }
216
- else
217
- @@pass = user_password
218
- puts "authorization @@pass : #{@@pass}"
219
- puts "authorization @@mail du else : #{@@mail}"
220
- if @@mail && @@pass
221
- puts "authorization @@pass v2 : #{@@pass}"
222
- puts "authorization @@mail du else v2 : #{@@mail}"
223
- # reset variables containing mail and password
224
- @@mail = nil
225
- @@pass = nil
226
- # return { return: 'Password trouvé, cherche mdp', password_authorized: false, message_id: message_id }
227
- return { return: 'logged', password_authorized: true, user_id: user_exists[:user_id], message_id: message_id }
228
- # Send the user account template
229
- else
230
- return { return: 'Password trouvé, cherche mdp', password_authorized: false, message_id: message_id }
231
- end
232
- end
233
- end
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
234
210
 
235
211
  def localstorage(data, message_id, ws)
236
212
  # return test
@@ -275,10 +251,31 @@ class EDen
275
251
  { data: { table: data['table'], infos: result }, message_id: message_id }
276
252
  end
277
253
 
254
+ 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
+ { data: { message: "envoi de validation a #{data['email']}" }, message_id: message_id }
274
+ end
275
+
278
276
  def insert(data, message_id, ws)
279
277
  table = data['table'].to_sym
280
278
  particles = data['particles']
281
-
282
279
  if db_access.table_exists?(table)
283
280
  schema = db_access.schema(table)
284
281
  insert_data = {}
@@ -61,5 +61,9 @@
61
61
  event.preventDefault(); // prevent zoom
62
62
  }
63
63
  }, {passive: false});
64
+
65
+
66
+
67
+
64
68
  </script>
65
69
  </html>