atome 0.5.6.8.7 → 0.5.7.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/basic.md +7 -8
  3. data/documentation/deep learning/basic_infos.txt +6 -6
  4. data/documentation/installation/atome_server.md +66 -1
  5. data/documentation/installation/buiding_atome.md +307 -0
  6. data/lib/atome/atome.rb +2 -3
  7. data/lib/atome/extensions/atome.rb +38 -12
  8. data/lib/atome/genesis/atomes.rb +1 -1
  9. data/lib/atome/genesis/genesis.rb +11 -11
  10. data/lib/atome/genesis/particles/event.rb +58 -50
  11. data/lib/atome/genesis/particles/identity.rb +3 -0
  12. data/lib/atome/genesis/particles/property.rb +2 -1
  13. data/lib/atome/genesis/particles/utility.rb +19 -12
  14. data/lib/atome/genesis/presets.rb +10 -0
  15. data/lib/atome/genesis/sparkle.rb +11 -9
  16. data/lib/atome/kernel/universe.rb +22 -11
  17. data/lib/atome/presets/atome.rb +20 -17
  18. data/lib/atome/utilities/essentials.rb +5 -5
  19. data/lib/atome/utilities/utilities.rb +168 -15
  20. data/lib/atome/version.rb +1 -1
  21. data/lib/atome.rb +1 -0
  22. data/lib/atome_relative.rb +1 -0
  23. data/lib/molecules/init.rb +22 -42
  24. data/lib/molecules/intuition/_deprecated_inputs.rb +111 -0
  25. data/lib/molecules/intuition/utillities.rb +105 -11
  26. data/lib/renderers/html/event.rb +20 -4
  27. data/lib/renderers/html/html.rb +145 -161
  28. data/lib/renderers/html/identity.rb +10 -2
  29. data/lib/renderers/html/utility.rb +64 -8
  30. data/vendor/assets/application/examples/b64_to_image.rb +9 -0
  31. data/vendor/assets/application/examples/drag.rb +9 -2
  32. data/vendor/assets/application/examples/matrix.rb +77 -114
  33. data/vendor/assets/application/examples/recorder.rb +74 -0
  34. data/vendor/assets/application/examples/site.rb +41 -0
  35. data/vendor/assets/application/examples/sub_atome_manipulation.rb +0 -2
  36. data/vendor/assets/application/examples/svg_img_to_vector.rb +6 -0
  37. data/vendor/assets/application/examples/svg_vectorizer.rb +21 -0
  38. data/vendor/assets/application/examples/table.rb +1 -1
  39. data/vendor/assets/application/examples/test.rb +572 -0
  40. data/vendor/assets/application/examples/tools.rb +650 -304
  41. data/vendor/assets/application/examples/vector.rb +16 -3
  42. data/vendor/assets/server/atome_server.rb +3 -2
  43. data/vendor/assets/server/atome_server_wasm.rb +2 -2
  44. data/vendor/assets/server/eDen.rb +135 -14
  45. data/vendor/assets/src/index.html +1 -1
  46. data/vendor/assets/src/index_opal.html +1 -1
  47. data/vendor/assets/src/index_server.html +1 -1
  48. data/vendor/assets/src/index_server_wasm.html +1 -1
  49. data/vendor/assets/src/index_wasm.html +1 -1
  50. data/vendor/assets/src/js/atome/atome.js +250 -49
  51. data/vendor/assets/src/js/atome/atome_helpers/communication.js +4 -4
  52. data/vendor/assets/src/js/atome/specific/opal.js +19 -3
  53. data/vendor/assets/src/js/atome/specific/wasm.js +18 -3
  54. data/vendor/assets/src/js/molecules/web.js +1 -1
  55. data/vendor/assets/src/medias/images/icons/Lowpass.svg +8 -0
  56. data/vendor/assets/src/medias/images/icons/activate.svg +3 -0
  57. data/vendor/assets/src/medias/images/icons/audio.svg +7 -0
  58. data/vendor/assets/src/medias/images/icons/band_pass.svg +8 -0
  59. data/vendor/assets/src/medias/images/icons/clear.svg +5 -0
  60. data/vendor/assets/src/medias/images/icons/color.svg +5 -0
  61. data/vendor/assets/src/medias/images/icons/copy.svg +8 -0
  62. data/vendor/assets/src/medias/images/icons/create.svg +3 -0
  63. data/vendor/assets/src/medias/images/icons/delete.svg +8 -0
  64. data/vendor/assets/src/medias/images/icons/edit-.svg +4 -0
  65. data/vendor/assets/src/medias/images/icons/edit.svg +4 -0
  66. data/vendor/assets/src/medias/images/icons/edition.svg +4 -0
  67. data/vendor/assets/src/medias/images/icons/equalizer-.svg +5 -0
  68. data/vendor/assets/src/medias/images/icons/equalizer.svg +5 -0
  69. data/vendor/assets/src/medias/images/icons/filter.svg +4 -0
  70. data/vendor/assets/src/medias/images/icons/folder.svg +4 -0
  71. data/vendor/assets/src/medias/images/icons/group.svg +6 -0
  72. data/vendor/assets/src/medias/images/icons/hamburger.svg +8 -0
  73. data/vendor/assets/src/medias/images/icons/high_pass.svg +5 -0
  74. data/vendor/assets/src/medias/images/icons/link.svg +4 -0
  75. data/vendor/assets/src/medias/images/icons/load.svg +4 -0
  76. data/vendor/assets/src/medias/images/icons/low_pass.svg +5 -0
  77. data/vendor/assets/src/medias/images/icons/microphone.svg +7 -0
  78. data/vendor/assets/src/medias/images/icons/midi_in.svg +4 -0
  79. data/vendor/assets/src/medias/images/icons/midi_out.svg +4 -0
  80. data/vendor/assets/src/medias/images/icons/modules.svg +11 -0
  81. data/vendor/assets/src/medias/images/icons/paste.svg +4 -0
  82. data/vendor/assets/src/medias/images/icons/pause.svg +5 -0
  83. data/vendor/assets/src/medias/images/icons/play.svg +7 -0
  84. data/vendor/assets/src/medias/images/icons/record.svg +4 -0
  85. data/vendor/assets/src/medias/images/icons/save.svg +5 -0
  86. data/vendor/assets/src/medias/images/icons/select--.svg +4 -0
  87. data/vendor/assets/src/medias/images/icons/select-.svg +5 -0
  88. data/vendor/assets/src/medias/images/icons/select-all.svg +4 -0
  89. data/vendor/assets/src/medias/images/icons/select.svg +4 -0
  90. data/vendor/assets/src/medias/images/icons/settings.svg +5 -0
  91. data/vendor/assets/src/medias/images/icons/settings0.svg +2 -0
  92. data/vendor/assets/src/medias/images/icons/settings1.svg +17 -0
  93. data/vendor/assets/src/medias/images/icons/settings2.svg +25 -0
  94. data/vendor/assets/src/medias/images/icons/settings_old.svg +6 -0
  95. data/vendor/assets/src/medias/images/icons/shape.svg +7 -0
  96. data/vendor/assets/src/medias/images/icons/speaker.svg +6 -0
  97. data/vendor/assets/src/medias/images/icons/stop.svg +4 -0
  98. data/vendor/assets/src/medias/images/icons/tool.svg +7 -0
  99. data/vendor/assets/src/medias/images/icons/tools.svg +9 -0
  100. data/vendor/assets/src/medias/images/icons/undo2.svg +4 -0
  101. data/vendor/assets/src/medias/images/icons/validate.svg +9 -0
  102. data/vendor/assets/src/medias/images/icons/vie.svg +3 -0
  103. data/vendor/assets/src/medias/images/icons/wave-saw.svg +3 -0
  104. data/vendor/assets/src/medias/images/icons/wave-sine.svg +3 -0
  105. data/vendor/assets/src/medias/images/icons/wave-square-.svg +4 -0
  106. data/vendor/assets/src/medias/images/icons/wave-square.svg +3 -0
  107. data/vendor/assets/src/medias/images/icons/wave-triangle.svg +3 -0
  108. data/vendor/assets/src/medias/images/icons/waveform-.svg +4 -0
  109. data/vendor/assets/src/medias/images/icons/waveform.svg +7 -0
  110. metadata +68 -6
  111. data/lib/molecules/intuition/inputs.rb +0 -111
  112. /data/lib/molecules/{examples → _deprecated_examples}/site.rb +0 -0
  113. /data/lib/molecules/intuition/{toolbox.rb → _deprecated_toolbox.rb} +0 -0
