glimmer-dsl-opal 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/README.md +453 -48
  4. data/VERSION +1 -1
  5. data/lib/display.rb +31 -0
  6. data/lib/glimmer-dsl-opal.rb +15 -36
  7. data/lib/glimmer-dsl-opal/ext/class.rb +10 -0
  8. data/lib/glimmer-dsl-opal/ext/file.rb +29 -0
  9. data/lib/glimmer-dsl-opal/ext/struct.rb +37 -0
  10. data/lib/glimmer-dsl-opal/samples/elaborate/contact_manager.rb +50 -23
  11. data/lib/glimmer-dsl-opal/samples/elaborate/login.rb +22 -5
  12. data/lib/glimmer-dsl-opal/samples/hello/hello_browser.rb +24 -1
  13. data/lib/glimmer-dsl-opal/samples/hello/hello_button.rb +46 -0
  14. data/lib/glimmer-dsl-opal/samples/hello/hello_computed.rb +27 -0
  15. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +7 -7
  16. data/lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb +62 -32
  17. data/lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb +47 -22
  18. data/lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb +37 -0
  19. data/lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb +84 -0
  20. data/lib/glimmer-dsl-opal/samples/hello/hello_table.rb +2 -2
  21. data/lib/glimmer/data_binding/observable_element.rb +1 -1
  22. data/lib/glimmer/data_binding/table_items_binding.rb +3 -3
  23. data/lib/glimmer/dsl/opal/custom_widget_expression.rb +6 -0
  24. data/lib/glimmer/dsl/opal/dsl.rb +2 -0
  25. data/lib/glimmer/dsl/opal/menu_bar_expression.rb +54 -0
  26. data/lib/glimmer/dsl/opal/menu_expression.rb +61 -0
  27. data/lib/glimmer/dsl/opal/widget_expression.rb +3 -2
  28. data/lib/glimmer/dsl/opal/widget_listener_expression.rb +2 -2
  29. data/lib/glimmer/swt/combo_proxy.rb +40 -1
  30. data/lib/glimmer/swt/control_editor.rb +2 -1
  31. data/lib/glimmer/swt/custom/checkbox_group.rb +2 -2
  32. data/lib/glimmer/swt/custom/radio_group.rb +2 -2
  33. data/lib/glimmer/swt/date_time_proxy.rb +66 -1
  34. data/lib/glimmer/swt/event_listener_proxy.rb +14 -4
  35. data/lib/glimmer/swt/font_proxy.rb +4 -4
  36. data/lib/glimmer/swt/grid_layout_proxy.rb +21 -12
  37. data/lib/glimmer/swt/label_proxy.rb +17 -6
  38. data/lib/glimmer/swt/layout_data_proxy.rb +10 -7
  39. data/lib/glimmer/swt/list_proxy.rb +33 -0
  40. data/lib/glimmer/swt/menu_item_proxy.rb +87 -0
  41. data/lib/glimmer/swt/menu_proxy.rb +162 -0
  42. data/lib/glimmer/swt/message_box_proxy.rb +53 -67
  43. data/lib/glimmer/swt/property_owner.rb +2 -0
  44. data/lib/glimmer/swt/radio_proxy.rb +1 -1
  45. data/lib/glimmer/swt/shell_proxy.rb +32 -187
  46. data/lib/glimmer/swt/tab_folder_proxy.rb +43 -0
  47. data/lib/glimmer/swt/table_column_proxy.rb +4 -3
  48. data/lib/glimmer/swt/table_editor.rb +2 -2
  49. data/lib/glimmer/swt/table_item_proxy.rb +15 -5
  50. data/lib/glimmer/swt/table_proxy.rb +34 -12
  51. data/lib/glimmer/swt/text_proxy.rb +1 -1
  52. data/lib/glimmer/swt/widget_proxy.rb +335 -38
  53. data/lib/glimmer/ui/custom_shell.rb +9 -7
  54. data/lib/glimmer/ui/custom_widget.rb +3 -3
  55. data/lib/os.rb +36 -0
  56. metadata +36 -3
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2020 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
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
@@ -31,8 +31,10 @@ module Glimmer
31
31
  class << self
32
32
  def included(klass)
33
33
  klass.extend(CustomWidget::ClassMethods)
34
- klass.include(Glimmer)
34
+ klass.include(Glimmer)
35
35
  Glimmer::UI::CustomWidget.add_custom_widget_namespaces_for(klass)
36
+ keyword = klass.name.split(':').last.underscore
37
+ LocalStorage[keyword] = $LOADED_FEATURES.last
36
38
  end
37
39
 
38
40
  def request_parameter_string
@@ -44,12 +46,12 @@ module Glimmer
44
46
  end
45
47
 
46
48
  def requested_and_not_handled?
47
- requested? && !request_parameter_string.include?('custom_shell_handled=true')
48
- end
49
+ requested? && !request_parameter_string.include?('custom_shell_handled=true')
50
+ end
49
51
 
50
52
  def requested?
51
53
  request_parameter_string.include?('custom_shell=')
52
- end
54
+ end
53
55
  end
54
56
 
55
57
  def initialize(parent, args, options, &content)
@@ -187,13 +187,13 @@ module Glimmer
187
187
  result || body_root&.can_handle_observation_request?(observation_request)
188
188
  end
189
189
 
190
- def handle_observation_request(observation_request, &block)
190
+ def handle_observation_request(observation_request, block)
191
191
  observation_request = observation_request.to_s
