shul 0.4.7 → 0.4.8
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 +0 -0
- data.tar.gz.sig +0 -0
- data/lib/shul.rb +34 -11
- 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: ecc70586d7078c779c6eb96fd722d3d5e655d162
|
4
|
+
data.tar.gz: 5e3eb2c2c4278829afd3ccdbd8ffd6688dad4db9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbaa771e67c7d098fa3e32f88500e89609cef61754c1d22a460267bc1526c3ca10d68acbe1b1f5a8d2bcd34c0603f5d649d63756bbdd84fb003417d954fc3043
|
7
|
+
data.tar.gz: e54e50d2cabc1f49e4f16eb2ee69d55b379b7ea3b0398ae382099be10f655bfa7dd7ba818926c2d63223cc0871e8c6541118853c0c626ca07615b5c10f2f0061
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/shul.rb
CHANGED
@@ -41,6 +41,7 @@ Shul::Main.new Shoes, doc
|
|
41
41
|
|
42
42
|
# modifications
|
43
43
|
#
|
44
|
+
# 11-Aug-2017: feature: An element can now be removed using method *remove*.
|
44
45
|
# 10-Aug-2017: feature: A Textbox element can now be created dynamically
|
45
46
|
# e.g. txt = e.create_element('textbox'); e.append_child txt
|
46
47
|
# 09-Aug-2017: feature: onkeypress() now implemented.
|
@@ -105,11 +106,23 @@ module Shul
|
|
105
106
|
attr_accessor :callback
|
106
107
|
|
107
108
|
class Box < Element
|
108
|
-
attr2_accessor *%i(background-color margin padding)
|
109
|
+
attr2_accessor *%i(background-color id margin padding)
|
109
110
|
|
110
111
|
def append_child(obj)
|
111
|
-
|
112
|
-
|
112
|
+
|
113
|
+
node = self.add obj
|
114
|
+
@rexle.callback.add_element(node, obj) if @rexle.callback
|
115
|
+
end
|
116
|
+
|
117
|
+
def deep_clone()
|
118
|
+
|
119
|
+
Shule.new(self.xml, rexle: @rexle).root
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
def remove()
|
124
|
+
@rexle.callback.remove_element(self) if @rexle.callback
|
125
|
+
self.delete
|
113
126
|
end
|
114
127
|
|
115
128
|
end
|
@@ -155,21 +168,24 @@ module Shul
|
|
155
168
|
|
156
169
|
class Textbox < Component
|
157
170
|
|
158
|
-
attr2_accessor *%i(
|
171
|
+
attr2_accessor *%i(value size)
|
159
172
|
|
160
173
|
def initialize(name='textbox', attributes: nil, rexle: nil)
|
161
|
-
|
174
|
+
|
175
|
+
h = {value: '', size: '40'}
|
176
|
+
h.merge!(attributes) if attributes
|
177
|
+
super(name, attributes: h, rexle: rexle)
|
162
178
|
end
|
163
179
|
end
|
164
180
|
|
165
181
|
|
166
|
-
def create_element(type)
|
182
|
+
def create_element(type, id: '')
|
167
183
|
|
168
184
|
h = {
|
169
|
-
textbox: Shul::Shule::Textbox
|
185
|
+
textbox: Shul::Shule::Textbox
|
170
186
|
}
|
171
|
-
|
172
|
-
h[type.to_sym]
|
187
|
+
|
188
|
+
h[type.to_sym].new(attributes: {id: id}, rexle: self)
|
173
189
|
end
|
174
190
|
|
175
191
|
def inspect()
|
@@ -208,7 +224,7 @@ module Shul
|
|
208
224
|
class Main
|
209
225
|
|
210
226
|
|
211
|
-
def initialize(shoes, source)
|
227
|
+
def initialize(shoes, source)
|
212
228
|
|
213
229
|
if source.is_a? Shule then
|
214
230
|
|
@@ -367,6 +383,11 @@ module Shul
|
|
367
383
|
def refresh
|
368
384
|
@shoes.flush
|
369
385
|
end
|
386
|
+
|
387
|
+
def remove_element(node)
|
388
|
+
node.obj.clear
|
389
|
+
refresh()
|
390
|
+
end
|
370
391
|
|
371
392
|
private
|
372
393
|
|
@@ -417,7 +438,7 @@ module Shul
|
|
417
438
|
obj = @shoes.method(name).call
|
418
439
|
obj.text = e.attributes[:value]
|
419
440
|
obj.change {|x| e.value = x.text() if x.text != e.text}
|
420
|
-
|
441
|
+
|
421
442
|
|
422
443
|
def e.value()
|
423
444
|
self.attributes[:value]
|
@@ -428,6 +449,8 @@ module Shul
|
|
428
449
|
self.obj.text = v
|
429
450
|
end
|
430
451
|
|
452
|
+
e.obj = obj
|
453
|
+
|
431
454
|
end
|
432
455
|
|
433
456
|
|
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.8
|
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-10 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.10
|
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.10
|
56
56
|
description:
|
57
57
|
email: james@jamesrobertson.eu
|
58
58
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|