atome 0.5.7.3.9 → 0.5.7.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/atome/atome.rb +24 -56
  3. data/lib/atome/extensions/atome.rb +10 -59
  4. data/lib/atome/extensions/sha.rb +7 -7
  5. data/lib/atome/genesis/genesis.rb +0 -89
  6. data/lib/atome/genesis/particles/communication.rb +1 -1
  7. data/lib/atome/genesis/particles/event.rb +0 -8
  8. data/lib/atome/genesis/particles/geometry.rb +0 -1
  9. data/lib/atome/genesis/particles/hierarchy.rb +0 -34
  10. data/lib/atome/genesis/particles/identity.rb +0 -30
  11. data/lib/atome/genesis/particles/material.rb +0 -11
  12. data/lib/atome/genesis/particles/property.rb +14 -16
  13. data/lib/atome/genesis/particles/security.rb +0 -45
  14. data/lib/atome/genesis/particles/utility.rb +17 -185
  15. data/lib/atome/genesis/sparkle.rb +3 -12
  16. data/lib/atome/kernel/black_matter.rb +0 -1
  17. data/lib/atome/kernel/universe.rb +5 -45
  18. data/lib/atome/presets/atome.rb +0 -22
  19. data/lib/atome/version.rb +1 -1
  20. data/lib/molecules/init.rb +0 -14
  21. data/lib/molecules/intuition/tools.rb +3 -22
  22. data/lib/molecules/intuition/utilities.rb +121 -77
  23. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
  24. data/lib/platform_specific/opal/extensions/color.rb +0 -5
  25. data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
  26. data/lib/platform_specific/opal/extensions/ping.rb +11 -20
  27. data/lib/renderers/html/effect.rb +0 -11
  28. data/lib/renderers/html/event.rb +0 -7
  29. data/lib/renderers/html/geometry.rb +0 -31
  30. data/lib/renderers/html/html.rb +13 -134
  31. data/lib/renderers/html/material.rb +0 -22
  32. data/lib/renderers/html/spatial.rb +0 -9
  33. data/lib/renderers/html/utility.rb +5 -8
  34. data/lib/renderers/renderer.rb +0 -1
  35. data/vendor/assets/application/examples/applications.rb +19 -71
  36. data/vendor/assets/application/examples/buttons.rb +5 -4
  37. data/vendor/assets/application/examples/unfasten.rb +15 -9
  38. data/vendor/assets/application/index.rb +1 -1
  39. data/vendor/assets/server/capture.rb +0 -1
  40. data/vendor/assets/server/database.rb +0 -1
  41. data/vendor/assets/server/eDen.rb +5 -80
  42. data/vendor/assets/src/index_server_wasm.html +0 -3
  43. data/vendor/assets/src/index_wasm.html +0 -6
  44. metadata +2 -6
  45. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  46. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  47. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  48. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
@@ -1,27 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # new({ method: :width, type: :integer, renderer: :html }) do |value, _user_proc|
4
- # unit_found = metrics[:width]
5
- # if unit_found
6
- # html.style(:width, "#{value}#{unit_found}")
7
- # elsif value.is_a?(Numeric)
8
- # html.style(:width, "#{value}px")
9
- # else
10
- # html.style(:width, value)
11
- # end
12
- # end
13
- #
14
- # new({ method: :height, renderer: :html, type: :string }) do |value, _user_proc|
15
- # unit_found = metrics,
16
- # [:height]
17
- # if unit_found
18
- # html.style(:height, "#{value}#{unit_found}")
19
- # elsif value.is_a?(Numeric)
20
- # html.style(:height, "#{value}px")
21
- # else
22
- # html.style(:height, value)
23
- # end
24
- # end
25
3
 
26
4
  new({ method: :width, renderer: :html, type: :int }) do |params, _user_proc|
27
5
  unit = @unit[:width] || :px if params.is_a? Numeric
@@ -34,15 +12,6 @@ new({ method: :height, renderer: :html, type: :int }) do |params, _user_proc|
34
12
  end
