atome 0.5.6.1.4 → 0.5.6.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +44 -0
- data/documentation/deep learning/basic_infos.txt +6 -0
- data/exe/atome +0 -2
- data/lib/atome/atome.rb +1 -1
- data/lib/atome/extensions/atome.rb +33 -23
- data/lib/atome/extensions/sha.rb +8 -8
- data/lib/atome/genesis/generators/atome.rb +1 -1
- data/lib/atome/genesis/generators/communication.rb +14 -20
- data/lib/atome/genesis/generators/effect.rb +2 -2
- data/lib/atome/genesis/generators/event.rb +25 -25
- data/lib/atome/genesis/generators/geometry.rb +3 -3
- data/lib/atome/genesis/generators/hierarchy.rb +6 -6
- data/lib/atome/genesis/generators/identity.rb +13 -13
- data/lib/atome/genesis/generators/material.rb +24 -11
- data/lib/atome/genesis/generators/property.rb +8 -24
- data/lib/atome/genesis/generators/security.rb +1 -1
- data/lib/atome/genesis/generators/spatial.rb +13 -13
- data/lib/atome/genesis/generators/time.rb +1 -1
- data/lib/atome/genesis/generators/utility.rb +39 -37
- data/lib/atome/genesis/genesis.rb +2 -1
- data/lib/atome/genesis/sparkle.rb +31 -11
- data/lib/atome/helpers/utilities.rb +108 -49
- data/lib/atome/kernel/universe.rb +13 -9
- data/lib/atome/version.rb +1 -1
- data/lib/eVe/eVe.rb +1 -1
- data/lib/eVe/eVe_relative.rb +1 -1
- data/lib/platform_specific/opal/extensions/sha.rb +25 -14
- data/lib/renderers/html/html.rb +6 -7
- data/vendor/assets/application/examples/atome_particle_validation.rb +7 -0
- data/vendor/assets/application/examples/attach.rb +3 -3
- data/vendor/assets/application/examples/border.rb +1 -1
- data/vendor/assets/application/examples/categories.rb +5 -0
- data/vendor/assets/application/examples/clones&monitoring.rb +105 -0
- data/vendor/assets/application/examples/database_handling.rb +20 -0
- data/vendor/assets/application/examples/display_bck.rb +1 -1
- data/vendor/assets/application/examples/drag.rb +3 -1
- data/vendor/assets/application/examples/encrypt.rb +6 -0
- data/vendor/assets/application/examples/find.rb +1 -1
- data/vendor/assets/application/examples/import.rb +2 -2
- data/vendor/assets/application/examples/read.rb +2 -0
- data/vendor/assets/application/examples/shadow.rb +2 -1
- data/vendor/assets/server/atome_server.rb +93 -16
- data/vendor/assets/server/atome_server_wasm.rb +1 -1
- data/vendor/assets/src/index.html +21 -21
- data/vendor/assets/src/index_server.html +11 -5
- data/vendor/assets/src/index_server_wasm.html +11 -4
- data/vendor/assets/src/js/atome/atome.js +1 -1
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +39 -30
- metadata +7 -4
- data/vendor/assets/application/examples/a_concat.rb +0 -19
- data/vendor/assets/application/examples/clones.rb +0 -177
@@ -1,14 +1,25 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# addon for the Atome class
|
4
|
-
class Atome
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
# # frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# # # addon for the Atome class
|
4
|
+
# class Atome
|
5
|
+
# # def calculate_sha(string)
|
6
|
+
# # if RUBY_ENGINE.downcase == 'opal' || 'wasm32-wasi'
|
7
|
+
# # # `sha256(#{string})`
|
8
|
+
# # js_code = "sha256('#{string}')"
|
9
|
+
# # JS.eval(js_code)
|
10
|
+
# # else
|
11
|
+
# # Digest::SHA256.hexdigest(string)
|
12
|
+
# # end
|
13
|
+
# # end
|
14
|
+
# #
|
15
|
+
# #
|
16
|
+
# def crypt(string)
|
17
|
+
# # if RUBY_ENGINE.downcase == 'opal' || 'wasm32-wasi'
|
18
|
+
# # `sha256(#{string})`
|
19
|
+
# js_code = "sha256('#{string}')"
|
20
|
+
# JS.eval(js_code)
|
21
|
+
# # else
|
22
|
+
# Digest::SHA256.hexdigest(string)
|
23
|
+
# # end
|
24
|
+
# end
|
25
|
+
# end
|
data/lib/renderers/html/html.rb
CHANGED
@@ -212,14 +212,13 @@ class HTML
|
|
212
212
|
def connect(params, &bloc)
|
213
213
|
type= params[:type]
|
214
214
|
server= params[:address]
|
215
|
-
user=params[:user]
|
216
|
-
pass=params[:pass]
|
217
|
-
atomes=params[:atomes]
|
218
|
-
particles=params[:particles]
|
219
|
-
|
220
|
-
#
|
215
|
+
# user=params[:user]
|
216
|
+
# pass=params[:pass]
|
217
|
+
# atomes=params[:atomes]
|
218
|
+
# particles=params[:particles]
|
219
|
+
# 'atomeJS.connect' is in the communication.js file ( connect: function (type, server, )
|
220
|
+
JS.eval("atomeJS.connect('#{type}','#{server}')")
|
221
221
|
# JS.eval("atomeJS.connect('ws://#{server}')")
|
222
|
-
# @original_atome.message(:helloworld)
|
223
222
|
end
|
224
223
|
|
225
224
|
def send_message(message)
|
@@ -6,10 +6,10 @@
|
|
6
6
|
# please note that atome.attach([:atome_id]) means that atome will be the parent of the atome with the id :atome_id
|
7
7
|
# to sum up : attach and attached are both setter and getter :
|
8
8
|
# a.attach(b.ib) will attach the current object to the IDs passed in the params. The current atome will be the child of the the atomes width IDS passed in the the params,
|
9
|
-
# a.attach(b.ib) means (insert '
|
9
|
+
# a.attach(b.ib) means (insert 'b' into 'a') or a is parent b is child
|
10
10
|
|
11
|
-
# while a.attached(b.id) (insert '
|
12
|
-
# a.attached(b.ib) means (insert '
|
11
|
+
# while a.attached(b.id) (insert 'a' into 'b')is the opposite to attached it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
|
12
|
+
# a.attached(b.ib) means (insert 'a' into 'b') or a is child b is parent
|
13
13
|
|
14
14
|
# atome.attach([:atome_id]) means that atome will be the child of the atome with the id :atome_id
|
15
15
|
# Here is how to use it as a setter :
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# # frozen_string_literal: true
|
2
|
+
|
3
|
+
# TODO : clones alteration must be bidirectional, to do so :
|
4
|
+
|
5
|
+
c = circle({ id: :the_circle, left: 12, top: 0, color: :orange, drag: { move: true, inertia: true, lock: :start } })
|
6
|
+
b = box({ top: 123 })
|
7
|
+
|
8
|
+
t = text({ data: :hello, left: 300 })
|
9
|
+
|
10
|
+
t.touch(true) do
|
11
|
+
puts "#{b.touch} , #{b.touch_code}"
|
12
|
+
b.touch_code[:touch].call
|
13
|
+
end
|
14
|
+
col = color({ id: :col1, red: 1, blue: 1 })
|
15
|
+
# #######################
|
16
|
+
atomes_monitored = [c, b]
|
17
|
+
# particles_monitored=[:left, :width, :touch, :apply]
|
18
|
+
particles_monitored = [:left, :width, :apply]
|
19
|
+
# particles_monitored = [:touch]
|
20
|
+
Atome.monitoring(atomes_monitored, particles_monitored) do |monitor_infos|
|
21
|
+
puts "1 ==> #{@id} : #{monitor_infos[:particle]},#{monitor_infos[:altered]}"
|
22
|
+
|
23
|
+
atomes_monitored.each do |atome_to_update|
|
24
|
+
# we exclude the current changing atome to avoid infinite loop
|
25
|
+
unless atome_to_update == self || (monitor_infos[:original] == monitor_infos[:altered]) || !monitor_infos[:altered]
|
26
|
+
puts "2 ==> #{atome_to_update.id} : #{monitor_infos[:particle]},#{monitor_infos[:altered]}"
|
27
|
+
atome_to_update.send(monitor_infos[:particle], monitor_infos[:altered])
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
# ####################
|
33
|
+
b.resize(true)
|
34
|
+
c.resize(true) do |l|
|
35
|
+
|
36
|
+
puts c.instance_variable_get("@resize_code")
|
37
|
+
end
|
38
|
+
ccc = color(:red)
|
39
|
+
wait 1 do
|
40
|
+
# b.left(133)
|
41
|
+
b.touch(true) do
|
42
|
+
puts "b width is #{b.width}"
|
43
|
+
end
|
44
|
+
|
45
|
+
c.left(133)
|
46
|
+
wait 1 do
|
47
|
+
# c.color(:red)
|
48
|
+
# c.apply([ccc.id])
|
49
|
+
b.width(155)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# TODO : make multi parents works
|
54
|
+
# TODO : make it works for event like touch , also attach and attached
|
55
|
+
# wait 2 do
|
56
|
+
# col = color({ id: :col1, red: 1, blue: 1 })
|
57
|
+
# Atome.monitoring([col], [:red, :blue], [:variable1, :variable2])
|
58
|
+
#
|
59
|
+
# c.apply([:col1])
|
60
|
+
# wait 2 do
|
61
|
+
# col.red(0)
|
62
|
+
# col.red
|
63
|
+
# c.apply([:col1])
|
64
|
+
# end
|
65
|
+
# end
|
66
|
+
|
67
|
+
############## add class solution
|
68
|
+
the_b = box({ color: :green })
|
69
|
+
|
70
|
+
the_b.resize(true) do
|
71
|
+
puts :j
|
72
|
+
end
|
73
|
+
|
74
|
+
class HTML
|
75
|
+
|
76
|
+
def id(id)
|
77
|
+
@element[:classList].add(id.to_s)
|
78
|
+
attr('id', id)
|
79
|
+
self
|
80
|
+
end
|
81
|
+
|
82
|
+
def add_class(val)
|
83
|
+
@element[:classList].add(val.to_s)
|
84
|
+
# @element.setAttribute('id', val)
|
85
|
+
end
|
86
|
+
|
87
|
+
# def force_top(id,value)
|
88
|
+
# element=JS.global[:document].getElementById(id.to_s)
|
89
|
+
# element[:style][:top] ='33px'
|
90
|
+
# end
|
91
|
+
end
|
92
|
+
|
93
|
+
new({ particle: :add_class }) do |params|
|
94
|
+
html.add_class(params)
|
95
|
+
end
|
96
|
+
#
|
97
|
+
# new({ particle: :force_top }) do |params|
|
98
|
+
# html.force_top(params)
|
99
|
+
# end
|
100
|
+
|
101
|
+
b = box({ id: :toto })
|
102
|
+
bb = box({ id: :toto, left: 333 })
|
103
|
+
bb.add_class(:toto)
|
104
|
+
b.add_class(:toto)
|
105
|
+
# bb.force_top(:toto,3)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
A.message({ action: :insert, data: { table: :security, particle: :email, data: 'jeezs@jeezs.net' } })
|
4
|
+
A.message({ action: :insert, data: { table: :security, particle: :name, data: 'jeezs' } }) do |data_received_from_server|
|
5
|
+
puts "my first insert #{data_received_from_server}"
|
6
|
+
end
|
7
|
+
A.message({ action: :query, data: { table: :identity } }) do |data_received_from_server|
|
8
|
+
puts "another insert : #{data_received_from_server}"
|
9
|
+
end
|
10
|
+
A.message({ action: :query, data: { table: :identity } }) do |data_received|
|
11
|
+
puts "received : #{data_received}"
|
12
|
+
end
|
13
|
+
|
14
|
+
A.message({ action: :insert, data: { table: :security, particle: :name, data: 'jeezs' } }) do |result|
|
15
|
+
puts "insert done : #{result}"
|
16
|
+
end
|
17
|
+
|
18
|
+
A.message({ action: :insert, data: { table: :security, particle: :name, data: 'jeezs' } }) do |result|
|
19
|
+
puts "last message received: #{result}"
|
20
|
+
end
|
@@ -70,7 +70,7 @@ new({ particle: :display, render: false }) do |params|
|
|
70
70
|
container = grab(:view).box({ id: grid_id, width: container_width, height: container_height, overflow: :auto, color: :white, depth: 0 })
|
71
71
|
############## deletion
|
72
72
|
container.touch(true) do
|
73
|
-
|
73
|
+
puts "removing container recursively : #{container.id}"
|
74
74
|
val_1= Universe.atomes.length
|
75
75
|
puts "val_1 : #{val_1}"
|
76
76
|
container.delete({ recursive: true })
|
@@ -21,7 +21,7 @@ end
|
|
21
21
|
|
22
22
|
|
23
23
|
importer do |val|
|
24
|
-
|
24
|
+
puts "case 21 #{val}"
|
25
25
|
end
|
26
26
|
|
27
27
|
# importer(:all) do |val|
|
@@ -29,5 +29,5 @@ end
|
|
29
29
|
# end
|
30
30
|
|
31
31
|
importer('the_boxy') do |val|
|
32
|
-
|
32
|
+
puts "yes !!! exception found : #{val}"
|
33
33
|
end
|
@@ -16,21 +16,74 @@ require 'securerandom'
|
|
16
16
|
require 'sequel'
|
17
17
|
|
18
18
|
class EDen
|
19
|
+
|
20
|
+
def self.db_access
|
21
|
+
Database.connect_database
|
22
|
+
end
|
23
|
+
|
19
24
|
def self.terminal(cmd, option, ws, value, user, pass)
|
20
|
-
`#{cmd}`
|
25
|
+
{return: `#{cmd}` }
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.pass(cmd, option, ws, value, user, pass)
|
29
|
+
{return: 'pass received' }
|
21
30
|
end
|
22
31
|
|
23
32
|
def self.init_db(cmd, option, ws, value, user, pass)
|
24
|
-
|
33
|
+
# Database.
|
34
|
+
{return: 'database initialised' }
|
25
35
|
end
|
26
36
|
|
37
|
+
def self.query(cmd, option, ws, value, user, pass)
|
38
|
+
identity_table = db_access[cmd['table'].to_sym]
|
39
|
+
result = identity_table.send(:all).send(:select)
|
40
|
+
{ action: :query, data: cmd['table'], return: result }
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.insert(cmd, option, ws, value, user, pass)
|
44
|
+
identity_table = db_access[:identity]
|
45
|
+
identity_table.insert(email: 'tre@tre')
|
46
|
+
{ action: :insert, data: cmd, return: { email: 'tre@tre' } }
|
47
|
+
end
|
48
|
+
|
49
|
+
# def self.authentification(cmd, option, ws, value, user, pass)
|
50
|
+
# db = Database.connect_database
|
51
|
+
# identity_items = db[:identity]
|
52
|
+
# security_items = db[:security]
|
53
|
+
#
|
54
|
+
# identity_items.insert(email: 'tre@tre')
|
55
|
+
# security_items.insert(password: 'poipoi')
|
56
|
+
# # testtest= "Mails count: #{identity_items.count}"
|
57
|
+
#
|
58
|
+
# user_email = value["mail"]
|
59
|
+
# user_password = value["pass"]
|
60
|
+
#
|
61
|
+
# # user_exists = identity_items.all.select{|item| item[:email]==user_email}
|
62
|
+
# user_exists = identity_items.send(:all).send(:select) do |item|
|
63
|
+
# item[:email] == user_email
|
64
|
+
# end
|
65
|
+
#
|
66
|
+
# if user_exists.empty?
|
67
|
+
# # "Mails count: #{identity_items.count}"
|
68
|
+
# # "Mails count: #{identity_items.all}"
|
69
|
+
# "Email non trouvé, erreur"
|
70
|
+
# # Ask to the user if he wants to subscribe
|
71
|
+
# # Send the basic template
|
72
|
+
# else
|
73
|
+
# "Email trouvé, cherche mdp"
|
74
|
+
# # Verify password
|
75
|
+
# # If password isn't ok, send error
|
76
|
+
# # If the password is ok, send the user account template
|
77
|
+
# end
|
78
|
+
# end
|
79
|
+
|
27
80
|
def self.file(source, operation, ws, value, user, pass)
|
28
81
|
file_content = File.send(operation, source, value).to_s
|
29
82
|
file_content = file_content.gsub("'", "\"")
|
30
|
-
"=> operation: #{operation}, source: #{source} , content : #{file_content}
|
83
|
+
{return: "=> operation: #{operation}, source: #{source} , content : #{file_content}" }
|
31
84
|
end
|
32
85
|
|
33
|
-
# return_message = EDen.safe_send(action_requested,
|
86
|
+
# return_message = EDen.safe_send(action_requested, data,option, current_user, user_pass)
|
34
87
|
|
35
88
|
def self.safe_send(method_name, *args)
|
36
89
|
method_sym = method_name.to_sym
|
@@ -38,7 +91,7 @@ class EDen
|
|
38
91
|
if eden_methods.include?(method_sym)
|
39
92
|
send(method_sym, *args)
|
40
93
|
else
|
41
|
-
"forbidden action: #{method_name}"
|
94
|
+
{return: "forbidden action: #{method_name}" }
|
42
95
|
end
|
43
96
|
end
|
44
97
|
end
|
@@ -55,12 +108,24 @@ class String
|
|
55
108
|
end
|
56
109
|
end
|
57
110
|
|
58
|
-
puts "kjhj"
|
59
|
-
|
60
111
|
class Database
|
112
|
+
|
113
|
+
def self.table_exists?(table_name)
|
114
|
+
eden = Sequel.connect("sqlite://eden.sqlite3")
|
115
|
+
if eden.table_exists?(table_name)
|
116
|
+
puts "La table #{table_name} existe dans la base de données."
|
117
|
+
else
|
118
|
+
puts "La table suivante : #{table_name} n'existe pas dans la base de données."
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
# def self.create_table(table_name)
|
61
124
|
def self.connect_database
|
62
125
|
if File.exist?("eden.sqlite3")
|
63
126
|
eden = Sequel.connect("sqlite://eden.sqlite3")
|
127
|
+
# now we test if the table exist
|
128
|
+
table_exists?(:table_name)
|
64
129
|
else
|
65
130
|
eden = Sequel.connect("sqlite://eden.sqlite3")
|
66
131
|
eden.create_table :atome do
|
@@ -71,10 +136,22 @@ class Database
|
|
71
136
|
eden.create_table :communication do
|
72
137
|
primary_key :communication_id
|
73
138
|
String :connection
|
74
|
-
JSON :
|
139
|
+
JSON :data
|
75
140
|
JSON :controller
|
76
141
|
end
|
77
142
|
|
143
|
+
###################
|
144
|
+
|
145
|
+
Sequel.extension :migration
|
146
|
+
|
147
|
+
Sequel.migration do
|
148
|
+
change do
|
149
|
+
add_column :communication, :jesaispas, String
|
150
|
+
end
|
151
|
+
end.apply(eden, :up)
|
152
|
+
|
153
|
+
###################
|
154
|
+
|
78
155
|
eden.create_table :effect do
|
79
156
|
primary_key :effect_id
|
80
157
|
Int :smooth
|
@@ -133,6 +210,9 @@ class Database
|
|
133
210
|
String :type
|
134
211
|
Int :id
|
135
212
|
String :name
|
213
|
+
String :firstname
|
214
|
+
String :email
|
215
|
+
String :nickname
|
136
216
|
Boolean :active
|
137
217
|
String :markup
|
138
218
|
String :bundle
|
@@ -245,7 +325,7 @@ end
|
|
245
325
|
class App < Roda
|
246
326
|
|
247
327
|
# comment below when test will be done
|
248
|
-
File.delete("./eden.sqlite3") if File.exist?("./eden.sqlite3")
|
328
|
+
# File.delete("./eden.sqlite3") if File.exist?("./eden.sqlite3")
|
249
329
|
eden = Database.connect_database
|
250
330
|
items = eden[:atome]
|
251
331
|
|
@@ -264,24 +344,21 @@ class App < Roda
|
|
264
344
|
if Faye::WebSocket.websocket?(r.env)
|
265
345
|
ws = Faye::WebSocket.new(r.env)
|
266
346
|
ws.on :open do |event|
|
267
|
-
ws.send('server ready'.to_json)
|
347
|
+
ws.send({return: 'server ready' }.to_json)
|
268
348
|
# ws.send('asking for synchro data'.to_json)
|
269
349
|
end
|
270
350
|
|
271
351
|
ws.on(:message) do |event|
|
272
352
|
json_string = event.data.gsub(/(\w+):/) { "\"#{$1}\":" }.gsub('=>', ':')
|
273
353
|
full_data = JSON.parse(json_string)
|
274
|
-
|
354
|
+
data = full_data['data']
|
275
355
|
action_requested = full_data['action']
|
276
356
|
value = full_data['value']
|
277
357
|
option = full_data['option']
|
278
358
|
current_user = full_data['user']
|
279
359
|
user_pass = full_data['pass']['global']
|
280
|
-
|
281
|
-
|
282
|
-
else
|
283
|
-
return_message = "no action msg: #{test}"
|
284
|
-
end
|
360
|
+
# return_message = EDen.safe_send(action_requested, data, option, ws, value, current_user, user_pass)
|
361
|
+
return_message = EDen.safe_send(action_requested, data, option, ws, value, current_user, user_pass)
|
285
362
|
ws.send(return_message.to_json)
|
286
363
|
end
|
287
364
|
|
@@ -66,7 +66,7 @@ end
|
|
66
66
|
|
67
67
|
class App < Roda
|
68
68
|
# comment below when test will be done
|
69
|
-
File.delete("./eden.sqlite3") if File.exist?("./eden.sqlite3")
|
69
|
+
# File.delete("./eden.sqlite3") if File.exist?("./eden.sqlite3")
|
70
70
|
eden = Database.connect_database
|
71
71
|
items = eden[:atome]
|
72
72
|
|
@@ -9,39 +9,39 @@
|
|
9
9
|
<meta name="msapplication-tap-highlight" content="no">
|
10
10
|
<link type="text/css" rel="stylesheet" href="css/style.css">
|
11
11
|
<style id="atomic_style"></style>
|
12
|
+
<script defer src="js/third_parties/browser.script.iife.min.js" type="text/javascript"></script>
|
12
13
|
<script type="text/javascript" src="js/third_parties/interact.min.js" defer></script>
|
13
14
|
<script type="text/javascript" src="js/third_parties/popmotion.min.js" defer></script>
|
14
15
|
<script type="text/javascript" src="js/third_parties/sortable.min.js" defer></script>
|
15
16
|
<script type="text/javascript" src="js/third_parties/wad.min.js" defer></script>
|
16
17
|
<script type="text/javascript" src="js/third_parties/sha256.min.js" defer></script>
|
17
18
|
<script type="text/javascript" src="js/third_parties/ping.min.js" defer></script>
|
18
|
-
<script
|
19
|
+
<script type="text/javascript" src="js/third_parties/fabric.min.js" defer></script>
|
19
20
|
<script type="text/javascript" src="js/third_parties/papaparse.min.js" defer></script>
|
20
|
-
<script src='js/opal/opal.js' defer></script>
|
21
|
-
<script src='js/opal/opal_parser.js' defer></script>
|
22
|
-
<script src='js/aui.js' defer></script>
|
23
|
-
<script defer defer src='js/host_mode.js'></script>
|
24
|
-
<script src='js/opal/atome_opal_extensions.js' defer></script>
|
25
|
-
<script src='js/atome/kernel.js' defer></script>
|
26
21
|
<script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
|
27
22
|
<script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
|
28
|
-
<!-- <script>-->
|
29
|
-
<!-- // to prevent right click-->
|
30
|
-
<!-- document.addEventListener("contextmenu", function (e) {-->
|
31
|
-
<!-- e.preventDefault();-->
|
32
|
-
<!-- });-->
|
33
|
-
<!-- </script>-->
|
23
|
+
<!-- <script>-->
|
24
|
+
<!-- // to prevent right click-->
|
25
|
+
<!-- document.addEventListener("contextmenu", function (e) {-->
|
26
|
+
<!-- e.preventDefault();-->
|
27
|
+
<!-- });-->
|
28
|
+
<!-- </script>-->
|
34
29
|
<title>atome</title>
|
35
30
|
</head>
|
36
31
|
<body id='user_view' class='atome'>
|
37
|
-
|
32
|
+
|
33
|
+
<div id='copyright'>©atome 2023</div>
|
38
34
|
</body>
|
39
|
-
<script
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
35
|
+
<script type="text/ruby">
|
36
|
+
require 'js'
|
37
|
+
require '/lib/platform_specific/wasm/atome_wasm_extensions'
|
38
|
+
require '/utilities/aui'
|
39
|
+
require '/utilities/host_mode'
|
40
|
+
require '/lib/atome_relative'
|
41
|
+
require './index'
|
42
|
+
#puts Universe.host
|
43
|
+
atome_infos
|
46
44
|
</script>
|
45
|
+
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
46
|
+
<script defer src="js/atome/atome.js" type="text/javascript"></script>
|
47
47
|
</html>
|
@@ -38,13 +38,19 @@
|
|
38
38
|
</body>
|
39
39
|
<script defer src="js/atome/specific/opal.js" type="text/javascript"></script>
|
40
40
|
<script defer src="js/atome/atome.js" type="text/javascript"></script>
|
41
|
-
<script defer src='js/application.js'></script>
|
42
41
|
<script>
|
42
|
+
function loadApplicationJs() {
|
43
|
+
var script = document.createElement('script');
|
44
|
+
script.src = 'js/application.js';
|
45
|
+
script.onload = function() {
|
46
|
+
rubyVMCallback("A.init_database");
|
47
|
+
};
|
48
|
+
document.body.appendChild(script);
|
49
|
+
}
|
50
|
+
|
43
51
|
window.addEventListener('load', function () {
|
44
|
-
|
45
|
-
Opal.eval("A.server({ address: 'localhost:9292' , type: 'ws'})")
|
46
|
-
Opal.eval('A.init_websocket')
|
52
|
+
rubyVMCallback('atome_genesis');
|
47
53
|
})
|
48
|
-
|
49
54
|
</script>
|
55
|
+
|
50
56
|
</html>
|
@@ -40,10 +40,17 @@
|
|
40
40
|
require '/lib/atome_relative'
|
41
41
|
require './index'
|
42
42
|
#puts Universe.host
|
43
|
-
|
44
|
-
A.server({ address: 'localhost:9292' , type: 'ws'})
|
45
|
-
A.init_websocket
|
43
|
+
atome_genesis
|
46
44
|
</script>
|
47
45
|
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
48
|
-
<script
|
46
|
+
<script>
|
47
|
+
function loadApplicationJs() {
|
48
|
+
var script = document.createElement('script');
|
49
|
+
script.src = 'js/application.js';
|
50
|
+
script.onload = function() {
|
51
|
+
rubyVMCallback("A.init_database");
|
52
|
+
};
|
53
|
+
document.body.appendChild(script);
|
54
|
+
}
|
55
|
+
</script>
|
49
56
|
</html>
|