@@ -2,47 +2,53 @@
2
2
 
3
3
  new({ particle: :touch, category: :event, type: :hash, store: false })
4
4
  new({ sanitizer: :touch }) do |params, user_bloc|
5
- # TODO: factorise code below
6
- # alert "touch_code: #{@touch_code}"
7
- @touch ||= {}
8
- @touch_code ||= {}
9
- option = true
10
- params = if params.instance_of? Hash
11
- @touch_code[params.keys[0]] = user_bloc
12
- option = params[params.keys[0]]
13
- params.keys[0]
14
- else
15
- case params
16
- when true
17
- @touch_code[:tap] = user_bloc
18
- :tap
19
- when :touch
20
- @touch_code[:tap] = user_bloc
21
- :tap
22
- when :down
23
- @touch_code[:down] = user_bloc
24
- :down
25
- when :up
26
- @touch_code[:up] = user_bloc
27
- :up
28
- when :long
29
- @touch_code[:long] = user_bloc
30
- :long
31
- when :double
32
- @touch_code[:double] = user_bloc
33
- :double
34
- when :remove
35
- params
36
- when false
37
- @touch_code[:remove] = user_bloc
38
- :remove
5
+ if params
6
+ # TODO: factorise code below
7
+ # alert "touch_code: #{@touch_code}"
8
+ @touch ||= {}
9
+ @touch_code ||= {}
10
+ option = true
11
+ params = if params.instance_of? Hash
12
+ @touch_code[params.keys[0]] = user_bloc
13
+ option = params[params.keys[0]]
14
+ params.keys[0]
39
15
  else
