htmlgrid 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/htmlgrid/dojotoolkit.rb +35 -28
- data/lib/htmlgrid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5d30addff4506799b90228f01a9c910f6231967
|
4
|
+
data.tar.gz: d96e8a7d27da7aab4acaf1458a334bbf89c76af2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7be2249769ff2f267ff89af97188e897c89e87d79403e71cb24658f315cf09d25211f756db822aec048da2ecf6fdc166c74a82b1c734b570b0cae68bec642754
|
7
|
+
data.tar.gz: b6995921b53ae767df96a8fabdd97e3d7de0396e1a5a3626e88e7ed7d5259c9c84cd97de5e1f54ec26c00b3e7898499fa17f242cf31fb60fef9d9f7e98f86a8a
|
data/History.txt
CHANGED
data/lib/htmlgrid/dojotoolkit.rb
CHANGED
@@ -7,10 +7,9 @@ require 'htmlgrid/component'
|
|
7
7
|
require 'htmlgrid/div'
|
8
8
|
|
9
9
|
module HtmlGrid
|
10
|
-
|
10
|
+
class Component
|
11
11
|
@@msie_ptrn = /MSIE\s*(\d)/
|
12
|
-
|
13
|
-
# FIXME
|
12
|
+
attr_accessor :dojo_tooltip
|
14
13
|
# DOJO_VERSION >= 1.7.0 only (removed old version support)
|
15
14
|
def dojo_tag(widget, args={}, inner_html='')
|
16
15
|
div = HtmlGrid::Div.new(@model, @session, self)
|
@@ -29,50 +28,58 @@ module HtmlGrid
|
|
29
28
|
tooltip.value = value
|
30
29
|
self.dojo_tooltip = tooltip
|
31
30
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
unless
|
31
|
+
def dojo_parse_on_load
|
32
|
+
if @container.respond_to?(:dojo_parse_on_load)
|
33
|
+
@container.dojo_parse_on_load
|
34
|
+
end
|
35
|
+
end
|
36
|
+
unless method_defined?(:dojo_dynamic_html)
|
38
37
|
alias :dojo_dynamic_html :dynamic_html
|
39
38
|
def dynamic_html(context)
|
40
39
|
html = ''
|
41
40
|
attrs = {
|
42
|
-
|
43
|
-
|
44
|
-
'
|
45
|
-
'
|
41
|
+
# NOTE:
|
42
|
+
# DOJO >= 1.8 has support for type name separated by '/'
|
43
|
+
# but, <= 1.7 must be separated with '.'
|
44
|
+
'data-dojo-type' => 'dijit.Tooltip',
|
45
|
+
'data-dojo-props' => "connectId:'#{css_id}'",
|
46
|
+
'id' => "#{css_id}_widget",
|
47
|
+
'style' => 'display: none',
|
46
48
|
}
|
47
|
-
unless
|
48
|
-
&& match[1].to_i < 7
|
49
|
+
unless match = @@msie_ptrn.match(@session.user_agent) \
|
50
|
+
&& match[1].to_i < 7
|
49
51
|
attrs.update({
|
50
52
|
'toggle' => 'fade',
|
51
53
|
'toggleDuration' => '500',
|
52
54
|
})
|
53
55
|
end
|
54
|
-
if
|
55
|
-
|
56
|
+
if @dojo_tooltip.is_a?(String)
|
57
|
+
if @dojo_tooltip !~ /^http/ # e.g. javascript
|
58
|
+
attrs.store('href', "'#@dojo_tooltip'")
|
59
|
+
else
|
60
|
+
attrs.store('href', @dojo_tooltip)
|
61
|
+
end
|
56
62
|
html << context.div(attrs)
|
57
|
-
elsif
|
63
|
+
elsif @dojo_tooltip.respond_to?(:to_html)
|
58
64
|
@dojo_tooltip.attributes.update(attrs)
|
59
65
|
html << @dojo_tooltip.to_html(context).force_encoding('utf-8')
|
60
66
|
end
|
61
|
-
unless
|
67
|
+
unless html.empty? || dojo_parse_on_load
|
62
68
|
html << context.script('type' => 'text/javascript') {
|
63
69
|
"dojoConfig.searchIds.push('#{css_id}')"
|
64
70
|
}
|
65
71
|
end
|
72
|
+
# call original dynamic_html
|
66
73
|
dojo_dynamic_html(context) << html
|
67
74
|
end
|
68
75
|
end
|
69
|
-
|
76
|
+
end
|
70
77
|
module DojoToolkit
|
71
78
|
module DojoTemplate
|
72
79
|
DOJO_DEBUG = false
|
73
80
|
DOJO_BACK_BUTTON = false
|
74
81
|
DOJO_ENCODING = nil
|
75
|
-
|
82
|
+
DOJO_PARSE_ON_LOAD = true
|
76
83
|
DOJO_PREFIX = []
|
77
84
|
DOJO_REQUIRE = []
|
78
85
|
def dynamic_html_headers(context)
|
@@ -89,7 +96,7 @@ module HtmlGrid
|
|
89
96
|
}.join(",")
|
90
97
|
end
|
91
98
|
config = [
|
92
|
-
"parseOnLoad:
|
99
|
+
"parseOnLoad: #{self.class::DOJO_PARSE_ON_LOAD}",
|
93
100
|
"isDebug: #{self.class::DOJO_DEBUG}",
|
94
101
|
"preventBackButtonFix: #{!self.class::DOJO_BACK_BUTTON}",
|
95
102
|
"bindEncoding: '#{encoding}'",
|
@@ -131,15 +138,15 @@ module HtmlGrid
|
|
131
138
|
}
|
132
139
|
dojo_dir = File.dirname(dojo_path)
|
133
140
|
headers << context.style(:type => "text/css") { <<-EOS
|
134
|
-
|
135
|
-
|
136
|
-
|
141
|
+
@import "#{File.join(dojo_dir, "/resources/dojo.css")}";
|
142
|
+
@import "#{File.join(dojo_dir, "../dijit/themes/tundra/tundra.css")}";
|
143
|
+
EOS
|
137
144
|
}
|
138
145
|
headers
|
139
146
|
end
|
140
|
-
|
141
|
-
|
142
|
-
|
147
|
+
def dojo_parse_on_load
|
148
|
+
self.class::DOJO_PARSE_ON_LOAD
|
149
|
+
end
|
143
150
|
def onload=(script)
|
144
151
|
(@dojo_onloads ||= []).push(script)
|
145
152
|
end
|
data/lib/htmlgrid/version.rb
CHANGED
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.1
|
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: 2016-07-
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sbsm
|