atome 0.5.5.8.7 → 0.5.5.9.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/atome.rb +7 -1
- data/lib/atome/genesis/generators/communication.rb +12 -4
- data/lib/atome/genesis/generators/spatial.rb +23 -13
- data/lib/atome/genesis/generators/utility.rb +1 -1
- data/lib/atome/genesis/sparkle.rb +23 -2
- data/lib/atome/helpers/essentials.rb +1 -1
- data/lib/atome/helpers/utilities.rb +20 -0
- data/lib/atome/kernel/universe.rb +18 -0
- data/lib/atome/version.rb +1 -1
- data/lib/renderers/html/communication.rb +3 -0
- data/lib/renderers/html/effect.rb +0 -1
- data/lib/renderers/html/geometry.rb +2 -2
- data/lib/renderers/html/html.rb +4 -6
- data/lib/renderers/html/identity.rb +6 -3
- data/lib/renderers/html/property.rb +9 -7
- data/lib/renderers/html/spatial.rb +25 -27
- data/vendor/assets/application/examples/atome.rb +0 -1
- data/vendor/assets/application/examples/compute.rb +3 -3
- data/vendor/assets/application/examples/example.rb +27 -0
- data/vendor/assets/application/examples/help.rb +17 -0
- data/vendor/assets/application/examples/int8.rb +14 -0
- data/vendor/assets/application/examples/test.rb +20 -0
- data/vendor/assets/application/examples/unit.rb +14 -0
- data/vendor/assets/server/atome_server.rb +7 -4
- metadata +9 -4
- /data/vendor/assets/application/examples/{messaging.rb → server.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bff5ca5d96c5da19c164ec49593ae7f237251c9656135a6f74d8fcfb028243a
|
4
|
+
data.tar.gz: fc6035092c39b7d795157ab5b5dd91db2b1b7a3037b3d1af356c33050a316348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10ca739de4b2760d6d77267f50ddc9aaf7d6b003e50dae9e2535259e542d83dc4da6536184fa45f59cafb84a4daf11764cb6f46e7fdc59028a3e201c4340d4f4
|
7
|
+
data.tar.gz: 6c58b50fab38c6d5c89e4ec86e384530165a1e26547f13415e0e056fd7c7c94c4b9cb75cc4f72bcf40c90c112d098dc1d0e1dd44ad2fa475b992c31e25f68c83
|
data/lib/atome/atome.rb
CHANGED
@@ -10,9 +10,11 @@ class Atome
|
|
10
10
|
|
11
11
|
# the keys :renderers, :type and :id should be placed in the first position in the hash
|
12
12
|
@history = {}
|
13
|
+
# @language = :english
|
13
14
|
@callback = {}
|
14
15
|
@tag = {}
|
15
16
|
@selected = false
|
17
|
+
@metrics = {}
|
16
18
|
@unit = {}
|
17
19
|
@collect = {}
|
18
20
|
@id = new_atome[:id] || identity_generator(:element)
|
@@ -26,7 +28,7 @@ class Atome
|
|
26
28
|
# now we store the proc in a an atome's property called :bloc
|
27
29
|
new_atome[:code] = atomes_proc if atomes_proc
|
28
30
|
# we reorder the hash
|
29
|
-
ordered_keys = %i[renderers id alien type]
|
31
|
+
ordered_keys = %i[renderers id alien type int8 unit]
|
30
32
|
ordered_part = ordered_keys.map { |k| [k, new_atome[k]] }.to_h
|
31
33
|
other_part = new_atome.reject { |k, _| ordered_keys.include?(k) }
|
32
34
|
# merge the parts to obtain an re-ordered hash
|
@@ -36,6 +38,10 @@ class Atome
|
|
36
38
|
collapse(reordered_atome)
|
37
39
|
end
|
38
40
|
|
41
|
+
def js
|
42
|
+
html.object
|
43
|
+
end
|
44
|
+
|
39
45
|
def particle_creation(element, params, store, rendering, &user_proc)
|
40
46
|
|
41
47
|
# @store_allow = false
|
@@ -7,13 +7,21 @@ end
|
|
7
7
|
|
8
8
|
new({ particle: :message }) do |params, bloc|
|
9
9
|
|
10
|
-
params = {message:
|
11
|
-
params[:user]=Universe.current_user
|
12
|
-
params[:pass]=Black_matter.password
|
10
|
+
params = { message: params } unless params.instance_of? Hash
|
11
|
+
params[:user] = Universe.current_user
|
12
|
+
params[:pass] = Black_matter.password
|
13
13
|
|
14
14
|
html.send_message(params, &bloc)
|
15
15
|
end
|
16
16
|
|
17
17
|
new({ particle: :controller }) do |msg|
|
18
18
|
Atome.controller_sender(msg)
|
19
|
-
end
|
19
|
+
end
|
20
|
+
|
21
|
+
new({ particle: :int8 })
|
22
|
+
|
23
|
+
new({ particle: :language }) do |params|
|
24
|
+
@data = int8[params]
|
25
|
+
params
|
26
|
+
end
|
27
|
+
|
@@ -1,9 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({
|
4
|
-
|
5
|
-
|
6
|
-
new({ particle: :
|
3
|
+
# new ({particle: :left}) do |params|
|
4
|
+
# {value: params, unit: :px} unless params.instance_of? Hash
|
5
|
+
# end
|
6
|
+
# new({ particle: :right, type: :integer })do |params|
|
7
|
+
# {value: params, unit: :px} unless params.instance_of? Hash
|
8
|
+
# end
|
9
|
+
# new({ particle: :top, type: :integer })do |params|
|
10
|
+
# {value: params, unit: :px} unless params.instance_of? Hash
|
11
|
+
#
|
12
|
+
# end
|
13
|
+
# new({ particle: :bottom, type: :integer })do |params|
|
14
|
+
# {value: params, unit: :px} unless params.instance_of? Hash
|
15
|
+
# end
|
16
|
+
|
17
|
+
new ({particle: :left})
|
18
|
+
new ({particle: :right})
|
19
|
+
new ({particle: :top})
|
20
|
+
new ({particle: :bottom})
|
21
|
+
|
22
|
+
|
7
23
|
new({ particle: :rotate, type: :integer })
|
8
24
|
new({ particle: :direction, type: :string })
|
9
25
|
new({ particle: :center, type: :string})
|
@@ -12,9 +28,7 @@ new({ particle: :position })
|
|
12
28
|
new({ particle: :organise })
|
13
29
|
new({ particle: :spacing })
|
14
30
|
new({ particle: :display }) do |params|
|
15
|
-
unless params.instance_of? Hash
|
16
|
-
params = { mode: params }
|
17
|
-
end
|
31
|
+
params = { mode: params } unless params.instance_of? Hash
|
18
32
|
params
|
19
33
|
end
|
20
34
|
new({ particle: :layout }) do |params|
|
@@ -23,9 +37,7 @@ new({ particle: :layout }) do |params|
|
|
23
37
|
elements_style = params.delete(:element) || {}
|
24
38
|
# now we get the list of the atome to layout
|
25
39
|
atomes_to_organise = []
|
26
|
-
if type == :group
|
27
|
-
atomes_to_organise = collect
|
28
|
-
end
|
40
|
+
atomes_to_organise = collect if type == :group
|
29
41
|
# if params[:listing] is specified group collection is override
|
30
42
|
atomes_to_organise = params[:listing] if params[:listing]
|
31
43
|
if mode_found == :default
|
@@ -56,9 +68,7 @@ new({ particle: :layout }) do |params|
|
|
56
68
|
end
|
57
69
|
container.remove({ category: :atome })
|
58
70
|
container.category(:matrix)
|
59
|
-
if mode_found == :list
|
60
|
-
params[:organise] = '1fr'
|
61
|
-
end
|
71
|
+
params[:organise] = '1fr' if mode_found == :list
|
62
72
|
params.each do |particle, value|
|
63
73
|
container.send(particle, value)
|
64
74
|
end
|
@@ -113,7 +113,7 @@ end
|
|
113
113
|
new({ particle: :relations, type: :hash })
|
114
114
|
new({ particle: :tag, render: false, type: :hash })
|
115
115
|
new({ particle: :web })
|
116
|
-
new({ particle: :
|
116
|
+
new({ particle: :metrics, type: :hash })
|
117
117
|
new({ initialize: :unit, value: {} })
|
118
118
|
new({ particle: :login }) do |params|
|
119
119
|
set_current_user(id) if params
|
@@ -91,7 +91,7 @@ Atome.new({ renderers: default_render, id: machine_id, type: :machine, password:
|
|
91
91
|
#user
|
92
92
|
user_password = {global: :star_win, read: { atome: :star_wars }, write: { atome: :star_wars } }
|
93
93
|
|
94
|
-
human({ id: :anonymous, login: true, password: user_password, data: { birthday: '10/05/1996' },selection: [],
|
94
|
+
human({ id: :anonymous, login: true, password: user_password, data: { birthday: '10/05/1996' },selection: [], attach: :user_view })
|
95
95
|
|
96
96
|
Universe.current_machine = machine_id
|
97
97
|
# the constant A is used to access alla atomes methods
|
@@ -116,4 +116,25 @@ def atome_infos
|
|
116
116
|
puts "server: #{server}"
|
117
117
|
end
|
118
118
|
|
119
|
-
|
119
|
+
|
120
|
+
# help and example below :
|
121
|
+
#
|
122
|
+
A.example(:left) do
|
123
|
+
english = 'here is an example, touch me to get some help, or click the code to exec'
|
124
|
+
french = "voici un example, click moi pour de l'aide, ou clicker le code pour l'executer"
|
125
|
+
code = <<STR
|
126
|
+
b=box
|
127
|
+
puts b.left
|
128
|
+
b.left(155)
|
129
|
+
puts b.left
|
130
|
+
STR
|
131
|
+
example = text({ int8: { english: english, french: french }, language: :english, width: 666 })
|
132
|
+
code_text = text({ int8: { english: code }, language: :english, width: 666, top: 33 })
|
133
|
+
example.touch(true) do
|
134
|
+
example.delete(true)
|
135
|
+
help(:left)
|
136
|
+
end
|
137
|
+
code_text.touch(true) do
|
138
|
+
eval(code)
|
139
|
+
end
|
140
|
+
end
|
@@ -35,7 +35,7 @@ module Essentials
|
|
35
35
|
left: 100, top: 100 },
|
36
36
|
text: { type: :text, component: { size: 18 },left: 0, top: 0,
|
37
37
|
apply: [:text_color],
|
38
|
-
width: :auto, height: :auto },
|
38
|
+
width: :auto, height: :auto, language: :english },
|
39
39
|
drm: { type: :drm, attach: :black_matter },
|
40
40
|
shadow: { type: :shadow, red: 0, green: 0, blue: 0, alpha: 0 },
|
41
41
|
color: { type: :color, red: 0, green: 0, blue: 0, alpha: 1}
|
@@ -52,6 +52,26 @@ class Atome
|
|
52
52
|
|
53
53
|
end
|
54
54
|
|
55
|
+
|
56
|
+
def help(particle, &doc)
|
57
|
+
if doc
|
58
|
+
Universe.set_help(particle, &doc)
|
59
|
+
else
|
60
|
+
doc_found = Universe.get_help(particle)
|
61
|
+
instance_exec(&doc_found) if doc_found.is_a?(Proc)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def example(particle, &example)
|
66
|
+
if example
|
67
|
+
Universe.set_example(particle, &example)
|
68
|
+
else
|
69
|
+
example_found = Universe.get_example(particle)
|
70
|
+
instance_exec(&example_found) if example_found.is_a?(Proc)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
|
55
75
|
# local server messaging
|
56
76
|
def file_for_opal(parent, bloc)
|
57
77
|
JS.eval("fileForOpal('#{parent}', #{bloc})")
|
@@ -11,10 +11,28 @@ class Universe
|
|
11
11
|
@specificities = {}
|
12
12
|
@history = {}
|
13
13
|
@users = {}
|
14
|
+
@help = {}
|
15
|
+
@example = {}
|
14
16
|
|
15
17
|
class << self
|
16
18
|
attr_reader :atomes, :renderer_list, :atome_list, :particle_list, :classes, :counter, :atomes_specificities
|
17
19
|
|
20
|
+
def set_help(particle, &doc)
|
21
|
+
@help[particle] = doc
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_help(particle)
|
25
|
+
@help[particle]
|
26
|
+
end
|
27
|
+
|
28
|
+
def set_example(particle, &example)
|
29
|
+
@example[particle] = example
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_example(particle)
|
33
|
+
@example[particle]
|
34
|
+
end
|
35
|
+
|
18
36
|
def add_to_particle_list(particle = nil, type)
|
19
37
|
instance_variable_get('@particle_list')[particle] = type
|
20
38
|
end
|
data/lib/atome/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
new({ method: :width, type: :integer, renderer: :html }) do |value, _user_proc|
|
4
|
-
unit_found =
|
4
|
+
unit_found = metrics[:width]
|
5
5
|
if unit_found
|
6
6
|
html.style(:width, "#{value}#{unit_found}")
|
7
7
|
elsif value.is_a?(Numeric)
|
@@ -12,7 +12,7 @@ new({ method: :width, type: :integer, renderer: :html }) do |value, _user_proc|
|
|
12
12
|
end
|
13
13
|
|
14
14
|
new({ method: :height, renderer: :html, type: :string }) do |value, _user_proc|
|
15
|
-
unit_found =
|
15
|
+
unit_found = metrics[:height]
|
16
16
|
if unit_found
|
17
17
|
html.style(:height, "#{value}#{unit_found}")
|
18
18
|
elsif value.is_a?(Numeric)
|
data/lib/renderers/html/html.rb
CHANGED
@@ -26,6 +26,10 @@ class HTML
|
|
26
26
|
@original_atome = current_atome
|
27
27
|
end
|
28
28
|
|
29
|
+
def object
|
30
|
+
@element
|
31
|
+
end
|
32
|
+
|
29
33
|
def hypertext(params)
|
30
34
|
current_div = JS.global[:document].getElementById(@id.to_s)
|
31
35
|
current_div[:innerHTML] = params
|
@@ -1473,10 +1477,8 @@ class HTML
|
|
1473
1477
|
@center_options = options
|
1474
1478
|
@parent = grab(attach)
|
1475
1479
|
|
1476
|
-
# Appliquer le centrage initial
|
1477
1480
|
apply_centering(@center_options, @parent)
|
1478
1481
|
|
1479
|
-
# Si l'option dynamique est activée, ajouter un écouteur d'événements
|
1480
1482
|
if @center_options[:dynamic]
|
1481
1483
|
event_handler = ->(event) do
|
1482
1484
|
apply_centering(@center_options, @parent)
|
@@ -1487,7 +1489,6 @@ class HTML
|
|
1487
1489
|
|
1488
1490
|
private
|
1489
1491
|
|
1490
|
-
# Méthode auxiliaire pour appliquer le centrage
|
1491
1492
|
def apply_centering(options, parent)
|
1492
1493
|
# Centre sur l'axe X
|
1493
1494
|
if options[:x]
|
@@ -1495,20 +1496,17 @@ class HTML
|
|
1495
1496
|
@original_atome.left(x_position)
|
1496
1497
|
end
|
1497
1498
|
|
1498
|
-
# Centre sur l'axe Y
|
1499
1499
|
if options[:y]
|
1500
1500
|
y_position = calculate_position(options[:y], parent.to_px(:height), @original_atome.to_px(:height))
|
1501
1501
|
@original_atome.top(y_position)
|
1502
1502
|
end
|
1503
1503
|
end
|
1504
1504
|
|
1505
|
-
# Méthode auxiliaire pour calculer la position
|
1506
1505
|
def calculate_position(option, parent_dimension, self_dimension)
|
1507
1506
|
if option.is_a?(String) && option.end_with?('%')
|
1508
1507
|
percent = option.chop.to_f / 100.0
|
1509
1508
|
(parent_dimension - self_dimension) * percent
|
1510
1509
|
elsif option == 0
|
1511
|
-
# Cas spécial pour centrer l'objet
|
1512
1510
|
(parent_dimension - self_dimension) / 2.0
|
1513
1511
|
else
|
1514
1512
|
option
|
@@ -41,9 +41,12 @@ end
|
|
41
41
|
new({ method: :type, type: :string, specific: :color, renderer: :html }) do
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
new({ method: :data, type: :string, specific: :text, renderer: :html }) do |params|
|
45
|
+
js[:innerHTML] = if language
|
46
|
+
int8[language].to_s
|
47
|
+
else
|
48
|
+
params.to_s
|
49
|
+
end
|
47
50
|
end
|
48
51
|
|
49
52
|
new({ method: :data, type: :string, specific: :vector, renderer: :html }) do |value|
|
@@ -14,7 +14,6 @@ end
|
|
14
14
|
new({ method: :alpha, type: :integer, specific: :color, renderer: :html }) do |value, _user_proc|
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
17
|
new({ renderer: :html, method: :diffusion, type: :string })
|
19
18
|
|
20
19
|
# edit
|
@@ -23,7 +22,6 @@ new({ renderer: :html, method: :edit }) do |params|
|
|
23
22
|
html.update_data(params)
|
24
23
|
end
|
25
24
|
|
26
|
-
|
27
25
|
new({ method: :border, type: :hash, renderer: :html }) do |value, _user_proc|
|
28
26
|
thickness = value[:thickness] || 5
|
29
27
|
type = value[:pattern] || :solid
|
@@ -45,15 +43,19 @@ new({ method: :insert, renderer: :html, type: :hash }) do |params|
|
|
45
43
|
html.table_insert(params)
|
46
44
|
end
|
47
45
|
|
48
|
-
|
49
|
-
|
50
46
|
new({ method: :remove, renderer: :html, type: :hash }) do |params|
|
51
47
|
html.table_remove(params)
|
52
48
|
end
|
53
49
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
50
|
new({ method: :sort, renderer: :html, type: :hash }) do |params|
|
58
51
|
html.refresh_table(params)
|
52
|
+
end
|
53
|
+
|
54
|
+
new({ particle: :unit, store: false }) do |params|
|
55
|
+
params.each do |k, v|
|
56
|
+
@unit[k] = v
|
57
|
+
# now we refresh the particle
|
58
|
+
send(k, send(k))
|
59
|
+
end
|
60
|
+
@unit
|
59
61
|
end
|
@@ -1,39 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ method: :
|
4
|
-
|
5
|
-
|
6
|
-
html.style(:top, params)
|
7
|
-
|
3
|
+
new({ method: :left, type: :integer, renderer: :html }) do |params|
|
4
|
+
unit = @unit[:left] || :px
|
5
|
+
js[:style][:left] = "#{params}#{unit}"
|
8
6
|
end
|
9
7
|
|
10
|
-
new({ method: :top, type: :integer, renderer: :html
|
11
|
-
|
8
|
+
new({ method: :top, type: :integer, renderer: :html }) do |params|
|
9
|
+
unit = @unit[:top] || :px
|
10
|
+
# alert unit
|
11
|
+
js[:style][:top] = "#{params}#{unit}"
|
12
12
|
end
|
13
|
-
new({ method: :top, type: :integer, renderer: :html, specific: :shadow })
|
14
|
-
|
15
13
|
new({ method: :bottom, type: :integer, renderer: :html }) do |params|
|
16
|
-
|
17
|
-
|
18
|
-
html.style(:bottom, params)
|
19
|
-
end
|
20
|
-
|
21
|
-
new({ method: :bottom, type: :integer, renderer: :html, specific: :text }) do |params|
|
22
|
-
html.style(:bottom, params)
|
14
|
+
unit = @unit[:bottom] || :px
|
15
|
+
js[:style][:bottom] = "#{params}#{unit}"
|
23
16
|
end
|
24
17
|
|
25
18
|
new({ method: :right, type: :integer, renderer: :html }) do |params|
|
26
|
-
|
27
|
-
params="#{params}px" unless params.instance_of?(Symbol)
|
28
|
-
html.style(:right, params)
|
29
|
-
end
|
19
|
+
unit = @unit[:right] || :px
|
30
20
|
|
31
|
-
|
32
|
-
# TODO: replace px with the unit specified by the user or sepcified by default by the system
|
33
|
-
params="#{params}px" unless params.instance_of?(Symbol)
|
34
|
-
html.style(:left, params)
|
21
|
+
js[:style][:right] = "#{params}#{unit}"
|
35
22
|
end
|
36
23
|
|
24
|
+
new({ method: :top, type: :integer, renderer: :html, specific: :shadow })
|
25
|
+
|
26
|
+
# new({ method: :top, type: :integer, renderer: :html, specific: :text }) do |params|
|
27
|
+
# unit = @unit[:left] || :px
|
28
|
+
# html.style(:top, "#{params}#{unit}"
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# new({ method: :bottom, type: :integer, renderer: :html, specific: :text }) do |params|
|
32
|
+
# html.style(:bottom, "#{params}#{unit}")
|
33
|
+
# end
|
34
|
+
|
37
35
|
new({ method: :left, type: :integer, specific: :color, renderer: :html })
|
38
36
|
|
39
37
|
new({ method: :left, type: :integer, renderer: :html, specific: :shadow })
|
@@ -46,11 +44,11 @@ end
|
|
46
44
|
|
47
45
|
new({ method: :rotate, type: :integer, renderer: :html, specific: :paint })
|
48
46
|
|
49
|
-
new({renderer: :html, method: :position }) do |params|
|
47
|
+
new({ renderer: :html, method: :position }) do |params|
|
50
48
|
html.style("position", params)
|
51
49
|
end
|
52
50
|
|
53
|
-
new({renderer: :html, method: :depth }) do |params|
|
51
|
+
new({ renderer: :html, method: :depth }) do |params|
|
54
52
|
html.style("z-index", params)
|
55
53
|
end
|
56
54
|
|
@@ -66,6 +64,6 @@ new({ method: :display, renderer: :html }) do |params|
|
|
66
64
|
html.style(:display, params)
|
67
65
|
end
|
68
66
|
|
69
|
-
new({renderer: :html, method: :center}) do |params|
|
67
|
+
new({ renderer: :html, method: :center }) do |params|
|
70
68
|
html.center(params, attach)
|
71
69
|
end
|
@@ -9,8 +9,8 @@ c.touch(true) do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
puts '------'
|
12
|
-
puts "b.compute left return the position on the screen of the item : #{b.compute({reference: c.id, particle: :left,
|
12
|
+
puts "b.compute left return the position on the screen of the item : #{b.compute({reference: c.id, particle: :left, metrics: :pixel})}"
|
13
13
|
puts "b.compute left : #{b.compute({ particle: :left })[:value]}, c left : #{b.left}"
|
14
14
|
puts "b.compute top :#{b.compute({ particle: :top })[:value]}, c top: #{b.top}"
|
15
|
-
|
16
|
-
|
15
|
+
puts "i.compute width :#{i.compute({ particle: :width })[:value]}, i width: #{i.width}"
|
16
|
+
pus "i.compute height :#{i.compute({ particle: :height })[:value]}, i height: #{i.height}"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
b = box({ drag: true })
|
5
|
+
|
6
|
+
A.example(:left) do
|
7
|
+
english = 'here is an example, touch me to get some help, or click the code to exec'
|
8
|
+
french = "voici un example, click moi pour de l'aide, ou clicker le code pour l'executer"
|
9
|
+
code = <<STR
|
10
|
+
b=box
|
11
|
+
puts b.left
|
12
|
+
b.left(155)
|
13
|
+
puts b.left
|
14
|
+
STR
|
15
|
+
example = text({ int8: { english: english, french: french }, language: :english, width: 666 })
|
16
|
+
code_text = text({ int8: { english: code }, language: :english, width: 666, top: 33 })
|
17
|
+
example.touch(true) do
|
18
|
+
example.delete(true)
|
19
|
+
help(:left)
|
20
|
+
end
|
21
|
+
code_text.touch(true) do
|
22
|
+
eval(code)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
b.example(:left)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
b = box({ drag: true })
|
5
|
+
A.help(:left) do
|
6
|
+
english = 'the left particle is,used to position the atome on the x axis, click me to get an example'
|
7
|
+
french = "'la particle left est utilisée pour positionner l'atome sur l'axe x, click moi pour obtenir un exemple"
|
8
|
+
|
9
|
+
t = text({ int8: { english: english, french: french }, width: 666 })
|
10
|
+
t.touch(true) do
|
11
|
+
t.delete(true)
|
12
|
+
example(:left)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
b.help(:left)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
t = text({ int8: { english: :hello, french: :salut, deutch: :halo }, language: :deutch })
|
4
|
+
|
5
|
+
wait 1 do
|
6
|
+
t.language(:french)
|
7
|
+
wait 1 do
|
8
|
+
t.language(:english)
|
9
|
+
# data is updated to the latest choice
|
10
|
+
puts t.data
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
puts t.data
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
new ({particle: :left}) do |params|
|
6
|
+
unless params.instance_of? Hash
|
7
|
+
params= {value: params, unit: :px}
|
8
|
+
end
|
9
|
+
params
|
10
|
+
end
|
11
|
+
|
12
|
+
new ({method: :left, renderer: :html}) do |params|
|
13
|
+
js[:style][:left] = "#{params[:value]}#{params[:unit]}"
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
b=box
|
18
|
+
b.touch (true)do
|
19
|
+
b.left(533)
|
20
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
box({ left: 50, id: :the_first_box, color: :blue })
|
5
|
+
b1=box({ left: 25, id: :the_second_box ,top: 3, unit: {left: '%', width: '%'}, color: :red})
|
6
|
+
box({ left: 550, id: :the_third_box , unit: {left: :px}, color: :green})
|
7
|
+
wait 2 do
|
8
|
+
b1.unit({left: 'cm'})
|
9
|
+
b1.unit({top: 'cm'})
|
10
|
+
# b1.unit[:top]='cm'
|
11
|
+
puts b1.unit
|
12
|
+
end
|
13
|
+
|
14
|
+
|
@@ -117,17 +117,20 @@ class App < Roda
|
|
117
117
|
ws.on(:message) do |event|
|
118
118
|
json_string = event.data.gsub(/(\w+):/) { "\"#{$1}\":" }.gsub('=>', ':')
|
119
119
|
full_data = JSON.parse(json_string)
|
120
|
+
|
120
121
|
message = full_data['message']
|
121
122
|
action_requested = full_data['action']
|
122
123
|
value= full_data['value']
|
123
124
|
option= full_data['option']
|
124
125
|
current_user = full_data['user']
|
125
126
|
user_pass = full_data['pass']['global']
|
126
|
-
if action_requested
|
127
|
+
# if action_requested == :request
|
128
|
+
# request (message)
|
129
|
+
# end
|
127
130
|
return_message = EDen.safe_send(action_requested, message,option,ws,value, current_user, user_pass)
|
128
|
-
else
|
129
|
-
|
130
|
-
end
|
131
|
+
# else
|
132
|
+
# return_message = "no action msg: #{full_data}"
|
133
|
+
# end
|
131
134
|
ws.send(return_message.to_json)
|
132
135
|
end
|
133
136
|
|
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.5.
|
4
|
+
version: 0.5.5.9.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-01-
|
11
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -513,6 +513,7 @@ files:
|
|
513
513
|
- vendor/assets/application/examples/duplicate.rb
|
514
514
|
- vendor/assets/application/examples/edit.rb
|
515
515
|
- vendor/assets/application/examples/encode.rb
|
516
|
+
- vendor/assets/application/examples/example.rb
|
516
517
|
- vendor/assets/application/examples/file.rb
|
517
518
|
- vendor/assets/application/examples/find.rb
|
518
519
|
- vendor/assets/application/examples/fit.rb
|
@@ -521,18 +522,19 @@ files:
|
|
521
522
|
- vendor/assets/application/examples/grab.rb
|
522
523
|
- vendor/assets/application/examples/gradient.rb
|
523
524
|
- vendor/assets/application/examples/group.rb
|
525
|
+
- vendor/assets/application/examples/help.rb
|
524
526
|
- vendor/assets/application/examples/hierarchy.rb
|
525
527
|
- vendor/assets/application/examples/history.rb
|
526
528
|
- vendor/assets/application/examples/hypertext.rb
|
527
529
|
- vendor/assets/application/examples/image.rb
|
528
530
|
- vendor/assets/application/examples/import.rb
|
529
531
|
- vendor/assets/application/examples/infos.rb
|
532
|
+
- vendor/assets/application/examples/int8.rb
|
530
533
|
- vendor/assets/application/examples/keyboard.rb
|
531
534
|
- vendor/assets/application/examples/layout.rb
|
532
535
|
- vendor/assets/application/examples/login.rb
|
533
536
|
- vendor/assets/application/examples/markup.rb
|
534
537
|
- vendor/assets/application/examples/match.rb
|
535
|
-
- vendor/assets/application/examples/messaging.rb
|
536
538
|
- vendor/assets/application/examples/monitor.rb
|
537
539
|
- vendor/assets/application/examples/on_resize.rb
|
538
540
|
- vendor/assets/application/examples/online.rb
|
@@ -553,6 +555,7 @@ files:
|
|
553
555
|
- vendor/assets/application/examples/security.rb
|
554
556
|
- vendor/assets/application/examples/select_text.rb
|
555
557
|
- vendor/assets/application/examples/selected.rb
|
558
|
+
- vendor/assets/application/examples/server.rb
|
556
559
|
- vendor/assets/application/examples/shadow.rb
|
557
560
|
- vendor/assets/application/examples/shapes.rb
|
558
561
|
- vendor/assets/application/examples/shortcut.rb
|
@@ -563,9 +566,11 @@ files:
|
|
563
566
|
- vendor/assets/application/examples/table.rb
|
564
567
|
- vendor/assets/application/examples/tagged.rb
|
565
568
|
- vendor/assets/application/examples/terminal.rb
|
569
|
+
- vendor/assets/application/examples/test.rb
|
566
570
|
- vendor/assets/application/examples/text.rb
|
567
571
|
- vendor/assets/application/examples/touch.rb
|
568
572
|
- vendor/assets/application/examples/type_mutation.rb
|
573
|
+
- vendor/assets/application/examples/unit.rb
|
569
574
|
- vendor/assets/application/examples/universe.rb
|
570
575
|
- vendor/assets/application/examples/vector.rb
|
571
576
|
- vendor/assets/application/examples/video.rb
|
@@ -747,7 +752,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
747
752
|
- !ruby/object:Gem::Version
|
748
753
|
version: '0'
|
749
754
|
requirements: []
|
750
|
-
rubygems_version: 3.5.
|
755
|
+
rubygems_version: 3.5.5
|
751
756
|
signing_key:
|
752
757
|
specification_version: 4
|
753
758
|
summary: the creative framework
|
File without changes
|