40
- @touch_code[:tap] = user_bloc
41
- :tap
16
+ case params
17
+ when true
18
+ @touch_code[:tap] = user_bloc
19
+ :tap
20
+ when :touch
21
+ @touch_code[:tap] = user_bloc
22
+ :tap
23
+ when :down
24
+ @touch_code[:down] = user_bloc
25
+ :down
26
+ when :up
27
+ @touch_code[:up] = user_bloc
28
+ :up
29
+ when :long
30
+ @touch_code[:long] = user_bloc
31
+ :long
32
+ when :double
33
+ @touch_code[:double] = user_bloc
34
+ :double
35
+ # when :remove
36
+ # params
37
+ when false
38
+ @touch_code[:remove] = user_bloc
39
+ :remove
40
+ else
41
+ @touch_code[:tap] = user_bloc
42
+ :tap
43
+ end
42
44
  end
43
- end
44
- @touch[params] = option
45
- params
45
+
46
+ @touch[params] = option
47
+ params
48
+ else
49
+ @touch = false
50
+ params
51
+ end
46
52
 
47
53
  end
48
54
  new({ particle: :play, category: :event, type: :boolean, store: false })
@@ -155,6 +161,12 @@ new({ sanitizer: :drag }) do |params, user_bloc|
155
161
 
156
162
  end
157
163
  @drag[params] = option
164
+ if params == :remove
165
+ params = false
166
+ else
167
+ @drag[params] = option
168
+ end
169
+
158
170
  params
159
171
  end
160
172
  new({ particle: :drop, category: :event, type: :boolean, store: false })
@@ -226,14 +238,13 @@ new({ sanitizer: :over }) do |params, user_bloc|
226
238
 
227
239
  end
228
240
 
229
- @over[params] = option
241
+ @over[params] = option
230
242
  params
231
243
 
232
244
  end
233
245
  # new({ particle: :sort }) do |_value, sort_proc|
234
246
  # @sort_proc = sort_proc
235
247
  # end
236
-
237
248
  new({ particle: :targets, category: :event, type: :string })
238
249
  new({ particle: :start, category: :event, type: :boolean })
239
250
  new({ pre: :start }) do |_value, user_proc|
@@ -290,12 +301,12 @@ new({ sanitizer: :keyboard }) do |params, user_bloc|
290
301
 
291
302
  params
292
303
  end
293
- new({ particle: :resize, category: :event, type: :boolean, store: false })
304
+ new({ particle: :resize, category: :event, type: :boolean, store: false })
294
305
  new({ sanitizer: :resize }) do |params, user_bloc|
