glimmer-dsl-opal 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +73 -4
- data/VERSION +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_browser.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_button.rb +46 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +7 -7
- data/lib/glimmer/dsl/opal/custom_widget_expression.rb +5 -0
- data/lib/glimmer/swt/date_time_proxy.rb +1 -1
- data/lib/glimmer/swt/grid_layout_proxy.rb +7 -8
- data/lib/glimmer/swt/label_proxy.rb +11 -3
- data/lib/glimmer/swt/layout_data_proxy.rb +4 -1
- data/lib/glimmer/swt/message_box_proxy.rb +2 -10
- data/lib/glimmer/ui/custom_shell.rb +9 -7
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7eae61c6229ea57329b4ef092da209e5fb6df422c81250cb23e9b5a389a8e48
|
4
|
+
data.tar.gz: a88dc02904e056011e050f552735227a5dd9ebf2232875f934f39da7f0b117d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7d86f37ff864394d31403aa99c4af80248e389dbbe894cf5dd615c3bae6b0b8c21e6191e7d75bc3a753c8227db1cf730ccc14feaae42395c89a62af15ee573e
|
7
|
+
data.tar.gz: 5b0c73b30a581c883a45c832817eed87e9260cb236056718083a42d67f0c93af397d58e052e231503d59f2e8ada03287cde0b5c89bf35729be5889924b7ed2fb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.7.4
|
4
|
+
|
5
|
+
- Hello, Button! Sample
|
6
|
+
- Fix issue with aligning label as :left, :center, or :right via style style when fill_layout is used
|
7
|
+
- Fix Hello, Browser sample by accessing https ssl website
|
8
|
+
- Fix issue with filling space horizontally when using grid layout
|
9
|
+
- Fix broken embedded `calendar` widget data-binding for hello_date_time.rb sample
|
10
|
+
- Fix broken message_box after opening multiple shells
|
11
|
+
- Fix issue with opening custom shells in new tabs/windows when CustomShell subclass is required conditionally
|
12
|
+
|
3
13
|
## 0.7.3
|
4
14
|
|
5
15
|
- Refactor to use to_collection gem
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Opal 0.7.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Opal 0.7.4 (Pure Ruby Web GUI)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-opal.svg)](http://badge.fury.io/rb/glimmer-dsl-opal)
|
3
3
|
[![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
4
|
|
@@ -58,7 +58,7 @@ Tic Tac Toe on the desktop with the same exact code (using the [`glimmer-dsl-swt
|
|
58
58
|
![Glimmer DSL for SWT Tic Tac Toe In Progress](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-tic-tac-toe-in-progress.png)
|
59
59
|
![Glimmer DSL for SWT Tic Tac Toe Game Over](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-tic-tac-toe-game-over.png)
|
60
60
|
|
61
|
-
NOTE: **Alpha Version** 0.7.
|
61
|
+
NOTE: **Alpha Version** 0.7.4 only supports bare-minimum capabilities for the following [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) [samples](https://github.com/AndyObtiva/glimmer#samples):
|
62
62
|
|
63
63
|
Hello:
|
64
64
|
|
@@ -78,6 +78,7 @@ Hello:
|
|
78
78
|
- [Hello, Checkbox Group!](#hello-checkbox-group)
|
79
79
|
- [Hello, Date Time!](#hello-date-time)
|
80
80
|
- [Hello, Table!](#hello-table)
|
81
|
+
- [Hello, Button!](#hello-button)
|
81
82
|
|
82
83
|
Elaborate:
|
83
84
|
|
@@ -145,6 +146,12 @@ Last but not least, you would likely want some special branding on the web, so y
|
|
145
146
|
|
146
147
|
Alternatively, web developers may directly use [Glimmer DSL for Opal](https://rubygems.org/gems/glimmer-dsl-opal) to build the GUI of web apps since it is as simple as desktop development, thus requiring a lot less code that is in pure Ruby only (as demonstrated in examples below) and avoiding opaque web concepts like 'render' and 'reactive' due to treating GUI as persistent just like desktop apps do. No HTML/JS/CSS skills are even required. Still, web designers may be involved with CSS only if needed, thanks to the clean semantic markup [Glimmer DSL for Opal](https://rubygems.org/gems/glimmer-dsl-opal) automatically produces.
|
147
148
|
|
149
|
+
## Principles
|
150
|
+
|
151
|
+
- Live purely in Rubyland via the Glimmer GUI DSL, completely oblivious to web browser technologies.
|
152
|
+
- Forget Routers! Glimmer DSL for Opal supports auto-routing of custom shells (windows), which are opened as separate tabs in a web browser with automatically generated routes and bookmarkable URLs.
|
153
|
+
- HTML is strictly made for creating documents not interactive applications. As such, software engineers can avoid and focus on creating web applications with Glimmer DSL for Opal in pure Ruby while content creators and web designers are the ones responsible for creating HTML documents for content purposes only as HTML was originally intended. As such, Glimmer web GUI built by software engineers gets embedded in the body of a web page with content around it maintained by content creators and web designers. This achieves a correct separation of responsibilities and better maintainability.
|
154
|
+
|
148
155
|
## Pre-requisites
|
149
156
|
|
150
157
|
- Rails 5: [https://github.com/rails/rails/tree/5-2-stable](https://github.com/rails/rails/tree/5-2-stable)
|
@@ -155,7 +162,7 @@ Alternatively, web developers may directly use [Glimmer DSL for Opal](https://ru
|
|
155
162
|
|
156
163
|
## Setup
|
157
164
|
|
158
|
-
(NOTE:
|
165
|
+
(NOTE: Keep in mind this is a very early experimental and incomplete **alpha**. If you run into issues, try to go back to a [previous revision](https://rubygems.org/gems/glimmer-dsl-opal/versions). Also, there is a slight chance any issues you encounter are fixed in master or some other branch that you could check out instead)
|
159
166
|
|
160
167
|
The [glimmer-dsl-opal](https://rubygems.org/gems/glimmer-dsl-opal) gem is a Rails Engine gem that includes assets.
|
161
168
|
|
@@ -179,7 +186,7 @@ Add the following to `Gemfile`:
|
|
179
186
|
gem 'opal-rails', '~> 1.1.2'
|
180
187
|
gem 'opal-async', '~> 1.2.0'
|
181
188
|
gem 'opal-jquery', '~> 0.4.4'
|
182
|
-
gem 'glimmer-dsl-opal', '~> 0.7.
|
189
|
+
gem 'glimmer-dsl-opal', '~> 0.7.4'
|
183
190
|
gem 'glimmer-dsl-xml', '~> 1.1.0', require: false
|
184
191
|
gem 'glimmer-dsl-css', '~> 1.1.0', require: false
|
185
192
|
|
@@ -809,6 +816,10 @@ You should see "Hello, Custom Widget!"
|
|
809
816
|
|
810
817
|
#### Hello, Custom Shell!
|
811
818
|
|
819
|
+
This sample demonstrates Glimmer DSL for Opal's ability to open multiple shells (windows) as web browser tabs.
|
820
|
+
|
821
|
+
It automatically handles routing so that tab URLs are bookmarkable. Web developers do not have to do any routing configuration manually.
|
822
|
+
|
812
823
|
Add the following require statement to `app/assets/javascripts/application.rb`
|
813
824
|
|
814
825
|
```ruby
|
@@ -1886,6 +1897,64 @@ Hello, Table! Game Booked
|
|
1886
1897
|
|
1887
1898
|
![Glimmer DSL for Opal Hello Table](images/glimmer-dsl-opal-hello-table-game-booked.png)
|
1888
1899
|
|
1900
|
+
#### Hello, Button!
|
1901
|
+
|
1902
|
+
Add the following require statement to `app/assets/javascripts/application.rb`
|
1903
|
+
|
1904
|
+
```ruby
|
1905
|
+
require 'glimmer-dsl-opal/samples/hello/hello_button'
|
1906
|
+
```
|
1907
|
+
|
1908
|
+
Or add the Glimmer code directly if you prefer to play around with it:
|
1909
|
+
|
1910
|
+
```ruby
|
1911
|
+
class HelloButton
|
1912
|
+
include Glimmer
|
1913
|
+
|
1914
|
+
attr_accessor :count
|
1915
|
+
|
1916
|
+
def initialize
|
1917
|
+
@count = 0
|
1918
|
+
end
|
1919
|
+
|
1920
|
+
def launch
|
1921
|
+
shell {
|
1922
|
+
text 'Hello, Button!'
|
1923
|
+
|
1924
|
+
button {
|
1925
|
+
text bind(self, :count) {|value| "Click To Increment: #{value} "}
|
1926
|
+
|
1927
|
+
on_widget_selected {
|
1928
|
+
self.count += 1
|
1929
|
+
}
|
1930
|
+
}
|
1931
|
+
}.open
|
1932
|
+
end
|
1933
|
+
end
|
1934
|
+
|
1935
|
+
HelloButton.new.launch
|
1936
|
+
```
|
1937
|
+
|
1938
|
+
Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
|
1939
|
+
|
1940
|
+
![Glimmer DSL for SWT Hello Button](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-hello-button.png)
|
1941
|
+
![Glimmer DSL for SWT Hello Button](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-hello-button-incremented.png)
|
1942
|
+
|
1943
|
+
Glimmer app on the web (using `glimmer-dsl-opal` gem):
|
1944
|
+
|
1945
|
+
Start the Rails server:
|
1946
|
+
```
|
1947
|
+
rails s
|
1948
|
+
```
|
1949
|
+
|
1950
|
+
Visit `http://localhost:3000`
|
1951
|
+
|
1952
|
+
You should see "Hello, Button!"
|
1953
|
+
|
1954
|
+
![Glimmer DSL for Opal Hello Button](images/glimmer-dsl-opal-hello-button.png)
|
1955
|
+
![Glimmer DSL for Opal Hello Button](images/glimmer-dsl-opal-hello-button-incremented.png)
|
1956
|
+
|
1957
|
+
|
1889
1958
|
### Elaborate Samples
|
1890
1959
|
|
1891
1960
|
#### Login
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.4
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Copyright (c) 2007-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 HelloButton
|
23
|
+
include Glimmer
|
24
|
+
|
25
|
+
attr_accessor :count
|
26
|
+
|
27
|
+
def initialize
|
28
|
+
@count = 0
|
29
|
+
end
|
30
|
+
|
31
|
+
def launch
|
32
|
+
shell {
|
33
|
+
text 'Hello, Button!'
|
34
|
+
|
35
|
+
button {
|
36
|
+
text bind(self, :count) {|value| "Click To Increment: #{value} "}
|
37
|
+
|
38
|
+
on_widget_selected {
|
39
|
+
self.count += 1
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}.open
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
HelloButton.new.launch
|
@@ -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
|
@@ -26,7 +26,7 @@ require 'date'
|
|
26
26
|
class EmailShell
|
27
27
|
include Glimmer::UI::CustomShell
|
28
28
|
|
29
|
-
# multiple options without default values
|
29
|
+
# multiple options without default values
|
30
30
|
options :date, :subject, :from, :message
|
31
31
|
|
32
32
|
# single option with default value
|
@@ -41,7 +41,7 @@ class EmailShell
|
|
41
41
|
shell(swt_style) {
|
42
42
|
grid_layout(2, false)
|
43
43
|
|
44
|
-
text subject
|
44
|
+
text subject
|
45
45
|
|
46
46
|
label {
|
47
47
|
text 'Date:'
|
@@ -78,7 +78,7 @@ class EmailShell
|
|
78
78
|
}
|
79
79
|
|
80
80
|
background :white
|
81
|
-
text message
|
81
|
+
text message
|
82
82
|
}
|
83
83
|
}
|
84
84
|
}
|
@@ -149,7 +149,7 @@ class HelloCustomShell
|
|
149
149
|
}
|
150
150
|
}
|
151
151
|
}.open
|
152
|
-
end
|
152
|
+
end
|
153
153
|
end
|
154
154
|
|
155
155
|
HelloCustomShell.new.launch
|
@@ -42,6 +42,11 @@ module Glimmer
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def interpret(parent, keyword, *args, &block)
|
45
|
+
begin
|
46
|
+
require `localStorage[#{keyword}]`
|
47
|
+
rescue => e
|
48
|
+
Glimmer::Config.logger.debug e.message
|
49
|
+
end
|
45
50
|
custom_widget_class = UI::CustomWidget.for(keyword)
|
46
51
|
# TODO clean code by extracting methods into CustomShell
|
47
52
|
if !Glimmer::UI::CustomShell.requested? && custom_widget_class&.ancestors&.to_a.include?(Glimmer::UI::CustomShell)
|
@@ -114,7 +114,7 @@ module Glimmer
|
|
114
114
|
event: 'change',
|
115
115
|
event_handler: -> (event_listener) {
|
116
116
|
-> (event) {
|
117
|
-
if date? || (time? && @timepicker_done)
|
117
|
+
if calendar? || date? || (time? && @timepicker_done)
|
118
118
|
@timepicker_done = false if time?
|
119
119
|
event_listener.call(event)
|
120
120
|
end
|
@@ -7,9 +7,8 @@ module Glimmer
|
|
7
7
|
.grid-layout {
|
8
8
|
display: grid;
|
9
9
|
grid-template-rows: min-content;
|
10
|
-
justify-content: start;
|
11
10
|
place-content: start;
|
12
|
-
align-items: stretch;
|
11
|
+
align-items: stretch;
|
13
12
|
}
|
14
13
|
CSS
|
15
14
|
attr_reader :num_columns, :make_columns_equal_width, :horizontal_spacing, :vertical_spacing, :margin_width, :margin_height
|
@@ -18,7 +17,7 @@ module Glimmer
|
|
18
17
|
super(parent, args)
|
19
18
|
self.horizontal_spacing = 10
|
20
19
|
self.vertical_spacing = 10
|
21
|
-
self.num_columns = @args.first || 1
|
20
|
+
self.num_columns = @args.first || 1
|
22
21
|
reapply
|
23
22
|
end
|
24
23
|
|
@@ -30,7 +29,7 @@ module Glimmer
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def make_columns_equal_width=(equal_width)
|
33
|
-
@make_columns_equal_width = equal_width
|
32
|
+
@make_columns_equal_width = equal_width
|
34
33
|
# @parent.add_css_class('make_columns_equal_width') if @make_columns_equal_width
|
35
34
|
reapply
|
36
35
|
end
|
@@ -68,15 +67,15 @@ module Glimmer
|
|
68
67
|
grid-column-gap: #{@horizontal_spacing}px;
|
69
68
|
CSS
|
70
69
|
if @parent.css_classes.include?('grid-layout')
|
71
|
-
layout_css.split(";").map(&:strip).map {|l| l.split(':').map(&:strip)}.each do |key, value|
|
70
|
+
layout_css.split(";").map(&:strip).map {|l| l.split(':').map(&:strip)}.each do |key, value|
|
72
71
|
@parent.dom_element.css(key, value) unless key.nil?
|
73
72
|
end
|
74
73
|
else
|
75
|
-
layout_css.split(";").map(&:strip).map {|l| l.split(':').map(&:strip)}.each do |key, value|
|
74
|
+
layout_css.split(";").map(&:strip).map {|l| l.split(':').map(&:strip)}.each do |key, value|
|
76
75
|
@parent.dom_element.css(key, 'initial') unless key.nil?
|
77
|
-
end
|
76
|
+
end
|
78
77
|
end
|
79
|
-
end
|
78
|
+
end
|
80
79
|
end
|
81
80
|
end
|
82
81
|
end
|
@@ -4,11 +4,10 @@ require 'glimmer/swt/widget_proxy'
|
|
4
4
|
module Glimmer
|
5
5
|
module SWT
|
6
6
|
class LabelProxy < WidgetProxy
|
7
|
-
attr_reader :text, :background_image, :image
|
7
|
+
attr_reader :text, :background_image, :image
|
8
8
|
|
9
9
|
def initialize(parent, args, block)
|
10
10
|
super(parent, args, block)
|
11
|
-
self.alignment = [:left, :center, :right].detect {|align| args.detect { |arg| SWTProxy[align] == arg } }
|
12
11
|
end
|
13
12
|
|
14
13
|
def text=(value)
|
@@ -32,6 +31,15 @@ module Glimmer
|
|
32
31
|
def element
|
33
32
|
'label'
|
34
33
|
end
|
34
|
+
|
35
|
+
def alignment
|
36
|
+
if @alignment.nil?
|
37
|
+
found_arg = nil
|
38
|
+
@alignment = [:left, :center, :right].detect {|align| found_arg = args.detect { |arg| SWTProxy[align] == SWTProxy[arg] } }
|
39
|
+
args.delete(found_arg)
|
40
|
+
end
|
41
|
+
@alignment
|
42
|
+
end
|
35
43
|
|
36
44
|
def alignment=(value)
|
37
45
|
# TODO consider storing swt value in the future instead
|
@@ -44,7 +52,7 @@ module Glimmer
|
|
44
52
|
label_id = id
|
45
53
|
label_class = name
|
46
54
|
@dom ||= html {
|
47
|
-
label(id: label_id, class: label_class) {
|
55
|
+
label(id: label_id, class: label_class, style: "text-align: #{alignment};") {
|
48
56
|
label_text
|
49
57
|
}
|
50
58
|
}.to_s
|
@@ -48,7 +48,8 @@ module Glimmer
|
|
48
48
|
if @horizontal_alignment == 'fill'
|
49
49
|
@parent.dom_element.css('width', '100%') if width_hint.nil?
|
50
50
|
else
|
51
|
-
@parent.dom_element.css('text-align', @horizontal_alignment)
|
51
|
+
@parent.dom_element.css('text-align', @horizontal_alignment.to_s)
|
52
|
+
@parent.dom_element.css('place-self', @horizontal_alignment.to_s)
|
52
53
|
@parent.dom_element.css('margin-left', 'auto') if ['right', 'center'].include?(@horizontal_alignment.to_s)
|
53
54
|
@parent.dom_element.css('margin-right', 'auto') if ['left', 'center'].include?(@horizontal_alignment.to_s)
|
54
55
|
end
|
@@ -89,6 +90,8 @@ module Glimmer
|
|
89
90
|
def grab_excess_horizontal_space=(grab_excess_horizontal_space)
|
90
91
|
@grab_excess_horizontal_space = grab_excess_horizontal_space
|
91
92
|
@parent.dom_element.css('width', "100%") if @grab_excess_horizontal_space && @horizontal_alignment == 'fill' && width_hint.nil?
|
93
|
+
@parent.dom_element.css('justify-self', @horizontal_alignment) if @grab_excess_horizontal_space && @horizontal_alignment != 'fill' && width_hint.nil?
|
94
|
+
@parent.parent.dom_element.css('justify-content', "normal") if @grab_excess_horizontal_space
|
92
95
|
# reapply
|
93
96
|
end
|
94
97
|
|
@@ -8,7 +8,7 @@ module Glimmer
|
|
8
8
|
|
9
9
|
def initialize(parent, args, block)
|
10
10
|
i = 0
|
11
|
-
@parent = parent || DisplayProxy.instance.shells.
|
11
|
+
@parent = parent || DisplayProxy.instance.shells.last
|
12
12
|
@args = args
|
13
13
|
@block = block
|
14
14
|
@children = Set.new
|
@@ -30,16 +30,8 @@ module Glimmer
|
|
30
30
|
dom_element.find('.modal-content .message').html(@text)
|
31
31
|
end
|
32
32
|
|
33
|
-
def document
|
34
|
-
element = self
|
35
|
-
begin
|
36
|
-
element = element.parent
|
37
|
-
end while(element.parent)
|
38
|
-
element
|
39
|
-
end
|
40
|
-
|
41
33
|
def open
|
42
|
-
|
34
|
+
parent.post_initialize_child(self)
|
43
35
|
end
|
44
36
|
|
45
37
|
def hide
|
@@ -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)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-opal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
@@ -251,6 +251,7 @@ files:
|
|
251
251
|
- lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/board.rb
|
252
252
|
- lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb
|
253
253
|
- lib/glimmer-dsl-opal/samples/hello/hello_browser.rb
|
254
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_button.rb
|
254
255
|
- lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb
|
255
256
|
- lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb
|
256
257
|
- lib/glimmer-dsl-opal/samples/hello/hello_combo.rb
|