atome 0.5.6.5.7 → 0.5.6.6.0

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.
@@ -1,280 +1,282 @@
1
- # frozen_string_literal: true
2
- text(:hello)
3
- class Atome
4
-
5
- def build_tool(&bloc)
6
- # alert params[:tool]
7
- a = Atome.instance_exec(&bloc)
8
- puts "===> a is : #{a[:action]}"
9
- # check below
10
- wait 2 do
11
- send a[:action]
12
- end
13
- grab(:toolbox).box({color: :white, width: 33, height: 33})
14
- end
15
- end
16
-
17
- class Object
18
- def new(params, &bloc)
19
- # Genesis = Genesis.Genesis
20
- if params.key?(:atome)
21
- Universe.add_atomes_specificities params[:atome]
22
- Genesis.build_atome(params[:atome], &bloc)
23
- elsif params.key?(:particle)
24
- Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
25
- # render indicate if the particle needs to be rendered
26
- # store tell the system if it need to store the particle value
27
- # type help the system what type of type the particle will receive and store
28
- Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
29
- store: params[:store], type: params[:type] }, &bloc)
30
- elsif params.key?(:sanitizer)
31
- Genesis.build_sanitizer(params[:sanitizer], &bloc)
32
- elsif params.key?(:pre)
33
- Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
34
- elsif params.key?(:post)
35
- Atome.instance_variable_set("@post_#{params[:post]}", bloc)
36
- elsif params.key?(:after)
37
- Atome.instance_variable_set("@after_#{params[:after]}", bloc)
38
- elsif params.key?(:read)
39
- Atome.instance_variable_set("@read_#{params[:read]}", bloc)
40
- elsif params[:renderer]
41
- renderer_found = params[:renderer]
42
- if params[:specific]
43
- Universe.set_atomes_specificities(params)
44
- params[:specific] = "#{params[:specific]}_"
45
- end
46
- render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
47
- Genesis.build_render(render_method, &bloc)
48
- elsif params.key?(:callback)
49
- particle_targetted = params[:callback]
50
- Atome.define_method "#{particle_targetted}_callback" do
51
- bloc.call
52
- end
53
- elsif params.key?(:tool)
54
- A.build_tool(&bloc)
55
- end
56
- end
57
- end
58
-
59
- grab(:intuition).box({id: :toolbox, top: :auto, bottom: 0, left: 0, width: 50, height: 255})
60
-
61
- def record_tool
62
- grab(Universe.current_user).selection
63
- alert "must get selection to treat it "
64
- end
65
-
66
-
67
- module Intuition
68
- def intuition_int8
69
- # tool taxonomy and list
70
- {
71
- capture: { int8: { french: :enregistrement, english: :record, german: :datensatz } },
72
- communication: { french: :communication, english: :communication, german: :communication },
73
- tool: { french: :outils, english: :tools, german: :werkzeuge },
74
- view: { french: :vue, english: :view, german: :aussicht },
75
- time: { french: :horloge, english: :clock, german: :Uhr },
76
- find: { french: :trouve, english: :find, german: :finden },
77
- home: { french: :accueil, english: :home, german: :zuhause },
78
- code: { french: :code, english: :code, german: :code },
79
- impulse: { french: :impulse, english: :impulse, german: :impulse },
80
- }
81
- end
82
- def intuition_taxonomy
83
-
84
- end
85
-
86
- def impulse
87
- # tool start point
88
- [:capture, :communication, :tool, :view, :time, :find, :home]
89
- end
90
-
91
- # def capture
92
- # categories=ATOME.methods_categories
93
- # [categories[:inputs]]
94
- # end
95
- #
96
- # def communication
97
- # categories=ATOME.methods_categories
98
- # [categories[:communications]]
99
- # end
100
- #
101
- # def toolz
102
- # categories=ATOME.methods_categories
103
- # [categories[:spatials],categories[:helpers],categories[:materials],
104
- # categories[:geometries],categories[:effects],
105
- # categories[:medias],categories[:hierarchies],categories[:utilities],categories[:events]]
106
- # end
107
- #
108
- # def tool_style(size = 33)
109
- # # styling
110
- # 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 } }]
111
- # 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 } }
112
- # return style
113
- # end
114
- #
115
- # def open_tool(tool_id, widthness=3, orientation=:x, speed=0.6)
116
- # if orientation == :x
117
- # orientation = :width
118
- # value = grab(tool_id).width
119
- # else
120
- # orientation = :height
121
- # value = grab(tool_id).height
122
- # end
123
- # animate({
124
- # start: { orientation => value },
125
- # end: { orientation => value * widthness },
126
- # duration: speed * 1000,
127
- # loop: 0,
128
- # curve: :easing,
129
- # target: tool_id
130
- # })
131
- # notification "find why this id #{self.atome_id}, add annimation callback to set overflow when anim complete"
132
- # grab(tool_id).overflow(:visible)
133
- # end
134
- #
135
- # def close_tool(tool_id, widthness, orientation, speed)
136
- # if orientation == :x
137
- # orientation = :width
138
- # value = grab(tool_id).width
139
- # else
140
- # orientation = :height
141
- # value = grab(tool_id).height
142
- # end
143
- # animate({
144
- # start: { orientation => value * widthness },
145
- # end: { orientation => value },
146
- # duration: speed * 1000,
147
- # loop: 0,
148
- # curve: :easing,
149
- # target: tool_id
150
- # })
151
- # # grab(tool_id).overflow(:hidden)
152
- # end
153
- #
154
- # def create_tool(tool_name, size = 33, x_pos = 0, y_pos = 33, offsset=0)
155
- # tool_created = tool(self.tool_style(size).merge({ parent: :main_menu, atome_id: "tool_" + tool_name, id: "tool_" + tool_name,
156
- # width: size, height: size, smooth: size / 9, overflow: :hidden, x: x_pos, y: y_pos, z: 1, content: [] }))
157
- # icon=tool_created.shape({ path: tool_name, width: size - size / 2, height: size - size / 2, center: true })
158
- # # name = intuition_list[tool_name][language]
159
- # particle({ atome_id: :tools_property_container, color: { red: 0.6, green: 0.6, blue: 0.6 } })
160
- # # we get the plugin code only if the plugin hasn't been interpreted before (unless condition below)
161
- # unless grab(:intuition).content.include? tool_name
162
- # ATOME.reader("./medias/e_rubies/tools/#{tool_name}.rb") do |data|
163
- # # todo add a security parser here
164
- # # we set the variable tool that can be used to facilitate plugin creation
165
- # data="tool=grab(:#{tool_created.atome_id})\n"+data
166
- # compile(data)
167
- # # we add the tool to the intuition content so it won't be loaded twice
168
- # grab(:intuition).content |= [tool_name]
169
- # end
170
- # end
171
- # # end
172
- # tool_created.active({ exec: false })
173
- # tool_created.inactive({ exec: false })
174
- # icon.touch(stop: true) do
175
- # if tool_created.active[:exec] == true
176
- # tool_created.color(:transparent)
177
- # tool_created.active(exec: false, proc: tool_created.active[:proc] )
178
- # tool_created.inactive(exec: true, proc: tool_created.inactive[:proc] )
179
- # else
180
- # tool_created.color({alpha: 0.3})
181
- # tool_created.active({ exec: true, proc: tool_created.active[:proc] })
182
- # end
183
- # end
184
- # end
185
- #
186
- # # we get menu entry point
187
- # def open_intuition(position = {})
188
- # position = { x: 0, yy: 0, size: 33, orientation: :vertical, offset: 0 }.merge(position)
189
- # # we get content language from view's language
190
- # if grab(:main_menu)
191
- # grab(:main_menu).delete
192
- # else
193
- # grab(:view).language
194
- # self.language(grab(:view).language)
195
- # orientation = position.delete(:orientation)
196
- # size = position.delete(:size)
197
- # offset = position.delete(:offset)
198
- # # positioning and scaling
199
- # if orientation == :vertical
200
- # requested_width = size
201
- # requested_height = (size+offset)* impulse.length
202
- # else
203
- # requested_width = (size+offset) * impulse.length
204
- # requested_height = size
205
- # end
206
- # tool({ atome_id: :main_menu, parent: :intuition, color: { alpha: 0 } }.merge(position).merge(width: requested_width, height: requested_height))
207
- # impulse.each_with_index do |item, index|
208
- # if orientation == :vertical
209
- # create_tool(item, size, 0, index * (size+offset))
210
- # else
211
- # create_tool(item, size, index * (size+offset), 0)
212
- # end
213
- # end
214
- # end
215
- # end
216
- end
217
- # atome class extension for eVe
218
-
219
- class Atome
220
- include Intuition
221
- # def atome(requested_property)
222
- # # add component list iin the content we maybe ahave to create a tool object because box can't handle this type of content
223
- # new_atome=self.tool({ atome_id: "#{self.atome_id}_#{requested_property}_atome_#{self.content.length}", x: 66})
224
- # new_atome.touch({ stop: true, option: :down}) do
225
- # color(:red)
226
- # new_atome.height = new_atome.height*3
227
- # end
228
- # new_atome.touch({ stop: true, option: :up}) do
229
- # color(:red)
230
- # new_atome.height = new_atome.height/3
231
- # end
232
- # notification "now we have to add an object or a new property (style) to store complete tool style including size and
233
- # orientation so we can position the new atome correctly"
234
- # # alert self.content.class
235
- # # alert self.content.length
236
- # # alert tool_style
237
- # end
238
- end
239
-
240
- # # we initialise the toolbox here :
1
+ # # frozen_string_literal: true
2
+ # text(:hello)
3
+ # class Atome
241
4
  #
