glimmer-dsl-opal 0.5.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/README.md +390 -29
- data/VERSION +1 -1
- data/app/assets/images/glimmer/images/calendar.gif +0 -0
- data/app/assets/images/glimmer/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/glimmer/images/ui-icons_444444_256x240.png +0 -0
- data/app/assets/images/glimmer/images/ui-icons_555555_256x240.png +0 -0
- data/app/assets/images/glimmer/images/ui-icons_777620_256x240.png +0 -0
- data/app/assets/images/glimmer/images/ui-icons_777777_256x240.png +0 -0
- data/app/assets/images/glimmer/images/ui-icons_cc0000_256x240.png +0 -0
- data/app/assets/images/glimmer/images/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/stylesheets/glimmer/glimmer.css +15 -0
- data/app/assets/stylesheets/glimmer/jquery-ui.css +1312 -0
- data/app/assets/stylesheets/glimmer/jquery-ui.structure.css +886 -0
- data/app/assets/stylesheets/glimmer/jquery-ui.theme.css +443 -0
- data/app/assets/stylesheets/glimmer/jquery.ui.timepicker.css +57 -0
- data/lib/glimmer-dsl-opal.rb +73 -8
- data/lib/glimmer-dsl-opal/ext/date.rb +49 -3
- data/lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe.rb +23 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_combo.rb +5 -5
- data/lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb +63 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_table.rb +283 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/GPL-LICENSE.txt +278 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/MIT-LICENSE.txt +20 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/jquery.ui.timepicker.css +57 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/jquery.ui.timepicker.js +1496 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/AUTHORS.txt +333 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/LICENSE.txt +43 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_444444_256x240.png +0 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_555555_256x240.png +0 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_777620_256x240.png +0 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_777777_256x240.png +0 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_cc0000_256x240.png +0 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.min.css +7 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.min.js +13 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.structure.min.css +5 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.theme.min.css +5 -0
- data/lib/glimmer-dsl-opal/vendor/jquery-ui/package.json +74 -0
- data/lib/glimmer-dsl-swt.rb +20 -35
- data/lib/glimmer/data_binding/table_items_binding.rb +31 -18
- data/lib/glimmer/dsl/opal/block_property_expression.rb +41 -0
- data/lib/glimmer/dsl/opal/custom_widget_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/dsl.rb +2 -0
- data/lib/glimmer/dsl/opal/shell_expression.rb +7 -2
- data/lib/glimmer/dsl/opal/widget_expression.rb +10 -1
- data/lib/glimmer/engine.rb +9 -0
- data/lib/glimmer/swt.rb +3 -3
- data/lib/glimmer/swt/button_proxy.rb +5 -5
- data/lib/glimmer/swt/checkbox_proxy.rb +1 -0
- data/lib/glimmer/swt/color_proxy.rb +45 -45
- data/lib/glimmer/swt/combo_proxy.rb +2 -2
- data/lib/glimmer/swt/composite_proxy.rb +7 -3
- data/lib/glimmer/swt/control_editor.rb +53 -0
- data/lib/glimmer/swt/date_time_proxy.rb +145 -0
- data/lib/glimmer/swt/display_proxy.rb +6 -2
- data/lib/glimmer/swt/fill_layout_proxy.rb +1 -1
- data/lib/glimmer/swt/label_proxy.rb +2 -2
- data/lib/glimmer/swt/layout_data_proxy.rb +8 -8
- data/lib/glimmer/swt/layout_proxy.rb +5 -5
- data/lib/glimmer/swt/list_proxy.rb +2 -2
- data/lib/glimmer/swt/make_shift_shell_proxy.rb +4 -4
- data/lib/glimmer/swt/message_box_proxy.rb +10 -8
- data/lib/glimmer/swt/property_owner.rb +2 -2
- data/lib/glimmer/swt/radio_proxy.rb +1 -0
- data/lib/glimmer/swt/row_layout_proxy.rb +1 -1
- data/lib/glimmer/swt/shell_proxy.rb +8 -0
- data/lib/glimmer/swt/tab_folder_proxy.rb +5 -5
- data/lib/glimmer/swt/tab_item_proxy.rb +7 -7
- data/lib/glimmer/swt/table_column_proxy.rb +71 -12
- data/lib/glimmer/swt/table_editor.rb +65 -0
- data/lib/glimmer/swt/table_item_proxy.rb +42 -7
- data/lib/glimmer/swt/table_proxy.rb +575 -20
- data/lib/glimmer/swt/text_proxy.rb +50 -2
- data/lib/glimmer/swt/widget_proxy.rb +120 -23
- data/lib/glimmer/ui/custom_widget.rb +8 -8
- data/lib/net/http.rb +1 -5
- data/lib/uri.rb +3 -3
- metadata +45 -9
- data/lib/glimmer/data_binding/ext/observable_model.rb +0 -40
@@ -20,13 +20,61 @@ module Glimmer
|
|
20
20
|
event: 'keyup',
|
21
21
|
event_handler: -> (event_listener) {
|
22
22
|
-> (event) {
|
23
|
+
# TODO consider unifying this event handler with on_key_pressed by relying on its result instead of hooking another keyup event
|
24
|
+
if @last_key_pressed_event.nil? || @last_key_pressed_event.doit
|
25
|
+
@text = event.target.value
|
26
|
+
event_listener.call(event)
|
27
|
+
else
|
28
|
+
# TODO Fix doit false, it's not stopping input
|
29
|
+
event.prevent
|
30
|
+
event.prevent_default
|
31
|
+
event.stop_propagation
|
32
|
+
event.stop_immediate_propagation
|
33
|
+
end
|
34
|
+
}
|
35
|
+
}
|
36
|
+
},
|
37
|
+
'on_key_pressed' => {
|
38
|
+
event: 'keydown',
|
39
|
+
event_handler: -> (event_listener) {
|
40
|
+
-> (event) {
|
41
|
+
@last_key_pressed_event = event
|
23
42
|
@text = event.target.value
|
24
|
-
|
43
|
+
# TODO generalize this solution to all widgets that support key presses
|
44
|
+
# TODO support event.location once DOM3 is supported by opal-jquery
|
45
|
+
event.define_singleton_method(:keyCode) {event.which}
|
46
|
+
event.define_singleton_method(:key_code, &event.method(:keyCode))
|
47
|
+
event.define_singleton_method(:character) {event.which.chr}
|
48
|
+
event.define_singleton_method(:stateMask) do
|
49
|
+
state_mask = 0
|
50
|
+
state_mask |= SWTProxy[:alt] if event.alt_key
|
51
|
+
state_mask |= SWTProxy[:ctrl] if event.ctrl_key
|
52
|
+
state_mask |= SWTProxy[:shift] if event.shift_key
|
53
|
+
state_mask |= SWTProxy[:command] if event.meta_key
|
54
|
+
state_mask
|
55
|
+
end
|
56
|
+
event.define_singleton_method(:state_mask, &event.method(:stateMask))
|
57
|
+
doit = true
|
58
|
+
event.define_singleton_method(:doit=) do |value|
|
59
|
+
doit = value
|
60
|
+
end
|
61
|
+
event.define_singleton_method(:doit) { doit }
|
62
|
+
event_listener.call(event)
|
63
|
+
|
64
|
+
# TODO Fix doit false, it's not stopping input
|
65
|
+
unless doit
|
66
|
+
event.prevent
|
67
|
+
event.prevent_default
|
68
|
+
event.stop_propagation
|
69
|
+
event.stop_immediate_propagation
|
70
|
+
end
|
71
|
+
|
72
|
+
doit
|
25
73
|
}
|
26
74
|
}
|
27
75
|
}
|
28
76
|
}
|
29
|
-
end
|
77
|
+
end
|
30
78
|
|
31
79
|
def dom
|
32
80
|
text_text = @text
|
@@ -29,13 +29,16 @@ module Glimmer
|
|
29
29
|
include Glimmer
|
30
30
|
include PropertyOwner
|
31
31
|
|
32
|
-
attr_reader :parent, :args, :path, :children, :enabled, :foreground, :background, :font, :focus
|
32
|
+
attr_reader :parent, :args, :path, :children, :enabled, :foreground, :background, :font, :focus, :disposed?, :rendered
|
33
|
+
alias isDisposed disposed?
|
34
|
+
alias is_disposed disposed?
|
35
|
+
alias rendered? rendered
|
33
36
|
|
34
37
|
class << self
|
35
38
|
# Factory Method that translates a Glimmer DSL keyword into a WidgetProxy object
|
36
|
-
def for(keyword, parent, args)
|
39
|
+
def for(keyword, parent, args, block)
|
37
40
|
the_widget_class = widget_class(keyword)
|
38
|
-
the_widget_class.respond_to?(:create) ? the_widget_class.create(parent, args) : the_widget_class.new(parent, args)
|
41
|
+
the_widget_class.respond_to?(:create) ? the_widget_class.create(keyword, parent, args, block) : the_widget_class.new(parent, args, block)
|
39
42
|
end
|
40
43
|
|
41
44
|
def widget_class(keyword)
|
@@ -97,21 +100,69 @@ module Glimmer
|
|
97
100
|
# end,
|
98
101
|
}
|
99
102
|
|
100
|
-
def initialize(parent, args)
|
103
|
+
def initialize(parent, args, block)
|
101
104
|
@parent = parent
|
102
105
|
@args = args
|
106
|
+
@block = block
|
103
107
|
@children = Set.new # TODO consider moving to composite
|
104
108
|
@enabled = true
|
109
|
+
@data = {}
|
105
110
|
DEFAULT_INITIALIZERS[self.class.underscored_widget_name(self)]&.call(self)
|
106
|
-
@parent.
|
111
|
+
@parent.post_initialize_child(self) # TODO rename to post_initialize_child to be closer to glimmer-dsl-swt terminology
|
107
112
|
end
|
108
113
|
|
114
|
+
# Executes for the parent of a child that just got added
|
115
|
+
def post_initialize_child(child)
|
116
|
+
@children << child
|
117
|
+
child.render
|
118
|
+
end
|
119
|
+
|
120
|
+
# Executes for the parent of a child that just got disposed
|
121
|
+
def post_dispose_child(child)
|
122
|
+
@children&.delete(child)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Executes at the closing of a parent widget curly braces after all children/properties have been added/set
|
126
|
+
def post_add_content
|
127
|
+
# No Op by default
|
128
|
+
end
|
129
|
+
|
130
|
+
def set_data(key=nil, value)
|
131
|
+
@data[key] = value
|
132
|
+
end
|
133
|
+
alias setData set_data
|
134
|
+
alias data= set_data
|
135
|
+
|
136
|
+
def get_data(key=nil)
|
137
|
+
@data[key]
|
138
|
+
end
|
139
|
+
alias getData get_data
|
140
|
+
alias data get_data
|
141
|
+
|
109
142
|
def css_classes
|
110
143
|
dom_element.attr('class').to_s.split
|
111
144
|
end
|
112
145
|
|
113
146
|
def dispose
|
147
|
+
remove_all_listeners
|
114
148
|
Document.find(path).remove
|
149
|
+
parent&.post_dispose_child(self)
|
150
|
+
# TODO fire on_widget_disposed listener
|
151
|
+
@disposed = true
|
152
|
+
end
|
153
|
+
|
154
|
+
def remove_all_listeners
|
155
|
+
observation_request_to_event_mapping.keys.each do |keyword|
|
156
|
+
[observation_request_to_event_mapping[keyword]].flatten.each do |mapping|
|
157
|
+
@observation_requests[keyword].to_a.each do |event_listener|
|
158
|
+
event = mapping[:event]
|
159
|
+
event_handler = mapping[:event_handler]
|
160
|
+
event_element_css_selector = mapping[:event_element_css_selector]
|
161
|
+
the_listener_dom_element = event_element_css_selector ? Element[event_element_css_selector] : listener_dom_element
|
162
|
+
the_listener_dom_element.off(event)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
115
166
|
end
|
116
167
|
|
117
168
|
def path
|
@@ -123,11 +174,6 @@ module Glimmer
|
|
123
174
|
'div'
|
124
175
|
end
|
125
176
|
|
126
|
-
def add_child(child)
|
127
|
-
@children << child
|
128
|
-
child.render
|
129
|
-
end
|
130
|
-
|
131
177
|
def enabled=(value)
|
132
178
|
@enabled = value
|
133
179
|
dom_element.prop('disabled', !@enabled)
|
@@ -165,12 +211,17 @@ module Glimmer
|
|
165
211
|
@parent.path
|
166
212
|
end
|
167
213
|
|
168
|
-
def
|
214
|
+
def parent_dom_element
|
215
|
+
Document.find(parent_path)
|
216
|
+
end
|
217
|
+
|
218
|
+
def render(custom_parent_dom_element = nil)
|
219
|
+
the_parent_dom_element = custom_parent_dom_element || parent_dom_element
|
169
220
|
old_element = dom_element
|
170
221
|
brand_new = @dom.nil? || old_element.empty?
|
171
|
-
build_dom
|
222
|
+
build_dom(!custom_parent_dom_element) # TODO handle custom parent layout by passing parent instead of parent dom element
|
172
223
|
if brand_new
|
173
|
-
|
224
|
+
the_parent_dom_element.append(@dom)
|
174
225
|
else
|
175
226
|
old_element.replace_with(@dom)
|
176
227
|
end
|
@@ -183,13 +234,29 @@ module Glimmer
|
|
183
234
|
children.each do |child|
|
184
235
|
child.render
|
185
236
|
end
|
237
|
+
@rendered = true
|
238
|
+
content_on_render_blocks.each { |content_block| content(&content_block) }
|
186
239
|
end
|
187
240
|
alias redraw render
|
188
241
|
|
189
|
-
def
|
242
|
+
def content_on_render_blocks
|
243
|
+
@content_on_render_blocks ||= []
|
244
|
+
end
|
245
|
+
|
246
|
+
def add_content_on_render(&content_block)
|
247
|
+
if rendered?
|
248
|
+
content_block.call
|
249
|
+
else
|
250
|
+
content_on_render_blocks << content_block
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
def build_dom(layout=true)
|
255
|
+
# TODO consider passing parent element instead and having table item include a table cell widget only for opal
|
190
256
|
@dom = nil
|
191
257
|
@dom = dom
|
192
258
|
@dom = @parent.layout.dom(@dom) if @parent.respond_to?(:layout) && @parent.layout
|
259
|
+
@dom
|
193
260
|
end
|
194
261
|
|
195
262
|
def content(&block)
|
@@ -248,6 +315,8 @@ module Glimmer
|
|
248
315
|
Document.find(path)
|
249
316
|
end
|
250
317
|
|
318
|
+
# TODO consider adding a default #dom method implementation for the common case, automatically relying on #element and other methods to build the dom html
|
319
|
+
|
251
320
|
def style_element
|
252
321
|
style_element_id = "#{id}-style"
|
253
322
|
style_element_selector = "style##{style_element_id}"
|
@@ -262,10 +331,6 @@ module Glimmer
|
|
262
331
|
element
|
263
332
|
end
|
264
333
|
|
265
|
-
def parent_dom_element
|
266
|
-
Document.find(parent_path)
|
267
|
-
end
|
268
|
-
|
269
334
|
def listener_path
|
270
335
|
path
|
271
336
|
end
|
@@ -297,16 +362,23 @@ module Glimmer
|
|
297
362
|
@observation_requests[keyword] << event_listener
|
298
363
|
event = mapping[:event]
|
299
364
|
event_handler = mapping[:event_handler]
|
365
|
+
event_element_css_selector = mapping[:event_element_css_selector]
|
300
366
|
potential_event_listener = event_handler&.call(event_listener)
|
301
367
|
event_listener = potential_event_listener || event_listener
|
302
|
-
|
368
|
+
async_event_listener = lambda do |event|
|
369
|
+
Async::Task.new do
|
370
|
+
event_listener.call(event)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
the_listener_dom_element = event_element_css_selector ? Element[event_element_css_selector] : listener_dom_element
|
374
|
+
delegate = the_listener_dom_element.on(event, &async_event_listener)
|
303
375
|
end
|
304
376
|
# TODO update code below for new WidgetProxy API
|
305
377
|
EventListenerProxy.new(element_proxy: self, event: event, selector: selector, delegate: delegate)
|
306
378
|
end
|
307
379
|
|
308
380
|
def add_observer(observer, property_name)
|
309
|
-
property_listener_installers = self.class
|
381
|
+
property_listener_installers = self.class&.ancestors&.to_a.map {|ancestor| widget_property_listener_installers[ancestor]}.compact
|
310
382
|
widget_listener_installers = property_listener_installers.map{|installer| installer[property_name.to_s.to_sym]}.compact if !property_listener_installers.empty?
|
311
383
|
widget_listener_installers.to_a.each do |widget_listener_installer|
|
312
384
|
widget_listener_installer.call(observer)
|
@@ -318,6 +390,14 @@ module Glimmer
|
|
318
390
|
super(attribute_name, *args) # PropertyOwner
|
319
391
|
end
|
320
392
|
|
393
|
+
def method_missing(method, *args, &block)
|
394
|
+
if method.to_s.start_with?('on_')
|
395
|
+
handle_observation_request(method, &block)
|
396
|
+
else
|
397
|
+
super(method, *args, &block)
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
321
401
|
def apply_property_type_converters(attribute_name, args)
|
322
402
|
if args.count == 1
|
323
403
|
value = args.first
|
@@ -368,9 +448,6 @@ module Glimmer
|
|
368
448
|
# value
|
369
449
|
# end
|
370
450
|
# end,
|
371
|
-
:items => lambda do |value|
|
372
|
-
value.to_java :string
|
373
|
-
end,
|
374
451
|
:text => lambda do |value|
|
375
452
|
# if swt_widget.is_a?(Browser)
|
376
453
|
# value.to_s
|
@@ -461,6 +538,13 @@ module Glimmer
|
|
461
538
|
# }
|
462
539
|
# end,
|
463
540
|
# },
|
541
|
+
DateTimeProxy => {
|
542
|
+
:date_time => lambda do |observer|
|
543
|
+
on_widget_selected { |selection_event|
|
544
|
+
observer.call(date_time)
|
545
|
+
}
|
546
|
+
end
|
547
|
+
},
|
464
548
|
RadioProxy => { #radio?
|
465
549
|
:selection => lambda do |observer|
|
466
550
|
on_widget_selected { |selection_event|
|
@@ -468,6 +552,17 @@ module Glimmer
|
|
468
552
|
}
|
469
553
|
end
|
470
554
|
},
|
555
|
+
TableProxy => {
|
556
|
+
:selection => lambda do |observer|
|
557
|
+
on_widget_selected { |selection_event|
|
558
|
+
if has_style?(:multi)
|
559
|
+
observer.call(selection.map(&:get_data))
|
560
|
+
else
|
561
|
+
observer.call(selection.first&.get_data)
|
562
|
+
end
|
563
|
+
}
|
564
|
+
end,
|
565
|
+
},
|
471
566
|
# Java::OrgEclipseSwtWidgets::MenuItem => {
|
472
567
|
# :selection => lambda do |observer|
|
473
568
|
# on_widget_selected { |selection_event|
|
@@ -489,11 +584,13 @@ module Glimmer
|
|
489
584
|
end
|
490
585
|
end
|
491
586
|
|
587
|
+
require 'glimmer/swt/display_proxy'
|
492
588
|
require 'glimmer/swt/browser_proxy'
|
493
589
|
require 'glimmer/swt/button_proxy'
|
494
590
|
require 'glimmer/swt/combo_proxy'
|
495
591
|
require 'glimmer/swt/checkbox_proxy'
|
496
592
|
require 'glimmer/swt/composite_proxy'
|
593
|
+
require 'glimmer/swt/date_time_proxy'
|
497
594
|
require 'glimmer/swt/group_proxy'
|
498
595
|
require 'glimmer/swt/label_proxy'
|
499
596
|
require 'glimmer/swt/list_proxy'
|
@@ -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
|
@@ -89,7 +89,7 @@ module Glimmer
|
|
89
89
|
def included(klass)
|
90
90
|
klass.extend(ClassMethods)
|
91
91
|
unless klass.name.include?('Glimmer::UI::CustomShell')
|
92
|
-
klass.include(Glimmer)
|
92
|
+
klass.include(Glimmer)
|
93
93
|
Glimmer::UI::CustomWidget.add_custom_widget_namespaces_for(klass)
|
94
94
|
end
|
95
95
|
end
|
@@ -107,7 +107,7 @@ module Glimmer
|
|
107
107
|
end
|
108
108
|
begin
|
109
109
|
constant = result.const_get(namespace)
|
110
|
-
return constant if constant
|
110
|
+
return constant if constant&.respond_to?(:ancestors) && constant&.ancestors&.to_a.include?(Glimmer::UI::CustomWidget)
|
111
111
|
constant
|
112
112
|
rescue => e
|
113
113
|
# Glimmer::Config.logger.debug {"#{e.message}\n#{e.backtrace.join("\n")}"}
|
@@ -158,7 +158,7 @@ module Glimmer
|
|
158
158
|
args = []
|
159
159
|
end
|
160
160
|
options ||= {}
|
161
|
-
args = options.delete('swt_style').split(',').map(&:to_sym) if options['swt_style']
|
161
|
+
args = options.delete('swt_style').split(',').map(&:to_sym) if options['swt_style']
|
162
162
|
@args = args
|
163
163
|
@swt_style = SWT::SWTProxy[*@args]
|
164
164
|
options ||= {}
|
@@ -244,7 +244,7 @@ module Glimmer
|
|
244
244
|
|
245
245
|
def has_style?(symbol)
|
246
246
|
@args.include?(symbol) # not a very solid implementation. Bring SWT constants eventually
|
247
|
-
end
|
247
|
+
end
|
248
248
|
|
249
249
|
def async_exec(&block)
|
250
250
|
SWT::DisplayProxy.instance.async_exec(&block)
|
@@ -273,7 +273,7 @@ module Glimmer
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
|
-
alias local_respond_to? respond_to?
|
276
|
+
alias local_respond_to? respond_to?
|
277
277
|
def respond_to?(method, *args, &block)
|
278
278
|
super or
|
279
279
|
can_handle_observation_request?(method) or
|
data/lib/net/http.rb
CHANGED
data/lib/uri.rb
CHANGED
@@ -6,7 +6,7 @@ module URI
|
|
6
6
|
|
7
7
|
def initialize(url)
|
8
8
|
@url = url
|
9
|
-
uri_match = url.match(REGEX)
|
9
|
+
uri_match = url.match(REGEX).to_a
|
10
10
|
@scheme = uri_match[1]
|
11
11
|
@host = uri_match[2]
|
12
12
|
@path = uri_match[3]
|
@@ -16,7 +16,7 @@ module URI
|
|
16
16
|
|
17
17
|
def to_s
|
18
18
|
url
|
19
|
-
end
|
19
|
+
end
|
20
20
|
end
|
21
21
|
|
22
22
|
TBLENCWWWCOMP_ = {"\u0000"=>"%00", "\u0001"=>"%01", "\u0002"=>"%02", "\u0003"=>"%03", "\u0004"=>"%04", "\u0005"=>"%05", "\u0006"=>"%06", "\a"=>"%07", "\b"=>"%08", "\t"=>"%09", "\n"=>"%0A", "\v"=>"%0B", "\f"=>"%0C", "\r"=>"%0D", "\u000E"=>"%0E", "\u000F"=>"%0F", "\u0010"=>"%10", "\u0011"=>"%11", "\u0012"=>"%12", "\u0013"=>"%13", "\u0014"=>"%14", "\u0015"=>"%15", "\u0016"=>"%16", "\u0017"=>"%17", "\u0018"=>"%18", "\u0019"=>"%19", "\u001A"=>"%1A", "\e"=>"%1B", "\u001C"=>"%1C", "\u001D"=>"%1D", "\u001E"=>"%1E", "\u001F"=>"%1F", " "=>"+", "!"=>"%21", "\""=>"%22", "#"=>"%23", "$"=>"%24", "%"=>"%25", "&"=>"%26", "'"=>"%27", "("=>"%28", ")"=>"%29", "*"=>"%2A", "+"=>"%2B", ","=>"%2C", "-"=>"%2D", "."=>"%2E", "/"=>"%2F", "0"=>"%30", "1"=>"%31", "2"=>"%32", "3"=>"%33", "4"=>"%34", "5"=>"%35", "6"=>"%36", "7"=>"%37", "8"=>"%38", "9"=>"%39", ":"=>"%3A", ";"=>"%3B", "<"=>"%3C", "="=>"%3D", ">"=>"%3E", "?"=>"%3F", "@"=>"%40", "A"=>"%41", "B"=>"%42", "C"=>"%43", "D"=>"%44", "E"=>"%45", "F"=>"%46", "G"=>"%47", "H"=>"%48", "I"=>"%49", "J"=>"%4A", "K"=>"%4B", "L"=>"%4C", "M"=>"%4D", "N"=>"%4E", "O"=>"%4F", "P"=>"%50", "Q"=>"%51", "R"=>"%52", "S"=>"%53", "T"=>"%54", "U"=>"%55", "V"=>"%56", "W"=>"%57", "X"=>"%58", "Y"=>"%59", "Z"=>"%5A", "["=>"%5B", "\\"=>"%5C", "]"=>"%5D", "^"=>"%5E", "_"=>"%5F", "`"=>"%60", "a"=>"%61", "b"=>"%62", "c"=>"%63", "d"=>"%64", "e"=>"%65", "f"=>"%66", "g"=>"%67", "h"=>"%68", "i"=>"%69", "j"=>"%6A", "k"=>"%6B", "l"=>"%6C", "m"=>"%6D", "n"=>"%6E", "o"=>"%6F", "p"=>"%70", "q"=>"%71", "r"=>"%72", "s"=>"%73", "t"=>"%74", "u"=>"%75", "v"=>"%76", "w"=>"%77", "x"=>"%78", "y"=>"%79", "z"=>"%7A", "{"=>"%7B", "|"=>"%7C", "}"=>"%7D", "~"=>"%7E", "\u007F"=>"%7F", "\u0080"=>"%80", "\u0081"=>"%81", "\u0082"=>"%82", "\u0083"=>"%83", "\u0084"=>"%84", "\u0085"=>"%85", "\u0086"=>"%86", "\u0087"=>"%87", "\u0088"=>"%88", "\u0089"=>"%89", "\u008A"=>"%8A", "\u008B"=>"%8B", "\u008C"=>"%8C", "\u008D"=>"%8D", "\u008E"=>"%8E", "\u008F"=>"%8F", "\u0090"=>"%90", "\u0091"=>"%91", "\u0092"=>"%92", "\u0093"=>"%93", "\u0094"=>"%94", "\u0095"=>"%95", "\u0096"=>"%96", "\u0097"=>"%97", "\u0098"=>"%98", "\u0099"=>"%99", "\u009A"=>"%9A", "\u009B"=>"%9B", "\u009C"=>"%9C", "\u009D"=>"%9D", "\u009E"=>"%9E", "\u009F"=>"%9F", "\u00A0"=>"%A0", "\u00A1"=>"%A1", "\u00A2"=>"%A2", "\u00A3"=>"%A3", "\u00A4"=>"%A4", "\u00A5"=>"%A5", "\u00A6"=>"%A6", "\u00A7"=>"%A7", "\u00A8"=>"%A8", "\u00A9"=>"%A9", "\u00AA"=>"%AA", "\u00AB"=>"%AB", "\u00AC"=>"%AC", "\u00AD"=>"%AD", "\u00AE"=>"%AE", "\u00AF"=>"%AF", "\u00B0"=>"%B0", "\u00B1"=>"%B1", "\u00B2"=>"%B2", "\u00B3"=>"%B3", "\u00B4"=>"%B4", "\u00B5"=>"%B5", "\u00B6"=>"%B6", "\u00B7"=>"%B7", "\u00B8"=>"%B8", "\u00B9"=>"%B9", "\u00BA"=>"%BA", "\u00BB"=>"%BB", "\u00BC"=>"%BC", "\u00BD"=>"%BD", "\u00BE"=>"%BE", "\u00BF"=>"%BF", "\u00C0"=>"%C0", "\u00C1"=>"%C1", "\u00C2"=>"%C2", "\u00C3"=>"%C3", "\u00C4"=>"%C4", "\u00C5"=>"%C5", "\u00C6"=>"%C6", "\u00C7"=>"%C7", "\u00C8"=>"%C8", "\u00C9"=>"%C9", "\u00CA"=>"%CA", "\u00CB"=>"%CB", "\u00CC"=>"%CC", "\u00CD"=>"%CD", "\u00CE"=>"%CE", "\u00CF"=>"%CF", "\u00D0"=>"%D0", "\u00D1"=>"%D1", "\u00D2"=>"%D2", "\u00D3"=>"%D3", "\u00D4"=>"%D4", "\u00D5"=>"%D5", "\u00D6"=>"%D6", "\u00D7"=>"%D7", "\u00D8"=>"%D8", "\u00D9"=>"%D9", "\u00DA"=>"%DA", "\u00DB"=>"%DB", "\u00DC"=>"%DC", "\u00DD"=>"%DD", "\u00DE"=>"%DE", "\u00DF"=>"%DF", "\u00E0"=>"%E0", "\u00E1"=>"%E1", "\u00E2"=>"%E2", "\u00E3"=>"%E3", "\u00E4"=>"%E4", "\u00E5"=>"%E5", "\u00E6"=>"%E6", "\u00E7"=>"%E7", "\u00E8"=>"%E8", "\u00E9"=>"%E9", "\u00EA"=>"%EA", "\u00EB"=>"%EB", "\u00EC"=>"%EC", "\u00ED"=>"%ED", "\u00EE"=>"%EE", "\u00EF"=>"%EF", "\u00F0"=>"%F0", "\u00F1"=>"%F1", "\u00F2"=>"%F2", "\u00F3"=>"%F3", "\u00F4"=>"%F4", "\u00F5"=>"%F5", "\u00F6"=>"%F6", "\u00F7"=>"%F7", "\u00F8"=>"%F8", "\u00F9"=>"%F9", "\u00FA"=>"%FA", "\u00FB"=>"%FB", "\u00FC"=>"%FC", "\u00FD"=>"%FD", "\u00FE"=>"%FE", "\u00FF"=>"%FF"}
|
@@ -54,7 +54,7 @@ module URI
|
|
54
54
|
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
55
55
|
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?![0-9a-fA-F][0-9a-fA-F])/ =~ str
|
56
56
|
str.b.gsub(/\+|%[0-9a-fA-F][0-9a-fA-F]/, TBLDECWWWCOMP_).force_encoding(enc)
|
57
|
-
end
|
57
|
+
end
|
58
58
|
end
|
59
59
|
|
60
60
|
module Kernel
|
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.
|
4
|
+
version: 0.7.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-
|
11
|
+
date: 2020-12-06 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.
|
19
|
+
version: 1.0.5
|
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.
|
26
|
+
version: 1.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: glimmer-dsl-xml
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: puts_debuggerer
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +209,19 @@ files:
|
|
209
209
|
- LICENSE.txt
|
210
210
|
- README.md
|
211
211
|
- VERSION
|
212
|
+
- app/assets/images/glimmer/images/calendar.gif
|
213
|
+
- app/assets/images/glimmer/images/ui-icons_222222_256x240.png
|
214
|
+
- app/assets/images/glimmer/images/ui-icons_444444_256x240.png
|
215
|
+
- app/assets/images/glimmer/images/ui-icons_555555_256x240.png
|
216
|
+
- app/assets/images/glimmer/images/ui-icons_777620_256x240.png
|
217
|
+
- app/assets/images/glimmer/images/ui-icons_777777_256x240.png
|
218
|
+
- app/assets/images/glimmer/images/ui-icons_cc0000_256x240.png
|
219
|
+
- app/assets/images/glimmer/images/ui-icons_ffffff_256x240.png
|
220
|
+
- app/assets/stylesheets/glimmer/glimmer.css
|
221
|
+
- app/assets/stylesheets/glimmer/jquery-ui.css
|
222
|
+
- app/assets/stylesheets/glimmer/jquery-ui.structure.css
|
223
|
+
- app/assets/stylesheets/glimmer/jquery-ui.theme.css
|
224
|
+
- app/assets/stylesheets/glimmer/jquery.ui.timepicker.css
|
212
225
|
- lib/glimmer-dsl-opal.rb
|
213
226
|
- lib/glimmer-dsl-opal/ext/date.rb
|
214
227
|
- lib/glimmer-dsl-opal/ext/exception.rb
|
@@ -228,22 +241,41 @@ files:
|
|
228
241
|
- lib/glimmer-dsl-opal/samples/hello/hello_computed/contact.rb
|
229
242
|
- lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb
|
230
243
|
- lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb
|
244
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb
|
231
245
|
- lib/glimmer-dsl-opal/samples/hello/hello_group.rb
|
232
246
|
- lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb
|
233
247
|
- lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
|
234
248
|
- lib/glimmer-dsl-opal/samples/hello/hello_radio.rb
|
235
249
|
- lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb
|
236
250
|
- lib/glimmer-dsl-opal/samples/hello/hello_tab.rb
|
251
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_table.rb
|
237
252
|
- lib/glimmer-dsl-opal/samples/hello/hello_world.rb
|
253
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/GPL-LICENSE.txt
|
254
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/MIT-LICENSE.txt
|
255
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/jquery.ui.timepicker.css
|
256
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui-timepicker/jquery.ui.timepicker.js
|
257
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/AUTHORS.txt
|
258
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/LICENSE.txt
|
259
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_444444_256x240.png
|
260
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_555555_256x240.png
|
261
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_777620_256x240.png
|
262
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_777777_256x240.png
|
263
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_cc0000_256x240.png
|
264
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/images/ui-icons_ffffff_256x240.png
|
265
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.min.css
|
266
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.min.js
|
267
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.structure.min.css
|
268
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/jquery-ui.theme.min.css
|
269
|
+
- lib/glimmer-dsl-opal/vendor/jquery-ui/package.json
|
238
270
|
- lib/glimmer-dsl-opal/vendor/jquery.js
|
239
271
|
- lib/glimmer-dsl-swt.rb
|
240
272
|
- lib/glimmer/data_binding/element_binding.rb
|
241
|
-
- lib/glimmer/data_binding/ext/observable_model.rb
|
242
273
|
- lib/glimmer/data_binding/list_selection_binding.rb
|
243
274
|
- lib/glimmer/data_binding/observable_element.rb
|
244
275
|
- lib/glimmer/data_binding/table_items_binding.rb
|
245
276
|
- lib/glimmer/dsl/opal/async_exec_expression.rb
|
246
277
|
- lib/glimmer/dsl/opal/bind_expression.rb
|
278
|
+
- lib/glimmer/dsl/opal/block_property_expression.rb
|
247
279
|
- lib/glimmer/dsl/opal/checkbox_group_selection_data_binding_expression.rb
|
248
280
|
- lib/glimmer/dsl/opal/color_expression.rb
|
249
281
|
- lib/glimmer/dsl/opal/column_properties_expression.rb
|
@@ -271,6 +303,7 @@ files:
|
|
271
303
|
- lib/glimmer/dsl/opal/table_items_data_binding_expression.rb
|
272
304
|
- lib/glimmer/dsl/opal/widget_expression.rb
|
273
305
|
- lib/glimmer/dsl/opal/widget_listener_expression.rb
|
306
|
+
- lib/glimmer/engine.rb
|
274
307
|
- lib/glimmer/swt.rb
|
275
308
|
- lib/glimmer/swt/browser_proxy.rb
|
276
309
|
- lib/glimmer/swt/button_proxy.rb
|
@@ -278,8 +311,10 @@ files:
|
|
278
311
|
- lib/glimmer/swt/color_proxy.rb
|
279
312
|
- lib/glimmer/swt/combo_proxy.rb
|
280
313
|
- lib/glimmer/swt/composite_proxy.rb
|
314
|
+
- lib/glimmer/swt/control_editor.rb
|
281
315
|
- lib/glimmer/swt/custom/checkbox_group.rb
|
282
316
|
- lib/glimmer/swt/custom/radio_group.rb
|
317
|
+
- lib/glimmer/swt/date_time_proxy.rb
|
283
318
|
- lib/glimmer/swt/display_proxy.rb
|
284
319
|
- lib/glimmer/swt/event_listener_proxy.rb
|
285
320
|
- lib/glimmer/swt/fill_layout_proxy.rb
|
@@ -304,6 +339,7 @@ files:
|
|
304
339
|
- lib/glimmer/swt/tab_folder_proxy.rb
|
305
340
|
- lib/glimmer/swt/tab_item_proxy.rb
|
306
341
|
- lib/glimmer/swt/table_column_proxy.rb
|
342
|
+
- lib/glimmer/swt/table_editor.rb
|
307
343
|
- lib/glimmer/swt/table_item_proxy.rb
|
308
344
|
- lib/glimmer/swt/table_proxy.rb
|
309
345
|
- lib/glimmer/swt/text_proxy.rb
|