35
13
 
36
14
 
37
- # new({ method: :size, type: :hash, renderer: :html }) do |value, _user_proc|
38
- # # html.style('fontSize',"#{value}px")
39
- # end
40
- #
41
- #
42
- # new({ method: :size, type: :int, renderer: :html }) do |value, _user_proc|
43
- # # html.style('fontSize', "#{value}px")
44
- # end
45
-
46
15
 
47
16
  new({ method: :size, type: :int, renderer: :html, specific: :text }) do |value, _user_proc|
48
17
  html.style('fontSize', "#{value}px")
@@ -4,10 +4,6 @@
4
4
 
5
5
  class HTML
6
6
 
7
- # def id
8
- # :poil
9
- # end
10
-
11
7
  def self.locate(selector, base_element = JS.global[:document][:body])
12
8
  return base_element if selector.empty?
13
9
 
@@ -16,17 +12,19 @@ class HTML
16
12
  elsif selector.has_key?(:parent)
17
13
  parent = base_element.querySelector("##{selector[:parent]}")
18
14
  return nil if parent.nil?
15
+
19
16
  parent.querySelectorAll("*").to_a
20
17
  elsif selector.has_key?(:html)
21
18
  html_element = selector[:html]
22
19
  return nil if html_element.nil?
20
+
23
21
  html_element.querySelectorAll("*").to_a
24
22
  end
25
23
  end
26
24
 
27
25
  def initialize(id_found, current_atome)
28
26
 
29
- @element ||= JS.global[:document].getElementById(id_found.to_s)
27
+ @element = JS.global[:document].getElementById(id_found.to_s)
30
28
  @id = id_found
31
29
  @original_atome = current_atome
32
30
  @touch_removed = {}
@@ -220,10 +218,7 @@ class HTML
220
218
  end
221
219
 
222
220
  particles_found = particles_found.merge(particles_from_style)
223
- current_atome = grab(@id)
224
221
  usr_bloc.call(particles_found)
225
- # current_atome.callback({ hyperedit: particles_found })
226
- # current_atome.call(:hyperedit)
227
222
 
228
223
  end
229
224
 
@@ -235,16 +230,9 @@ class HTML
235
230
  def connect(params, &bloc)
236
231
  type = params[:type]
237
232
  server = params[:address]
238
- # user=params[:user]
239
- # pass=params[:pass]
240
- # atomes=params[:atomes]
241
- # particles=params[:particles]
242
- # 'atomeJS.connect' is in the communication.js file ( connect: function (type, server, )
243
- JS.eval("atomeJS.connect('#{type}','#{server}')")
244
233
 
245
- # @websocket = JS.new(JS.global.WebSocket.new("#{type}://#{server}"))
234
+ JS.eval("atomeJS.connect('#{type}','#{server}')")
246
235
 
247
- # JS.eval("atomeJS.connect('ws://#{server}')")
248
236
  end
249
237
 
250
238
  def transform_to_string_keys_and_values(hash)
@@ -314,28 +302,6 @@ class HTML
314
302
  JS.global[:document][:body].appendChild(@element)
315
303
  add_class('atome')
316
304
  id(id)
317
- ####
318
-
319
- # editable_pres = JS.global[:document].querySelectorAll('pre[contenteditable="true"]')
320
- # editable_pres_array = Array.new(editable_pres[:length].to_i) { |i| editable_pres.call(:item, i) }
321
- # editable_pres_array.each do |pre|
322
- # pre.addEventListener('input') do
323
- # if pre[:innerText].strip == ''
324
- # pre[:innerHTML] = '​' # Insère un caractère d'espace insécable
325
- # end
326
- # end
327
- # end
328
-
329
- # editable_pres = JS.global[:document].querySelectorAll('pre[contenteditable="true"]')
330
- #
331
- # editable_pres_array = Array.new(editable_pres[:length].to_i) { |i| editable_pres.call(:item, i) }
332
- # editable_pres_array.each do |pre|
333
- # pre.addEventListener('click') do
334
- # pre.focus()
335
- # pre[:style][:caretColor] = 'blue' # Changez la couleur du curseur en bleu
336
- # end
337
- # end
338
- ###
339
305
  self