242
- # # the launch bar
243
- # launch_bar = box({ x: 0, y: 0, width: 33, height: "100%", parent: :intuition, z: 0, color: { alpha: 0 } })
244
- # launch_bar.touch({ option: :long }) do |evt|
245
- # size = 33
246
- # yy_touch_position = grab(:view).convert(:height) - evt.page_y
247
- # if yy_touch_position < size
248
- # #if the long touch is within the wanted area( in this at bottom of the screen) we open the menu
249
- # # launch_bar.open_intuition({ x: size, yy: 6,offset: 6, orientation: :horizontal, size: size })
250
- # launch_bar.open_intuition({ x: 6, yy: size,offset: 6, orientation: :vertical, size: size })
5
+ # def build_tool(&bloc)
6
+ # # alert params[:tool]
7
+ # a = Atome.instance_exec(&bloc)
8
+ # puts "===> a is : #{a[:action]}"
9
+ # # check below
10
+ # wait 2 do
11
+ # send a[:action]
12
+ # end
13
+ # grab(:toolbox).box({color: :white, width: 33, height: 33})
251
14
  # end
252
15
  # end
253
16
  #
254
- # # # # # # # # # # # # # # # tests below # # # # # # # # # # # # #
17
+ # class Object
18
+ # def new(params, &bloc)
19
+ # # Genesis = Genesis.Genesis
20
+ # if params.key?(:atome)
21
+ # Universe.add_atomes_specificities params[:atome]
22
+ # Genesis.build_atome(params[:atome], &bloc)
23
+ # elsif params.key?(:particle)
24
+ # Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
25
+ # # render indicate if the particle needs to be rendered
26
+ # # store tell the system if it need to store the particle value
27
+ # # type help the system what type of type the particle will receive and store
28
+ # Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
29
+ # store: params[:store], type: params[:type] }, &bloc)
30
+ # elsif params.key?(:sanitizer)
31
+ # Genesis.build_sanitizer(params[:sanitizer], &bloc)
32
+ # elsif params.key?(:pre)
33
+ # Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
34
+ # elsif params.key?(:post)
35
+ # Atome.instance_variable_set("@post_#{params[:post]}", bloc)
36
+ # elsif params.key?(:after)
37
+ # @startup='coool!!!'
38
+ # alert 'after is set'
39
+ # Atome.instance_variable_set("@after_#{params[:after]}", bloc)
40
+ # elsif params.key?(:read)
41
+ # Atome.instance_variable_set("@read_#{params[:read]}", bloc)
42
+ # elsif params[:renderer]
43
+ # renderer_found = params[:renderer]
44
+ # if params[:specific]
45
+ # Universe.set_atomes_specificities(params)
46
+ # params[:specific] = "#{params[:specific]}_"
47
+ # end
48
+ # render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
49
+ # Genesis.build_render(render_method, &bloc)
50
+ # elsif params.key?(:callback)
51
+ # particle_targetted = params[:callback]
52
+ # Atome.define_method "#{particle_targetted}_callback" do
53
+ # bloc.call
54
+ # end
55
+ # elsif params.key?(:tool)
56
+ # A.build_tool(&bloc)
57
+ # end
58
+ # end
59
+ # end
255
60
  #
