htmlgrid 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/htmlgrid/dojotoolkit.rb +5 -5
- data/lib/htmlgrid/version.rb +1 -1
- data/test/test_component.rb +2 -2
- data/test/test_composite.rb +3 -5
- data/test/test_dojotoolkit.rb +74 -0
- data/test/test_grid.rb +14 -14
- data/test/test_interaction_list.rb +7 -5
- metadata +8 -9
- data/History.txt +0 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d505cc41b84a12f80f67b30b425bd5466d261cc3
|
4
|
+
data.tar.gz: 84670f093031efc69daef742c5c73f75e6e97474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd47cfdb1298fcfe65d1c123b7c92aa8c92b99430424e505d6f5b4a1aeb39b9a7acb92c92cd49b34ebe559fd4bdcdb2269b2d3f798028efc5a284fbe28f752f9
|
7
|
+
data.tar.gz: 48554f5b0ccb34936bf763d30b212895fb6edfff0e565429048b4774ec745f78e343c7818bc1d1f6a63e1d159dda2ba13f724a0849a5c41635a700e96cd082b6
|
data/lib/htmlgrid/dojotoolkit.rb
CHANGED
@@ -41,21 +41,22 @@ module HtmlGrid
|
|
41
41
|
# NOTE:
|
42
42
|
# DOJO >= 1.8 has support for type name separated by '/'
|
43
43
|
# but, <= 1.7 must be separated with '.'
|
44
|
-
'data-dojo-type' => 'dijit
|
45
|
-
'data-dojo-props' => "connectId
|
44
|
+
'data-dojo-type' => 'dijit/TooltipDialog',
|
45
|
+
'data-dojo-props' => "connectId:#{css_id}",
|
46
46
|
'id' => "#{css_id}_widget",
|
47
47
|
'style' => 'display: none',
|
48
48
|
}
|
49
|
-
unless match = @@msie_ptrn.match(@session.user_agent) \
|
49
|
+
unless (match = @@msie_ptrn.match(@session.user_agent)) \
|
50
50
|
&& match[1].to_i < 7
|
51
51
|
attrs.update({
|
52
52
|
'toggle' => 'fade',
|
53
53
|
'toggleDuration' => '500',
|
54
54
|
})
|
55
55
|
end
|
56
|
+
@dojo_tooltip ||= nil
|
56
57
|
if @dojo_tooltip.is_a?(String)
|
57
58
|
if @dojo_tooltip !~ /^http/ # e.g. javascript
|
58
|
-
attrs.store('href', "
|
59
|
+
attrs.store('href', "#@dojo_tooltip")
|
59
60
|
else
|
60
61
|
attrs.store('href', @dojo_tooltip)
|
61
62
|
end
|
@@ -101,7 +102,6 @@ module HtmlGrid
|
|
101
102
|
"preventBackButtonFix: #{!self.class::DOJO_BACK_BUTTON}",
|
102
103
|
"bindEncoding: '#{encoding}'",
|
103
104
|
"searchIds: []",
|
104
|
-
"async: true",
|
105
105
|
"urchin: ''",
|
106
106
|
"has: {
|
107
107
|
'dojo-firebug': #{self.class::DOJO_DEBUG},
|
data/lib/htmlgrid/version.rb
CHANGED
data/test/test_component.rb
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
# ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
|
22
22
|
# htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
|
23
23
|
#
|
24
|
-
# TestComponent -- htmlgrid -- 26.11.2002 -- hwyss@ywesee.com
|
24
|
+
# TestComponent -- htmlgrid -- 26.11.2002 -- hwyss@ywesee.com
|
25
25
|
|
26
26
|
$: << File.expand_path("../lib", File.dirname(__FILE__))
|
27
27
|
$: << File.expand_path("../ext", File.dirname(__FILE__))
|
@@ -59,7 +59,7 @@ class TestComponent < Minitest::Test
|
|
59
59
|
comp = HtmlGrid::Component.new("foo", "bar")
|
60
60
|
assert_equal("foo", comp.model)
|
61
61
|
assert_equal("bar", comp.session)
|
62
|
-
|
62
|
+
assert_nil(comp.container)
|
63
63
|
assert_equal(false, comp.label?)
|
64
64
|
comp.label = true
|
65
65
|
assert_equal(true, comp.label?)
|
data/test/test_composite.rb
CHANGED
@@ -178,13 +178,13 @@ module CompositeTest
|
|
178
178
|
composite = StubCompositeColspan1.new(
|
179
179
|
StubCompositeModel.new, StubCompositeSession.new)
|
180
180
|
composite.full_colspan
|
181
|
-
|
181
|
+
assert_nil(composite.full_colspan)
|
182
182
|
end
|
183
183
|
def test_full_colspan2
|
184
184
|
composite = StubCompositeColspan2.new(
|
185
185
|
StubCompositeModel.new, StubCompositeSession.new)
|
186
186
|
composite.full_colspan
|
187
|
-
|
187
|
+
assert_nil(composite.full_colspan)
|
188
188
|
end
|
189
189
|
def test_full_colspan3
|
190
190
|
composite = StubCompositeColspan3.new(
|
@@ -244,9 +244,7 @@ module CompositeTest
|
|
244
244
|
table = StubComposite4.new(
|
245
245
|
StubCompositeModel.new, StubCompositeSession.new)
|
246
246
|
assert_equal(<<-EXP.gsub(/\n|^\s*/, ''), table.to_html(CGI.new))
|
247
|
-
|
248
|
-
<TR><TD><A class="standard">brafoo</A></TD></TR>
|
249
|
-
</TABLE>
|
247
|
+
<TABLE cellspacing=\"0\"><TR><TD class=\"dradnats\"><A class=\"standard\">brafoo</A></TD></TR></TABLE>
|
250
248
|
EXP
|
251
249
|
end
|
252
250
|
def test_to_back
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# HtmlGrid -- HyperTextMarkupLanguage Framework
|
4
|
+
# Copyright (C) 2003 ywesee - intellectual capital connected
|
5
|
+
# Andreas Schrafl, Benjamin Fay, Hannes Wyss, Markus Huggler
|
6
|
+
#
|
7
|
+
# This library is free software; you can redistribute it and/or
|
8
|
+
# modify it under the terms of the GNU Lesser General Public
|
9
|
+
# License as published by the Free Software Foundation; either
|
10
|
+
# version 2.1 of the License, or (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public
|
18
|
+
# License along with this library; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
20
|
+
#
|
21
|
+
# ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
|
22
|
+
# htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
|
23
|
+
#
|
24
|
+
|
25
|
+
$: << File.expand_path('../lib', File.dirname(__FILE__))
|
26
|
+
$: << File.dirname(__FILE__)
|
27
|
+
|
28
|
+
require 'minitest/autorun'
|
29
|
+
require 'stub/cgi'
|
30
|
+
require 'htmlgrid/dojotoolkit'
|
31
|
+
require 'test_helper'
|
32
|
+
require 'flexmock/minitest'
|
33
|
+
|
34
|
+
class TestDojotoolkit < Minitest::Test
|
35
|
+
class StubAttributeComponent < HtmlGrid::Component
|
36
|
+
HTML_ATTRIBUTES = { "key" => "val" }
|
37
|
+
end
|
38
|
+
class StubInitComponent < HtmlGrid::Component
|
39
|
+
attr_reader :init_called
|
40
|
+
def init
|
41
|
+
@init_called = true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
class StubLabelComponent < HtmlGrid::Component
|
45
|
+
LABEL = true
|
46
|
+
end
|
47
|
+
class StubContainer
|
48
|
+
attr_accessor :onsubmit
|
49
|
+
end
|
50
|
+
def setup
|
51
|
+
@component = HtmlGrid::Component.new(nil, nil)
|
52
|
+
@session = flexmock('session') do |s|
|
53
|
+
s.should_receive(:user_agent).and_return('user_agent').by_default
|
54
|
+
end
|
55
|
+
@cgi = CGI.new
|
56
|
+
end
|
57
|
+
def test_dynamic_html
|
58
|
+
comp = HtmlGrid::Component.new("foo", @session)
|
59
|
+
comp.dojo_tooltip = 'my_tooltip'
|
60
|
+
assert_equal("foo", comp.model)
|
61
|
+
assert_equal(false, comp.label?)
|
62
|
+
result= comp.dynamic_html(@cgi)
|
63
|
+
assert(/href="my_tooltip"/.match(result))
|
64
|
+
end
|
65
|
+
def test_dynamic_html_with_msie
|
66
|
+
@session.should_receive(:user_agent).and_return('MSIE 4')
|
67
|
+
comp = HtmlGrid::Component.new("foo", @session)
|
68
|
+
comp.dojo_tooltip = 'my_tooltip'
|
69
|
+
assert_equal("foo", comp.model)
|
70
|
+
assert_equal(false, comp.label?)
|
71
|
+
result= comp.dynamic_html(@cgi)
|
72
|
+
assert(/href="my_tooltip"/.match(result))
|
73
|
+
end
|
74
|
+
end
|
data/test/test_grid.rb
CHANGED
@@ -123,9 +123,9 @@ class TestGrid < Minitest::Test
|
|
123
123
|
def test_add_multiple__3
|
124
124
|
@grid.add(["test", nil, "foo"], 0, 0)
|
125
125
|
assert_equal(1, @grid.height)
|
126
|
-
expected = '<TABLE cellspacing="0"><TR><TD>
|
126
|
+
expected = '<TABLE cellspacing="0"><TR><TD>testfoo</TD></TR></TABLE>'
|
127
127
|
assert_equal(expected, @grid.to_html(CGI.new))
|
128
|
-
assert_equal(
|
128
|
+
assert_equal(1, @grid.width)
|
129
129
|
end
|
130
130
|
def test_add_fieldx
|
131
131
|
@grid.add("test", 1, 0)
|
@@ -225,7 +225,7 @@ class TestGrid < Minitest::Test
|
|
225
225
|
expected = '<TABLE cellspacing="0"><TR><TD class="foo"> </TD></TR></TABLE>'
|
226
226
|
assert_equal(expected, @grid.to_html(CGI.new))
|
227
227
|
@grid.add(nil, 1,1)
|
228
|
-
@grid.add_style('bar', 0, 1, 2)
|
228
|
+
@grid.add_style('bar', 0, 1, 2)
|
229
229
|
expected = '<TABLE cellspacing="0"><TR><TD class="foo"> </TD>'
|
230
230
|
expected << '<TD> </TD></TR><TR><TD class="bar"> </TD>'
|
231
231
|
expected << '<TD class="bar"> </TD></TR></TABLE>'
|
@@ -271,7 +271,7 @@ class TestGrid < Minitest::Test
|
|
271
271
|
assert_equal(expected, @grid.to_html(CGI.new))
|
272
272
|
end
|
273
273
|
def test_attributes
|
274
|
-
### this test has changed behavior: its not desirable to have magically
|
274
|
+
### this test has changed behavior: its not desirable to have magically
|
275
275
|
### transferred css information from a component to its container
|
276
276
|
@grid.add(StubGridComponent.new, 0,0)
|
277
277
|
expected = '<TABLE cellspacing="0"><TR><TD>bar</TD></TR></TABLE>'
|
@@ -309,7 +309,7 @@ class TestGrid < Minitest::Test
|
|
309
309
|
end
|
310
310
|
def test_set_row_attributes3
|
311
311
|
@grid.set_row_attributes({'foo' => 'bar'}, 1, 2)
|
312
|
-
|
312
|
+
expected = '<TABLE cellspacing="0"><TR><TD> </TD><TD> </TD></TR><TR foo="bar"><TD> </TD><TD> </TD></TR></TABLE>'
|
313
313
|
assert_equal(expected, @grid.to_html(CGI.new))
|
314
314
|
end
|
315
315
|
def test_insert_row
|
@@ -357,7 +357,7 @@ class TestGrid < Minitest::Test
|
|
357
357
|
end
|
358
358
|
def test_nil_attribute2
|
359
359
|
thing = StubGridComponent.new
|
360
|
-
thing.set_attribute("class", nil)
|
360
|
+
thing.set_attribute("class", nil)
|
361
361
|
@grid.add(thing, 0,0)
|
362
362
|
@grid.to_html(CGI.new)
|
363
363
|
end
|
@@ -367,15 +367,15 @@ class TestGrid < Minitest::Test
|
|
367
367
|
@grid.to_html(CGI.new)
|
368
368
|
end
|
369
369
|
def test_add_negative
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
370
|
+
assert( @grid.add('foo', -1, 0) )
|
371
|
+
assert( @grid.add('foo', 0, -1) )
|
372
|
+
assert( @grid.add(['foo', 'bar'], -1, 0) )
|
373
|
+
assert( @grid.add(['foo', 'bar'], 0, -1) )
|
374
374
|
end
|
375
375
|
def test_add_style_negative
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
376
|
+
assert( @grid.add_style('bar', -1, 1) )
|
377
|
+
assert( @grid.add_style('bar', 1, -1) )
|
378
|
+
assert( @grid.add_style('bar', 1, 1, -1) )
|
379
|
+
assert( @grid.add_style('bar', 1, 1, 1,-1) )
|
380
380
|
end
|
381
381
|
end
|
@@ -88,6 +88,9 @@ module InteractionTest
|
|
88
88
|
end
|
89
89
|
def error(key)
|
90
90
|
end
|
91
|
+
def user_agent
|
92
|
+
'user_agent'
|
93
|
+
end
|
91
94
|
end
|
92
95
|
class StubCompositeForm < HtmlGrid::Form
|
93
96
|
COMPONENTS = {
|
@@ -247,9 +250,7 @@ module InteractionTest
|
|
247
250
|
table = StubComposite4.new(
|
248
251
|
StubCompositeModel.new, StubCompositeSession.new)
|
249
252
|
assert_equal(<<-EXP.gsub(/\n|^\s*/, ''), table.to_html(CGI.new))
|
250
|
-
|
251
|
-
<TR><TD><A class="standard">brafoo</A></TD></TR>
|
252
|
-
</TABLE>
|
253
|
+
<TABLE cellspacing=\"0\"><TR><TD class=\"dradnats\"><A class=\"standard\">brafoo</A></TD></TR></TABLE>
|
253
254
|
EXP
|
254
255
|
end
|
255
256
|
|
@@ -272,8 +273,8 @@ module InteractionTest
|
|
272
273
|
'<TR><TD>interaction for Marcoumar</TD></TR>',
|
273
274
|
'<TR><TD>interaction for Marcoumar</TD></TR></TABLE> <DIV id="drugs"></DIV><TABLE cellspacing="0">',
|
274
275
|
'<TR><TH> </TH></TR>',
|
275
|
-
'<TR><TD class="css.info"
|
276
|
-
'<TR><TD class="css.info-bg"
|
276
|
+
'<TR><TD class="css.info"> </TD></TR>',
|
277
|
+
'<TR><TD class="css.info-bg"> </TD></TR></TABLE>',
|
277
278
|
]
|
278
279
|
html = composite.to_html(CGI.new)
|
279
280
|
expected.each_with_index do |line, idx|
|
@@ -282,3 +283,4 @@ module InteractionTest
|
|
282
283
|
end
|
283
284
|
end
|
284
285
|
end
|
286
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmlgrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaomi Hatakeyama, Zeno R.R. Davatz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sbsm
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.6.4
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.6.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,7 +156,6 @@ executables: []
|
|
156
156
|
extensions: []
|
157
157
|
extra_rdoc_files: []
|
158
158
|
files:
|
159
|
-
- History.txt
|
160
159
|
- Manifest.txt
|
161
160
|
- lib/htmlgrid/booleanvalue.rb
|
162
161
|
- lib/htmlgrid/button.rb
|
@@ -214,6 +213,7 @@ files:
|
|
214
213
|
- test/test_component.rb
|
215
214
|
- test/test_composite.rb
|
216
215
|
- test/test_datevalue.rb
|
216
|
+
- test/test_dojotoolkit.rb
|
217
217
|
- test/test_form.rb
|
218
218
|
- test/test_formlist.rb
|
219
219
|
- test/test_grid.rb
|
@@ -245,9 +245,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
247
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.
|
248
|
+
rubygems_version: 2.6.8
|
249
249
|
signing_key:
|
250
250
|
specification_version: 4
|
251
251
|
summary: HtmlGrid is a Html-ToolKit for Ruby Webframeworks.
|
252
252
|
test_files: []
|
253
|
-
has_rdoc:
|
data/History.txt
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
=== 1.1.3 / 15.08.2016
|
2
|
-
|
3
|
-
* Add session variable fallback assignment
|
4
|
-
|
5
|
-
=== 1.1.2 / 10.08.2016
|
6
|
-
|
7
|
-
* Fix warnings by syntax or coding style
|
8
|
-
* Fix test errors
|
9
|
-
* Fix asset (doc) files permission
|
10
|
-
* Fix installation issues on ruby 2.0.0 and 2.1.9
|
11
|
-
* Add ruby 2.3.1 as ci target
|
12
|
-
|
13
|
-
=== 1.1.1 / 07.07.2016
|
14
|
-
|
15
|
-
* Improve dojotoolkit.rb
|
16
|
-
|
17
|
-
=== 1.1.0 / 06.07.2016
|
18
|
-
|
19
|
-
* Rename djConfig to dojoConfig
|
20
|
-
* Rename dojoType to data-dojo-type
|
21
|
-
* Remove duplicated dojoConfig (use only data-dojo-config)
|
22
|
-
* Add package support for onload script
|
23
|
-
|
24
|
-
=== 1.0.9 / 05.07.2016
|
25
|
-
|
26
|
-
* Made tooltip work with dojo 1.11
|
27
|
-
* Only tested with dojo 1.11. Works probably with dojo >= 1.8.
|
28
|
-
|
29
|
-
=== 1.0.8 / 10.05.2015
|
30
|
-
|
31
|
-
* Removed C-interface
|
32
|
-
* Removed obsolete tests for RUBY_VERSION < 1.9
|
33
|
-
* Ported to Ruby 2.3.0. Updated minitest. Use newer version of sbsm.
|
34
|
-
* Ruby 1.9.3 is no longer supported
|
35
|
-
|
36
|
-
=== 1.0.7 / 03.12.2013
|
37
|
-
|
38
|
-
* Remove LEGACY_INTERFACE. No. LEGACY_INTERFACE was readded before release 1.0.7
|
39
|
-
* Make travis work just fine.
|
40
|
-
|
41
|
-
=== 1.0.6 / 06.04.2012
|
42
|
-
|
43
|
-
* Updated onload problem against dojo 1.7
|
44
|
-
* Removed old version support
|
45
|
-
|
46
|
-
=== 1.0.5 / 23.02.2012
|
47
|
-
|
48
|
-
* trying to get rid of htmlgrid.so
|
49
|
-
|
50
|
-
=== 1.0.4 / 23.12.2011
|
51
|
-
|
52
|
-
* Added force_encoding('utf-8') to the return value of Grid#to_html method
|
53
|
-
|
54
|
-
=== 1.0.3 / 23.12.2011
|
55
|
-
|
56
|
-
* patch grid.c for Ruby 1.9.3
|
57
|
-
|
58
|
-
=== 1.0.2 / 23.12.2011
|
59
|
-
|
60
|
-
* Fix FachinfoDocument encoding error
|
61
|
-
|
62
|
-
=== 1.0.1 / 09.12.2011
|
63
|
-
|
64
|
-
* Updated component.rb to be compatible for both Ruby 1.8 and 1.9
|
65
|
-
* Fixed require grid.o for gem install case
|
66
|
-
|
67
|
-
=== 1.0.0 / 16.12.2010
|
68
|
-
|
69
|
-
* htmlgrid is now Ruby 1.9 ready.
|
70
|
-
|
71
|
-
* Birthday!
|
72
|
-
|