glimmer-dsl-opal 0.9.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +366 -161
  5. data/VERSION +1 -1
  6. data/lib/display.rb +1 -1
  7. data/lib/glimmer-dsl-opal.rb +8 -4
  8. data/lib/glimmer-dsl-opal/ext/file.rb +1 -1
  9. data/lib/glimmer-dsl-opal/ext/glimmer/dsl/engine.rb +28 -8
  10. data/lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_repository.rb +4 -4
  11. data/lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe.rb +2 -2
  12. data/lib/glimmer-dsl-opal/samples/hello/hello_browser.rb +1 -1
  13. data/lib/glimmer-dsl-opal/samples/hello/hello_button.rb +1 -1
  14. data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb +1 -1
  15. data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb +1 -1
  16. data/lib/glimmer-dsl-opal/samples/hello/hello_combo.rb +1 -1
  17. data/lib/glimmer-dsl-opal/samples/hello/hello_computed.rb +1 -1
  18. data/lib/glimmer-dsl-opal/samples/hello/hello_computed/contact.rb +21 -0
  19. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +1 -1
  20. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb +1 -1
  21. data/lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb +1 -1
  22. data/lib/glimmer-dsl-opal/samples/hello/hello_dialog.rb +78 -0
  23. data/lib/glimmer-dsl-opal/samples/hello/hello_group.rb +1 -1
  24. data/lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb +1 -1
  25. data/lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb +1 -1
  26. data/lib/glimmer-dsl-opal/samples/hello/hello_menu_bar.rb +1 -1
  27. data/lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb +1 -1
  28. data/lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb +1 -1
  29. data/lib/glimmer-dsl-opal/samples/hello/hello_radio.rb +1 -1
  30. data/lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb +1 -1
  31. data/lib/glimmer-dsl-opal/samples/hello/hello_tab.rb +1 -1
  32. data/lib/glimmer-dsl-opal/samples/hello/hello_table.rb +1 -1
  33. data/lib/glimmer-dsl-opal/samples/hello/hello_world.rb +4 -4
  34. data/lib/glimmer-dsl-swt.rb +1 -1
  35. data/lib/glimmer/config/opal_logger.rb +16 -0
  36. data/lib/glimmer/dsl/opal/async_exec_expression.rb +1 -1
  37. data/lib/glimmer/dsl/opal/block_property_expression.rb +1 -1
  38. data/lib/glimmer/dsl/opal/checkbox_group_selection_data_binding_expression.rb +1 -1
  39. data/lib/glimmer/dsl/opal/color_expression.rb +1 -1
  40. data/lib/glimmer/dsl/opal/custom_widget_expression.rb +1 -1
  41. data/lib/glimmer/dsl/opal/dialog_expression.rb +20 -0
  42. data/lib/glimmer/dsl/opal/display_expression.rb +1 -1
  43. data/lib/glimmer/dsl/opal/dsl.rb +1 -1
  44. data/lib/glimmer/dsl/opal/exec_expression.rb +1 -1
  45. data/lib/glimmer/dsl/opal/font_expression.rb +1 -1
  46. data/lib/glimmer/dsl/opal/menu_bar_expression.rb +1 -1
  47. data/lib/glimmer/dsl/opal/menu_expression.rb +1 -1
  48. data/lib/glimmer/dsl/opal/message_box_expression.rb +1 -1
  49. data/lib/glimmer/dsl/opal/radio_group_selection_data_binding_expression.rb +1 -1
  50. data/lib/glimmer/dsl/opal/rgb_expression.rb +1 -1
  51. data/lib/glimmer/dsl/opal/rgba_expression.rb +1 -1
  52. data/lib/glimmer/dsl/opal/swt_expression.rb +4 -4
  53. data/lib/glimmer/dsl/opal/sync_exec_expression.rb +1 -1
  54. data/lib/glimmer/swt.rb +1 -1
  55. data/lib/glimmer/swt/color_proxy.rb +1 -1
  56. data/lib/glimmer/swt/composite_proxy.rb +16 -2
  57. data/lib/glimmer/swt/control_editor.rb +1 -1
  58. data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
  59. data/lib/glimmer/swt/custom/radio_group.rb +1 -1
  60. data/lib/glimmer/swt/dialog_proxy.rb +191 -0
  61. data/lib/glimmer/swt/display_proxy.rb +34 -5
  62. data/lib/glimmer/swt/font_proxy.rb +1 -1
  63. data/lib/glimmer/swt/grid_layout_proxy.rb +11 -16
  64. data/lib/glimmer/swt/label_proxy.rb +22 -1
  65. data/lib/{glimmer-dsl-opal/ext/struct.rb → glimmer/swt/latest_dialog_proxy.rb} +19 -12
  66. data/lib/glimmer/swt/latest_message_box_proxy.rb +25 -1
  67. data/lib/glimmer/swt/latest_shell_proxy.rb +59 -0
  68. data/lib/glimmer/swt/layout_data_proxy.rb +4 -0
  69. data/lib/glimmer/swt/layout_proxy.rb +9 -6
  70. data/lib/glimmer/swt/make_shift_shell_proxy.rb +1 -1
  71. data/lib/glimmer/swt/menu_item_proxy.rb +1 -1
  72. data/lib/glimmer/swt/menu_proxy.rb +3 -3
  73. data/lib/glimmer/swt/message_box_proxy.rb +45 -16
  74. data/lib/glimmer/swt/row_layout_proxy.rb +24 -6
  75. data/lib/glimmer/swt/shell_proxy.rb +43 -9
  76. data/lib/glimmer/swt/style_constantizable.rb +1 -1
  77. data/lib/glimmer/swt/swt_proxy.rb +1 -1
  78. data/lib/glimmer/swt/tab_folder_proxy.rb +1 -1
  79. data/lib/glimmer/swt/table_editor.rb +1 -1
  80. data/lib/glimmer/swt/table_item_proxy.rb +1 -1
  81. data/lib/glimmer/swt/table_proxy.rb +1 -1
  82. data/lib/glimmer/swt/widget_proxy.rb +50 -17
  83. data/lib/glimmer/ui/custom_shell.rb +1 -1
  84. data/lib/glimmer/ui/custom_widget.rb +1 -1
  85. data/lib/glimmer/util/proc_tracker.rb +15 -6
  86. data/lib/net/http.rb +30 -2
  87. data/lib/os.rb +1 -1
  88. metadata +30 -5
@@ -14,6 +14,16 @@ module Glimmer
14
14
  .row-layout-pack-false {
15
15
  align-items: stretch;
16
16
  }
17
+
18
+ .row-layout-center.row-layout-horizontal > * {
19
+ margin-top: auto;
20
+ margin-bottom: auto;
21
+ }
22
+
23
+ .row-layout-center.row-layout-vertical > * {
24
+ margin-left: auto;
25
+ margin-right: auto;
26
+ }
17
27
 
18
28
  .row-layout-horizontal {
19
29
  flex-direction: row;
@@ -32,13 +42,11 @@ module Glimmer
32
42
  }
33
43
  CSS
34
44
 
35
- attr_reader :type, :margin_width, :margin_height, :margin_top, :margin_right, :margin_bottom, :margin_left, :spacing, :pack
36
-
45
+ attr_reader :type, :margin_width, :margin_height, :margin_top, :margin_right, :margin_bottom, :margin_left, :spacing, :pack, :center
46
+
37
47
  def initialize(parent, args)
38
48
  super(parent, args)
39
- @type = @args.first || :horizontal
40
- @marign_width = 15
41
- @margin_height = 15
49
+ @type = args.first || :horizontal
42
50
  self.pack = true
43
51
  @parent.dom_element.add_class('row-layout')
44
52
  @parent.dom_element.add_class(horizontal? ? 'row-layout-horizontal' : 'row-layout-vertical')
@@ -67,6 +75,16 @@ module Glimmer
67
75
  end
68
76
  end
69
77
 
78
+ def center=(center_value)
79
+ @center = center_value
80
+ # Using padding for width since margin-right isn't getting respected with width 100%
81
+ if @center
82
+ parent.dom_element.add_class("row-layout-center")
83
+ else
84
+ parent.dom_element.remove_class("row-layout-center")
85
+ end
86
+ end
87
+
70
88
  def margin_width=(pixels)
71
89
  @margin_width = pixels
72
90
  # Using padding for width since margin-right isn't getting respected with width 100%
@@ -101,7 +119,7 @@ module Glimmer
101
119
  @margin_left = pixels
102
120
  @parent.dom_element.css('padding-left', @margin_left)
103
121
  end
104
-
122
+
105
123
  def spacing=(spacing)
106
124
  @spacing = spacing.to_i
107
125
  # TODO implement changes to accomodate layout_data in the future
@@ -24,6 +24,17 @@ module Glimmer
24
24
  width: 100%;
25
25
  height: 100%;
26
26
  }
27
+ .shell .dialog-overlay {
28
+ position: fixed;
29
+ z-index: 10;
30
+ padding-top: 100px;
31
+ left: 0;
32
+ top: 0;
33
+ width: 100%;
34
+ height: 100%;
35
+ overflow: auto;
36
+ background-color: rgba(0,0,0,0.4);
37
+ }
27
38
  CSS
28
39
 
29
40
  # TODO consider renaming to ShellProxy to match SWT API
@@ -36,9 +47,7 @@ module Glimmer
36
47
  def initialize(args)
37
48
  @args = args
38
49
  @children = []
39
- # TODO consider the implication of emptying the body
40
- Document.find('body').empty unless ENV['RUBY_ENV'] == 'test'
41
- render
50
+ render # TODO attach to specific element
42
51
  @layout = FillLayoutProxy.new(self, [])
43
52
  @layout.margin_width = 0
44
53
  @layout.margin_height = 0
@@ -84,7 +93,7 @@ module Glimmer
84
93
  def dom
85
94
  i = 0
86
95
  body_id = id
87
- body_class = ([name] + css_classes.to_a).join(' ')
96
+ body_class = ([name, 'hide'] + css_classes.to_a).join(' ')
88
97
  @dom ||= html {
89
98
  div(id: body_id, class: body_class) {
90
99
  # TODO consider supporting the idea of dynamic CSS building on close of shell that adds only as much CSS as needed for widgets that were mentioned
@@ -98,15 +107,40 @@ module Glimmer
98
107
  }
99
108
  end
100
109
  end
101
- ''
110
+ div(class: 'dialog-overlay hide') {
111
+ }
102
112
  }
103
113
  }.to_s
104
114
  end
105
115
 
106
- def open
107
- # TODO consider the idea of delaying rendering till the open method
108
- # TODO make it start as hidden and show shell upon open
109
- # DisplayProxy.instance.shells << self
116
+ def open(async: true)
117
+ work = lambda do
118
+ unless @open
119
+ DisplayProxy.instance.shells.select(&:open?).reject {|s| s == self}.map(&:hide)
120
+ dom_element.remove_class('hide')
121
+ @open = true
122
+ end
123
+ end
124
+ if async
125
+ DisplayProxy.instance.async_exec(&work)
126
+ else
127
+ work.call
128
+ end
129
+ end
130
+
131
+ def hide
132
+ dom_element.add_class('hide')
133
+ @open = false
134
+ end
135
+
136
+ def close
137
+ DisplayProxy.instance.shells.delete(self)
138
+ dom_element.remove
139
+ @open = false
140
+ end
141
+
142
+ def open?
143
+ @open
110
144
  end
111
145
  end
112
146
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -77,15 +77,20 @@ module Glimmer
77
77
  def underscored_widget_name(widget_proxy)
78
78
  widget_proxy.class.name.split(/::|\./).last.sub(/Proxy$/, '').underscore
79
79
  end