295
- @resize ||= { }
306
+ @resize ||= {}
296
307
  @resize_code ||= {}
297
308
 
298
- option = {min: { width: 10, height: 10 }, max: { width: 3000, height: 3000 }}
309
+ option = { min: { width: 10, height: 10 }, max: { width: 3000, height: 3000 } }
299
310
  params = if params.instance_of? Hash
300
311
  @resize_code[:resize] = user_bloc
301
312
  option = params[params.keys[0]]
@@ -323,14 +334,11 @@ new({ particle: :overflow, category: :event, type: :boolean }) do |params, bloc|
323
334
  params
324
335
 
325
336
  end
326
-
327
-
328
-
329
- new({particle: :animate , category: :event, type: :hash}) do |params|
337
+ new({ particle: :animate, category: :event, type: :hash }) do |params|
330
338
  if params.instance_of? Hash
331
- params={ from: 0, to: 300, duration: 1000 }.merge(params)
339
+ params = { from: 0, to: 300, duration: 1000 }.merge(params)
332
340
  else
333
- params={ from: 0, to: 300, duration: 1000 }
341
+ params = { from: 0, to: 300, duration: 1000 }
334
342
  end
335
343
  html.play_animation(params)
336
344
  end
@@ -64,8 +64,11 @@ end
64
64
 
65
65
  new(particle: :selected, category: :identity, type: :boolean) do |params|
66
66
  if params == true
67
+ border({ thickness: 3, red: 1, green: 1, blue: 1, alpha: 1, pattern: :dotted })
68
+ border({ thickness: 10, pattern: :solid, color: :red})
67
69
  grab(Universe.current_user).selection << @id
68
70
  elsif params == false
71
+ border({alpha: 0, thickness: 0})
69
72
  grab(Universe.current_user).selection.collect.delete(@id)
70
73
  else
71
74
  # TODO: for future use
@@ -142,5 +142,6 @@ new({ particle: :value }) do |val|
142
142
  val
143
143
  end
144
144
 
145
+ new({ particle: :behavior })
145
146
 
146
- new({ particle: :behavior })
147
+ new({ particle: :orientation, type: :symbol, category: :property })
@@ -160,13 +160,13 @@ new({ particle: :duplicate, category: :utility, type: :string, store: false }) d
160
160
  end
161
161
  end
162
162
  params[:attached] = attached_atomes
163
- infos_found =infos.dup
164
- keys_to_delete = [ :history, :callback, :duplicate, :copy, :paste, :touch_code, :html, :attached, :aid]
163
+ infos_found = infos.dup
164
+ keys_to_delete = [:history, :callback, :duplicate, :copy, :paste, :touch_code, :html, :attached, :aid]
165
165
  keys_to_delete.each { |key| infos_found.delete(key) }
166
166
  new_atome_id = "#{@id}_copy_#{copy_number}".to_sym
167
- infos_found[:id]=new_atome_id
168
- infos_found=infos_found.merge(params)
169
- new_atome =Atome.new( infos_found)
167
+ infos_found[:id] = new_atome_id
168
+ infos_found = infos_found.merge(params)
169
+ new_atome = Atome.new(infos_found)
170
170
  @duplicate ||= {}
171
171
  @duplicate[new_atome_id] = new_atome
172
172
  new_atome
@@ -230,25 +230,32 @@ new({ particle: :get, category: :utility, type: :string }) do |params|
230
230
  data[row_nb][data[row_nb].keys[column_nb]] # we get the content of the cell
231
231
  end
232
232
 
233
- new ({ particle: :css, category: :utility, type: :string })
233
+ new({ particle: :css, category: :utility, type: :string })
234
234
 
235
235
  new({ read: :css }) do
236
236
  CssProxy.new(js, nil, self)
237
237
  end
238
238
 
239
- new({particle: :holder, category: :utility, type: :atome})
239
+ new({ particle: :holder, category: :utility, type: :atome })
240
240
 
241
241
  # this particle is mainly used in conjunction with alternate particle as a 'lambda' to alternate methods
242
- new({particle: :executor, category: :utility, type: :hash}) do |params|
242
+ new({ particle: :executor, category: :utility, type: :hash }) do |params|
243
243
  params.each do |method, opt|