192
192
  if observation_request.start_with?('on_updated_')
193
193
  property = observation_request.sub(/^on_updated_/, '') # TODO look into eliminating duplication from above
194
194
  add_observer(DataBinding::Observer.proc(&block), property) if can_add_observer?(property)
195
195
  else
196
- body_root.handle_observation_request(observation_request, &block)
196
+ body_root.handle_observation_request(observation_request, block)
197
197
  end
198
198
  end
199
199
 
@@ -267,7 +267,7 @@ module Glimmer
267
267
 
268
268
  def method_missing(method, *args, &block)
269
269
  if can_handle_observation_request?(method)
270
- handle_observation_request(method, &block)
270
+ handle_observation_request(method, block)
271
271
  else
272
272
  body_root.send(method, *args, &block)
273
273
  end
@@ -0,0 +1,36 @@
1
+ # Copyright (c) 2020 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
+
22
+ class OS
23
+ class << self
24
+ def windows?
25
+ # No Op in Opal
26
+ end
27
+
28
+ def mac?
29
+ # No Op in Opal
30
+ end
31
+
32
+ def linux?
33
+ # No Op in Opal
34
+ end
35
+ end
36
+ end
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.7.1
4
+ version: 0.8.0
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-06 00:00:00.000000000 Z
11
+ date: 2020-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer
@@ -66,6 +66,26 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: to_collection
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.1
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: 3.0.0
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 2.0.1
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: 3.0.0
69
89
  - !ruby/object:Gem::Dependency
70
90
  name: puts_debuggerer
71
91
  requirement: !ruby/object:Gem::Requirement
@@ -196,7 +216,8 @@ dependencies:
196
216
  - - "~>"
197
217
  - !ruby/object:Gem::Version
198
218
  version: 0.4.4
199
- description: Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
219
+ description: Glimmer DSL for Opal on Rails (Pure Ruby Web GUI and Auto-Webifier of
220
+ Desktop Apps)
200
221
  email: andy.am@gmail.com
201
222
  executables: []
202
223
  extensions: []
@@ -222,9 +243,13 @@ files:
222
243
  - app/assets/stylesheets/glimmer/jquery-ui.structure.css
223
244
  - app/assets/stylesheets/glimmer/jquery-ui.theme.css
224
245
  - app/assets/stylesheets/glimmer/jquery.ui.timepicker.css
246
+ - lib/display.rb
225
247
  - lib/glimmer-dsl-opal.rb
248
+ - lib/glimmer-dsl-opal/ext/class.rb
226
249
  - lib/glimmer-dsl-opal/ext/date.rb
227
250
  - lib/glimmer-dsl-opal/ext/exception.rb
251
+ - lib/glimmer-dsl-opal/ext/file.rb
252
+ - lib/glimmer-dsl-opal/ext/struct.rb
228
253
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager.rb
229
254
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact.rb
230
255
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_manager_presenter.rb
@@ -234,6 +259,7 @@ files:
234
259
  - lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/board.rb
235
260
  - lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb
236
261
  - lib/glimmer-dsl-opal/samples/hello/hello_browser.rb
262
+ - lib/glimmer-dsl-opal/samples/hello/hello_button.rb
237
263
  - lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb
238
264
  - lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb
239
265
  - lib/glimmer-dsl-opal/samples/hello/hello_combo.rb
@@ -245,6 +271,8 @@ files:
245
271
  - lib/glimmer-dsl-opal/samples/hello/hello_group.rb
246
272
  - lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb
247
273
  - lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
274
+ - lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb
275
+ - lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb
248
276
  - lib/glimmer-dsl-opal/samples/hello/hello_radio.rb
249
277
  - lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb
250
278
  - lib/glimmer-dsl-opal/samples/hello/hello_tab.rb
@@ -289,6 +317,8 @@ files:
289
317
  - lib/glimmer/dsl/opal/layout_data_expression.rb
290
318
  - lib/glimmer/dsl/opal/layout_expression.rb
291
319
  - lib/glimmer/dsl/opal/list_selection_data_binding_expression.rb
320
+ - lib/glimmer/dsl/opal/menu_bar_expression.rb
321
+ - lib/glimmer/dsl/opal/menu_expression.rb
292
322
  - lib/glimmer/dsl/opal/message_box_expression.rb
293
323
  - lib/glimmer/dsl/opal/observe_expression.rb
294
324
  - lib/glimmer/dsl/opal/property_expression.rb
@@ -326,6 +356,8 @@ files:
326
356
  - lib/glimmer/swt/layout_proxy.rb
327
357
  - lib/glimmer/swt/list_proxy.rb
328
358
  - lib/glimmer/swt/make_shift_shell_proxy.rb
359
+ - lib/glimmer/swt/menu_item_proxy.rb
360
+ - lib/glimmer/swt/menu_proxy.rb
329
361
  - lib/glimmer/swt/message_box_proxy.rb
330
362
  - lib/glimmer/swt/point.rb
331
363
  - lib/glimmer/swt/property_owner.rb
@@ -348,6 +380,7 @@ files:
348
380
  - lib/glimmer/ui/custom_widget.rb
349
381
  - lib/glimmer/util/proc_tracker.rb
350
382
  - lib/net/http.rb
383
+ - lib/os.rb
351
384
  - lib/uri.rb
352
385
  homepage: http://github.com/AndyObtiva/glimmer-dsl-opal
353
386
  licenses: