htmlcom 0.2.0 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/htmlcom.rb +69 -10
  5. metadata +66 -45
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d7960f5340eeea39252bf10f7b8c916c0b88877d86cea08064a132043602a45
4
- data.tar.gz: 1d6d0f6e7ec0bf4508f77e611e7301925cc791744ff84ae58ed32debd058e3fb
3
+ metadata.gz: 8004cbae029ee293b21479ba8848c1651f26f335b999d16c0ef8d81441b71f30
4
+ data.tar.gz: 9cf701e4bb970992b648fd54b73e4e7a700716bbaa8c5a898fce1b43800ebad1
5
5
  SHA512:
6
- metadata.gz: 91ef20411c97b6b4dfbe8cec05547b4f38adfa4247d21b20db78f05c5880dcaa449543d17d4056b2a647998bb0318df46e35d1268fa4f42aa7e189f6930d135f
7
- data.tar.gz: b39f2b7c0f1385577fe682c10fca9073a8f28c9a8babe10436d0dd9d99443e8fd46f8088fe8c0fe13022540e38a16b8a1fe3a7fe1b34edeaae9aa4a9594d6da3
6
+ metadata.gz: 91c0da1574759668917fd20254b82babcdbfca8302a6019b4d2d13e6125c26fdf08b65299965debf497ad530f2fd8120851bd88e7aabccc27e40360386a9aa98
7
+ data.tar.gz: 66e8aba374f7e41d4c9c01cc5820141c8ed03f823f1ec2dea5de68c5a6af8aac98308a3a1b37ea80422fdd75e88ac98b268f1183bff3ce53a7b576e0231a0923
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -8,13 +8,14 @@ require 'nokogiri'
8
8
  require 'xml_to_sliml'
9
9
  require 'jsajax_wizard'
10
10
  require 'jsmenubuilder'
11
+ require 'jstreebuilder'
11
12
 
12
13
 
13
14
  module HtmlCom
14
15
 
15
16
  class Accordion
16
17
 
17
- attr_reader :to_html
18
+ attr_reader :to_html, :to_css, :to_js, :to_tags
18
19
 
19
20
  def initialize(xml, debug: false)
20
21
 
@@ -23,10 +24,43 @@ module HtmlCom
23
24
  # transform the accordion XML to tags XML
24
25
  tags = Nokogiri::XSLT(xsl()).transform(Nokogiri::XML(xml))\
25
26
  .to_xhtml(indent: 0)
27
+
28
+ @to_tags = tags # used for debugging the structure
29
+
26
30
  jmb = JsMenuBuilder.new(tags, debug: debug)
31
+
32
+ pg = if Rexle.new(xml).root.attributes[:navbar] then
33
+
34
+ a = jmb.to_h.keys.sort.map {|key, _| [key, '#' + key.downcase]}
35
+
36
+ navbar = JsMenuBuilder.new(:sticky_navbar, {sticky_navbar: a,
37
+ debug: debug})
38
+
39
+ @to_css = navbar.to_css + "\n" + jmb.to_css
40
+ @to_js = navbar.to_js + "\n" + jmb.to_js
41
+
42
+
43
+ jmb.to_webpage do |css, html, js|
44
+
45
+ [
46
+ navbar.to_css + "\n" + css,
47
+ navbar.to_html + "\n" + html,
48
+ navbar.to_js + "\n" + js
49
+ ]
50
+
51
+ end
52
+
53
+ else
54
+
55
+ @to_css = jmb.to_css
56
+ @to_js = jmb.to_js
57
+
58
+ jmb.to_webpage
59
+
60
+ end
27
61
 
28
- # apply the AJAX
29
- @to_html = JsAjaxWizard.new(jmb.to_webpage).to_html
62
+ # apply the AJAX
63
+ @to_html = JsAjaxWizard.new(pg).to_html
30
64
 
31
65
  end
32
66
 
