atome 0.5.6.6.9 → 0.5.6.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/atome +22 -7
- data/lib/atome/atome.rb +1 -1
- data/lib/atome/extensions/atome.rb +45 -2
- data/lib/atome/genesis/genesis.rb +1 -1
- data/lib/atome/genesis/sparkle.rb +17 -19
- data/lib/atome/kernel/universe.rb +7 -6
- data/lib/atome/utilities/utilities.rb +47 -37
- data/lib/atome/version.rb +1 -1
- data/lib/renderers/html/html.rb +3 -0
- data/vendor/assets/application/examples/affect.rb +1 -1
- data/vendor/assets/application/examples/allow_copy.rb +13 -0
- data/vendor/assets/application/examples/allow_system_right_click.rb +16 -0
- data/vendor/assets/application/examples/alternate.rb +18 -0
- data/vendor/assets/application/examples/js&ruby.rb +8 -21
- data/vendor/assets/application/examples/localstorage.rb +19 -0
- data/vendor/assets/application/examples/matrix.rb +8 -8
- data/vendor/assets/application/examples/test.rb +0 -19
- data/vendor/assets/application/examples/tools.rb +302 -300
- data/vendor/assets/src/index_opal.html +1 -5
- data/vendor/assets/src/index_server.html +13 -18
- data/vendor/assets/src/index_server_wasm.html +1 -6
- data/vendor/assets/src/index_wasm.html +6 -6
- data/vendor/assets/src/js/atome/atome.js +8 -4
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +0 -94
- data/vendor/assets/src/js/atome/specific/opal.js +93 -0
- data/vendor/assets/src/js/atome/specific/wasm.js +99 -7
- metadata +6 -2
@@ -1,318 +1,320 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# b = box({ top: :auto, bottom: 0, id: :box_tool })
|
6
|
-
#
|
7
|
-
# b.touch(:down) do
|
8
|
-
# creation_layer = box({ top: 0, left: 0, id: :creation_layer, width: '100%', height: '100%', apply: :creation_layer_col })
|
9
|
-
# creation_layer.touch(:down) do |event|
|
10
|
-
# left_found = event[:pageX].to_i
|
11
|
-
# top_found = event[:pageY].to_i
|
12
|
-
# box({ left: left_found, top: top_found ,id: "tutu_#{Universe.atomes.length}", color: :red})
|
13
|
-
# creation_layer.delete(true)
|
14
|
-
# creation_layer.touch({ remove: :down })
|
15
|
-
# puts Universe.atomes.length
|
16
|
-
# puts "=> #{Universe.user_atomes}"
|
17
|
-
# end
|
18
|
-
# end
|
19
|
-
|
20
|
-
|
3
|
+
# Universe.allow_history = false
|
21
4
|
|
22
|
-
|
5
|
+
color({ id: :creation_layer_col, alpha: 1 })
|
23
6
|
|
24
|
-
|
25
|
-
class Atome
|
26
|
-
|
27
|
-
def build_tool(&bloc)
|
28
|
-
# alert params[:tool]
|
29
|
-
a = Atome.instance_exec(&bloc)
|
30
|
-
puts "===> a is : #{a[:action]}"
|
31
|
-
# check below
|
32
|
-
# wait 2 do
|
33
|
-
# send a[:action]
|
34
|
-
# end
|
35
|
-
grab(:toolbox).box({color: :white, width: Intuition.style[:tool][:width], height: Intuition.style[:tool][:width]})
|
36
|
-
end
|
37
|
-
end
|
7
|
+
b = box({ top: :auto, bottom: 0, id: :box_tool })
|
38
8
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
# type help the system what type of type the particle will receive and store
|
50
|
-
Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
|
51
|
-
store: params[:store], type: params[:type] }, &bloc)
|
52
|
-
elsif params.key?(:sanitizer)
|
53
|
-
Genesis.build_sanitizer(params[:sanitizer], &bloc)
|
54
|
-
elsif params.key?(:pre)
|
55
|
-
Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
|
56
|
-
elsif params.key?(:post)
|
57
|
-
Atome.instance_variable_set("@post_#{params[:post]}", bloc)
|
58
|
-
elsif params.key?(:after)
|
59
|
-
Atome.instance_variable_set("@after_#{params[:after]}", bloc)
|
60
|
-
elsif params.key?(:read)
|
61
|
-
Atome.instance_variable_set("@read_#{params[:read]}", bloc)
|
62
|
-
elsif params[:renderer]
|
63
|
-
renderer_found = params[:renderer]
|
64
|
-
if params[:specific]
|
65
|
-
Universe.set_atomes_specificities(params)
|
66
|
-
params[:specific] = "#{params[:specific]}_"
|
67
|
-
end
|
68
|
-
render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
|
69
|
-
Genesis.build_render(render_method, &bloc)
|
70
|
-
elsif params.key?(:callback)
|
71
|
-
particle_targetted = params[:callback]
|
72
|
-
Atome.define_method "#{particle_targetted}_callback" do
|
73
|
-
bloc.call
|
74
|
-
end
|
75
|
-
elsif params.key?(:tool)
|
76
|
-
A.build_tool(&bloc)
|
77
|
-
end
|
9
|
+
b.touch(:down) do
|
10
|
+
creation_layer = box({ top: 0, left: 0, id: :creation_layer, width: '100%', height: '100%', apply: :creation_layer_col })
|
11
|
+
creation_layer.touch(:down) do |event|
|
12
|
+
left_found = event[:pageX].to_i
|
13
|
+
top_found = event[:pageY].to_i
|
14
|
+
box({ left: left_found, top: top_found ,id: "tutu_#{Universe.atomes.length}", color: :red})
|
15
|
+
creation_layer.delete(true)
|
16
|
+
creation_layer.touch({ remove: :down })
|
17
|
+
puts Universe.atomes.length
|
18
|
+
puts "=> #{Universe.user_atomes}"
|
78
19
|
end
|
79
20
|
end
|
80
21
|
|
81
22
|
|
82
|
-
def record_tool
|
83
|
-
grab(Universe.current_user).selection
|
84
|
-
alert "must get selection to treat it "
|
85
|
-
end
|
86
|
-
|
87
|
-
|
88
|
-
module Intuition
|
89
|
-
class << self
|
90
|
-
def style
|
91
|
-
size=39
|
92
|
-
style={}
|
93
|
-
style[:toolbox]={width: size}
|
94
|
-
style[:toolbox]={height: size}
|
95
|
-
style[:tool]={width: size}
|
96
|
-
style[:tool]={height: size}
|
97
|
-
|
98
|
-
style
|
99
|
-
end
|
100
|
-
def intuition_int8
|
101
|
-
# tool taxonomy and list
|
102
|
-
{
|
103
|
-
capture: { int8: { french: :enregistrement, english: :record, german: :datensatz } },
|
104
|
-
communication: { french: :communication, english: :communication, german: :communication },
|
105
|
-
tool: { french: :outils, english: :tools, german: :werkzeuge },
|
106
|
-
view: { french: :vue, english: :view, german: :aussicht },
|
107
|
-
time: { french: :horloge, english: :clock, german: :Uhr },
|
108
|
-
find: { french: :trouve, english: :find, german: :finden },
|
109
|
-
home: { french: :accueil, english: :home, german: :zuhause },
|
110
|
-
code: { french: :code, english: :code, german: :code },
|
111
|
-
impulse: { french: :impulse, english: :impulse, german: :impulse },
|
112
|
-
}
|
113
|
-
end
|
114
|
-
def intuition_taxonomy
|
115
|
-
|
116
|
-
end
|
117
|
-
|
118
|
-
def impulse
|
119
|
-
# tool start point
|
120
|
-
[:capture, :communication, :tool, :view, :time, :find, :home]
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
|
125
|
-
# def capture
|
126
|
-
# categories=ATOME.methods_categories
|
127
|
-
# [categories[:inputs]]
|
128
|
-
# end
|
129
|
-
#
|
130
|
-
# def communication
|
131
|
-
# categories=ATOME.methods_categories
|
132
|
-
# [categories[:communications]]
|
133
|
-
# end
|
134
|
-
#
|
135
|
-
# def toolz
|
136
|
-
# categories=ATOME.methods_categories
|
137
|
-
# [categories[:spatials],categories[:helpers],categories[:materials],
|
138
|
-
# categories[:geometries],categories[:effects],
|
139
|
-
# categories[:medias],categories[:hierarchies],categories[:utilities],categories[:events]]
|
140
|
-
# end
|
141
|
-
#
|
142
|
-
# def tool_style(size = 33)
|
143
|
-
# # styling
|
144
|
-
# shadows = [{ x: size / 15, y: size / 15, thickness: 0, blur: size / 3, color: { red: 0, green: 0, blue: 0, alpha: 0.3 } }, { x: -size / 15, y: -size / 15, thickness: 0, blur: size / 6, color: { red: 1, green: 1, blue: 1, alpha: 0.3 } }]
|
145
|
-
# style = { type: :tool, content: { points: 4 }, color: { red: 0.9, green: 0.9, blue: 0.9, alpha: 0.15 }, parent: :intuition, shadow: shadows, blur: { value: 6, invert: true } }
|
146
|
-
# return style
|
147
|
-
# end
|
148
|
-
#
|
149
|
-
# def open_tool(tool_id, widthness=3, orientation=:x, speed=0.6)
|
150
|
-
# if orientation == :x
|
151
|
-
# orientation = :width
|
152
|
-
# value = grab(tool_id).width
|
153
|
-
# else
|
154
|
-
# orientation = :height
|
155
|
-
# value = grab(tool_id).height
|
156
|
-
# end
|
157
|
-
# animate({
|
158
|
-
# start: { orientation => value },
|
159
|
-
# end: { orientation => value * widthness },
|
160
|
-
# duration: speed * 1000,
|
161
|
-
# loop: 0,
|
162
|
-
# curve: :easing,
|
163
|
-
# target: tool_id
|
164
|
-
# })
|
165
|
-
# notification "find why this id #{self.atome_id}, add annimation callback to set overflow when anim complete"
|
166
|
-
# grab(tool_id).overflow(:visible)
|
167
|
-
# end
|
168
|
-
#
|
169
|
-
# def close_tool(tool_id, widthness, orientation, speed)
|
170
|
-
# if orientation == :x
|
171
|
-
# orientation = :width
|
172
|
-
# value = grab(tool_id).width
|
173
|
-
# else
|
174
|
-
# orientation = :height
|
175
|
-
# value = grab(tool_id).height
|
176
|
-
# end
|
177
|
-
# animate({
|
178
|
-
# start: { orientation => value * widthness },
|
179
|
-
# end: { orientation => value },
|
180
|
-
# duration: speed * 1000,
|
181
|
-
# loop: 0,
|
182
|
-
# curve: :easing,
|
183
|
-
# target: tool_id
|
184
|
-
# })
|
185
|
-
# # grab(tool_id).overflow(:hidden)
|
186
|
-
# end
|
187
|
-
#
|
188
|
-
# def create_tool(tool_name, size = 33, x_pos = 0, y_pos = 33, offsset=0)
|
189
|
-
# tool_created = tool(self.tool_style(size).merge({ parent: :main_menu, atome_id: "tool_" + tool_name, id: "tool_" + tool_name,
|
190
|
-
# width: size, height: size, smooth: size / 9, overflow: :hidden, x: x_pos, y: y_pos, z: 1, content: [] }))
|
191
|
-
# icon=tool_created.shape({ path: tool_name, width: size - size / 2, height: size - size / 2, center: true })
|
192
|
-
# # name = intuition_list[tool_name][language]
|
193
|
-
# particle({ atome_id: :tools_property_container, color: { red: 0.6, green: 0.6, blue: 0.6 } })
|
194
|
-
# # we get the plugin code only if the plugin hasn't been interpreted before (unless condition below)
|
195
|
-
# unless grab(:intuition).content.include? tool_name
|
196
|
-
# ATOME.reader("./medias/e_rubies/tools/#{tool_name}.rb") do |data|
|
197
|
-
# # todo add a security parser here
|
198
|
-
# # we set the variable tool that can be used to facilitate plugin creation
|
199
|
-
# data="tool=grab(:#{tool_created.atome_id})\n"+data
|
200
|
-
# compile(data)
|
201
|
-
# # we add the tool to the intuition content so it won't be loaded twice
|
202
|
-
# grab(:intuition).content |= [tool_name]
|
203
|
-
# end
|
204
|
-
# end
|
205
|
-
# # end
|
206
|
-
# tool_created.active({ exec: false })
|
207
|
-
# tool_created.inactive({ exec: false })
|
208
|
-
# icon.touch(stop: true) do
|
209
|
-
# if tool_created.active[:exec] == true
|
210
|
-
# tool_created.color(:transparent)
|
211
|
-
# tool_created.active(exec: false, proc: tool_created.active[:proc] )
|
212
|
-
# tool_created.inactive(exec: true, proc: tool_created.inactive[:proc] )
|
213
|
-
# else
|
214
|
-
# tool_created.color({alpha: 0.3})
|
215
|
-
# tool_created.active({ exec: true, proc: tool_created.active[:proc] })
|
216
|
-
# end
|
217
|
-
# end
|
218
|
-
# end
|
219
|
-
#
|
220
|
-
# # we get menu entry point
|
221
|
-
# def open_intuition(position = {})
|
222
|
-
# position = { x: 0, yy: 0, size: 33, orientation: :vertical, offset: 0 }.merge(position)
|
223
|
-
# # we get content language from view's language
|
224
|
-
# if grab(:main_menu)
|
225
|
-
# grab(:main_menu).delete
|
226
|
-
# else
|
227
|
-
# grab(:view).language
|
228
|
-
# self.language(grab(:view).language)
|
229
|
-
# orientation = position.delete(:orientation)
|
230
|
-
# size = position.delete(:size)
|
231
|
-
# offset = position.delete(:offset)
|
232
|
-
# # positioning and scaling
|
233
|
-
# if orientation == :vertical
|
234
|
-
# requested_width = size
|
235
|
-
# requested_height = (size+offset)* impulse.length
|
236
|
-
# else
|
237
|
-
# requested_width = (size+offset) * impulse.length
|
238
|
-
# requested_height = size
|
239
|
-
# end
|
240
|
-
# tool({ atome_id: :main_menu, parent: :intuition, color: { alpha: 0 } }.merge(position).merge(width: requested_width, height: requested_height))
|
241
|
-
# impulse.each_with_index do |item, index|
|
242
|
-
# if orientation == :vertical
|
243
|
-
# create_tool(item, size, 0, index * (size+offset))
|
244
|
-
# else
|
245
|
-
# create_tool(item, size, index * (size+offset), 0)
|
246
|
-
# end
|
247
|
-
# end
|
248
|
-
# end
|
249
|
-
# end
|
250
|
-
end
|
251
|
-
# atome class extension for eVe
|
252
|
-
|
253
|
-
class Atome
|
254
|
-
include Intuition
|
255
|
-
# def atome(requested_property)
|
256
|
-
# # add component list iin the content we maybe ahave to create a tool object because box can't handle this type of content
|
257
|
-
# new_atome=self.tool({ atome_id: "#{self.atome_id}_#{requested_property}_atome_#{self.content.length}", x: 66})
|
258
|
-
# new_atome.touch({ stop: true, option: :down}) do
|
259
|
-
# color(:red)
|
260
|
-
# new_atome.height = new_atome.height*3
|
261
|
-
# end
|
262
|
-
# new_atome.touch({ stop: true, option: :up}) do
|
263
|
-
# color(:red)
|
264
|
-
# new_atome.height = new_atome.height/3
|
265
|
-
# end
|
266
|
-
# notification "now we have to add an object or a new property (style) to store complete tool style including size and
|
267
|
-
# orientation so we can position the new atome correctly"
|
268
|
-
# # alert self.content.class
|
269
|
-
# # alert self.content.length
|
270
|
-
# # alert tool_style
|
271
|
-
# end
|
272
|
-
end
|
273
|
-
|
274
|
-
# # we initialise the toolbox here :
|
275
23
|
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
# #
|
283
|
-
#
|
284
|
-
#
|
24
|
+
# ######################
|
25
|
+
#
|
26
|
+
# # frozen_string_literal: true
|
27
|
+
# class Atome
|
28
|
+
#
|
29
|
+
# def build_tool(&bloc)
|
30
|
+
# # alert params[:tool]
|
31
|
+
# a = Atome.instance_exec(&bloc)
|
32
|
+
# puts "===> a is : #{a[:action]}"
|
33
|
+
# # check below
|
34
|
+
# # wait 2 do
|
35
|
+
# # send a[:action]
|
36
|
+
# # end
|
37
|
+
# grab(:toolbox).box({color: :white, width: Intuition.style[:tool][:width], height: Intuition.style[:tool][:width]})
|
285
38
|
# end
|
286
39
|
# end
|
287
40
|
#
|
288
|
-
#
|
41
|
+
# class Object
|
42
|
+
# def new(params, &bloc)
|
43
|
+
# # Genesis = Genesis.Genesis
|
44
|
+
# if params.key?(:atome)
|
45
|
+
# Universe.add_atomes_specificities params[:atome]
|
46
|
+
# Genesis.build_atome(params[:atome], &bloc)
|
47
|
+
# elsif params.key?(:particle)
|
48
|
+
# Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
|
49
|
+
# # render indicate if the particle needs to be rendered
|
50
|
+
# # store tell the system if it need to store the particle value
|
51
|
+
# # type help the system what type of type the particle will receive and store
|
52
|
+
# Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
|
53
|
+
# store: params[:store], type: params[:type] }, &bloc)
|
54
|
+
# elsif params.key?(:sanitizer)
|
55
|
+
# Genesis.build_sanitizer(params[:sanitizer], &bloc)
|
56
|
+
# elsif params.key?(:pre)
|
57
|
+
# Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
|
58
|
+
# elsif params.key?(:post)
|
59
|
+
# Atome.instance_variable_set("@post_#{params[:post]}", bloc)
|
60
|
+
# elsif params.key?(:after)
|
61
|
+
# Atome.instance_variable_set("@after_#{params[:after]}", bloc)
|
62
|
+
# elsif params.key?(:read)
|
63
|
+
# Atome.instance_variable_set("@read_#{params[:read]}", bloc)
|
64
|
+
# elsif params[:renderer]
|
65
|
+
# renderer_found = params[:renderer]
|
66
|
+
# if params[:specific]
|
67
|
+
# Universe.set_atomes_specificities(params)
|
68
|
+
# params[:specific] = "#{params[:specific]}_"
|
69
|
+
# end
|
70
|
+
# render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
|
71
|
+
# Genesis.build_render(render_method, &bloc)
|
72
|
+
# elsif params.key?(:callback)
|
73
|
+
# particle_targetted = params[:callback]
|
74
|
+
# Atome.define_method "#{particle_targetted}_callback" do
|
75
|
+
# bloc.call
|
76
|
+
# end
|
77
|
+
# elsif params.key?(:tool)
|
78
|
+
# A.build_tool(&bloc)
|
79
|
+
# end
|
80
|
+
# end
|
81
|
+
# end
|
289
82
|
#
|
290
|
-
# list = molecule_analysis(@molecules_list)
|
291
|
-
# notif list[:tools]
|
292
|
-
# notif "======"
|
293
|
-
# notif list[:molecules]
|
294
|
-
# notif "======"
|
295
|
-
# notif list[:atomes]
|
296
|
-
# notif "======"
|
297
|
-
# notif list[:molecules][:shadow]
|
298
|
-
# let's build the toolbox
|
299
|
-
grab(:intuition).box({id: :toolbox, top: :auto, bottom: 0, left: 0, width: Intuition.style[:toolbox][:width], height: 255})
|
300
|
-
|
301
|
-
# tool builder
|
302
|
-
|
303
|
-
new({ tool: :capture }) do |params|
|
304
|
-
tool = { id: :rec_01,
|
305
|
-
name: :record, icon: :record, action: {open: [:sub_menu]}, code: :record_tool, position: { root: 1 }, # position can be multiple
|
306
|
-
option: { opt1: :method_2 }, int8: { french: :enregistrement, english: :record, german: :datensatz } }
|
307
|
-
tool
|
308
|
-
end
|
309
|
-
# Intuition::toolbox_style
|
310
|
-
# Intuition.toolbox_style
|
311
|
-
# puts A.impulse
|
312
|
-
# def fill_toolzone(tools_ids)
|
313
83
|
#
|
84
|
+
# def record_tool
|
85
|
+
# grab(Universe.current_user).selection
|
86
|
+
# alert "must get selection to treat it "
|
314
87
|
# end
|
315
88
|
#
|
316
|
-
#
|
317
|
-
|
89
|
+
#
|
90
|
+
# module Intuition
|
91
|
+
# class << self
|
92
|
+
# def style
|
93
|
+
# size=39
|
94
|
+
# style={}
|
95
|
+
# style[:toolbox]={width: size}
|
96
|
+
# style[:toolbox]={height: size}
|
97
|
+
# style[:tool]={width: size}
|
98
|
+
# style[:tool]={height: size}
|
99
|
+
#
|
100
|
+
# style
|
101
|
+
# end
|
102
|
+
# def intuition_int8
|
103
|
+
# # tool taxonomy and list
|
104
|
+
# {
|
105
|
+
# capture: { int8: { french: :enregistrement, english: :record, german: :datensatz } },
|
106
|
+
# communication: { french: :communication, english: :communication, german: :communication },
|
107
|
+
# tool: { french: :outils, english: :tools, german: :werkzeuge },
|
108
|
+
# view: { french: :vue, english: :view, german: :aussicht },
|
109
|
+
# time: { french: :horloge, english: :clock, german: :Uhr },
|
110
|
+
# find: { french: :trouve, english: :find, german: :finden },
|
111
|
+
# home: { french: :accueil, english: :home, german: :zuhause },
|
112
|
+
# code: { french: :code, english: :code, german: :code },
|
113
|
+
# impulse: { french: :impulse, english: :impulse, german: :impulse },
|
114
|
+
# }
|
115
|
+
# end
|
116
|
+
# def intuition_taxonomy
|
117
|
+
#
|
118
|
+
# end
|
119
|
+
#
|
120
|
+
# def impulse
|
121
|
+
# # tool start point
|
122
|
+
# [:capture, :communication, :tool, :view, :time, :find, :home]
|
123
|
+
# end
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
#
|
127
|
+
# # def capture
|
128
|
+
# # categories=ATOME.methods_categories
|
129
|
+
# # [categories[:inputs]]
|
130
|
+
# # end
|
131
|
+
# #
|
132
|
+
# # def communication
|
133
|
+
# # categories=ATOME.methods_categories
|
134
|
+
# # [categories[:communications]]
|
135
|
+
# # end
|
136
|
+
# #
|
137
|
+
# # def toolz
|
138
|
+
# # categories=ATOME.methods_categories
|
139
|
+
# # [categories[:spatials],categories[:helpers],categories[:materials],
|
140
|
+
# # categories[:geometries],categories[:effects],
|
141
|
+
# # categories[:medias],categories[:hierarchies],categories[:utilities],categories[:events]]
|
142
|
+
# # end
|
143
|
+
# #
|
144
|
+
# # def tool_style(size = 33)
|
145
|
+
# # # styling
|
146
|
+
# # shadows = [{ x: size / 15, y: size / 15, thickness: 0, blur: size / 3, color: { red: 0, green: 0, blue: 0, alpha: 0.3 } }, { x: -size / 15, y: -size / 15, thickness: 0, blur: size / 6, color: { red: 1, green: 1, blue: 1, alpha: 0.3 } }]
|
147
|
+
# # style = { type: :tool, content: { points: 4 }, color: { red: 0.9, green: 0.9, blue: 0.9, alpha: 0.15 }, parent: :intuition, shadow: shadows, blur: { value: 6, invert: true } }
|
148
|
+
# # return style
|
149
|
+
# # end
|
150
|
+
# #
|
151
|
+
# # def open_tool(tool_id, widthness=3, orientation=:x, speed=0.6)
|
152
|
+
# # if orientation == :x
|
153
|
+
# # orientation = :width
|
154
|
+
# # value = grab(tool_id).width
|
155
|
+
# # else
|
156
|
+
# # orientation = :height
|
157
|
+
# # value = grab(tool_id).height
|
158
|
+
# # end
|
159
|
+
# # animate({
|
160
|
+
# # start: { orientation => value },
|
161
|
+
# # end: { orientation => value * widthness },
|
162
|
+
# # duration: speed * 1000,
|
163
|
+
# # loop: 0,
|
164
|
+
# # curve: :easing,
|
165
|
+
# # target: tool_id
|
166
|
+
# # })
|
167
|
+
# # notification "find why this id #{self.atome_id}, add annimation callback to set overflow when anim complete"
|
168
|
+
# # grab(tool_id).overflow(:visible)
|
169
|
+
# # end
|
170
|
+
# #
|
171
|
+
# # def close_tool(tool_id, widthness, orientation, speed)
|
172
|
+
# # if orientation == :x
|
173
|
+
# # orientation = :width
|
174
|
+
# # value = grab(tool_id).width
|
175
|
+
# # else
|
176
|
+
# # orientation = :height
|
177
|
+
# # value = grab(tool_id).height
|
178
|
+
# # end
|
179
|
+
# # animate({
|
180
|
+
# # start: { orientation => value * widthness },
|
181
|
+
# # end: { orientation => value },
|
182
|
+
# # duration: speed * 1000,
|
183
|
+
# # loop: 0,
|
184
|
+
# # curve: :easing,
|
185
|
+
# # target: tool_id
|
186
|
+
# # })
|
187
|
+
# # # grab(tool_id).overflow(:hidden)
|
188
|
+
# # end
|
189
|
+
# #
|
190
|
+
# # def create_tool(tool_name, size = 33, x_pos = 0, y_pos = 33, offsset=0)
|
191
|
+
# # tool_created = tool(self.tool_style(size).merge({ parent: :main_menu, atome_id: "tool_" + tool_name, id: "tool_" + tool_name,
|
192
|
+
# # width: size, height: size, smooth: size / 9, overflow: :hidden, x: x_pos, y: y_pos, z: 1, content: [] }))
|
193
|
+
# # icon=tool_created.shape({ path: tool_name, width: size - size / 2, height: size - size / 2, center: true })
|
194
|
+
# # # name = intuition_list[tool_name][language]
|
195
|
+
# # particle({ atome_id: :tools_property_container, color: { red: 0.6, green: 0.6, blue: 0.6 } })
|
196
|
+
# # # we get the plugin code only if the plugin hasn't been interpreted before (unless condition below)
|
197
|
+
# # unless grab(:intuition).content.include? tool_name
|
198
|
+
# # ATOME.reader("./medias/e_rubies/tools/#{tool_name}.rb") do |data|
|
199
|
+
# # # todo add a security parser here
|
200
|
+
# # # we set the variable tool that can be used to facilitate plugin creation
|
201
|
+
# # data="tool=grab(:#{tool_created.atome_id})\n"+data
|
202
|
+
# # compile(data)
|
203
|
+
# # # we add the tool to the intuition content so it won't be loaded twice
|
204
|
+
# # grab(:intuition).content |= [tool_name]
|
205
|
+
# # end
|
206
|
+
# # end
|
207
|
+
# # # end
|
208
|
+
# # tool_created.active({ exec: false })
|
209
|
+
# # tool_created.inactive({ exec: false })
|
210
|
+
# # icon.touch(stop: true) do
|
211
|
+
# # if tool_created.active[:exec] == true
|
212
|
+
# # tool_created.color(:transparent)
|
213
|
+
# # tool_created.active(exec: false, proc: tool_created.active[:proc] )
|
214
|
+
# # tool_created.inactive(exec: true, proc: tool_created.inactive[:proc] )
|
215
|
+
# # else
|
216
|
+
# # tool_created.color({alpha: 0.3})
|
217
|
+
# # tool_created.active({ exec: true, proc: tool_created.active[:proc] })
|
218
|
+
# # end
|
219
|
+
# # end
|
220
|
+
# # end
|
221
|
+
# #
|
222
|
+
# # # we get menu entry point
|
223
|
+
# # def open_intuition(position = {})
|
224
|
+
# # position = { x: 0, yy: 0, size: 33, orientation: :vertical, offset: 0 }.merge(position)
|
225
|
+
# # # we get content language from view's language
|
226
|
+
# # if grab(:main_menu)
|
227
|
+
# # grab(:main_menu).delete
|
228
|
+
# # else
|
229
|
+
# # grab(:view).language
|
230
|
+
# # self.language(grab(:view).language)
|
231
|
+
# # orientation = position.delete(:orientation)
|
232
|
+
# # size = position.delete(:size)
|
233
|
+
# # offset = position.delete(:offset)
|
234
|
+
# # # positioning and scaling
|
235
|
+
# # if orientation == :vertical
|
236
|
+
# # requested_width = size
|
237
|
+
# # requested_height = (size+offset)* impulse.length
|
238
|
+
# # else
|
239
|
+
# # requested_width = (size+offset) * impulse.length
|
240
|
+
# # requested_height = size
|
241
|
+
# # end
|
242
|
+
# # tool({ atome_id: :main_menu, parent: :intuition, color: { alpha: 0 } }.merge(position).merge(width: requested_width, height: requested_height))
|
243
|
+
# # impulse.each_with_index do |item, index|
|
244
|
+
# # if orientation == :vertical
|
245
|
+
# # create_tool(item, size, 0, index * (size+offset))
|
246
|
+
# # else
|
247
|
+
# # create_tool(item, size, index * (size+offset), 0)
|
248
|
+
# # end
|
249
|
+
# # end
|
250
|
+
# # end
|
251
|
+
# # end
|
252
|
+
# end
|
253
|
+
# # atome class extension for eVe
|
254
|
+
#
|
255
|
+
# class Atome
|
256
|
+
# include Intuition
|
257
|
+
# # def atome(requested_property)
|
258
|
+
# # # add component list iin the content we maybe ahave to create a tool object because box can't handle this type of content
|
259
|
+
# # new_atome=self.tool({ atome_id: "#{self.atome_id}_#{requested_property}_atome_#{self.content.length}", x: 66})
|
260
|
+
# # new_atome.touch({ stop: true, option: :down}) do
|
261
|
+
# # color(:red)
|
262
|
+
# # new_atome.height = new_atome.height*3
|
263
|
+
# # end
|
264
|
+
# # new_atome.touch({ stop: true, option: :up}) do
|
265
|
+
# # color(:red)
|
266
|
+
# # new_atome.height = new_atome.height/3
|
267
|
+
# # end
|
268
|
+
# # notification "now we have to add an object or a new property (style) to store complete tool style including size and
|
269
|
+
# # orientation so we can position the new atome correctly"
|
270
|
+
# # # alert self.content.class
|
271
|
+
# # # alert self.content.length
|
272
|
+
# # # alert tool_style
|
273
|
+
# # end
|
274
|
+
# end
|
275
|
+
#
|
276
|
+
# # # we initialise the toolbox here :
|
277
|
+
# #
|
278
|
+
# # # the launch bar
|
279
|
+
# # launch_bar = box({ x: 0, y: 0, width: 33, height: "100%", parent: :intuition, z: 0, color: { alpha: 0 } })
|
280
|
+
# # launch_bar.touch({ option: :long }) do |evt|
|
281
|
+
# # size = 33
|
282
|
+
# # yy_touch_position = grab(:view).convert(:height) - evt.page_y
|
283
|
+
# # if yy_touch_position < size
|
284
|
+
# # #if the long touch is within the wanted area( in this at bottom of the screen) we open the menu
|
285
|
+
# # # launch_bar.open_intuition({ x: size, yy: 6,offset: 6, orientation: :horizontal, size: size })
|
286
|
+
# # launch_bar.open_intuition({ x: 6, yy: size,offset: 6, orientation: :vertical, size: size })
|
287
|
+
# # end
|
288
|
+
# # end
|
289
|
+
# #
|
290
|
+
# # # # # # # # # # # # # # # # tests below # # # # # # # # # # # # #
|
291
|
+
# #
|
292
|
+
# # list = molecule_analysis(@molecules_list)
|
293
|
+
# # notif list[:tools]
|
294
|
+
# # notif "======"
|
295
|
+
# # notif list[:molecules]
|
296
|
+
# # notif "======"
|
297
|
+
# # notif list[:atomes]
|
298
|
+
# # notif "======"
|
299
|
+
# # notif list[:molecules][:shadow]
|
300
|
+
# # let's build the toolbox
|
301
|
+
# grab(:intuition).box({id: :toolbox, top: :auto, bottom: 0, left: 0, width: Intuition.style[:toolbox][:width], height: 255})
|
302
|
+
#
|
303
|
+
# # tool builder
|
304
|
+
#
|
305
|
+
# new({ tool: :capture }) do |params|
|
306
|
+
# tool = { id: :rec_01,
|
307
|
+
# name: :record, icon: :record, action: {open: [:sub_menu]}, code: :record_tool, position: { root: 1 }, # position can be multiple
|
308
|
+
# option: { opt1: :method_2 }, int8: { french: :enregistrement, english: :record, german: :datensatz } }
|
309
|
+
# tool
|
310
|
+
# end
|
311
|
+
# # Intuition::toolbox_style
|
312
|
+
# # Intuition.toolbox_style
|
313
|
+
# # puts A.impulse
|
314
|
+
# # def fill_toolzone(tools_ids)
|
315
|
+
# #
|
316
|
+
# # end
|
317
|
+
# #
|
318
|
+
# # fill_toolzone(%i[files edition select group link copy undo settings])
|
319
|
+
#
|
318
320
|
|
@@ -43,9 +43,5 @@
|
|
43
43
|
</script>
|
44
44
|
<script defer src="js/atome/atome.js" type="text/javascript"></script>
|
45
45
|
<script src='js/application.js' defer></script>
|
46
|
-
|
47
|
-
window.addEventListener('load', function () {
|
48
|
-
Opal.eval('atome_infos')
|
49
|
-
})
|
50
|
-
</script>
|
46
|
+
|
51
47
|
</html>
|
@@ -25,12 +25,7 @@
|
|
25
25
|
<script defer src='js/atome/kernel.js'></script>
|
26
26
|
<script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
|
27
27
|
<script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
|
28
|
-
|
29
|
-
<!-- // to prevent right click-->
|
30
|
-
<!-- document.addEventListener("contextmenu", function (e) {-->
|
31
|
-
<!-- e.preventDefault();-->
|
32
|
-
<!-- });-->
|
33
|
-
<!-- </script>-->
|
28
|
+
|
34
29
|
<title>atome</title>
|
35
30
|
</head>
|
36
31
|
<body id='user_view' class='atome'>
|
@@ -42,18 +37,18 @@
|
|
42
37
|
</script>
|
43
38
|
<script defer src="js/atome/atome.js" type="text/javascript"></script>
|
44
39
|
<script>
|
45
|
-
function loadApplicationJs() {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
}
|
53
|
-
|
54
|
-
window.addEventListener('load', function () {
|
55
|
-
|
56
|
-
})
|
40
|
+
// function loadApplicationJs() {
|
41
|
+
// var script = document.createElement('script');
|
42
|
+
// script.src = 'js/application.js';
|
43
|
+
// script.onload = function() {
|
44
|
+
// rubyVMCallback("A.init_database");
|
45
|
+
// };
|
46
|
+
// document.body.appendChild(script);
|
47
|
+
// }
|
48
|
+
//
|
49
|
+
// window.addEventListener('load', function () {
|
50
|
+
// rubyVMCallback('atome_genesis');
|
51
|
+
// })
|
57
52
|
</script>
|
58
53
|
|
59
54
|
</html>
|
@@ -20,12 +20,7 @@
|
|
20
20
|
<script type="text/javascript" src="js/third_parties/papaparse.min.js" defer></script>
|
21
21
|
<script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
|
22
22
|
<script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
|
23
|
-
|
24
|
-
<!-- // to prevent right click-->
|
25
|
-
<!-- document.addEventListener("contextmenu", function (e) {-->
|
26
|
-
<!-- e.preventDefault();-->
|
27
|
-
<!-- });-->
|
28
|
-
<!-- </script>-->
|
23
|
+
|
29
24
|
<title>atome</title>
|
30
25
|
</head>
|
31
26
|
<body id='user_view' class='atome'>
|