256
- # list = molecule_analysis(@molecules_list)
257
- # notif list[:tools]
258
- # notif "======"
259
- # notif list[:molecules]
260
- # notif "======"
261
- # notif list[:atomes]
262
- # notif "======"
263
- # notif list[:molecules][:shadow]
264
-
265
- new({ tool: :capture }) do |params|
266
- tool = { id: :rec_01,
267
-
268
- name: :record, icon: :record, action: {open: [:sub_menu]}, code: :record_tool, position: { root: 1 }, # position can be multiple
269
- option: { opt1: :method_2 }, int8: { french: :enregistrement, english: :record, german: :datensatz } }
270
- tool
271
- end
272
-
273
-
274
- puts A.impulse
275
- # def fill_toolzone(tools_ids)
61
+ # grab(:intuition).box({id: :toolbox, top: :auto, bottom: 0, left: 0, width: 50, height: 255})
276
62
  #
63
+ # def record_tool
64
+ # grab(Universe.current_user).selection
65
+ # alert "must get selection to treat it "
277
66
  # end
278
67
  #
279
- # fill_toolzone(%i[files edition select group link copy undo settings])
280
-
68
+ #
69
+ # module Intuition
70
+ # def intuition_int8
71
+ # # tool taxonomy and list
72
+ # {
73
+ # capture: { int8: { french: :enregistrement, english: :record, german: :datensatz } },
74
+ # communication: { french: :communication, english: :communication, german: :communication },
75
+ # tool: { french: :outils, english: :tools, german: :werkzeuge },
76
+ # view: { french: :vue, english: :view, german: :aussicht },
77
+ # time: { french: :horloge, english: :clock, german: :Uhr },
78
+ # find: { french: :trouve, english: :find, german: :finden },
79
+ # home: { french: :accueil, english: :home, german: :zuhause },
80
+ # code: { french: :code, english: :code, german: :code },
81
+ # impulse: { french: :impulse, english: :impulse, german: :impulse },
82
+ # }
83
+ # end
84
+ # def intuition_taxonomy
85
+ #
86
+ # end
87
+ #
88
+ # def impulse
89
+ # # tool start point
90
+ # [:capture, :communication, :tool, :view, :time, :find, :home]
91
+ # end
92
+ #
93
+ # # def capture
94
+ # # categories=ATOME.methods_categories
95
+ # # [categories[:inputs]]
96
+ # # end
97
+ # #
98
+ # # def communication
99
+ # # categories=ATOME.methods_categories
100
+ # # [categories[:communications]]
101
+ # # end
102
+ # #
103
+ # # def toolz
104
+ # # categories=ATOME.methods_categories
105
+ # # [categories[:spatials],categories[:helpers],categories[:materials],
106
+ # # categories[:geometries],categories[:effects],
107
+ # # categories[:medias],categories[:hierarchies],categories[:utilities],categories[:events]]
108
+ # # end
109
+ # #
110
+ # # def tool_style(size = 33)
111
+ # # # styling
112
+ # # 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 } }]
113
+ # # 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 } }
114
+ # # return style
115
+ # # end
116
+ # #
117
+ # # def open_tool(tool_id, widthness=3, orientation=:x, speed=0.6)
118
+ # # if orientation == :x
119
+ # # orientation = :width
120
+ # # value = grab(tool_id).width
121
+ # # else
122
+ # # orientation = :height
123
+ # # value = grab(tool_id).height
124
+ # # end
125
+ # # animate({
126
+ # # start: { orientation => value },
127
+ # # end: { orientation => value * widthness },
128
+ # # duration: speed * 1000,
129
+ # # loop: 0,
130
+ # # curve: :easing,
131
+ # # target: tool_id
132
+ # # })
133
+ # # notification "find why this id #{self.atome_id}, add annimation callback to set overflow when anim complete"
134
+ # # grab(tool_id).overflow(:visible)
135
+ # # end
136
+ # #
137
+ # # def close_tool(tool_id, widthness, orientation, speed)
138
+ # # if orientation == :x
139
+ # # orientation = :width
140
+ # # value = grab(tool_id).width
141
+ # # else
142
+ # # orientation = :height
143
+ # # value = grab(tool_id).height
144
+ # # end
145
+ # # animate({
146
+ # # start: { orientation => value * widthness },
147
+ # # end: { orientation => value },
148
+ # # duration: speed * 1000,
149
+ # # loop: 0,
150
+ # # curve: :easing,
151
+ # # target: tool_id
152
+ # # })
153
+ # # # grab(tool_id).overflow(:hidden)
154
+ # # end
155
+ # #
156
+ # # def create_tool(tool_name, size = 33, x_pos = 0, y_pos = 33, offsset=0)
157
+ # # tool_created = tool(self.tool_style(size).merge({ parent: :main_menu, atome_id: "tool_" + tool_name, id: "tool_" + tool_name,
158
+ # # width: size, height: size, smooth: size / 9, overflow: :hidden, x: x_pos, y: y_pos, z: 1, content: [] }))
159
+ # # icon=tool_created.shape({ path: tool_name, width: size - size / 2, height: size - size / 2, center: true })
160
+ # # # name = intuition_list[tool_name][language]
161
+ # # particle({ atome_id: :tools_property_container, color: { red: 0.6, green: 0.6, blue: 0.6 } })
162
+ # # # we get the plugin code only if the plugin hasn't been interpreted before (unless condition below)
163
+ # # unless grab(:intuition).content.include? tool_name
164
+ # # ATOME.reader("./medias/e_rubies/tools/#{tool_name}.rb") do |data|
165
+ # # # todo add a security parser here
166
+ # # # we set the variable tool that can be used to facilitate plugin creation
167
+ # # data="tool=grab(:#{tool_created.atome_id})\n"+data
168
+ # # compile(data)
169
+ # # # we add the tool to the intuition content so it won't be loaded twice
170
+ # # grab(:intuition).content |= [tool_name]
171
+ # # end
172
+ # # end
173
+ # # # end
174
+ # # tool_created.active({ exec: false })
175
+ # # tool_created.inactive({ exec: false })
176
+ # # icon.touch(stop: true) do
177
+ # # if tool_created.active[:exec] == true
178
+ # # tool_created.color(:transparent)
179
+ # # tool_created.active(exec: false, proc: tool_created.active[:proc] )
180
+ # # tool_created.inactive(exec: true, proc: tool_created.inactive[:proc] )
181
+ # # else
182
+ # # tool_created.color({alpha: 0.3})
183
+ # # tool_created.active({ exec: true, proc: tool_created.active[:proc] })
184
+ # # end
185
+ # # end
186
+ # # end
187
+ # #
188
+ # # # we get menu entry point
189
+ # # def open_intuition(position = {})
190
+ # # position = { x: 0, yy: 0, size: 33, orientation: :vertical, offset: 0 }.merge(position)
191
+ # # # we get content language from view's language
192
+ # # if grab(:main_menu)
193
+ # # grab(:main_menu).delete
194
+ # # else
195
+ # # grab(:view).language
196
+ # # self.language(grab(:view).language)
197
+ # # orientation = position.delete(:orientation)
198
+ # # size = position.delete(:size)
199
+ # # offset = position.delete(:offset)
200
+ # # # positioning and scaling
201
+ # # if orientation == :vertical
202
+ # # requested_width = size
203
+ # # requested_height = (size+offset)* impulse.length
204
+ # # else
205
+ # # requested_width = (size+offset) * impulse.length
206
+ # # requested_height = size
207
+ # # end
208
+ # # tool({ atome_id: :main_menu, parent: :intuition, color: { alpha: 0 } }.merge(position).merge(width: requested_width, height: requested_height))
209
+ # # impulse.each_with_index do |item, index|
210
+ # # if orientation == :vertical
211
+ # # create_tool(item, size, 0, index * (size+offset))
212
+ # # else
213
+ # # create_tool(item, size, index * (size+offset), 0)
214
+ # # end
215
+ # # end
216
+ # # end
217
+ # # end
218
+ # end
219
+ # # atome class extension for eVe
220
+ #
221
+ # class Atome
222
+ # include Intuition
223
+ # # def atome(requested_property)
224
+ # # # add component list iin the content we maybe ahave to create a tool object because box can't handle this type of content
225
+ # # new_atome=self.tool({ atome_id: "#{self.atome_id}_#{requested_property}_atome_#{self.content.length}", x: 66})
226
+ # # new_atome.touch({ stop: true, option: :down}) do
227
+ # # color(:red)
228
+ # # new_atome.height = new_atome.height*3
229
+ # # end
230
+ # # new_atome.touch({ stop: true, option: :up}) do
231
+ # # color(:red)
232
+ # # new_atome.height = new_atome.height/3
233
+ # # end
234
+ # # notification "now we have to add an object or a new property (style) to store complete tool style including size and
235
+ # # orientation so we can position the new atome correctly"
236
+ # # # alert self.content.class
237
+ # # # alert self.content.length
238
+ # # # alert tool_style
239
+ # # end
240
+ # end
241
+ #
242
+ # # # we initialise the toolbox here :
243
+ # #
244
+ # # # the launch bar
245
+ # # launch_bar = box({ x: 0, y: 0, width: 33, height: "100%", parent: :intuition, z: 0, color: { alpha: 0 } })
246
+ # # launch_bar.touch({ option: :long }) do |evt|
247
+ # # size = 33
248
+ # # yy_touch_position = grab(:view).convert(:height) - evt.page_y
249
+ # # if yy_touch_position < size
250
+ # # #if the long touch is within the wanted area( in this at bottom of the screen) we open the menu
251
+ # # # launch_bar.open_intuition({ x: size, yy: 6,offset: 6, orientation: :horizontal, size: size })
252
+ # # launch_bar.open_intuition({ x: 6, yy: size,offset: 6, orientation: :vertical, size: size })
253
+ # # end
254
+ # # end
255
+ # #
256
+ # # # # # # # # # # # # # # # # tests below # # # # # # # # # # # # #
257
+ # #
258
+ # # list = molecule_analysis(@molecules_list)
259
+ # # notif list[:tools]
260
+ # # notif "======"
261
+ # # notif list[:molecules]
262
+ # # notif "======"
263
+ # # notif list[:atomes]
264
+ # # notif "======"
265
+ # # notif list[:molecules][:shadow]
266
+ #
267
+ # new({ tool: :capture }) do |params|
268
+ # tool = { id: :rec_01,
269
+ #
270
+ # name: :record, icon: :record, action: {open: [:sub_menu]}, code: :record_tool, position: { root: 1 }, # position can be multiple
271
+ # option: { opt1: :method_2 }, int8: { french: :enregistrement, english: :record, german: :datensatz } }
272
+ # tool
273
+ # end
274
+ #
275
+ #
276
+ # puts A.impulse
277
+ # # def fill_toolzone(tools_ids)
278
+ # #
279
+ # # end
280
+ # #
281
+ # # fill_toolzone(%i[files edition select group link copy undo settings])
282
+ #
@@ -173,7 +173,7 @@ class HTML
173
173
  hash_result
