jsmenubuilder 0.3.2 → 0.3.6
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/lib/jsmenubuilder.rb +224 -8
- data.tar.gz.sig +0 -0
- metadata +28 -27
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2f53866202816efd3039339119e78ec8956b15d0803f9e79f08e3b4d366e082
|
4
|
+
data.tar.gz: 2d8cf65f25b14c6a2e8ce36b8fba42e5e3749f175b714890aec0246e3413eb3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e93ad2fc06c3a7f12ed957652fc3a14baa5a829c94d4e90d4522dfb060509c2ba110b9d19851f718f5c58308cbc1689847393f7d53d260d05175a2504b0381
|
7
|
+
data.tar.gz: f24a3a9fc53f8fb516938178896ce52e90079196b75ef2dc69c359c65da9963c16652c1499c1487cf81da266396ee2e2fba0304e39b7c4d53ff1702f975072d1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/jsmenubuilder.rb
CHANGED
@@ -206,6 +206,95 @@ h2.anchor {
|
|
206
206
|
|
207
207
|
EOF
|
208
208
|
|
209
|
+
VERTICAL_MENU_CSS =<<EOF
|
210
|
+
.vertical-menu {
|
211
|
+
width: 200px; /* Set a width if you like */
|
212
|
+
}
|
213
|
+
|
214
|
+
.vertical-menu a {
|
215
|
+
background-color: #eee; /* Grey background color */
|
216
|
+
color: black; /* Black text color */
|
217
|
+
display: block; /* Make the links appear below each other */
|
218
|
+
padding: 12px; /* Add some padding */
|
219
|
+
text-decoration: none; /* Remove underline from links */
|
220
|
+
}
|
221
|
+
|
222
|
+
.vertical-menu a:hover {
|
223
|
+
background-color: #ccc; /* Dark grey background on mouse-over */
|
224
|
+
}
|
225
|
+
|
226
|
+
.vertical-menu a.active {
|
227
|
+
background-color: #4CAF50; /* Add a green color to the "active/current" link */
|
228
|
+
color: white;
|
229
|
+
}
|
230
|
+
EOF
|
231
|
+
|
232
|
+
FIXED_MENU_CSS =<<EOF
|
233
|
+
/* The navigation bar */
|
234
|
+
.navbar {
|
235
|
+
overflow: hidden;
|
236
|
+
background-color: #333;
|
237
|
+
position: fixed; /* Set the navbar to fixed position */
|
238
|
+
top: 0; /* Position the navbar at the top of the page */
|
239
|
+
width: 100%; /* Full width */
|
240
|
+
}
|
241
|
+
|
242
|
+
/* Links inside the navbar */
|
243
|
+
.navbar a {
|
244
|
+
float: left;
|
245
|
+
display: block;
|
246
|
+
color: #f2f2f2;
|
247
|
+
text-align: center;
|
248
|
+
padding: 14px 16px;
|
249
|
+
text-decoration: none;
|
250
|
+
}
|
251
|
+
|
252
|
+
/* Change background on mouse-over */
|
253
|
+
.navbar a:hover {
|
254
|
+
background: #ddd;
|
255
|
+
color: black;
|
256
|
+
}
|
257
|
+
|
258
|
+
/* Main content */
|
259
|
+
.main {
|
260
|
+
margin-top: 30px; /* Add a top margin to avoid content overlay */
|
261
|
+
}
|
262
|
+
EOF
|
263
|
+
|
264
|
+
BREADCRUMB_CSS =<<EOF
|
265
|
+
/* Style the list */
|
266
|
+
ul.breadcrumb {
|
267
|
+
padding: 10px 16px;
|
268
|
+
list-style: none;
|
269
|
+
background-color: #eee;
|
270
|
+
}
|
271
|
+
|
272
|
+
/* Display list items side by side */
|
273
|
+
ul.breadcrumb li {
|
274
|
+
display: inline;
|
275
|
+
font-size: 18px;
|
276
|
+
}
|
277
|
+
|
278
|
+
/* Add a slash symbol (/) before/behind each list item */
|
279
|
+
ul.breadcrumb li+li:before {
|
280
|
+
padding: 8px;
|
281
|
+
color: black;
|
282
|
+
content: "/\\00a0";
|
283
|
+
}
|
284
|
+
|
285
|
+
/* Add a color to all links inside the list */
|
286
|
+
ul.breadcrumb li a {
|
287
|
+
color: #0275d8;
|
288
|
+
text-decoration: none;
|
289
|
+
}
|
290
|
+
|
291
|
+
/* Add a color on mouse-over */
|
292
|
+
ul.breadcrumb li a:hover {
|
293
|
+
color: #01447e;
|
294
|
+
text-decoration: underline;
|
295
|
+
}
|
296
|
+
EOF
|
297
|
+
|
209
298
|
FULL_PAGE_TABS_JS =<<EOF
|
210
299
|
function openPage(pageName,elmnt) {
|
211
300
|
var i, tabcontent;
|
@@ -280,6 +369,11 @@ function myFunction() {
|
|
280
369
|
}
|
281
370
|
EOF
|
282
371
|
|
372
|
+
VERTICAL_MENU_JS = ''
|
373
|
+
FIXED_MENU_JS = ''
|
374
|
+
BREADCRUMB_JS = ''
|
375
|
+
|
376
|
+
|
283
377
|
attr_reader :html, :css, :js
|
284
378
|
|
285
379
|
def initialize(unknown=nil, options={})
|
@@ -304,7 +398,8 @@ EOF
|
|
304
398
|
options = unknown
|
305
399
|
end
|
306
400
|
|
307
|
-
@types = %i(tabs full_page_tabs accordion sticky_navbar
|
401
|
+
@types = %i(tabs full_page_tabs accordion sticky_navbar
|
402
|
+
vertical_menu fixed_menu breadcrumb)
|
308
403
|
|
309
404
|
build(type, options) if type
|
310
405
|
|
@@ -423,7 +518,7 @@ EOF
|
|
423
518
|
puts 'inside build_h'.info if @debug
|
424
519
|
|
425
520
|
h = doc.root.xpath('tag').inject({}) do |r,e|
|
426
|
-
r.merge(e.attributes[:title] => e.children.join.strip)
|
521
|
+
r.merge(e.attributes[:title] => [e.children.join.strip, e.attributes[:class].join(' ')])
|
427
522
|
end
|
428
523
|
|
429
524
|
puts ('build_h: ' + h.inspect).debug if @debug
|
@@ -455,8 +550,9 @@ EOF
|
|
455
550
|
|
456
551
|
a = RexleBuilder.build do |xml|
|
457
552
|
xml.tags({mode: type}) do
|
458
|
-
entries.each do |heading,
|
459
|
-
|
553
|
+
entries.each do |heading, value|
|
554
|
+
content, klass = value
|
555
|
+
xml.tag({title: heading, class: klass}, content )
|
460
556
|
end
|
461
557
|
end
|
462
558
|
end
|
@@ -573,12 +669,19 @@ EOF
|
|
573
669
|
|
574
670
|
xml.h2({class: 'anchor', id: char.downcase}, char)
|
575
671
|
|
576
|
-
rows.each do |heading,
|
672
|
+
rows.each do |heading, value|
|
673
|
+
|
674
|
+
puts 'value: ' + value.inspect if @debug
|
675
|
+
inner_html, attrclass = value
|
676
|
+
|
577
677
|
puts 'inner_html: ' + inner_html.inspect if debug
|
578
678
|
xml.a({class: 'anchor', name: heading.downcase.gsub(/\W/,'-')\
|
579
679
|
.gsub(/-{2,}/,'-').gsub(/^-|-$/,'')})
|
580
680
|
xml.button({class:'accordion'}, heading.to_s)
|
581
|
-
|
681
|
+
|
682
|
+
s = 'panel'
|
683
|
+
s += ' ' + attrclass if attrclass
|
684
|
+
xml.div({class: s}, inner_html)
|
582
685
|
|
583
686
|
end
|
584
687
|
end
|
@@ -600,7 +703,7 @@ EOF
|
|
600
703
|
|
601
704
|
opt[:html]
|
602
705
|
|
603
|
-
elsif opt[:
|
706
|
+
elsif opt[:items]
|
604
707
|
|
605
708
|
RexleBuilder.build do |xml|
|
606
709
|
|
@@ -608,7 +711,7 @@ EOF
|
|
608
711
|
|
609
712
|
xml.div(id: 'navbar') do
|
610
713
|
|
611
|
-
opt[:
|
714
|
+
opt[:items].each do |title, href|
|
612
715
|
xml.a({href: href}, title)
|
613
716
|
end
|
614
717
|
|
@@ -624,6 +727,119 @@ EOF
|
|
624
727
|
return doc
|
625
728
|
|
626
729
|
|
730
|
+
end
|
731
|
+
|
732
|
+
def vertical_menu(opt={})
|
733
|
+
|
734
|
+
puts 'inside vertical_navbar' if @debug
|
735
|
+
|
736
|
+
navhtml = if opt[:html] then
|
737
|
+
|
738
|
+
opt[:html]
|
739
|
+
|
740
|
+
elsif opt[:items]
|
741
|
+
|
742
|
+
RexleBuilder.build do |xml|
|
743
|
+
|
744
|
+
xml.html do
|
745
|
+
|
746
|
+
xml.div(class: 'vertical-menu') do
|
747
|
+
|
748
|
+
opt[:items].each do |title, href|
|
749
|
+
xml.a({href: href}, title)
|
750
|
+
end
|
751
|
+
|
752
|
+
end
|
753
|
+
|
754
|
+
end
|
755
|
+
end
|
756
|
+
end
|
757
|
+
|
758
|
+
doc = Rexle.new(navhtml)
|
759
|
+
puts 'doc: ' + doc.xml.inspect if @debug
|
760
|
+
|
761
|
+
return doc
|
762
|
+
|
763
|
+
|
764
|
+
end
|
765
|
+
|
766
|
+
def fixed_menu(opt={})
|
767
|
+
|
768
|
+
puts 'inside fixed_menu' if @debug
|
769
|
+
|
770
|
+
navhtml = if opt[:html] then
|
771
|
+
|
772
|
+
opt[:html]
|
773
|
+
|
774
|
+
elsif opt[:items]
|
775
|
+
|
776
|
+
RexleBuilder.build do |xml|
|
777
|
+
|
778
|
+
xml.html do
|
779
|
+
|
780
|
+
xml.div(class: 'navbar') do
|
781
|
+
|
782
|
+
opt[:items].each do |title, href|
|
783
|
+
xml.a({href: href}, title)
|
784
|
+
end
|
785
|
+
|
786
|
+
end
|
787
|
+
|
788
|
+
xml.div(class: 'main') do
|
789
|
+
|
790
|
+
end
|
791
|
+
|
792
|
+
end
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
doc = Rexle.new(navhtml)
|
797
|
+
puts 'doc: ' + doc.xml.inspect if @debug
|
798
|
+
|
799
|
+
return doc
|
800
|
+
|
801
|
+
|
627
802
|
end
|
803
|
+
|
804
|
+
def breadcrumb(opt={})
|
805
|
+
|
806
|
+
puts 'inside breadcrumb' if @debug
|
807
|
+
|
808
|
+
navhtml = if opt[:html] then
|
809
|
+
|
810
|
+
opt[:html]
|
811
|
+
|
812
|
+
elsif opt[:items]
|
813
|
+
|
814
|
+
RexleBuilder.build do |xml|
|
815
|
+
|
816
|
+
xml.html do
|
817
|
+
|
818
|
+
xml.ul(class: 'breadcrumb') do
|
819
|
+
|
820
|
+
opt[:items][0..-2].each do |title, href|
|
821
|
+
xml.li do
|
822
|
+
xml.a({href: href}, title)
|
823
|
+
end
|
824
|
+
end
|
825
|
+
|
826
|
+
title = opt[:items][-1].first
|
827
|
+
xml.li title
|
828
|
+
|
829
|
+
end
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
end
|
834
|
+
end
|
835
|
+
end
|
836
|
+
|
837
|
+
doc = Rexle.new(navhtml)
|
838
|
+
puts 'doc: ' + doc.xml.inspect if @debug
|
839
|
+
|
840
|
+
return doc
|
841
|
+
|
842
|
+
|
843
|
+
end
|
628
844
|
|
629
845
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsmenubuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -11,31 +11,31 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjEwMTE3MjAxMDI3WhcN
|
15
|
+
MjIwMTE3MjAxMDI3WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC2UBXg
|
17
|
+
dSeJqcBwxeYBSbb4Juz+zVFhmlo/usgbmk+Y8bbO/hI+AlPyH5UnWhNDSWh23AXa
|
18
|
+
pP1do4VSJ7ne25KRB7Qdb843fndoLtowgb1vmpoovKAj0/aNMjXl1OqbWxp4tisU
|
19
|
+
TTrzOiihBReECZLnRhU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vi80E
|
33
|
+
yD+/vvvKT8C6A+7Luv70eCEqNC2kmI5k2FKlfkkfaHacRtDz4Ntzw+W216u2ewBB
|
34
|
+
4DzeVtqMQq2g7T4xVjQRRwdBJkdERbyx4TD/2HNa6VNC/V8R5aVlKNyjjglPSC3P
|
35
|
+
stR9WM2Qrn9oxHHjgt05mQb9lgp7uGqcCvQoP82U8lJawp7oLLsO25kTe4Hj28T1
|
36
|
+
+BcAGJd5hR/dFCHvJ6rtQss3
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rexle
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: '1.5'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.5.
|
49
|
+
version: 1.5.9
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
version: '1.5'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 1.5.
|
59
|
+
version: 1.5.9
|
60
60
|
description:
|
61
61
|
email: james@jamesrobertson.eu
|
62
62
|
executables: []
|
@@ -83,7 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.7.10
|
87
88
|
signing_key:
|
88
89
|
specification_version: 4
|
89
90
|
summary: Generates HTML based tabs using HTML, CSS, and JavaScript.
|
metadata.gz.sig
CHANGED
Binary file
|