@@ -53,6 +87,10 @@ xsl= %q(
53
87
  <xsl:attribute name='title'>
54
88
  <xsl:value-of select='@title'/>
55
89
  </xsl:attribute>
90
+
91
+ <xsl:attribute name='class'>
92
+ <xsl:value-of select='@class'/>
93
+ </xsl:attribute>
56
94
 
57
95
  <xsl:element name="input">
58
96
  <xsl:attribute name="type">hidden</xsl:attribute>
@@ -88,8 +126,8 @@ xsl= %q(
88
126
 
89
127
  attr_accessor :title, :content
90
128
 
91
- def initialize(title, content: '', callback: nil)
92
- @title, @content, @callback = title, content, callback
129
+ def initialize(title, content: '', callback: nil, debug: false)
130
+ @title, @content, @callback, @debug = title, content, callback, debug
93
131
  end
94
132
 
95
133
  def content=(s)
@@ -118,13 +156,16 @@ xsl= %q(
118
156
  # current options for type:
119
157
  # :tabs, :full_page_tabs
120
158
 
121
- def initialize(type=:tabs, headings: [], xml: nil)
159
+ def initialize(type=:tabs, headings: [], xml: nil, debug: false)
122
160
 
123
- @type = type
161
+ @type, @debug = type, debug
124
162
  @build = JsMenuBuilder.new(type, headings: headings)
163
+
164
+ @active_tab = 1
125
165
 
126
166
  @tab = headings.map do |heading|
127
- Tab.new heading, content: "<h3>#{heading}</h3>", callback: self
167
+ Tab.new heading, content: "<h3>#{heading}</h3>",
168
+ callback: self, debug: debug
128
169
  end
129
170
 
130
171
  if xml then
@@ -162,8 +203,14 @@ xsl= %q(
162
203
  tabs = @tab.map do |tab|
163
204
  tab.title ? tab.to_a : nil
164
205
  end.compact.to_h
165
-
166
- @build = JsMenuBuilder.new(@type, tabs: tabs, active: @active_tab)
206
+
207
+ if @debug then
208
+ puts 'inside ping; tabs: ' + tabs.inspect
209
+ puts '@active_tab: ' + @active_tab.inspect
210
+ end
211
+
212
+ @build = JsMenuBuilder.new(@type, tabs: tabs,
213
+ active: @active_tab, debug: @debug)
167
214
 
168
215
  end
169
216
 
@@ -186,5 +233,17 @@ xsl= %q(
186
233
 
187
234
  end
188
235
 
236
+ class Tree
237
+
238
+ def initialize(s, debug: false, hn: 2)
239
+ jtb = JsTreeBuilder.new(:sidebar, {src: s, hn: hn, debug: debug})
240
+ @html = jtb.to_webpage
241
+ end
242
+
243
+ def to_webpage()
244
+ @html
245
+ end
246
+
247
+ end
189
248
 
190
249
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlcom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,112 +11,132 @@ cert_chain:
11
11
  - |
12
12
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CgcplEOsZGlrgCZ2KY
31
- uqvoK+lDnyPdURA6Vc5cd+g9oScHfwrKzEBwTTBpQN6sEsr0j2tOSiu6lRbrUC4v
32
- 0USc/7/xVKngne627NcI9R7fEvCNb3D2N94OclzD5abIQ+SHs7OI6YQsh/cucz3V
33
- 53F76lpbUb+SR2GaGS3k6Jjkp4eth3WaZevJm0q9kXQq/QfrJHOAF/MtE7t/iHCL
34
- /n7YY5CKqm+xa0+wM6XS9eGzY+bz+7UCPJ58HXsnYa9k5EnWLIYpdXkGCf0iULCn
35
- WiRgzz3/21eCm7N/8s5UGa7uDJXDDxf/i/QsEUJn1VcorDbODN3DbcPYph26bgQm
36
- vY6P53Z8DPcEft++oI9aZl1n
28
+ BgkqhkiG9w0BAQsFAAOCAYEAAoxegKwCmU/XAf+rPvvgIXNHaHXNUrvz0UY35Fld
29
+ UAUAT5VtRdMl1fOsF20D1ZvB8EvgcO5R9sZOh2zdyjCmn/XT6VIyQXMZ3pBEFoCX
30
+ JyShDdKobcYKlMrb9Nr9+Mn4J4vfOQcB2NFYwonaDLPQ9AjXwit7rhuOsbDAPnHt
31
+ WXQfhCZCk5CoVQeDAuzpnCJm55chl07x+VQYBDedjbHCevrleL6REiRQ0LhkEpPi
32
+ 6beXYDQ6kQfSx368fAS8NLwNuozMTcRgRUl7xqP0+ul8nSJZLLWIXmsrs6cyHnw9
33
+ HwdPlwmYQHY1xkBxGI9yW8rB4FrO3JUOgLgDnMZ57q9iNKMS9uIqXaWEm0MQLY6m
34
+ 0KaSzHUAYca+U2kPPE5/bYl/PRm6PEwzKh9gvxP9DfOsvMo5zx6nIwTk7q9OBGVh
35
+ Y7ogWFuR7xV5C2r4jFG/ETJJx68h+Dq4axa5mkEdMQz1iBbVr7SAq4Uoad0IbYtV
36
+ 9JH57w1VS3ePSOlwBmm2yWGh
37
37
  -----END CERTIFICATE-----
38
- date: 2019-12-07 00:00:00.000000000 Z
38
+ date: 2021-01-17 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: jsmenubuilder
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.3'
44
47
  - - ">="
45
48
  - !ruby/object:Gem::Version
46
- version: 0.2.0
49
+ version: 0.3.2
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '0.3'
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.3.2
60
+ - !ruby/object:Gem::Dependency
61
+ name: jstreebuilder
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
47
64
  - - "~>"
48
65
  - !ruby/object:Gem::Version
49
66
  version: '0.2'
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 0.2.4
50
70
  type: :runtime
51
71
  prerelease: false
52
72
  version_requirements: !ruby/object:Gem::Requirement
53
73
  requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 0.2.0
57
74
  - - "~>"
58
75
  - !ruby/object:Gem::Version
59
76
  version: '0.2'
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 0.2.4
60
80
  - !ruby/object:Gem::Dependency
61
81
  name: jsajax_wizard
62
82
  requirement: !ruby/object:Gem::Requirement
63
83
  requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 0.3.0
67
84
  - - "~>"
68
85
  - !ruby/object:Gem::Version
69
86
  version: '0.3'
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.3.1
70
90
  type: :runtime
71
91
  prerelease: false
72
92
  version_requirements: !ruby/object:Gem::Requirement
73
93
  requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: 0.3.0
77
94
  - - "~>"
78
95
  - !ruby/object:Gem::Version
79
96
  version: '0.3'
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 0.3.1
80
100
  - !ruby/object:Gem::Dependency
81
101
  name: xml_to_sliml
82
102
  requirement: !ruby/object:Gem::Requirement
83
103
  requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 0.1.0
87
104
  - - "~>"
88
105
  - !ruby/object:Gem::Version
89
106
  version: '0.1'
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 0.1.2
90
110
  type: :runtime
91
111
  prerelease: false
92
112
  version_requirements: !ruby/object:Gem::Requirement
93
113
  requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: 0.1.0
97
114
  - - "~>"
98
115
  - !ruby/object:Gem::Version
99
116
  version: '0.1'
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 0.1.2
100
120
  - !ruby/object:Gem::Dependency
101
121
  name: nokogiri
102
122
  requirement: !ruby/object:Gem::Requirement
103
123
  requirements:
104
124
  - - "~>"
105
125
  - !ruby/object:Gem::Version
106
- version: '1.10'
126
+ version: '1.11'
107
127
  - - ">="
108
128
  - !ruby/object:Gem::Version
109
- version: 1.10.7
129
+ version: 1.11.1
110
130
  type: :runtime
111
131
  prerelease: false
112
132
  version_requirements: !ruby/object:Gem::Requirement
113
133
  requirements:
114
134
  - - "~>"
115
135
  - !ruby/object:Gem::Version
116
- version: '1.10'
136
+ version: '1.11'
117
137
  - - ">="
118
138
  - !ruby/object:Gem::Version
119
- version: 1.10.7
139
+ version: 1.11.1
120
140
  description:
121
141
  email: james@jamesrobertson.eu
122
142
  executables: []
@@ -143,7 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
163
  - !ruby/object:Gem::Version
144
164
  version: '0'
145
165
  requirements: []
146
- rubygems_version: 3.0.3
166
+ rubyforge_project:
167
+ rubygems_version: 2.7.10
147
168
  signing_key:
148
169
  specification_version: 4
149
170
  summary: Generates HTML components and is designed for rendering dynamic web pages
metadata.gz.sig CHANGED
Binary file