340
306
  end
341
307
 
@@ -407,8 +373,6 @@ class HTML
407
373
  JS.global[:document][:body].appendChild(@element)
408
374
  add_class('atome')
409
375
  @element.setAttribute('src', 'https://www.youtube.com/embed/lLeQZ8Llkso?si=MMsGBEXELy9yBl9R')
410
- # below we get image to feed width and height if needed
411
- # image = JS.global[:Image].new
412
376
  self.id(id)
413
377
  self
414
378
  end
@@ -439,8 +403,6 @@ class HTML
439
403
  end
440
404
 
441
405
  def svg_data(all_datas)
442
- # we remove previous datas
443
- # @element.innerHTML = ''
444
406
  all_datas.each do |full_data|
445
407
  full_data.each do |type_passed, datas|
446
408
 
@@ -517,7 +479,6 @@ class HTML
517
479
  def path(objet_path)
518
480
  @element.setAttribute('src', objet_path)
519
481
  # below we get image to feed width and height if needed
520
- # image = JS.global[:Image].new
521
482
  @element[:src] = objet_path
522
483
  @element[:onload] = lambda do |_event|
523
484
  @element[:width]
@@ -635,10 +596,6 @@ class HTML
635
596
  self
636
597
  end
637
598
 
638
- # def visible(param)
639
- # @element[:style][:display] = param.to_s
640
- # end
641
-
642
599
  def delete(id_to_delete)
643
600
  element_to_delete = JS.global[:document].getElementById(id_to_delete.to_s)
644
601
  element_to_delete.remove if element_to_delete
@@ -662,7 +619,6 @@ class HTML
662
619
  mql = JS.global[:window].matchMedia(media_query)
663
620
 
664
621
  event_handler = ->(event) do
665
- # bloc.call({ matches: event[:matches] }) if bloc.is_a? Proc
666
622
  proc_content = bloc.call({ matches: event[:matches] }) if event_validation(bloc)
667
623
  if proc_content.instance_of? Hash
668
624
  proc_content.each do |k, v|
@@ -678,7 +634,6 @@ class HTML
678
634
  event_handler = ->(event) do
679
635
  width = JS.global[:window][:innerWidth]
680
636
  height = JS.global[:window][:innerHeight]
681
- # bloc.call({ width: width, height: height }) if bloc.is_a? Proc
682
637
  proc_content = bloc.call({ width: width, height: height }) if event_validation(bloc)
683
638
  if proc_content.instance_of? Hash
684
639
  proc_content.each do |k, v|
@@ -687,18 +642,9 @@ class HTML
687
642
  end
688
643
  end
689
644
 
690
- # proc_content = @drag_move.call(event) if event_validation(@drag_move)
691
- # if proc_content.instance_of? Hash
692
- # proc_content.each do |k, v|
693
- # @original_atome.send(k, v)
694
- # end
695
- # end
696
- # puts event_handler.class
697
645
  JS.global[:window].addEventListener('resize', event_handler)
698
- # JS.global[:window].addEventListener('resize', event_handler)
699
646
  else
700
647
  event_handler = ->(event) do
701
- # bloc.call(event) if bloc.is_a? Proc
702
648
  proc_content = bloc.call(event) if event_validation(bloc)
703
649
  if proc_content.instance_of? Hash
704
650
  proc_content.each do |k, v|
@@ -719,7 +665,6 @@ class HTML
719
665
  # we use .call instead of instance_eval because instance_eval bring the current object as context
720
666
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
721
667
  # group etc..
722
- # @keyboard_press.call(event) if @keyboard_press.is_a?(Proc)
723
668
  proc_content = @keyboard_press.call(event) if event_validation(@keyboard_press)
724
669
  if proc_content.instance_of? Hash
725
670
  proc_content.each do |k, v|