174
174
  end
175
175
 
176
- def hyperedit(params)
176
+ def hyperedit(params, usr_bloc)
177
177
  html_object = JS.global[:document].getElementById(params.to_s)
178
178
  particles_from_style = {}
179
179
  # we get all the styles tag present in the page
@@ -197,10 +197,15 @@ class HTML
197
197
  key, value = pair.split(':').map(&:strip)
198
198
  particles_from_style[key.to_sym] = value if key && value
199
199
  end
200
+
201
+ # alert "hyperedit"
202
+
203
+
200
204
  particles_found = particles_found.merge(particles_from_style)
201
205
  current_atome = grab(@id)
202
- current_atome.callback({ hyperedit: particles_found })
203
- current_atome.call(:hyperedit)
206
+ usr_bloc.call(particles_found)
207
+ # current_atome.callback({ hyperedit: particles_found })
208
+ # current_atome.call(:hyperedit)
204
209
 
205
210
  end
206
211
 
@@ -41,3 +41,12 @@ new({ method: :sort, renderer: :html, type: :hash }) do |params|
41
41
  html.refresh_table(params)
42
42
  end
43
43
 
44
+ new({ method: :inside, renderer: :html }) do |params|
45
+ if params
46
+ affect.each do |at_found|
47
+ grab(at_found).html.style("box-sizing", 'border-box')
48
+ end
49
+ else
50
+ html.style("boxSizing", ' content-box')
51
+ end
52
+ end
@@ -11,8 +11,8 @@ end
11
11
  new({ renderer: :html, method: :hypertext }) do |params|