244
244
  send(method, opt)
245
245
  end
246
246
  params
247
247
  end
248
248
 
249
-
250
- new({ particle: :tick, store: false }) do |val|
251
- @tick[val] ||= 1
252
- @tick[val]= @tick[val] += 1
249
+ new({ particle: :tick, category: :utility, store: false, type: :hash }) do |val|
250
+ @tick[val] ||= 0
251
+ @tick[val] = @tick[val] += 1
253
252
  @tick[val]
254
253
  end
254
+
255
+ new({ particle: :storage, category: :utility, type: :hash })
256
+ new({ particle: :state, category: :utility, type: :symbol })
257
+
258
+
259
+ new({ particle: :record, category: :utility, type: :hash })
260
+ new({ particle: :preview, category: :utility, type: :hash })
261
+
@@ -0,0 +1,10 @@
1
+
2
+ new({preset: :box })
3
+
4
+ new({preset: :circle })do |params = {},&bloc|
5
+
6
+ { type: :shape, width: 39, height: 39, smooth: '100%',
7
+ apply: [:circle_color],
8
+ left: 0, top: 0}
9
+ end
10
+
@@ -5,10 +5,10 @@
5
5
  # Lets create the U.I.
6
6
  default_render = Essentials.default_params[:render_engines]
7
7
  Atome.new(
8
- { renderers: [], id: :eDen, type: :element, tag: { system: true } }
8
+ { renderers: [], aid: :eDen, type: :element, tag: { system: true } }
9
9
  )