@@ -737,7 +682,6 @@ class HTML
737
682
  # we use .call instead of instance_eval because instance_eval bring the current object as context
738
683
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
739
684
  # group etc..
740
- # @keyboard_down.call(event) if @keyboard_down.is_a?(Proc)
741
685
  proc_content = @keyboard_down.call(event) if event_validation(@keyboard_down)
742
686
  if proc_content.instance_of? Hash
743
687
  proc_content.each do |k, v|
@@ -755,7 +699,6 @@ class HTML
755
699
  # we use .call instead of instance_eval because instance_eval bring the current object as context
756
700
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
757
701
  # group etc..
758
- # @keyboard_up.call(event) if @keyboard_up.is_a?(Proc)
759
702
  proc_content = @keyboard_up.call(event) if event_validation(@keyboard_up)
760
703
  if proc_content.instance_of? Hash
761
704
  proc_content.each do |k, v|
@@ -830,7 +773,6 @@ class HTML
830
773
  # we use .call instead of instance_eval because instance_eval bring the current object as context
831
774
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
832
775
  # group etc..
833
- # @drag_start.call(event) if event_validation(@drag_start)
834
776
  proc_content = @drag_start.call(event) if event_validation(@drag_start)
835
777
  if proc_content.instance_of? Hash
836
778
  proc_content.each do |k, v|
@@ -848,7 +790,6 @@ class HTML
848
790
  # we use .call instead of instance_eval because instance_eval bring the current object as context
849
791
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
850
792
  # group etc..
851
- # @drag_end.call(event) if event_validation(@drag_end)
852
793
  proc_content = @drag_end.call(event) if event_validation(@drag_end)
853
794
  if proc_content.instance_of? Hash
854
795
  proc_content.each do |k, v|
@@ -877,7 +818,6 @@ class HTML
877
818
  # we use .call instead of instance_eval because instance_eval bring the current object as context
878
819
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
879
820
  # group etc..
880
- # @drag_move.call(event) if event_validation(@drag_move)
881
821
  proc_content = @drag_move.call(event) if event_validation(@drag_move)
882
822
  if proc_content.instance_of? Hash
883
823
  proc_content.each do |k, v|
@@ -947,7 +887,6 @@ class HTML
947
887
  # we use .call instead of instance_eval because instance_eval bring the current object as context
948
888
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
949
889
  # group etc..
950
- # @drag_move.call(event) if event_validation(@drag_move)
951
890
  proc_content = @drag_move.call(event) if event_validation(@drag_move)
952
891
  if proc_content.instance_of? Hash
953
892
  proc_content.each do |k, v|
@@ -980,7 +919,6 @@ class HTML
980
919
  # we use .call instead of instance_eval because instance_eval bring the current object as context
981
920
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
982
921
  # group etc..
983
- # @drag_lock.call(event) if event_validation(@drag_lock)
984
922
  proc_content = @drag_lock.call(event) if event_validation(@drag_lock)
985
923
  if proc_content.instance_of? Hash
986
924
  proc_content.each do |k, v|
@@ -997,7 +935,6 @@ class HTML
997
935
  # we use .call instead of instance_eval because instance_eval bring the current object as context
998
936
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
999
937
  # group etc..
1000
- # bloc.call({ source: draggable_element, destination: dropzone_element }) if event_validation(bloc)
1001
938
  proc_content = bloc.call({ source: draggable_element, destination: dropzone_element }) if event_validation(bloc)
1002
939
  if proc_content.instance_of? Hash
1003
940
  proc_content.each do |k, v|
@@ -1014,16 +951,7 @@ class HTML
1014
951
  accept: nil, # Accept any element
1015
952
  overlap: 0.75,
1016
953
  ondropactivate: lambda do |native_event|
1017
- event = Native(native_event)
1018
-
1019
954
  drop_action(native_event, @drop_activate) if event_validation(@drop_activate)
