atome 0.5.7.3.6 → 0.5.7.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/documentation/deep learning/architecture.txt +4 -4
- data/documentation/deep learning/basic_infos.txt +2 -2
- data/documentation/deep learning/example_of_users_code.rb +43 -43
- data/documentation/installation/buiding_atome.md +2 -2
- data/lib/atome/atome.rb +24 -56
- data/lib/atome/extensions/atome.rb +31 -77
- data/lib/atome/extensions/sha.rb +7 -7
- data/lib/atome/genesis/atomes.rb +1 -1
- data/lib/atome/genesis/genesis.rb +6 -95
- data/lib/atome/genesis/particles/communication.rb +1 -1
- data/lib/atome/genesis/particles/event.rb +0 -8
- data/lib/atome/genesis/particles/geometry.rb +3 -4
- data/lib/atome/genesis/particles/hierarchy.rb +28 -27
- data/lib/atome/genesis/particles/identity.rb +0 -30
- data/lib/atome/genesis/particles/material.rb +13 -12
- data/lib/atome/genesis/particles/property.rb +41 -16
- data/lib/atome/genesis/particles/security.rb +0 -45
- data/lib/atome/genesis/particles/utility.rb +77 -137
- data/lib/atome/genesis/sparkle.rb +3 -12
- data/lib/atome/kernel/black_matter.rb +2 -0
- data/lib/atome/kernel/universe.rb +5 -45
- data/lib/atome/presets/atome.rb +0 -22
- data/lib/atome/utilities/utilities.rb +19 -8
- data/lib/atome/version.rb +2 -1
- data/lib/molecules/init.rb +0 -14
- data/lib/molecules/intuition/tools.rb +24 -43
- data/lib/molecules/intuition/utilities.rb +261 -135
- data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
- data/lib/platform_specific/opal/extensions/color.rb +0 -5
- data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
- data/lib/platform_specific/opal/extensions/object.rb +1 -1
- data/lib/platform_specific/opal/extensions/ping.rb +11 -20
- data/lib/renderers/html/effect.rb +0 -11
- data/lib/renderers/html/event.rb +0 -7
- data/lib/renderers/html/geometry.rb +0 -31
- data/lib/renderers/html/html.rb +32 -128
- data/lib/renderers/html/material.rb +0 -22
- data/lib/renderers/html/spatial.rb +0 -9
- data/lib/renderers/html/utility.rb +5 -8
- data/lib/renderers/renderer.rb +0 -1
- data/vendor/assets/application/examples/account.rb +35 -0
- data/vendor/assets/application/examples/actor&role.rb +23 -0
- data/vendor/assets/application/examples/animation.rb +1 -1
- data/vendor/assets/application/examples/applications.rb +26 -77
- data/vendor/assets/application/examples/atome.rb +1 -1
- data/vendor/assets/application/examples/attach.rb +7 -7
- data/vendor/assets/application/examples/attached.rb +13 -15
- data/vendor/assets/application/examples/basic_understanding.rb +1 -1
- data/vendor/assets/application/examples/buttons.rb +48 -0
- data/vendor/assets/application/examples/clear.rb +12 -12
- data/vendor/assets/application/examples/clones&monitoring.rb +1 -1
- data/vendor/assets/application/examples/delete.rb +19 -14
- data/vendor/assets/application/examples/detach.rb +8 -0
- data/vendor/assets/application/examples/dig.rb +1 -1
- data/vendor/assets/application/examples/display.rb +6 -6
- data/vendor/assets/application/examples/drag.rb +1 -1
- data/vendor/assets/application/examples/duplicate.rb +6 -6
- data/vendor/assets/application/examples/exchange.rb +17 -0
- data/vendor/assets/application/examples/generator_and_build.rb +3 -3
- data/vendor/assets/application/examples/hierarchy.rb +5 -5
- data/vendor/assets/application/examples/layout.rb +1 -1
- data/vendor/assets/application/examples/preset.rb +3 -3
- data/vendor/assets/application/examples/selected.rb +1 -1
- data/vendor/assets/application/examples/shapes.rb +1 -1
- data/vendor/assets/application/examples/size.rb +1 -1
- data/vendor/assets/application/examples/test.rb +0 -320
- data/vendor/assets/application/examples/tools.rb +136 -192
- data/vendor/assets/application/examples/unfasten.rb +23 -0
- data/vendor/assets/application/index.rb +1 -1
- data/vendor/assets/server/atome_server.rb +1 -0
- data/vendor/assets/server/capture.rb +0 -1
- data/vendor/assets/server/database.rb +0 -1
- data/vendor/assets/server/eDen.rb +16 -94
- data/vendor/assets/src/index_server_wasm.html +1 -0
- data/vendor/assets/src/index_wasm.html +0 -6
- data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
- data/vendor/assets/src/js/third_parties/three.min.js +1 -1
- data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
- data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
- metadata +8 -6
- data/lib/molecules/_deprecated_examples/site.rb +0 -34
- data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
- data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
- data/lib/platform_specific/opal/extensions/sha.rb +0 -25
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
|
4
|
-
|
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: :
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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
|
-
|
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
|
-
|
139
|
-
|
121
|
+
{ activation: move_active_code,
|
122
|
+
alteration: { event: move_code },
|
123
|
+
inactivation: move_inactive_code}
|
140
124
|
end
|
141
125
|
|
142
|
-
new({ tool: :
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
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
|
-
|
163
|
-
|
164
|
-
|
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
|
-
|
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
|
-
|
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: :
|
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: :
|
190
|
+
new({ tool: :color }) do
|
213
191
|
active_code = lambda {
|
214
|
-
|
215
|
-
|
216
|
-
|
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
|
-
|
225
|
-
|
226
|
-
|
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
|
-
#
|
231
|
-
|
232
|
-
|
233
|
-
|
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,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
b = box({ drag: true, id: :the_b, top: 63, left: 63 })
|
3
|
+
c = b.circle({ left: 99, id: :the_c })
|
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 })
|
6
|
+
c.touch(:down) do
|
7
|
+
b.unfasten([c.id])
|
8
|
+
b.color(:green)
|
9
|
+
t.data('circle unfasten')
|
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
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
text({id: :infos,left: 155, data: "number of item fasten to the box : #{b.fasten}"})
|
@@ -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,18 +26,13 @@ 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
|
46
|
-
|
47
36
|
def metadata(msg, pid, message_id, ws)
|
48
37
|
|
49
38
|
path = msg[:output_file]
|
@@ -64,7 +53,6 @@ class EDen
|
|
64
53
|
custom_data = data.to_json
|
65
54
|
comment_metadata = "-metadata comment=#{custom_data.shellescape}"
|
66
55
|
|
67
|
-
# input_file = path
|
68
56
|
temp_output_file = "./temp_#{File.basename(path)}"
|
69
57
|
ffmpeg_cmd = "ffmpeg -i #{path.shellescape} #{comment_metadata} -codec copy #{temp_output_file.shellescape}"
|
70
58
|
|
@@ -78,30 +66,19 @@ class EDen
|
|
78
66
|
end
|
79
67
|
end
|
80
68
|
|
81
|
-
|
82
69
|
ws.send({ :pid => pid, :return => msg, :message_id => message_id }.to_json)
|
83
70
|
end
|
84
71
|
|
85
72
|
def finished(msg, pid, message_id, ws)
|
86
73
|
|
87
|
-
path = msg[:output_file]
|
88
|
-
# metadata = msg[:metadata]
|
89
|
-
|
90
|
-
# custom_data = metadata.to_json
|
91
|
-
# comment_metadata = "-metadata comment=#{custom_data.shellescape}"
|
92
74
|
|
93
|
-
|
94
|
-
# temp_output_file = "./temp_#{File.basename(input_file)}"
|
95
|
-
|
96
|
-
##### write tag
|
75
|
+
# write tag
|
97
76
|
metadata(msg, pid, message_id, ws)
|
98
77
|
|
99
|
-
|
100
|
-
msg[:read]=true
|
78
|
+
# read tag
|
79
|
+
msg[:read] = true
|
101
80
|
metadata(msg, pid, message_id, ws)
|
102
81
|
|
103
|
-
|
104
|
-
|
105
82
|
ws.send({ :pid => pid, :return => msg, :message_id => message_id }.to_json)
|
106
83
|
end
|
107
84
|
|
@@ -111,7 +88,6 @@ class EDen
|
|
111
88
|
begin
|
112
89
|
Process.getpgid(pid) # Vérifier si le processus est toujours actif
|
113
90
|
Process.kill("SIGINT", pid)
|
114
|
-
# puts "Recording stopped.#{pid} : #{pid.class}"
|
115
91
|
rescue Errno::ESRCH # Le processus n'existe pas
|
116
92
|
puts "Recording already stopped or PID not found."
|
117
93
|
end
|
@@ -142,7 +118,6 @@ class EDen
|
|
142
118
|
stdin, stdout, stderr, wait_thr = Open3.popen3(command)
|
143
119
|
pid = wait_thr.pid # Sauvegarder le PID du processus ffmpeg
|
144
120
|
msg = { output_file: output_file, media: :audio, record: :stop, data: data }
|
145
|
-
# puts "pid class : #{pid.class}"
|
146
121
|
Thread.new { wait_thr.join; finished(msg, pid, message_id, ws) }
|
147
122
|
elsif media == 'video'
|
148
123
|
resolution = "1280x720"
|
@@ -157,8 +132,7 @@ class EDen
|
|
157
132
|
msg = { output_file: output_file, media: :video, record: :stop, data: data }
|
158
133
|
Thread.new { wait_thr.join; finished(msg, pid, message_id, ws) }
|
159
134
|
else
|
160
|
-
#
|
161
|
-
|
135
|
+
#
|
162
136
|
end
|
163
137
|
|
164
138
|
{ pid: pid, return: "path : #{path} record : #{media} received : duration #{duration} : name: #{name}, pid: #{pid}", message_id: message_id }
|
@@ -171,78 +145,24 @@ class EDen
|
|
171
145
|
identity_items = db[:user]
|
172
146
|
# retrieving sent data
|
173
147
|
user_email = data["particles"]["email"]
|
174
|
-
|
175
|
-
sanitized_email = sanitize_email(user_email)
|
148
|
+
user_pass = data["particles"]["password"]
|
176
149
|
# database search
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
if !mail_exists
|
181
|
-
@@pass = nil
|
182
|
-
puts "authentication @@pass : #{@@pass}"
|
183
|
-
{ return: 'Email non trouvé, erreur', message_id: message_id }
|
150
|
+
user_exist = identity_items.where(email: user_email, password: user_pass).first
|
151
|
+
if !user_exist
|
152
|
+
{ return: 'identifiants incorrects ou compte inexistant', message_id: message_id }
|
184
153
|
else
|
185
|
-
|
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
|
154
|
+
{ return: "utilisateur loggé : #{user_exist.inspect}", mail_authorized: true, message_id: message_id }
|
198
155
|
end
|
199
156
|
end
|
200
157
|
|
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
|
234
158
|
|
235
159
|
def localstorage(data, message_id, ws)
|
236
|
-
|
237
|
-
# ws.send(return_message.to_json)
|
238
|
-
return { return: 'localstorage content received', authorized: true, message_id: message_id }
|
160
|
+
{ return: 'localstorage content received', authorized: true, message_id: message_id }
|
239
161
|
|
240
162
|
end
|
241
163
|
|
242
164
|
def historicize(data, message_id, ws)
|
243
|
-
|
244
|
-
# ws.send(return_message.to_json)
|
245
|
-
return { return: 'item to historicize received', authorized: true, message_id: message_id }
|
165
|
+
{ return: 'item to historicize received', authorized: true, message_id: message_id }
|
246
166
|
|
247
167
|
end
|
248
168
|
|
@@ -256,7 +176,6 @@ class EDen
|
|
256
176
|
def create_db_table(data, message_id, ws)
|
257
177
|
table = data['table']
|
258
178
|
type = data['type']
|
259
|
-
primary = data['primary']
|
260
179
|
Database.create_table(table, type)
|
261
180
|
{ data: { message: "table #{table} added" }, message_id: message_id }
|
262
181
|
end
|
@@ -275,10 +194,13 @@ class EDen
|
|
275
194
|
{ data: { table: data['table'], infos: result }, message_id: message_id }
|
276
195
|
end
|
277
196
|
|
197
|
+
def account_creation(data, message_id, ws)
|
198
|
+
{ data: { message: "envoi de validation a #{data['email']}" }, message_id: message_id }
|
199
|
+
end
|
200
|
+
|
278
201
|
def insert(data, message_id, ws)
|
279
202
|
table = data['table'].to_sym
|
280
203
|
particles = data['particles']
|
281
|
-
|
282
204
|
if db_access.table_exists?(table)
|
283
205
|
schema = db_access.schema(table)
|
284
206
|
insert_data = {}
|
@@ -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'>
|