10
10
  Atome.new(
11
- { renderers: [], id: :user_view, type: :element, tag: { system: true },
11
+ { renderers: [], aid: :user_view, type: :element, tag: { system: true },
12
12
  attach: :eDen }
13
13
  )
14
14
 
@@ -56,13 +56,13 @@ Atome.new(
56
56
  # system object creation
57
57
  # the black_matter is used to store un materialized atomes
58
58
  Atome.new(
59
- { renderers: default_render, id: :black_matter, type: :shape, attach: :user_view,
59
+ { renderers: default_render, aid: :black_matter, type: :shape, attach: :user_view,
60
60
  left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0, overflow: :hidden, tag: { system: true }
61
61
  })
62
62
 
63
63
  # view port
64
64
  Atome.new(
65
- { renderers: default_render, id: :view, type: :shape, attach: :user_view, apply: [:view_color],
65
+ { renderers: default_render, aid: :view,type: :shape, attach: :user_view, apply: [:view_color],
66
66
  tag: { system: true }, left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
67
67
  }
68
68
 
@@ -70,7 +70,7 @@ Atome.new(
70
70
 
71
71
  # unreal port, hold system object and tools
72
72
  Atome.new(
73
- { renderers: default_render, id: :intuition, type: :shape, attach: :user_view, tag: { system: true },
73
+ { renderers: default_render, aid: :intuition, type: :shape, attach: :user_view,data: {}, tag: { system: true },
74
74
  left: 0, top: 0, bottom: 0, width: 0, height: :auto, overflow: :visible
75
75
  }
76
76
  )
@@ -80,12 +80,14 @@ machine_id = :dummy_machine
80
80
  machine_password = { read: { atome: :star_wars }, write: { atome: :star_wars } }
81
81
 
82
82
  # copy basket
83
- Atome.new({ renderers: [:html], id: :copy, collect: [], type: :group, tag: { system: true } })
83
+ Atome.new({ renderers: [:html], aid: :copy, collect: [], type: :group, tag: { system: true } })
84
84
 
85
85
  # machine
86
86
  Atome.new({ renderers: default_render, id: machine_id, type: :machine, password: machine_password,
87
87
  name: :macAir, data: { date: '10090717' }, tag: { system: true } })
88
88
 
89
+
90
+
89
91
  # user
90
92
  user_password = { global: :star_win, read: { atome: :star_wars }, write: { atome: :star_wars } }
91
93
 
@@ -98,7 +100,7 @@ A = Atome.new(
98
100
  { renderers: default_render, id: :atome, type: :element, tag: { system: true } }
99
101
  )
100
102
  # atome selector / collector
101
- Atome.new({ renderers: [:html], id: :selector, collect: [], type: :group, tag: { system: true } })
103
+ Atome.new({ renderers: [:html], aid: :selector, collect: [], type: :group, tag: { system: true } })
102
104
 
103
105
  # atome infos
104
106
  def atome_infos
@@ -167,7 +169,7 @@ def init_database # this method is call from JS (atome/communication) at WS conn
167
169
  # puts "===> #{_db_state}"
168
170
  end
169
171
 
170
- A.sync({ action: :create_db_column, data: { table: :user, column: :email, type: :string } }) do |_db_state|
172
+ A.sync({ action: :create_db_column, data: { table: :user, column: :email, type: :string, unique: true } }) do |_db_state|
171
173
  end
172
174
 
173
175
  A.sync({ action: :create_db_column, data: { table: :user, column: :password, type: :string } }) do |_db_state|
@@ -210,6 +212,6 @@ def user_login
210
212
 
211
213
  end
212
214
 
213
- Universe.allow_localstorage = true # to stop data to be stored in localstorage
215
+ # Universe.allow_localstorage = true # to stop data to be stored in localstorage
214
216
  # Universe.allow_sync= false # to stop data to be sync on server
215
217
  touch_allow(false) # this lock the system right click in web view
@@ -19,14 +19,20 @@ class Universe
19
19
  @users = {}
20
20
  @help = {}
21
21
  @example = {}
22
- @allow_localstorage = false
23
- @allow_sync = false
24
- @connected= false
22
+ @allow_localstorage = false # temp storage boolean
23
+ @allow_sync = false # temp server storage sync
24
+ @connected = false
25
25
  @database_ready = false
26
+ @tools = {}
27
+ @allow_tool_operations = false
28
+ @active_tools = []
29
+ @atome_preset = []
26
30
  # @historicize=false
27
31
  class << self
28
- attr_reader :atomes, :atomes_ids, :renderer_list,:molecule_list, :atome_list, :particle_list, :classes, :counter, :atomes_specificities
29
- attr_accessor :connected,:allow_sync, :allow_localstorage, :database_ready
32
+ attr_reader :atomes, :atomes_ids, :renderer_list, :molecule_list, :atome_list, :particle_list, :classes, :counter,
33
+ :atomes_specificities
34
+ attr_accessor :connected, :allow_sync, :allow_localstorage, :database_ready, :edit_mode, :tools,
35
+ :allow_tool_operations, :active_tools, :atome_preset
30
36
 
31
37
  def messages
32
38
  @messages
@@ -150,7 +156,7 @@ class Universe
150
156
  end
151
157
 
152
158
  def app_identity
153
- # each app hav its own identity, this allow to generate new user identities from the
159
+ # each app has its own identity, this allow to generate new user identities from the
154
160
  # unique_id = generate_unique_id_with_timestamp
155
161
  @app_identity = generate_uuid
156
162
  # the identity is define as follow : parentsCreatorID_softwareInstanceID_objetID
@@ -257,18 +263,23 @@ class Universe
257
263
  def historicize(id, operation, element, params)
258
264
 
259
265
  if @allow_sync && Universe.connected
260
- A.sync({ action: :historicize, data: { table: :user } })
266
+ A.sync({ action: :historicize, data: { table: :user } })
261
267
  end
262
-
268
+
263
269
  # if @allow_localstorage && @database_ready
264
270
  if @allow_localstorage
265
-
271
+
266
272
  operation_timing = Time.now.strftime("%Y%m%d%H%M%S%3N") + @increment.to_s
267
273
  @increment += 1
268
274
  @increment = @increment % 100
275
+ # puts "===> { #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }"
276
+ # puts "<==== #{@allow_localstorage} : #{element} ====>"
277
+ if @allow_localstorage.include? element
278
+ JS.global[:localStorage].setItem(operation_timing, "{ #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }")
279
+ @history[@history.length] = { operation_timing => { id => { operation => { element => params } }, sync: false, time: Time.now } }
280
+ puts "===> { #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }"
281
+ end
269
282
 
270
- JS.global[:localStorage].setItem(operation_timing, "{ #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }")
271
- @history[@history.length] = { operation_timing => { id => { operation => { element => params } }, sync: false, time: Time.now } }
272
283
 
273
284
  end
274
285
  end
@@ -13,7 +13,7 @@ class Atome
13
13
  # TODO : remove Essentials.default_params[atome_preset] || {} as it is
14
14
  # applied twice because preset is now a particle
15
15
  preset_params = Essentials.default_params[atome_preset] || {}
16
-
16
+ # preset_params = {preset: atome_preset}
17
17
  basic_params[:type] = preset_params[:type] || :element
18
18
  # basic_params[:aid] = identity_generator(:a)
19
19
  basic_params[:id] = params[:id]|| identity_generator
@@ -37,39 +37,42 @@ class Atome
37
37
  else
38
38
  params[:attach] = params[:attach] || @id || :view
39
39
  end
40
- # # we reorder the hash
41
- reordered_params =reorder_particles(params)
42
- reordered_params
40
+ # we reorder the hash
41
+ reorder_particles(params)
43
42
  end
44
43
 
45
44
  def preset_common(params, &bloc)
45
+
46
46
  ## if an atome with current id exist we update the ID in the params
47
47
  # params[:id] = "#{params[:id]}_#{Universe.atomes.length}" if grab(params[:id])
48
48
  # if Universe.atomes[params[:id]]
49
49
  # alert "atome found : #{ grab(params[:id])}"
50
50
  # grab(params[:id])
51
51
  # else
52
+
52
53
  Atome.new(params, &bloc)
53
54
  # end
54
55
  end
55
56
 
56
- def box(params = {}, &bloc)
57
- atome_preset = :box
58
- params = atome_common(atome_preset, params)
59
- preset_common(params, &bloc)
60
- end
61
57
 
62
- # def intuition(params = {}, &bloc)
63
- # atome_preset = :intuition
58
+
59
+ # def box(params = {}, &bloc)
60
+ # atome_preset = :box
61
+ # params = atome_common(atome_preset, params)
62
+ # preset_common(params, &bloc)
63
+ # end
64
+ #
65
+ # # def intuition(params = {}, &bloc)
66
+ # # atome_preset = :intuition
67
+ # # params = atome_common(atome_preset, params)
68
+ # # preset_common(params, &bloc)
69
+ # # end
70
+ #
71
+ # def circle(params = {}, &bloc)
72
+ # atome_preset = :circle
64
73
  # params = atome_common(atome_preset, params)
65
74
  # preset_common(params, &bloc)
66
75
  # end
67
-
68
- def circle(params = {}, &bloc)
69
- atome_preset = :circle
70
- params = atome_common(atome_preset, params)
71
- preset_common(params, &bloc)
72
- end
73
76
  end
74
77
 
75
78
 
@@ -17,22 +17,22 @@ module Essentials
17
17
  # Warning : type must be define first
18
18
  render_engines: [:html],
19
19
  image: { type: :image, left: 0, top: 0},
20
- matrix: { type: :matrix, left: 0, top: 0, option: {}},
20
+ table: { type: :table, left: 0, top: 0, option: {}},
21
21
  # FIXME : look at build_atome FIXME to resolve default parent attachment problem
22
22
  video: { type: :video },
23
23
  animation: { type: :animation, attach: :black_matter },
24
24
  element: { type: :element, renderers: [], attach: :black_matter },
25
25
  box: { type: :shape, width: 39, height: 39,
26
26
  apply: [:box_color],
27
- left: 0, top: 0, preset: :box },
27
+ left: 0, top: 0 },
28
28
  # intuition: { type: :intuition, width: 39, height: 39,
29
29
  # apply: [:box_color],
30
30
  # left: 0, top: 0, preset: :intuition },
31
31
  vector: { type: :vector, width: 39, height: 39,
32
32
  left: 0, top: 0, preset: :vector, definition: corp },
33
- circle: { type: :shape, width: 39, height: 39, smooth: '100%',
34
- apply: [:circle_color],
35
- left: 0, top: 0, preset: :circle },
33
+ # circle: { type: :shape, width: 39, height: 39, smooth: '100%',
34
+ # apply: [:circle_color],
35
+ # left: 0, top: 0, preset: :circle },
36
36
  shape: { type: :shape, width: 39, height: 39,
37
37
  apply: [:shape_color],
38
38
  left: 0, top: 0 },