jsmenubuilder 0.3.4 → 0.3.5
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.tar.gz.sig +0 -0
- data/lib/jsmenubuilder.rb +151 -4
- metadata +2 -2
- 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: 390f2055daa29b9c5b8af617ef19102a9d06e5b2a688bc5cf5c17df27a5c7cf7
|
4
|
+
data.tar.gz: 83f06038310c93648c578c4635d31da97b515d1e3dca1f3625f739257b7111ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49c3173c496d39ac8f5be2652892bba3ed418f9bf1ddc85df27cafe9283a51efa690828343f7679aad1febea03ee261d85733a0cc2d0400f164583e978698767
|
7
|
+
data.tar.gz: 2a0ac728386fc75241f7776cf044bb521255c731b8e9f834347a34c154fa20d0b93733423d9f81b806da5d4c22bd626f2b62607b640ec4962dbe107ccbf72b53
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/jsmenubuilder.rb
CHANGED
@@ -229,6 +229,72 @@ VERTICAL_MENU_CSS =<<EOF
|
|
229
229
|
}
|
230
230
|
EOF
|
231
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
|
+
|
232
298
|
FULL_PAGE_TABS_JS =<<EOF
|
233
299
|
function openPage(pageName,elmnt) {
|
234
300
|
var i, tabcontent;
|
@@ -304,7 +370,8 @@ function myFunction() {
|
|
304
370
|
EOF
|
305
371
|
|
306
372
|
VERTICAL_MENU_JS = ''
|
307
|
-
|
373
|
+
FIXED_MENU_JS = ''
|
374
|
+
BREADCRUMB_JS = ''
|
308
375
|
|
309
376
|
|
310
377
|
attr_reader :html, :css, :js
|
@@ -331,7 +398,8 @@ VERTICAL_MENU_JS = ''
|
|
331
398
|
options = unknown
|
332
399
|
end
|
333
400
|
|
334
|
-
@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)
|
335
403
|
|
336
404
|
build(type, options) if type
|
337
405
|
|
@@ -635,7 +703,7 @@ VERTICAL_MENU_JS = ''
|
|
635
703
|
|
636
704
|
opt[:html]
|
637
705
|
|
638
|
-
elsif opt[:
|
706
|
+
elsif opt[:items]
|
639
707
|
|
640
708
|
RexleBuilder.build do |xml|
|
641
709
|
|
@@ -643,7 +711,7 @@ VERTICAL_MENU_JS = ''
|
|
643
711
|
|
644
712
|
xml.div(id: 'navbar') do
|
645
713
|
|
646
|
-
opt[:
|
714
|
+
opt[:items].each do |title, href|
|
647
715
|
xml.a({href: href}, title)
|
648
716
|
end
|
649
717
|
|
@@ -694,5 +762,84 @@ VERTICAL_MENU_JS = ''
|
|
694
762
|
|
695
763
|
|
696
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
|
+
|
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
|
697
844
|
|
698
845
|
end
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
stR9WM2Qrn9oxHHjgt05mQb9lgp7uGqcCvQoP82U8lJawp7oLLsO25kTe4Hj28T1
|
36
36
|
+BcAGJd5hR/dFCHvJ6rtQss3
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2021-01-
|
38
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|