1020
- # @drag_lock.call(event) if event_validation(@drag_lock)
1021
- # proc_content = @drop_activate.call(event) if event_validation(@drop_activate)
1022
- # if proc_content.instance_of? Hash
1023
- # proc_content.each do |k, v|
1024
- # @original_atome.send(k, v)
1025
- # end
1026
- # end
1027
955
  end
1028
956
  })
1029
957
  end
@@ -1033,7 +961,6 @@ class HTML
1033
961
  @drop_deactivate = @original_atome.instance_variable_get('@drop_code')[:deactivate]
1034
962
  interact.dropzone({
1035
963
  # accept: nil, # Accept any element
1036
- # overlap: 0.75,
1037
964
  # FIXME : remove because os an opal bug since 1.8 reactivate when opal will be debbuged
1038
965
  ondropdeactivate: lambda do |native_event|
1039
966
  drop_action(native_event, @drop_deactivate) if event_validation(@drop_deactivate)
@@ -1060,7 +987,6 @@ class HTML
1060
987
  @drop_enter = @original_atome.instance_variable_get('@drop_code')[:enter]
1061
988
 
1062
989
  interact.dropzone({
1063
- # accept: nil,
1064
990
  overlap: 0.001,
1065
991
  # FIXME : remove because os an opal bug since 1.8 reactivate when opal will be debbuged
1066
992
  ondragenter: lambda do |native_event|
@@ -1074,8 +1000,6 @@ class HTML
1074
1000
  @drop_leave = @original_atome.instance_variable_get('@drop_code')[:leave]
1075
1001
 
1076
1002
  interact.dropzone({
1077
- # accept: nil,
1078
- # overlap: 0.75,
1079
1003
  # FIXME : remove because os an opal bug since 1.8 reactivate when opal will be debbuged
1080
1004
  ondragleave: lambda do |native_event|
1081
1005
  drop_action(native_event, @drop_leave) if event_validation(@drop_enter)
@@ -1098,7 +1022,6 @@ class HTML
1098
1022
  @drop_leave = ''
1099
1023
  else
1100
1024
  # to remove all interact event ( touch, drag, scale, ... uncomment below)
1101
- # interact = JS.eval("return interact('##{@id}')")
1102
1025
  # interact.unset
1103
1026
  @drop_activate = ''
1104
1027
  @drop_deactivate = ''
@@ -1165,7 +1088,6 @@ class HTML
1165
1088
  style(:overflow, params)
1166
1089
  @overflow = @original_atome.instance_variable_get('@overflow_code')[:overflow]
1167
1090
  @element.addEventListener('scroll', lambda do |native_event|
1168
- # event = Native(native_event)
1169
1091
  scroll_top = @element[:scrollTop].to_i
1170
1092
  scroll_left = @element[:scrollLeft].to_i
1171
1093
  # we use .call instead of instance_eval because instance_eval bring the current object as context
@@ -1191,7 +1113,6 @@ class HTML
1191
1113
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1192
1114
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1193
1115
  # group etc..
1194
- # @over_over.call(event) if event_validation(@over_over)
1195
1116
 
1196
1117
  proc_content = @over_over.call(event) if event_validation(@over_over)
1197
1118
  if proc_content.instance_of? Hash
@@ -1210,7 +1131,6 @@ class HTML
1210
1131
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1211
1132
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1212
1133
  # group etc..
1213
- # @over_enter.call(event) if event_validation(@over_enter)
1214
1134
  proc_content = @over_enter.call(event) if event_validation(@over_enter)
1215
1135
  if proc_content.instance_of? Hash
1216
1136
  proc_content.each do |k, v|
@@ -1232,7 +1152,6 @@ class HTML
1232
1152
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1233
1153
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1234
1154
  # group etc..
1235
- # @over_leave.call(event) if event_validation(@over_leave)
1236
1155
  proc_content = @over_leave.call(event) if event_validation(@over_leave)
1237
1156
  if proc_content.instance_of? Hash
1238
1157
  proc_content.each do |k, v|
@@ -1284,8 +1203,6 @@ class HTML
1284
1203
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1285
1204
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1286
1205
  # group etc..
1287
- # @touch_down.call(event) if @touch_down.is_a?(Proc) && (!Universe.edit_mode || @original_atome.tag[:system])
1288
- # @touch_down.call(event) if event_validation(@touch_down)
1289
1206
  proc_content = @touch_down.call(event) if event_validation(@touch_down)
1290
1207
  if proc_content.instance_of? Hash
1291
1208
  proc_content.each do |k, v|
@@ -1308,11 +1225,6 @@ class HTML
1308
1225
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1309
1226
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1310
1227
  # group etc..
1311
- # @touch_up.call(event) if @touch_up.is_a?(Proc) && (!Universe.edit_mode || @original_atome.tag[:system])
1312
- # event = Native(native_event)
1313
- # ########## old code :
1314
- # @touch_tap.call(event) if event_validation(@touch_tap)
1315
- # ########## new code:
1316
1228
  proc_content = @touch_tap.call(event) if event_validation(@touch_tap)
1317
1229
  if proc_content.instance_of? Hash
1318
1230
  proc_content.each do |k, v|
@@ -1334,8 +1246,6 @@ class HTML
1334
1246
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1335
1247
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1336
1248
  # group etc..
1337
- # @touch_up.call(event) if @touch_up.is_a?(Proc) && (!Universe.edit_mode || @original_atome.tag[:system])
1338
- # @touch_up.call(event) if event_validation(@touch_up)
1339
1249
  proc_content = @touch_up.call(event) if event_validation(@touch_up)
1340
1250
  if proc_content.instance_of? Hash
1341
1251
  proc_content.each do |k, v|
@@ -1355,15 +1265,12 @@ class HTML
1355
1265
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1356
1266
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1357
1267
  # group etc..
1358
- # @touch_double.call(event) if @touch_double.is_a?(Proc) && (!Universe.edit_mode || @original_atome.tag[:system])
1359
- # @touch_double.call(event) if event_validation(@touch_double)
1360
1268
  proc_content = @touch_double.call(event) if event_validation(@touch_double)
1361
1269
  if proc_content.instance_of? Hash
1362
1270
  proc_content.each do |k, v|
1363
1271
  @original_atome.send(k, v)
1364
1272
  end
1365
1273
  end
1366
- # end
1367
1274
  end
1368
1275
 
1369
1276
  end
@@ -1378,18 +1285,13 @@ class HTML
1378
1285
  # we use .call instead of instance_eval because instance_eval bring the current object as context
1379
1286
  # and it's lead to a problem of context and force the use of grab(:view) when suing atome method such as shape ,
1380
1287
  # group etc..
1381
- # @touch_long.call(event) if event_validation(@touch_long)
1382
1288
  proc_content = @touch_long.call(event) if event_validation(@touch_long)
1383
1289
  if proc_content.instance_of? Hash
1384
1290
  proc_content.each do |k, v|
1385
1291
  @original_atome.send(k, v)
1386
1292
  end
1387
1293
  end
1388
- # @touch_long.call(event) if @touch_long.is_a?(Proc) && (!Universe.edit_mode || @original_atome.tag[:system])
1389
- # @touch_double.call(event) if event_validation(@touch_double)
1390
-
1391
1294
  end
1392
- # end
1393
1295
  end
1394
1296
 
1395
1297
  def touch_remove(option)
@@ -1419,20 +1321,12 @@ class HTML
1419
1321
  @touch_removed[:up] = true
1420
1322
  @touch_up = ''
1421
1323
  else
1422
- # interact = JS.eval("return interact('##{@id}')")
1423
- # interact.unset
1424
1324
  touch_remove(:double)
1425
1325
  touch_remove(:down)
1426
1326
  touch_remove(:long)
1427
1327
  touch_remove(:tap)
1428
1328
  touch_remove(:touch)
1429
1329
  touch_remove(:up)
1430
-
1431
- # @element.removeEventListener('touchstart', onTouchStart);
1432
- # @element.removeEventListener('touchmove', onTouchMove);
1433
- # @element.removeEventListener('touchend', onTouchEnd);
1434
- # console.log("Touch events removed");
1435
- # @original_atome.instance_variable_set('@touch_code', nil)
1436
1330
  end
1437
1331
 
1438
1332
  end
@@ -1529,7 +1423,7 @@ class HTML
1529
1423
 
1530
1424
  table_html.appendChild(thead)
1531
1425
  tbody = JS.global[:document].createElement('tbody')
1532
- data.each_with_index do |row, row_index|
1426
+ data.each_with_index do |row, _row_index|
1533
1427
  tr = JS.global[:document].createElement('tr')
1534
1428
 
1535
1429
  max_length.times do |cell_index|
@@ -1608,21 +1502,7 @@ class HTML
1608
1502
  def set_td_style(td)
1609
1503
  cell_height = @original_atome.component[:height]
1610
1504
  cell_width = @original_atome.component[:width]
1611
- # shadow_found = @original_atome.component[:shadow]
1612
- # if shadow_found
1613
- # red = shadow_found[:red] * 255
1614
- # green = shadow_found[:green] * 255
1615
- # blue = shadow_found[:blue] * 255
1616
- # alpha = shadow_found[:alpha]
1617
- # left = shadow_found[:left]
1618
- # top = shadow_found[:top]
1619
- # blur = shadow_found[:blur] # new correct behavior all atome's value should now be get using :value,here to resolve conflict with blur and back blur
1620
- # inset = :inset if shadow_found[:invert]
1621
- # shadow_created = "#{left}px #{top}px #{blur}px rgba(#{red}, #{green}, #{blue}, #{alpha}) #{inset}"
1622
- # end
1623
- # td[:style][:border] = '1px solid black'
1624
1505
  td[:style][:backgroundColor] = 'white'
1625
- # td[:style][:boxShadow] = shadow_created
1626
1506
  td[:style][:width] = "#{cell_width}px"
1627
1507
  td[:style]['min-width'] = "#{cell_width}px"
1628
1508
  td[:style]['max-width'] = "#{cell_height}px"
@@ -1704,9 +1584,7 @@ class HTML
1704
1584
  end
1705
1585
  rows = table_element.querySelectorAll('tr').to_a
1706
1586
  rows.each_with_index do |row, index|
1707
- if index == 0
1708
- # case1
1709
- else
1587
+ unless index == 0
1710
1588
  new_cell = JS.global[:document].createElement('td')
1711
1589
  new_cell[:innerText] = ''
1712
1590
  set_td_style(new_cell)
@@ -1740,7 +1618,6 @@ class HTML
1740
1618
  end
1741
1619
 
1742
1620
  def remove(params)
1743
- # puts "remove => #{params}"
1744
1621
  # TODO: FIXME: "html : must create a case here #{params} (#{@original_atome.id})"
1745
1622
  case params
1746
1623
  when Hash
@@ -1759,7 +1636,7 @@ class HTML
1759
1636
 
1760
1637
  if row_index >= rows.length
1761
1638
  puts "row not found : #{row_index}"
1762
- return
1639
+ true
1763
1640
  end
1764
1641
  row_to_remove = rows[row_index]
1765
1642
 
@@ -1774,7 +1651,7 @@ class HTML
1774
1651
 
1775
1652
  if table_element.nil?
1776
1653
  puts 'Table not found'
1777
- return
1654
+ true
1778
1655
  end
1779
1656
 
1780
1657
  rows = table_element.querySelectorAll('tbody tr').to_a
@@ -1789,13 +1666,14 @@ class HTML
1789
1666
  case v
1790
1667
  when :paint
1791
1668
  style(:background, 'none')
1792
- # style('box-shadow', 'none')
1793
- # style('text-shadow', 'none')
1794
1669
  when :color
1670
+ #
1795
1671
  when :shadow
1796
1672
  style('box-shadow', 'none')
1797
1673
  style('text-shadow', 'none')
1798
1674
  style("filter", 'none')
1675
+ else
1676
+ #
1799
1677
  end
1800
1678
  end
1801
1679
  end
@@ -1813,13 +1691,14 @@ class HTML
1813
1691
 
1814
1692
  def table_remove(params)
1815
1693
  if params[:row]
1694
+ #
1816
1695
  elsif params[:column]
1696
+ #
1817
1697
  end
1818
1698
  end
1819
1699
 
1820
1700
  # atomisation!
1821
1701
  def atomized(html_object)
1822
- # html_object = html_object[0] if html_object.instance_of? Array
1823
1702
  @element = html_object
1824
1703
  end
1825
1704
 
@@ -6,11 +6,6 @@ end
6
6
 
7
7
  new({ method: :gradient, renderer: :html, type: :hash })
8
8
 
9
- # new({ method: :remove, renderer: :html, type: :hash }) do |params|
10
- # # alert "===> #{params}"
11
- # # html.table_remove(params)
12
- # html.remove(params)
13
- # end
14
9
 
15
10
  new({ method: :remove, renderer: :html, type: :string }) do |object_id_to_remove, bloc|
16
11
 
@@ -64,23 +59,6 @@ new({ method: :remove, renderer: :html, type: :string }) do |object_id_to_remove
64
59
  end
65
60
  end
66
61
 
67
- # new({ method: :border, type: :hash, renderer: :html }) do |value, _user_proc|
68
- # thickness = value[:thickness] || 5
69
- # type = value[:pattern] || :solid
70
- #
71
- # if value[:color].instance_of? Atome
72
- # color_found = value[:color]
73
- # else
74
- # color_found = grab('black_matter').color(value[:color])
75
- # end
76
- #
77
- # red = color_found.red * 255
78
- # green = color_found.green * 255
79
- # blue = color_found.blue * 255
80
- # alpha = color_found.alpha
81
- #
82
- # html.style(:border, "#{type} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
83
- # end
84
62
  new({ method: :thickness, type: :integer, renderer: :html })
85
63
 
86
64
  # end
@@ -26,15 +26,6 @@ new({ method: :top, type: :integer, renderer: :html, specific: :shadow }) do
26
26
  affect(affect)
27
27
  end
28
28
 
29
- # new({ method: :top, type: :integer, renderer: :html, specific: :text }) do |params|
30
- # unit = @unit[:left] || :px
31
- # html.style(:top, "#{params}#{unit}"
32
- # end
33
- #
34
- # new({ method: :bottom, type: :integer, renderer: :html, specific: :text }) do |params|
35
- # html.style(:bottom, "#{params}#{unit}")
36
- # end
37
-
38
29
  new({ method: :left, type: :integer, specific: :color, renderer: :html })
39
30
 
40
31
  new({ method: :left, type: :integer, renderer: :html, specific: :shadow }) do
@@ -106,20 +106,17 @@ new({ method: :compute, type: :hash, renderer: :html }) do |params|
106
106
  end
107
107
 
108
108
  new({ renderer: :html, method: :preview }) do |params, user_proc|
109
- if params[:id]
110
- id_f = params[:id]
111
- else
112
- id_f = identity_generator
113
- end
109
+ id_f = params[:id] || identity_generator
114
110
  if params[:stop]
115
111
  html.stop_video_preview(id_f)
116
112
  else
117
113
 
118
- if params[:media] == :video
114
+ case params[:media]
115
+ when :video
119
116
  html.video_preview(id_f, true, false)
120
- elsif params[:media] == :audio
117
+ when :audio
121
118
  html.video_preview(id_f, false, true)
122
- elsif params[:media] == :all
119
+ when :all
123
120
  html.video_preview(id_f, true, true)
124
121
  else
125
122
  html.video_preview(id_f, true, true)
@@ -3,7 +3,6 @@
3
3
  # Rendering method here
4
4
  class Atome
5
5
  # private
6
-
7
6
  def render(element, params, &user_proc)
8
7
 
9
8
  render_engines = @renderers || []