htmlgrid 1.0.9 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc2a221d74e06626ae58d60dedfddd2b02bf9604
4
- data.tar.gz: 8623a7bd39724e206e54b956e478d9cfb9197c6b
3
+ metadata.gz: 5ff89d7ef9b327cfe5f71794afc0e08acabe92ae
4
+ data.tar.gz: 6669995c93c30107c4b20b207950fa3f7229ec0d
5
5
  SHA512:
6
- metadata.gz: adc1e28727ad07bacee6b850c5d86534827382ccc33a65cef2d81f2dbfa29667cd83836bf39f3462af8e10fffc010864ef02f867e0001222fc18881a1848f5b7
7
- data.tar.gz: f8572317835cd5136d8ed8abe4ec209da35e2d31a47c65332fbc83ae327b245d2c1f8a1bc99469eb156109c8f31fed8bb833be16d25ca3ebe1c73d6d94ad2d08
6
+ metadata.gz: 3a659474980dc94623435c3ede8307cf0249888ccb644187de53a29333936823780a4c3ae8a44a425d9bc15dc8b47865ca633a47ec1d31628ec7e7bffb44f6de
7
+ data.tar.gz: fd7d0cd908342a8fc1c48ee087f985dad3bd33ef5ca86cbcc43bde20b6213baff3290cdbdf2db86fe872a32c00f832bb0ee31540474863fc6d031640f47342b2
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 1.1.0 / 06.07.2016
2
+
3
+ * Rename djConfig to dojoConfig
4
+ * Rename dojoType to data-dojo-type
5
+ * Remove duplicated dojoConfig (use only data-dojo-config)
6
+ * Add package support for onload script
7
+
1
8
  === 1.0.9 / 05.07.2016
2
9
 
3
10
  * Made tooltip work with dojo 1.11
@@ -14,11 +14,10 @@ module HtmlGrid
14
14
  # DOJO_VERSION >= 1.7.0 only (removed old version support)
15
15
  def dojo_tag(widget, args={}, inner_html='')
16
16
  div = HtmlGrid::Div.new(@model, @session, self)
17
- div.set_attribute('dojoType', widget)
18
- lim = ","
17
+ div.set_attribute('data-dojo-type', widget)
19
18
  args.each { |key, value|
20
- if(value.is_a?(Array))
21
- value = value.join(lim)
19
+ if value.is_a?(Array)
20
+ value = value.join(',')
22
21
  end
23
22
  div.set_attribute(key, value)
24
23
  }
@@ -61,7 +60,7 @@ module HtmlGrid
61
60
  end
62
61
  unless(html.empty? || dojo_parse_widgets)
63
62
  html << context.script('type' => 'text/javascript') {
64
- "djConfig.searchIds.push('#{css_id}')"
63
+ "dojoConfig.searchIds.push('#{css_id}')"
65
64
  }
66
65
  end
67
66
  dojo_dynamic_html(context) << html
@@ -83,16 +82,6 @@ module HtmlGrid
83
82
  dojo_path = @lookandfeel.resource_global(:dojo_js)
84
83
  dojo_path ||= '/resources/dojo/dojo/dojo.js'
85
84
  args = { 'type' => 'text/javascript'}
86
- headers << context.script(args.dup) {
87
- "djConfig = {
88
- isDebug: #{self.class::DOJO_DEBUG},
89
- parseWidgets: #{dojo_parse_widgets},
90
- preventBackButtonFix: #{!self.class::DOJO_BACK_BUTTON},
91
- bindEncoding: '#{encoding}',
92
- searchIds: [],
93
- urchin: ''
94
- };"
95
- }
96
85
  packages = ""
97
86
  unless(self.class::DOJO_PREFIX.empty?)
98
87
  packages = self.class::DOJO_PREFIX.collect { |prefix, path|
@@ -115,27 +104,28 @@ module HtmlGrid
115
104
  ].join(',')
116
105
  args.store('data-dojo-config', config)
117
106
  args.store('src', dojo_path)
118
-
119
107
  headers << context.script(args)
120
108
  args = { 'type' => 'text/javascript' }
121
109
  headers << context.script(args) {
122
- script = ''
123
- self.class::DOJO_REQUIRE.uniq.each { |req|
124
- script << "'#{req}',"
125
- }
126
- if(@dojo_onloads)
110
+ package_paths = self.class::DOJO_REQUIRE.map { |req|
111
+ "'#{req}'"
112
+ }.join(',')
113
+ package_names = self.class::DOJO_REQUIRE.map { |req|
114
+ req.split('/').last
115
+ }.join(',')
116
+ if @dojo_onloads
127
117
  onloads = ''
128
118
  @dojo_onloads.each { |onload|
129
119
  onloads << "#{onload}\n"
130
120
  }
131
121
  script =
132
- "require([#{script.chomp(',')}], function(ready, parser) {" \
122
+ "require([#{package_paths}], function(#{package_names}) {" \
133
123
  "ready(function() {" \
134
124
  "#{onloads}" \
135
125
  "});" \
136
126
  "});"
137
127
  else
138
- script = "require([#{script.chomp(',')}]);"
128
+ script = "require([#{package_paths}]);"
139
129
  end
140
130
  script
141
131
  }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
3
  module HtmlGrid
4
- VERSION = '1.0.9'
4
+ VERSION = '1.1.0'
5
5
  end
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.0.9
4
+ version: 1.1.0
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-05 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sbsm