atome 0.5.7.4.8 → 0.5.7.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atome/extensions/atome.rb +14 -1
- data/lib/atome/genesis/genesis.rb +3 -3
- data/lib/atome/genesis/particles/utility.rb +6 -5
- data/lib/atome/genesis/sparkle.rb +9 -14
- data/lib/atome/utilities/utilities.rb +15 -0
- data/lib/atome/version.rb +1 -1
- data/lib/molecules/intuition/utilities.rb +5 -4
- data/lib/renderers/html/html.rb +29 -13
- data/vendor/assets/application/examples/animation.rb +21 -17
- data/vendor/assets/application/examples/applications.rb +4 -1
- data/vendor/assets/application/examples/buttons.rb +28 -33
- data/vendor/assets/application/examples/server.rb +1 -0
- data/vendor/assets/application/examples/terminal.rb +3 -1
- data/vendor/assets/application/examples/test.rb +15 -0
- data/vendor/assets/application/examples/touch.rb +4 -4
- data/vendor/assets/server/atome_server_wasm.rb +0 -1
- data/vendor/assets/server/eDen.rb +1 -0
- data/vendor/assets/src/index_server_wasm.html +5 -1
- data/vendor/assets/src/js/atome/atome.js +12 -8
- data/vendor/assets/src/js/atome/specific/wasm.js +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfe78ba10396036f7ff7cfcb324d6e121006e841e276f0602b5ffd50e480df9f
|
4
|
+
data.tar.gz: 713ee69cadbee8b0fd7d7ae7456589537c8e815e138881b183bf5eda1b4612c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d67424076d1715af0771efee85a60eeaa140900125e1458319c84746b00a0d3651ab0f46c530e43f3c9fa539cdc1259f532fae5ad188636dd538b6249bdc131e
|
7
|
+
data.tar.gz: ff448ccf270a36189e590bafb6030cea066f35f2a960801ea6af81c70fbea9908c3d897bf04c7a214cfc0f1bb13c0a114e4b61eec69079f50ed366241cb391d6
|
@@ -138,7 +138,20 @@ class Object
|
|
138
138
|
|
139
139
|
def hook(a_id)
|
140
140
|
a_id = a_id.to_sym
|
141
|
-
Universe.atomes[a_id]
|
141
|
+
# Universe.atomes[a_id]
|
142
|
+
atome_get=''
|
143
|
+
Universe.atomes.each do |aid_f, atome|
|
144
|
+
# alert "1 #{atome}"
|
145
|
+
|
146
|
+
if atome.id== a_id
|
147
|
+
atome_get= atome
|
148
|
+
# alert "2 #{atome}"
|
149
|
+
end
|
150
|
+
# alert "3 #{atome_get}"
|
151
|
+
|
152
|
+
end
|
153
|
+
# alert atome_get
|
154
|
+
atome_get
|
142
155
|
end
|
143
156
|
|
144
157
|
def grab(id_to_get)
|
@@ -133,11 +133,11 @@ class Genesis
|
|
133
133
|
@apply.each do |fasten_atome|
|
134
134
|
collected_atomes << fasten_atome if grab(fasten_atome).type.to_sym == element.to_sym
|
135
135
|
end
|
136
|
-
|
136
|
+
elsif fasten
|
137
137
|
fasten.each do |fasten_atome|
|
138
|
-
|
138
|
+
child_found=grab(fasten_atome)
|
139
|
+
collected_atomes << fasten_atome if child_found.type.to_sym == element.to_sym
|
139
140
|
end
|
140
|
-
|
141
141
|
end
|
142
142
|
# TODO/ FIXME : potential problem with group here"
|
143
143
|
collected_atomes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
def delete_recursive(atome_id, force=false)
|
3
3
|
return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system]) unless force
|
4
|
-
|
4
|
+
touch(false)
|
5
5
|
parent_id_found = grab(atome_id).attach
|
6
6
|
parent_found = grab(parent_id_found)
|
7
7
|
new_array = parent_found.fasten.dup
|
@@ -11,7 +11,7 @@ def delete_recursive(atome_id, force=false)
|
|
11
11
|
delete_recursive(atome_id_found, force)
|
12
12
|
end
|
13
13
|
grab(atome_id).render(:delete, { :recursive => true })
|
14
|
-
grab(atome_id).touch(
|
14
|
+
grab(atome_id).touch(false)
|
15
15
|
Universe.delete(grab(atome_id).aid)
|
16
16
|
end
|
17
17
|
|
@@ -37,7 +37,7 @@ new({ particle: :target }) do |params|
|
|
37
37
|
end
|
38
38
|
new({ particle: :delete, category: :utility, type: :boolean, render: false }) do |params|
|
39
39
|
if params == true
|
40
|
-
|
40
|
+
touch(false)
|
41
41
|
# We use the tag persistent to exclude color of system object and other default colors
|
42
42
|
unless @tag && (@tag[:persistent] || @tag[:system])
|
43
43
|
# if we are on a matrix we delete cells found & group found
|
@@ -64,13 +64,14 @@ new({ particle: :delete, category: :utility, type: :boolean, render: false }) do
|
|
64
64
|
# if we are on a matrix we delete cells found & group found
|
65
65
|
cells.delete(true)
|
66
66
|
group.delete(true)
|
67
|
+
touch(false)
|
67
68
|
if params[:recursive]
|
68
69
|
grab(attach).unfasten([id])
|
69
70
|
unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
|
70
71
|
fasten.each do |atttached_atomes|
|
71
72
|
delete_recursive(atttached_atomes)
|
72
73
|
end
|
73
|
-
touch(
|
74
|
+
# touch(false)
|
74
75
|
render(:delete, params)
|
75
76
|
Universe.delete(@aid)
|
76
77
|
end
|
@@ -79,7 +80,7 @@ new({ particle: :delete, category: :utility, type: :boolean, render: false }) do
|
|
79
80
|
# alert "fasten : #{fasten}"
|
80
81
|
delete_recursive(atttached_atomes, true)
|
81
82
|
end
|
82
|
-
touch(
|
83
|
+
touch(false)
|
83
84
|
render(:delete, params)
|
84
85
|
# alert "Universe : #{Universe.atomes[@aid]}"
|
85
86
|
# alert "length = #{Universe.atomes.length}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
Universe.language
|
3
|
+
Universe.language = :english
|
4
4
|
|
5
5
|
# now let's get the default render engine
|
6
6
|
|
@@ -64,7 +64,7 @@ Atome.new(
|
|
64
64
|
|
65
65
|
# view port
|
66
66
|
Atome.new(
|
67
|
-
{ renderers: default_render, aid: :view,type: :shape, attach: :user_view, apply: [:view_color],
|
67
|
+
{ renderers: default_render, aid: :view, type: :shape, attach: :user_view, apply: [:view_color],
|
68
68
|
tag: { system: true }, left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
|
69
69
|
# language: :english
|
70
70
|
}
|
@@ -73,7 +73,7 @@ Atome.new(
|
|
73
73
|
|
74
74
|
# unreal port, hold system object and tools
|
75
75
|
Atome.new(
|
76
|
-
{ renderers: default_render, aid: :intuition, type: :shape, attach: :user_view,data: {}, tag: { system: true },
|
76
|
+
{ renderers: default_render, aid: :intuition, type: :shape, attach: :user_view, data: {}, tag: { system: true },
|
77
77
|
left: 0, top: 0, bottom: 0, width: 0, height: :auto, overflow: :visible
|
78
78
|
}
|
79
79
|
)
|
@@ -89,8 +89,6 @@ Atome.new({ renderers: [:html], aid: :copy, collect: [], type: :group, tag: { sy
|
|
89
89
|
Atome.new({ renderers: default_render, id: machine_id, type: :machine, password: machine_password,
|
90
90
|
name: :macAir, data: { date: '10090717' }, tag: { system: true } })
|
91
91
|
|
92
|
-
|
93
|
-
|
94
92
|
# user
|
95
93
|
user_password = { global: :star_win, read: { atome: :star_wars }, write: { atome: :star_wars } }
|
96
94
|
|
@@ -149,15 +147,13 @@ def atome_genesis
|
|
149
147
|
server = Universe.current_server
|
150
148
|
server ||= 'disconnected'
|
151
149
|
puts "server: #{server}"
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
puts "websocket initialised #{msg}"
|
158
|
-
end
|
159
|
-
Universe.allow_sync = true
|
150
|
+
return unless server.start_with?('http') && Atome::host.to_sym != :tauri
|
151
|
+
Universe.connected = true
|
152
|
+
A.server({ address: 'localhost:9292', type: 'ws' })
|
153
|
+
A.init_websocket do |msg|
|
154
|
+
puts "websocket initialised #{msg}"
|
160
155
|
end
|
156
|
+
Universe.allow_sync = true
|
161
157
|
end
|
162
158
|
|
163
159
|
# this method is call from JS (atome/communication) at WS connection
|
@@ -188,7 +184,6 @@ def init_database
|
|
188
184
|
A.sync({ action: :create_db_column, data: { table: :history, column: :date, type: :datetime } }) do |_db_state|
|
189
185
|
end
|
190
186
|
|
191
|
-
|
192
187
|
# now we send localstorage content to the server
|
193
188
|
Atome.send_localstorage_content
|
194
189
|
|
@@ -470,6 +470,21 @@ class Atome
|
|
470
470
|
end
|
471
471
|
end
|
472
472
|
|
473
|
+
def store_ruby_callback(params)
|
474
|
+
|
475
|
+
params.each do |element, value_v|
|
476
|
+
send("#{element}_code")[element].call(value_v)
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
def read_ruby_callback(element)
|
481
|
+
puts "dunno what this method is about ?? method call :#{element}"
|
482
|
+
# alert id
|
483
|
+
# puts "2 ===> #{element} !!!"
|
484
|
+
# alert send("terminal_callback").inspect
|
485
|
+
# alert send("#{element}_callback")
|
486
|
+
end
|
487
|
+
|
473
488
|
# this method generate the method accessible for end developers
|
474
489
|
# it's the send the method define in "particle_callback"
|
475
490
|
def callback(element, return_params = nil)
|
data/lib/atome/version.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
class Atome
|
4
4
|
def reorder_menu
|
5
|
+
# disposition = data
|
5
6
|
disposition = data[:inactive][:disposition]
|
6
7
|
margin = data[:inactive][:margin]
|
7
8
|
spacing = data[:inactive][:spacing]
|
@@ -72,9 +73,9 @@ class Atome
|
|
72
73
|
menu_item.top = margin[:top] + (inactive_style[:height] + spacing) * position_in_menu
|
73
74
|
menu_item.left = margin[:left]
|
74
75
|
end
|
75
|
-
|
76
76
|
menu_item.text.each do |text_f|
|
77
|
-
grab(text_f)
|
77
|
+
item_found = grab(text_f)
|
78
|
+
item_found.set(inactive_state_text)
|
78
79
|
end
|
79
80
|
|
80
81
|
end
|
@@ -592,10 +593,10 @@ new(molecule: :show) do |page_id, &bloc|
|
|
592
593
|
color({ id: :page_color, red: 0.1, green: 0.1, blue: 0.1 })
|
593
594
|
|
594
595
|
id_f = "#{id}_content"
|
595
|
-
main_page = box({ width: :auto, depth: -1, height: :auto, id: id_f, top: 0, bottom: 0, left: 0, right: 0, apply: :page_color, category: :page
|
596
|
+
main_page = box({ width: :auto, depth: -1, height: :auto, id: id_f, top: 0, bottom: 0, left: 0, right: 0, apply: :page_color, category: :page})
|
596
597
|
main_page.remove(:box_color)
|
597
598
|
|
598
|
-
new_page = main_page.box({ width: '100%', height: '100%', top: 0, left: 0, id: page_id })
|
599
|
+
new_page = main_page.box({ width: '100%', height: '100%', top: 0, left: 0, id: page_id, overflow: :auto })
|
599
600
|
|
600
601
|
# now looking for associated blocks
|
601
602
|
blocks_found = params[:blocks]
|
data/lib/renderers/html/html.rb
CHANGED
@@ -254,6 +254,7 @@ class HTML
|
|
254
254
|
end
|
255
255
|
|
256
256
|
def send_message(message)
|
257
|
+
# puts "message : #{message}"
|
257
258
|
# FIXME : find why we have to sanitize this message when using ruby wams
|
258
259
|
message = transform_to_string_keys_and_values(message)
|
259
260
|
JS.eval("atomeJS.ws_sender('#{message}')")
|
@@ -1214,11 +1215,11 @@ class HTML
|
|
1214
1215
|
interact = JS.eval("return interact('##{@id}')")
|
1215
1216
|
# unless @touch_removed[:down]
|
1216
1217
|
interact.on('down') do |native_event|
|
1217
|
-
|
1218
|
+
@touch_down_event = Native(native_event)
|
1218
1219
|
# we use .call instead of instance_eval because instance_eval bring the current object as context
|
1219
1220
|
# and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
|
1220
1221
|
# group etc..
|
1221
|
-
proc_content = @touch_down.call(
|
1222
|
+
proc_content = @touch_down.call(@touch_down_event) if event_validation(@touch_down)
|
1222
1223
|
if proc_content.instance_of? Hash
|
1223
1224
|
proc_content.each do |k, v|
|
1224
1225
|
@original_atome.send(k, v)
|
@@ -1236,11 +1237,11 @@ class HTML
|
|
1236
1237
|
# unless @touch_removed[:tap]
|
1237
1238
|
interact.on('tap') do |native_event|
|
1238
1239
|
|
1239
|
-
|
1240
|
+
@touch_tap_event = Native(native_event)
|
1240
1241
|
# we use .call instead of instance_eval because instance_eval bring the current object as context
|
1241
1242
|
# and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
|
1242
1243
|
# group etc..
|
1243
|
-
proc_content = @touch_tap.call(
|
1244
|
+
proc_content = @touch_tap.call(@touch_tap_event) if event_validation(@touch_tap)
|
1244
1245
|
if proc_content.instance_of? Hash
|
1245
1246
|
proc_content.each do |k, v|
|
1246
1247
|
# alert "(#{@original_atome.id}, #{k}, #{v}, #{_option})"
|
@@ -1257,11 +1258,11 @@ class HTML
|
|
1257
1258
|
@touch_up = @original_atome.instance_variable_get('@touch_code')[:up]
|
1258
1259
|
# unless @touch_removed[:up]
|
1259
1260
|
interact.on('up') do |native_event|
|
1260
|
-
|
1261
|
+
@touch_up_event = Native(native_event)
|
1261
1262
|
# we use .call instead of instance_eval because instance_eval bring the current object as context
|
1262
1263
|
# and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
|
1263
1264
|
# group etc..
|
1264
|
-
proc_content = @touch_up.call(
|
1265
|
+
proc_content = @touch_up.call(@touch_up_event) if event_validation(@touch_up)
|
1265
1266
|
if proc_content.instance_of? Hash
|
1266
1267
|
proc_content.each do |k, v|
|
1267
1268
|
@original_atome.send(k, v)
|
@@ -1276,11 +1277,11 @@ class HTML
|
|
1276
1277
|
@touch_double = @original_atome.instance_variable_get('@touch_code')[:double]
|
1277
1278
|
# unless @touch_removed[:double]
|
1278
1279
|
interact.on('doubletap') do |native_event|
|
1279
|
-
|
1280
|
+
@touch_double_event = Native(native_event)
|
1280
1281
|
# we use .call instead of instance_eval because instance_eval bring the current object as context
|
1281
1282
|
# and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
|
1282
1283
|
# group etc..
|
1283
|
-
proc_content = @touch_double.call(
|
1284
|
+
proc_content = @touch_double.call(@touch_double_event) if event_validation(@touch_double)
|
1284
1285
|
if proc_content.instance_of? Hash
|
1285
1286
|
proc_content.each do |k, v|
|
1286
1287
|
@original_atome.send(k, v)
|
@@ -1296,11 +1297,11 @@ class HTML
|
|
1296
1297
|
interact = JS.eval("return interact('##{@id}')")
|
1297
1298
|
# unless @touch_removed[:long]
|
1298
1299
|
interact.on('hold') do |native_event|
|
1299
|
-
|
1300
|
+
@touch_long_event = Native(native_event)
|
1300
1301
|
# we use .call instead of instance_eval because instance_eval bring the current object as context
|
1301
1302
|
# and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
|
1302
1303
|
# group etc..
|
1303
|
-
proc_content = @touch_long.call(
|
1304
|
+
proc_content = @touch_long.call(@touch_long_event) if event_validation(@touch_long)
|
1304
1305
|
if proc_content.instance_of? Hash
|
1305
1306
|
proc_content.each do |k, v|
|
1306
1307
|
@original_atome.send(k, v)
|
@@ -1310,38 +1311,53 @@ class HTML
|
|
1310
1311
|
end
|
1311
1312
|
|
1312
1313
|
def touch_remove(option)
|
1313
|
-
|
1314
1314
|
@element[:style][:cursor] = 'default'
|
1315
1315
|
case option
|
1316
1316
|
when :double
|
1317
1317
|
@touch_double = ''
|
1318
1318
|
@touch_removed[:double] = true
|
1319
|
+
@touch_double_event= nil
|
1319
1320
|
when :down
|
1320
1321
|
@touch_down = ''
|
1321
1322
|
@touch_removed[:down] = true
|
1323
|
+
@touch_down_event= nil
|
1322
1324
|
when :long
|
1323
1325
|
@touch_removed[:long] = true
|
1324
1326
|
@touch_long = ''
|
1327
|
+
@touch_long_event= nil
|
1325
1328
|
when :tap
|
1326
1329
|
@touch_removed[:tap] = true
|
1327
1330
|
@touch_tap = ''
|
1328
1331
|
@touch_removed[:touch] = true
|
1329
1332
|
@touch_touch = ''
|
1333
|
+
@touch_tap_event= nil
|
1334
|
+
|
1330
1335
|
when :touch
|
1331
1336
|
@touch_removed[:tap] = true
|
1332
1337
|
@touch_tap = ''
|
1333
1338
|
@touch_removed[:touch] = true
|
1334
1339
|
@touch_touch = ''
|
1340
|
+
@touch_tap_event= nil
|
1341
|
+
|
1335
1342
|
when :up
|
1336
1343
|
@touch_removed[:up] = true
|
1337
1344
|
@touch_up = ''
|
1345
|
+
@touch_up_event= nil
|
1338
1346
|
else
|
1339
1347
|
touch_remove(:double)
|
1348
|
+
@touch_double_event= nil
|
1349
|
+
|
1340
1350
|
touch_remove(:down)
|
1351
|
+
@touch_down_event= nil
|
1352
|
+
|
1341
1353
|
touch_remove(:long)
|
1354
|
+
@touch_long_event= nil
|
1355
|
+
|
1342
1356
|
touch_remove(:tap)
|
1343
1357
|
touch_remove(:touch)
|
1358
|
+
@touch_tap_event= nil
|
1344
1359
|
touch_remove(:up)
|
1360
|
+
@touch_up_event= nil
|
1345
1361
|
end
|
1346
1362
|
|
1347
1363
|
end
|
@@ -1362,7 +1378,7 @@ class HTML
|
|
1362
1378
|
if Atome.host == 'tauri'
|
1363
1379
|
JS.eval("readFile('#{id}','#{file}')")
|
1364
1380
|
else
|
1365
|
-
puts '
|
1381
|
+
puts 'read file in progress in server mode'
|
1366
1382
|
end
|
1367
1383
|
end
|
1368
1384
|
|
@@ -1370,7 +1386,7 @@ class HTML
|
|
1370
1386
|
if Atome.host == 'tauri'
|
1371
1387
|
JS.eval("browseFile('#{id}','#{file}')")
|
1372
1388
|
else
|
1373
|
-
puts '
|
1389
|
+
puts 'browse file in progress in server mode'
|
1374
1390
|
end
|
1375
1391
|
end
|
1376
1392
|
|
@@ -84,6 +84,8 @@
|
|
84
84
|
# create callback methode when playing
|
85
85
|
|
86
86
|
# # here is how to animate shape :
|
87
|
+
wait 0.2 do
|
88
|
+
puts " we wait 0.2 sec else there's a of a problem if we use server wasm "
|
87
89
|
|
88
90
|
b=box({id: :the_box})
|
89
91
|
|
@@ -91,28 +93,30 @@ b=box({id: :the_box})
|
|
91
93
|
puts "width +#{val}"
|
92
94
|
end
|
93
95
|
|
94
|
-
b.animate({ to: 456, particle: :left, duration: 5000}) do |val|
|
95
|
-
|
96
|
-
end
|
96
|
+
b.animate({ to: 456, particle: :left, duration: 5000}) do |val|
|
97
|
+
puts "left +#{val}"
|
98
|
+
end
|
97
99
|
|
98
|
-
b.animate({ end: :left}) do |val|
|
99
|
-
|
100
|
-
end
|
100
|
+
b.animate({ end: :left}) do |val|
|
101
|
+
puts "left ended"
|
102
|
+
end
|
101
103
|
|
102
|
-
b.animate({ to: 69, particle: :smooth, duration: 10000}) do |val|
|
103
|
-
|
104
|
-
end
|
104
|
+
b.animate({ to: 69, particle: :smooth, duration: 10000}) do |val|
|
105
|
+
puts "smooth +#{val}"
|
106
|
+
end
|
105
107
|
|
106
|
-
b.animate({ end: :smooth}) do |val|
|
107
|
-
|
108
|
-
end
|
108
|
+
b.animate({ end: :smooth}) do |val|
|
109
|
+
puts " cool smooth end now!!!"
|
110
|
+
end
|
109
111
|
|
110
|
-
b.animate({ to: 90, particle: :rotate, duration: 10000}) do |val|
|
111
|
-
|
112
|
-
end
|
112
|
+
b.animate({ to: 90, particle: :rotate, duration: 10000}) do |val|
|
113
|
+
puts "rotate +#{val}"
|
114
|
+
end
|
115
|
+
|
116
|
+
b.animate({ to: 222, particle: :top, duration: 10000}) do |val|
|
117
|
+
puts "top +#{val}"
|
118
|
+
end
|
113
119
|
|
114
|
-
b.animate({ to: 222, particle: :top, duration: 10000}) do |val|
|
115
|
-
puts "top +#{val}"
|
116
120
|
end
|
117
121
|
|
118
122
|
|
@@ -43,6 +43,7 @@ a.page(page0)
|
|
43
43
|
a.page(page1)
|
44
44
|
a.page({ id: :page3,
|
45
45
|
color: :red,
|
46
|
+
footer: { color: :green, height: 22 }
|
46
47
|
})
|
47
48
|
|
48
49
|
|
@@ -69,6 +70,7 @@ page_3=a.show(:page3)
|
|
69
70
|
|
70
71
|
wait 1 do
|
71
72
|
page_3.color(:cyan)
|
73
|
+
page_3.box({top: 900})
|
72
74
|
end
|
73
75
|
|
74
76
|
|
@@ -78,4 +80,5 @@ end
|
|
78
80
|
# end
|
79
81
|
|
80
82
|
|
81
|
-
puts(grab(:project).inspect)
|
83
|
+
puts(grab(:project).inspect)
|
84
|
+
|
@@ -3,46 +3,41 @@
|
|
3
3
|
box({color: :gray, width: 666, height: 666})
|
4
4
|
box({ id: :the_box, drag: true, color: { alpha: 2 } })
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
color: :orange, margin: { left: 33, top: 12 } },
|
18
|
-
active: { text: { color: :white, shadow: {} }, color: :blue, shadow: {} },
|
19
|
-
item_1: {
|
20
|
-
text: :acceuil,
|
21
|
-
code: menu1_code
|
22
|
-
},
|
23
|
-
item_2: {
|
24
|
-
text: :page_2,
|
25
|
-
code: menu2_code
|
26
|
-
|
27
|
-
},
|
28
|
-
item_3: {
|
29
|
-
text: :page_3,
|
30
|
-
code: lambda { puts :item_3_touched }
|
31
|
-
},
|
32
|
-
})
|
33
|
-
|
34
|
-
c = text({ top: 99, left: 99, data: 'add a button' })
|
6
|
+
|
7
|
+
but =buttons({
|
8
|
+
id: "my_menu",
|
9
|
+
depth: 9999,
|
10
|
+
attach: :the_box,
|
11
|
+
inactive: { text: { color: :gray }, width: 66, height: 12, spacing: 3, disposition: :horizontal,
|
12
|
+
color: :orange, margin: { left: 33, top: 12 } },
|
13
|
+
active: { text: { color: :white, shadow: {} }, color: :blue, shadow: {} },
|
14
|
+
})
|
15
|
+
|
16
|
+
c = text({ top: 99, left: 99, data: 'add buttons' })
|
35
17
|
|
36
18
|
c.touch(:down) do
|
37
19
|
but.add_button(new_button: {
|
38
20
|
text: :button1,
|
39
21
|
code: lambda { puts :button1_touched }
|
40
22
|
})
|
41
|
-
|
23
|
+
but.add_button(new_button2: {
|
24
|
+
text: :button2,
|
25
|
+
code: lambda { puts :button1_touched }
|
26
|
+
})
|
27
|
+
but.add_button(new_button3: {
|
28
|
+
text: :button3,
|
29
|
+
code: lambda { puts :button1_touched }
|
30
|
+
})
|
31
|
+
|
32
|
+
wait 0.2 do
|
33
|
+
grab(:my_menu).remove_menu_item(:new_button2)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
|
42
40
|
|
43
41
|
|
44
|
-
wait 2 do
|
45
|
-
grab(:menu1).remove_menu_item(:item_2)
|
46
|
-
end
|
47
42
|
|
48
43
|
# TODO: remove menu_item ,reset_menu, reorder, delete
|
@@ -20,5 +20,6 @@ c.touch(true) do
|
|
20
20
|
A.message({ action: :terminal , data: 'cd ..;cd server;ls; pwd'}) do |result|
|
21
21
|
puts "result : #{result}"
|
22
22
|
end
|
23
|
+
{} #must add an empty hash else events events method will interpret keys of the hash and send a missing method errors
|
23
24
|
end
|
24
25
|
#
|
@@ -1 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
def contact_template
|
5
|
+
{ id: :humans, role: nil, date: { companies: [], project: {}, events: {}, last_name: nil, first_name: nil ,
|
6
|
+
emails: { home: nil }, phones: {}, address: {}, groups: [] } }
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
element({id: :testing, data: contact_template})
|
11
|
+
# grab(:testing).data(contact_template)
|
12
|
+
|
13
|
+
|
14
|
+
wait 2 do
|
15
|
+
grab(:testing).data
|
16
|
+
end
|
@@ -8,17 +8,17 @@ t.touch(:down) do |event|
|
|
8
8
|
puts :down
|
9
9
|
puts event[:pageX]
|
10
10
|
puts event[:pageY]
|
11
|
-
b.touch({remove: :down})
|
11
|
+
b.touch({ remove: :down })
|
12
12
|
# b.touch({remove: :up})
|
13
13
|
# b.touch({remove: :long})
|
14
14
|
# b.touch({remove: :double})
|
15
15
|
# b.touch({remove: :tap})
|
16
16
|
# b.touch({remove: :touch})
|
17
|
-
|
17
|
+
# b.touch(false) to remove all touches bindings
|
18
18
|
t.data('touch down killed')
|
19
19
|
end
|
20
20
|
|
21
|
-
touch_code =lambda do
|
21
|
+
touch_code = lambda do
|
22
22
|
b.color(:red)
|
23
23
|
puts 'box tapped'
|
24
24
|
# b.instance_variable_set('@touch_code', nil)
|
@@ -29,7 +29,7 @@ b.touch(:long) do
|
|
29
29
|
# puts :long
|
30
30
|
# t.data('type of touch is : long ')
|
31
31
|
# b.color(:black)
|
32
|
-
{color: :cyan}
|
32
|
+
{ color: :cyan }
|
33
33
|
end
|
34
34
|
|
35
35
|
b.touch(:up) do
|
@@ -3,7 +3,8 @@
|
|
3
3
|
<head>
|
4
4
|
<link rel="icon" type="image/x-icon"
|
5
5
|
href="https://github.com/atomecorp/atome/blob/master/vendor/assets/src/favicon.ico">
|
6
|
-
<meta name="viewport"
|
6
|
+
<meta name="viewport"
|
7
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover,user-scalable=no">
|
7
8
|
<meta charset='UTF-8'/>
|
8
9
|
<meta name="format-detection" content="telephone=no">
|
9
10
|
<meta name="msapplication-tap-highlight" content="no">
|
@@ -30,6 +31,7 @@
|
|
30
31
|
<div id='copyright'>©atome 2024</div>
|
31
32
|
</body>
|
32
33
|
<script type="text/ruby">
|
34
|
+
|
33
35
|
require 'js'
|
34
36
|
require '/lib/platform_specific/wasm/atome_wasm_extensions'
|
35
37
|
require '/utilities/aui'
|
@@ -38,6 +40,8 @@
|
|
38
40
|
require './index'
|
39
41
|
#atome_infos
|
40
42
|
atome_genesis
|
43
|
+
|
44
|
+
|
41
45
|
</script>
|
42
46
|
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
43
47
|
<script type="text/javascript">
|
@@ -28,8 +28,8 @@ async function readFile(atome_id, filePath) {
|
|
28
28
|
} catch (error) {
|
29
29
|
fileContent = error;
|
30
30
|
}
|
31
|
-
atomeJsToRuby("grab(:" + atome_id + ").
|
32
|
-
atomeJsToRuby("grab(:" + atome_id + ").
|
31
|
+
atomeJsToRuby("grab(:" + atome_id + ").store_ruby_callback({ read: '" + fileContent + "' })");
|
32
|
+
atomeJsToRuby("grab(:" + atome_id + ").read_ruby_callback(:read)");
|
33
33
|
}
|
34
34
|
|
35
35
|
|
@@ -43,8 +43,8 @@ async function browseFile(atome_id, directoryPath) {
|
|
43
43
|
} catch (error) {
|
44
44
|
directoryContent = error;
|
45
45
|
}
|
46
|
-
atomeJsToRuby("grab(:" + atome_id + ").
|
47
|
-
atomeJsToRuby("grab(:" + atome_id + ").
|
46
|
+
atomeJsToRuby("grab(:" + atome_id + ").store_ruby_callback({ browse: '" + directoryContent + "' })");
|
47
|
+
atomeJsToRuby("grab(:" + atome_id + ").read_ruby_callback(:browse)");
|
48
48
|
}
|
49
49
|
|
50
50
|
|
@@ -75,18 +75,22 @@ async function terminal(atome_id, cmd) {
|
|
75
75
|
}
|
76
76
|
cmd_result = cmd_result.replace(/\r?\n/g, "");
|
77
77
|
|
78
|
-
atomeJsToRuby("grab(:" + atome_id + ").
|
79
|
-
atomeJsToRuby("grab(:" + atome_id + ").
|
78
|
+
atomeJsToRuby("grab(:" + atome_id + ").store_ruby_callback({ terminal: '" + cmd_result + "' })");
|
79
|
+
atomeJsToRuby("grab(:" + atome_id + ").read_ruby_callback(:terminal)");
|
80
80
|
|
81
81
|
}
|
82
82
|
|
83
83
|
|
84
84
|
function distant_terminal(id, cmd) {
|
85
|
+
|
85
86
|
let myd_data_test = 'Terminal particle will soon be implemented when using a non native mode\nYou can switch to OSX to test';
|
86
|
-
let call_back_to_send = `grab(:${id}).
|
87
|
-
let call = `grab(:${id}).
|
87
|
+
let call_back_to_send = `grab(:${id}).store_ruby_callback({terminal: "${myd_data_test}"})`
|
88
|
+
let call = `grab(:${id}).read_ruby_callback(:terminal)`
|
88
89
|
atomeJsToRuby(call_back_to_send)
|
89
90
|
atomeJsToRuby(call)
|
91
|
+
|
92
|
+
// let call = `grab(:${id}).read_ruby_callback(:terminal)`
|
93
|
+
// atomeJsToRuby(call)
|
90
94
|
}
|
91
95
|
|
92
96
|
|
@@ -3,7 +3,8 @@ function atomeJsToRuby(rubycode) {
|
|
3
3
|
}
|
4
4
|
|
5
5
|
function controller_message(msg) {
|
6
|
-
|
6
|
+
/// use for communication with server
|
7
|
+
rubyVM.eval(msg);
|
7
8
|
}
|
8
9
|
|
9
10
|
// document.addEventListener("DOMContentLoaded", function() {
|
@@ -119,7 +120,6 @@ const communication = {
|
|
119
120
|
ws_sender: function (message) {
|
120
121
|
// now we send the data to the server
|
121
122
|
// puts "--> message : #{message}"
|
122
|
-
|
123
123
|
this.websocket.send(message)
|
124
124
|
},
|
125
125
|
}
|
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.
|
4
|
+
version: 0.5.7.5.1
|
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-07-
|
11
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -913,7 +913,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
913
913
|
- !ruby/object:Gem::Version
|
914
914
|
version: '0'
|
915
915
|
requirements: []
|
916
|
-
rubygems_version: 3.5.
|
916
|
+
rubygems_version: 3.5.15
|
917
917
|
signing_key:
|
918
918
|
specification_version: 4
|
919
919
|
summary: the creative framework
|