shul 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -2
- data.tar.gz.sig +0 -0
- data/lib/shul.rb +89 -29
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0c889fb435e4092d24f058416ab632730f99239
|
4
|
+
data.tar.gz: 439d039a7699496c749cb17da891bb454db25926
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b794859fc0cb6aaf6d2f6c1a5d11fd3fc063ef69fe53cee14750f60442d801174bf0617d16e6aa9adb2c207e4865963454590a5056af4834a75c0e4228fc5ed6
|
7
|
+
data.tar.gz: 9d2c08db72c391ee11c4fb99647c9d636b5f16150e1b5999cd0fe6fa8f031e3a16de92cd81bdcc75f03440066fdd28eb14a1d654c6417d2800f398ec83536810
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
3��v��m̃OJ�/�IK��y��_�'G`6�>�a��A �d���j�
|
2
|
+
{\�^��!*��]��:�@����B�x�,��cp���9�Z���=��-/����ۂf�X~"�$�ZHMy_�{�x���Zae��4O�0z��f9�ifa�Y�C��_q�f0b�� �b0}ИQ�Y��poL���2ғ��#-�>�ŧ�x{v��g~��N1����gP�f� �Ɉ���Y����+�Tztxb��
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/shul.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
|
2
3
|
# file: shul.rb
|
3
4
|
# author: James Robertson
|
@@ -41,6 +42,7 @@ Shul::Main.new Shoes, doc
|
|
41
42
|
|
42
43
|
# modifications
|
43
44
|
#
|
45
|
+
# 12-Aug-2017: feature: A Radiogroup can now be created or deleted dynamically
|
44
46
|
# 11-Aug-2017: feature: An element can now be removed using method *remove*.
|
45
47
|
# 10-Aug-2017: feature: A Textbox element can now be created dynamically
|
46
48
|
# e.g. txt = e.create_element('textbox'); e.append_child txt
|
@@ -68,9 +70,11 @@ Shul::Main.new Shoes, doc
|
|
68
70
|
# * tested using the green_shoes gem.
|
69
71
|
|
70
72
|
|
73
|
+
|
71
74
|
require 'domle'
|
72
75
|
|
73
76
|
|
77
|
+
|
74
78
|
module RexleObject
|
75
79
|
refine Rexle::Element do
|
76
80
|
|
@@ -107,11 +111,18 @@ module Shul
|
|
107
111
|
|
108
112
|
class Box < Element
|
109
113
|
attr2_accessor *%i(background-color id margin padding)
|
114
|
+
|
115
|
+
def initialize(name=nil, attributes: {}, rexle: nil)
|
116
|
+
|
117
|
+
name = self.class.to_s[/\w+$/].downcase
|
118
|
+
super(name, attributes: attributes, rexle: rexle)
|
119
|
+
end
|
110
120
|
|
111
121
|
def append_child(obj)
|
112
122
|
|
113
123
|
node = self.add obj
|
114
|
-
|
124
|
+
|
125
|
+
@rexle.callback.add_element(node) if @rexle.callback
|
115
126
|
end
|
116
127
|
|
117
128
|
def deep_clone()
|
@@ -159,17 +170,34 @@ module Shul
|
|
159
170
|
end
|
160
171
|
|
161
172
|
class Radiogroup < Component
|
173
|
+
attr2_accessor *%i(value)
|
174
|
+
|
175
|
+
def initialize(name='radiogroup', attributes: nil, rexle: nil)
|
162
176
|
|
177
|
+
h = {value: ''}
|
178
|
+
h.merge!(attributes) if attributes
|
179
|
+
super(name, attributes: VisualAttributes.new(h), rexle: rexle)
|
180
|
+
end
|
181
|
+
|
163
182
|
end
|
164
183
|
|
165
184
|
class Radio < Component
|
185
|
+
|
186
|
+
attr2_accessor *%i(label value)
|
187
|
+
|
188
|
+
def initialize(name='radio', attributes: nil, rexle: nil)
|
189
|
+
|
190
|
+
h = {label: '', value: ''}
|
191
|
+
h.merge!(attributes) if attributes
|
192
|
+
super(name, attributes: VisualAttributes.new(h), rexle: rexle)
|
193
|
+
end
|
166
194
|
|
167
195
|
end
|
168
196
|
|
169
197
|
class Textbox < Component
|
170
198
|
|
171
199
|
attr2_accessor *%i(value size)
|
172
|
-
|
200
|
+
|
173
201
|
def initialize(name='textbox', attributes: nil, rexle: nil)
|
174
202
|
|
175
203
|
h = {value: '', size: '40'}
|
@@ -179,13 +207,30 @@ module Shul
|
|
179
207
|
end
|
180
208
|
|
181
209
|
|
182
|
-
def create_element(type,
|
210
|
+
def create_element(type, attributes={})
|
183
211
|
|
184
212
|
h = {
|
185
|
-
textbox: Shul::Shule::Textbox
|
213
|
+
textbox: Shul::Shule::Textbox,
|
214
|
+
radiogroup: Shul::Shule::Radiogroup,
|
215
|
+
radio: Shul::Shule::Radio
|
186
216
|
}
|
187
217
|
|
188
|
-
|
218
|
+
data = attributes.delete :data
|
219
|
+
|
220
|
+
element = h[type.to_sym].new(attributes: attributes, rexle: self)
|
221
|
+
|
222
|
+
if type == 'radiogroup' and data then
|
223
|
+
|
224
|
+
a = data
|
225
|
+
a.each do |label, value|
|
226
|
+
|
227
|
+
element.add create_element('radio', label: label, value: value)
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
232
|
+
|
233
|
+
return element
|
189
234
|
end
|
190
235
|
|
191
236
|
def inspect()
|
@@ -344,6 +389,18 @@ module Shul
|
|
344
389
|
|
345
390
|
using RexleObject
|
346
391
|
|
392
|
+
class Radiogroup
|
393
|
+
|
394
|
+
def initialize(e)
|
395
|
+
@e = e
|
396
|
+
end
|
397
|
+
|
398
|
+
def clear()
|
399
|
+
@e.elements.each {|x| x.obj.clear}
|
400
|
+
end
|
401
|
+
|
402
|
+
end
|
403
|
+
|
347
404
|
attr_reader :width, :height
|
348
405
|
|
349
406
|
def initialize(shoes, doc)
|
@@ -373,15 +430,20 @@ module Shul
|
|
373
430
|
|
374
431
|
end
|
375
432
|
|
376
|
-
def add_element(node
|
433
|
+
def add_element(node)
|
377
434
|
|
378
|
-
node.obj = method(
|
435
|
+
node.obj = method(node.name.sub(':','_').to_sym).call(node)
|
436
|
+
|
437
|
+
node.elements.each do |element|
|
438
|
+
element.obj = method(element.name.sub(':','_').to_sym).call(element)
|
439
|
+
end
|
440
|
+
|
379
441
|
refresh()
|
380
442
|
|
381
443
|
end
|
382
444
|
|
383
445
|
def refresh
|
384
|
-
@shoes.flush
|
446
|
+
@shoes.flush if @shoes
|
385
447
|
end
|
386
448
|
|
387
449
|
def remove_element(node)
|
@@ -619,31 +681,29 @@ module Shul
|
|
619
681
|
e.obj = @shoes.progress
|
620
682
|
end
|
621
683
|
|
622
|
-
def
|
623
|
-
|
624
|
-
r = nil
|
684
|
+
def radio(e)
|
625
685
|
|
626
|
-
e.
|
627
|
-
|
628
|
-
def x.value() self.attributes[:value] end
|
629
|
-
def x.value=(v) self.attributes[:value] = v end
|
630
|
-
|
631
|
-
x.value = x.attributes[:value].to_s
|
632
|
-
|
633
|
-
h = x.attributes
|
634
|
-
|
686
|
+
def e.value() self.attributes[:value] end
|
687
|
+
def e.value=(v) self.attributes[:value] = v end
|
635
688
|
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
689
|
+
e.value = e.attributes[:value].to_s
|
690
|
+
|
691
|
+
h = e.attributes
|
692
|
+
e.obj = @shoes.flow do
|
693
|
+
r = @shoes.radio :radiogroup01
|
694
|
+
r.click {e.parent.value = e.value unless e.value.empty?}
|
640
695
|
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
696
|
+
r.checked = h[:checked] == 'true'
|
697
|
+
@shoes.para h[:label]
|
698
|
+
end
|
699
|
+
|
700
|
+
end
|
701
|
+
|
702
|
+
def radiogroup(e)
|
646
703
|
|
704
|
+
|
705
|
+
|
706
|
+
e.obj = Radiogroup.new e
|
647
707
|
end
|
648
708
|
|
649
709
|
def quit()
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
t8eGazfn6KO3ECwm0DI6ZG6K+/TPPHv8HXfONWq0oGmvwamHXWjcz3hCa5hZw0Vt
|
32
32
|
+vU993j3UFViMQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-08-
|
34
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: domle
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
version: '0.1'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.1.
|
45
|
+
version: 0.1.11
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
version: '0.1'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.1.
|
55
|
+
version: 0.1.11
|
56
56
|
description:
|
57
57
|
email: james@jamesrobertson.eu
|
58
58
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|