80
+
81
+ def widget_handling_listener
82
+ @@widget_handling_listener
83
+ end
80
84
  end
81
85
 
82
86
  DEFAULT_INITIALIZERS = {
87
+ # TODO remove if built in class initializer is taking care of this
83
88
  composite: lambda do |composite_proxy|
84
- if composite_proxy.layout.nil?
85
- layout = GridLayoutProxy.new(composite_proxy, [])
86
- composite_proxy.layout = layout
87
- layout.margin_width = 15
88
- layout.margin_height = 15
89
+ if composite_proxy.get_layout.nil?
90
+ the_layout = GridLayoutProxy.new(composite_proxy, [])
91
+ composite_proxy.layout = the_layout
92
+ the_layout.margin_width = 15
93
+ the_layout.margin_height = 15
89
94
  end
90
95
  end,
91
96
  # scrolled_composite: lambda do |scrolled_composite|
@@ -100,7 +105,7 @@ module Glimmer
100
105
  table_column_proxy.width = 80
101
106
  end,
102
107
  # group: lambda do |group_proxy|
103
- # group_proxy.layout = GridLayoutProxy.new(group_proxy, []) if group.layout.nil?
108
+ # group_proxy.layout = GridLayoutProxy.new(group_proxy, []) if group.get_layout.nil?
104
109
  # end,
105
110
  }
106
111
 
@@ -135,8 +140,8 @@ module Glimmer
135
140
  dom_element.css('position', 'relative')
136
141
  menu&.render
137
142
  menu.dom_element.css('position', 'absolute')
138
- menu.dom_element.css('left', mouse_event.x - parent.layout&.margin_width.to_i) # TODO - parent.layout&.margin_left.to_i)
139
- menu.dom_element.css('top', mouse_event.y - parent.layout&.margin_height.to_i - 5) # TODO - parent.layout&.margin_top.to_i)
143
+ menu.dom_element.css('left', mouse_event.x - parent.get_layout&.margin_width.to_i) # TODO - parent.get_layout&.margin_left.to_i)
144
+ menu.dom_element.css('top', mouse_event.y - parent.get_layout&.margin_height.to_i - 5) # TODO - parent.get_layout&.margin_top.to_i)
140
145
  @menu_requested = false
141
146
  end
142
147
  }
@@ -186,18 +191,31 @@ module Glimmer
186
191
  def path
187
192
  "#{parent_path} #{element}##{id}.#{name}"
188
193
  end
194
+ alias widget_path path # pure path without subchildren modifications
189
195
 
190
196
  # Root element representing widget. Must be overridden by subclasses if different from div
191
197
  def element
192
198
  'div'
193
199
  end
194
200
 
195
- def pack(*args)
196
- # No Op (just a shim) TODO consider if it should be implemented
201
+ def shell
202
+ current_widget = self
203
+ current_widget = current_widget.parent until current_widget.parent.nil?
204
+ current_widget
197
205
  end
198
206
 
199
- def layout(*args)
200
- # No Op (just a shim) TODO consider if it should be implemented
207
+ def parents
208
+ parents_array = []
209
+ current_widget = self
210
+ until current_widget.parent.nil?
211
+ current_widget = current_widget.parent
212
+ parents_array << current_widget
213
+ end
214
+ parents_array
215
+ end
216
+
217
+ def dialog_ancestor
218
+ parents.detect {|p| p.is_a?(DialogProxy)}
201
219
  end
202
220
 
203
221
  def enabled=(value)
@@ -236,7 +254,7 @@ module Glimmer
236
254
  alias setFocus set_focus
237
255
 
238
256
  def parent_path
239
- @parent.path
257
+ @parent&.path
240
258
  end
241
259
 
242
260
  def parent_dom_element
@@ -252,7 +270,6 @@ module Glimmer
252
270
  the_parent_dom_element.append(@dom) # TODO make a method attach to allow subclasses to override if needed
253
271
  else
254
272
  old_element.replace_with(@dom)
255
- old_element.replace_with(@dom)
256
273
  end
257
274
  observation_requests&.each do |keyword, event_listener_set|
258
275
  event_listener_set.each do |event_listener|
@@ -287,7 +304,7 @@ module Glimmer
287
304
  # TODO consider passing parent element instead and having table item include a table cell widget only for opal
288
305
  @dom = nil
289
306
  @dom = dom
290
- @dom = @parent.layout.dom(@dom) if @parent.respond_to?(:layout) && @parent.layout
307
+ @dom = @parent.get_layout.dom(@dom) if @parent.respond_to?(:layout) && @parent.get_layout
291
308
  @dom
292
309
  end
293
310
 
@@ -633,6 +650,18 @@ module Glimmer
633
650
  @event_listener_proxies ||= []
634
651
  end
635
652
 
653
+ def suspend_event_handling
654
+ @event_handling_suspended = true
655
+ end
656
+
657
+ def resume_event_handling
658
+ @event_handling_suspended = false
659
+ end
660
+
661
+ def event_handling_suspended?
662
+ @event_handling_suspended
663
+ end
664
+
636
665
  def can_handle_observation_request?(observation_request)
637
666
  # TODO sort this out for Opal
638
667
  observation_request = observation_request.to_s
@@ -662,7 +691,10 @@ module Glimmer
662
691
  # TODO look into the issue with using async::task.new here. maybe put it in event listener (like not being able to call preventDefault or return false successfully )
663
692
  # maybe consider pushing inside the widget classes instead where needed only or implement universal doit support correctly to bypass this issue
664
693
  # Async::Task.new do
665
- event_listener.call(event)
694
+ @@widget_handling_listener = self
695
+ # TODO also make sure to disable all widgets for suspension
696
+ event_listener.call(event) unless dialog_ancestor&.event_handling_suspended?
697
+ @widget_handling_listener = nil
666
698
  # end
667
699
  end
668
700
  the_listener_dom_element = event_element_css_selector ? Element[event_element_css_selector] : listener_dom_element
@@ -896,6 +928,7 @@ require 'glimmer/swt/button_proxy'
896
928
  require 'glimmer/swt/combo_proxy'
897
929
  require 'glimmer/swt/checkbox_proxy'
898
930
  require 'glimmer/swt/composite_proxy'
931
+ require 'glimmer/swt/dialog_proxy'
899
932
  require 'glimmer/swt/date_time_proxy'
900
933
  require 'glimmer/swt/group_proxy'
901
934
  require 'glimmer/swt/label_proxy'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -24,16 +24,25 @@ require 'delegate'
24
24
  module Glimmer
25
25
  module Util
26
26
  class ProcTracker < DelegateClass(Proc)
27
- def initialize(proc)
28
- super(proc)
27
+ attr_reader :owner
28
+
29
+ def initialize(proc = nil, owner: nil, &block)
30
+ super(proc || block)
31
+ @owner = owner
29
32
  end
33
+
30
34
  def call(*args)
31
35
  __getobj__.call(*args)
32
36
  @called = true
33
37
  end
38
+
34
39
  def called?
35
40
  !!@called
36
41
  end
42
+
43
+ def respond_to?(method, *args, &block)
44
+ %w[owner called?].include?(method.to_s) || super(method, *args, &block)
45
+ end
37
46
  end
38
47
  end
39
48
  end
@@ -1,13 +1,41 @@
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
1
22
  # Missing Net module class methods TODO implement
2
23
 
3
24
  require_relative '../uri'
4
25
 
5
26
  module Net
6
27
  # TODO Implement HTTP with jQuery for use in Glimmer DSL for Opal
28
+ # TODO Re-Implement in Fetch in the future
7
29
  # Note: ignore Protocol superclass for now
8
30
  class HTTP
9
- def post_form(uri, params)
10
- # TODO
31
+ class << self
32
+ def post_form(uri, params)
33
+ response_body = nil
34
+ result = ::HTTP.post(uri, payload: params) do |response|
35
+ response_body = response.body
36
+ end
37
+ response_body
38
+ end
11
39
  end
12
40
  end
13
41
  end
data/lib/os.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-22 00:00:00.000000000 Z
11
+ date: 2021-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.5
19
+ version: 1.0.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.5
26
+ version: 1.0.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: glimmer-dsl-xml
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +86,26 @@ dependencies:
86
86
  - - "<"
87
87
  - !ruby/object:Gem::Version
88
88
  version: 3.0.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: pure-struct
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 1.0.2
96
+ - - "<"
97
+ - !ruby/object:Gem::Version
98
+ version: 2.0.0
99
+ type: :runtime
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: 1.0.2
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: 2.0.0
89
109
  - !ruby/object:Gem::Dependency
90
110
  name: puts_debuggerer
91
111
  requirement: !ruby/object:Gem::Requirement
@@ -250,7 +270,6 @@ files:
250
270
  - lib/glimmer-dsl-opal/ext/exception.rb
251
271
  - lib/glimmer-dsl-opal/ext/file.rb
252
272
  - lib/glimmer-dsl-opal/ext/glimmer/dsl/engine.rb
253
- - lib/glimmer-dsl-opal/ext/struct.rb
254
273
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager.rb
255
274
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact.rb
256
275
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_manager_presenter.rb
@@ -269,6 +288,7 @@ files:
269
288
  - lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb
270
289
  - lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb
271
290
  - lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb
291
+ - lib/glimmer-dsl-opal/samples/hello/hello_dialog.rb
272
292
  - lib/glimmer-dsl-opal/samples/hello/hello_group.rb
273
293
  - lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb
274
294
  - lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
@@ -299,6 +319,7 @@ files:
299
319
  - lib/glimmer-dsl-opal/vendor/jquery-ui/package.json
300
320
  - lib/glimmer-dsl-opal/vendor/jquery.js
301
321
  - lib/glimmer-dsl-swt.rb
322
+ - lib/glimmer/config/opal_logger.rb
302
323
  - lib/glimmer/data_binding/element_binding.rb
303
324
  - lib/glimmer/data_binding/list_selection_binding.rb
304
325
  - lib/glimmer/data_binding/observable_element.rb
@@ -312,6 +333,7 @@ files:
312
333
  - lib/glimmer/dsl/opal/combo_selection_data_binding_expression.rb
313
334
  - lib/glimmer/dsl/opal/custom_widget_expression.rb
314
335
  - lib/glimmer/dsl/opal/data_binding_expression.rb
336
+ - lib/glimmer/dsl/opal/dialog_expression.rb
315
337
  - lib/glimmer/dsl/opal/display_expression.rb
316
338
  - lib/glimmer/dsl/opal/dsl.rb
317
339
  - lib/glimmer/dsl/opal/exec_expression.rb
@@ -347,6 +369,7 @@ files:
347
369
  - lib/glimmer/swt/custom/checkbox_group.rb
348
370
  - lib/glimmer/swt/custom/radio_group.rb
349
371
  - lib/glimmer/swt/date_time_proxy.rb
372
+ - lib/glimmer/swt/dialog_proxy.rb
350
373
  - lib/glimmer/swt/display_proxy.rb
351
374
  - lib/glimmer/swt/event_listener_proxy.rb
352
375
  - lib/glimmer/swt/fill_layout_proxy.rb
@@ -354,7 +377,9 @@ files:
354
377
  - lib/glimmer/swt/grid_layout_proxy.rb
355
378
  - lib/glimmer/swt/group_proxy.rb
356
379
  - lib/glimmer/swt/label_proxy.rb
380
+ - lib/glimmer/swt/latest_dialog_proxy.rb
357
381
  - lib/glimmer/swt/latest_message_box_proxy.rb
382
+ - lib/glimmer/swt/latest_shell_proxy.rb
358
383
  - lib/glimmer/swt/layout_data_proxy.rb
359
384
  - lib/glimmer/swt/layout_proxy.rb
360
385
  - lib/glimmer/swt/list_proxy.rb