12
12
  html.hypertext(params)
13
13
  end
14
- new({ renderer: :html, method: :hyperedit }) do |params|
15
- html.hyperedit(params)
14
+ new({ renderer: :html, method: :hyperedit }) do |params, usr_proc|
15
+ html.hyperedit(params, usr_proc)
16
16
  end
17
17
  new({ renderer: :html, method: :read, type: :string }) do |value, &bloc|
18
18
  html.read(id, value)
@@ -1,15 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # col=color({red: 1, green: 0.2, id: :the_col})
4
- c = circle({ id: :the_circle })
3
+
4
+
5
+
6
+
7
+
8
+
9
+ b=box({id: :my_b_box, left: 150, top: 150})
10
+ b.border({ thickness: 15, red: 1, green: 1, blue: 0, alpha: 1, pattern: :solid ,id: :jjjj, inside: true})
11
+
12
+ wait 1.5 do
13
+ border({ thickness: 30, red: 1, green: 1, blue: 0, alpha: 1, pattern: :solid ,id: :poil, inside: true})
14
+ end
15
+
16
+ c = circle({ id: :the_circle, color: :green })
5
17
  b = box({ left: 333, id: :the_box })
6
18
  circle({ top: 190, width: 99, height: 99, id: :dont_break_too })
7
- c2 = circle({ top: 190, width: 99, height: 99, id: :dont_break })
19
+ c2 = circle({ top: 190, width: 99, height: 99, id: :dont_break, color: :orange })
8
20
  # let's add the border
9
21
  wait 1 do
10
22
  c2.shadow({
11
- # id: :s1,
12
- # affect: [:the_circle],
13
23
  left: 9,
14
24
  top: 3,
15
25
  blur: 9,
@@ -31,7 +41,7 @@ end
31
41
  #
32
42
  b.touch(true) do
33
43
 
34
- b.border({ thickness: 5, red: 1, green: 1, blue: 1, alpha: 1, pattern: :dotted, id: :the_door })
44
+ b.border({ thickness: 5, red: 1, green: 1, blue: 1, alpha: 1, pattern: :dotted, id: :the_door,inside: true })
35
45
  puts " no new atome added!, number of atomes: #{Universe.atomes.length}"
36
46
  b.apply([:the_door])
37
47
  c.apply([:the_door])
@@ -52,47 +62,14 @@ b.touch(true) do
52
62
  end
53
63
  end
54
64
 
55
- # wait 6 do
56
- # image(:red_planet)
57
- # end
58
65
 
59
- # # frozen_string_literal: true
60
- #
61
- # col=color({red: 1, blue: 1, id: :the_col})
62
- #
63
- #
64
- # c=circle
65
- # b=box({left: 333})
66
- # # b.attached([col.id])
67
- # c.border({ thickness: 5, pattern: :dotted })
68
- # b.border({ thickness: 5, attached: col.id, pattern: :dotted })
69
66
  bb=box({top: 50, left: 100})
70
67
  bb.text(:touch_me)
71
- bord=bb.border({ thickness: 3, pattern: :dotted})
68
+ bord=bb.border({ thickness: 3, pattern: :dotted, inside: true})
72
69
  bb.touch(true) do
73
70
  col=bord.color({red: 1 })
74
71
 
75
72
  wait 2 do
76
73
  col.green(1)
77
74
  end
78
- # bord.apply(:titi)
79
- # puts 'opk'
80
75
  end
81
-
82
-
83
- # c=color(:pink)
84
- # # red: 1, green: 1, blue: 0, alpha: 1,
85
- # wait 0.2 do
86
- # bord.red(1)
87
- # wait 0.2 do
88
- # bord.green(1)
89
- # wait 0.2 do
90
- # bord.blue(1)
91
- # wait 0.2 do
92
- # bord.alpha(1)
93
- # bord.apply(c.id)
94
- # end
95
- # end
96
- # end
97
- #
98
- # end