Skip to content

Commit d79fc68

Browse files
committed
🎨 Stylise doxygen layout
1 parent 4096a69 commit d79fc68

12 files changed

+2584
-4
lines changed

Doxyfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ IGNORE_PREFIX =
155155
GENERATE_HTML = YES
156156
HTML_OUTPUT = html
157157
HTML_FILE_EXTENSION = .html
158-
HTML_HEADER =
159-
HTML_FOOTER =
158+
HTML_HEADER = doxygen/header.html
159+
HTML_FOOTER = doxygen/footer.html
160160
HTML_STYLESHEET =
161-
HTML_EXTRA_STYLESHEET =
162-
HTML_EXTRA_FILES =
161+
HTML_EXTRA_STYLESHEET = doxygen/customdoxygen.css
162+
HTML_EXTRA_FILES = doxygen/doxy-boot.js doxygen/jquery.smartmenus.js doxygen/addons/bootstrap/jquery.smartmenus.bootstrap.js doxygen/addons/bootstrap/jquery.smartmenus.bootstrap.css
163163
HTML_COLORSTYLE_HUE = 220
164164
HTML_COLORSTYLE_SAT = 100
165165
HTML_COLORSTYLE_GAMMA = 80
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
You probably do not need to edit this at all.
3+
4+
Add some SmartMenus required styles not covered in Bootstrap 3's default CSS.
5+
These are theme independent and should work with any Bootstrap 3 theme mod.
6+
*/
7+
/* sub menus arrows on desktop */
8+
.navbar-nav:not(.sm-collapsible) ul .caret {
9+
position: absolute;
10+
right: 0;
11+
margin-top: 6px;
12+
margin-right: 15px;
13+
border-top: 4px solid transparent;
14+
border-bottom: 4px solid transparent;
15+
border-left: 4px dashed;
16+
}
17+
.navbar-nav:not(.sm-collapsible) ul a.has-submenu {
18+
padding-right: 30px;
19+
}
20+
/* make sub menu arrows look like +/- buttons in collapsible mode */
21+
.navbar-nav.sm-collapsible .caret, .navbar-nav.sm-collapsible ul .caret {
22+
position: absolute;
23+
right: 0;
24+
margin: -3px 15px 0 0;
25+
padding: 0;
26+
width: 32px;
27+
height: 26px;
28+
line-height: 24px;
29+
text-align: center;
30+
border-width: 1px;
31+
border-style: solid;
32+
}
33+
.navbar-nav.sm-collapsible .caret:before {
34+
content: '+';
35+
font-family: monospace;
36+
font-weight: bold;
37+
}
38+
.navbar-nav.sm-collapsible .open > a > .caret:before {
39+
content: '-';
40+
}
41+
.navbar-nav.sm-collapsible a.has-submenu {
42+
padding-right: 50px;
43+
}
44+
/* revert to Bootstrap's default carets in collapsible mode when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav */
45+
.navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] .caret, .navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] ul .caret {
46+
position: static;
47+
margin: 0 0 0 2px;
48+
padding: 0;
49+
width: 0;
50+
height: 0;
51+
border-top: 4px dashed;
52+
border-right: 4px solid transparent;
53+
border-bottom: 0;
54+
border-left: 4px solid transparent;
55+
}
56+
.navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] .caret:before {
57+
content: '' !important;
58+
}
59+
.navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] a.has-submenu {
60+
padding-right: 15px;
61+
}
62+
/* scrolling arrows for tall menus */
63+
.navbar-nav span.scroll-up, .navbar-nav span.scroll-down {
64+
position: absolute;
65+
display: none;
66+
visibility: hidden;
67+
height: 20px;
68+
overflow: hidden;
69+
text-align: center;
70+
}
71+
.navbar-nav span.scroll-up-arrow, .navbar-nav span.scroll-down-arrow {
72+
position: absolute;
73+
top: -2px;
74+
left: 50%;
75+
margin-left: -8px;
76+
width: 0;
77+
height: 0;
78+
overflow: hidden;
79+
border-top: 7px dashed transparent;
80+
border-right: 7px dashed transparent;
81+
border-bottom: 7px solid;
82+
border-left: 7px dashed transparent;
83+
}
84+
.navbar-nav span.scroll-down-arrow {
85+
top: 6px;
86+
border-top: 7px solid;
87+
border-right: 7px dashed transparent;
88+
border-bottom: 7px dashed transparent;
89+
border-left: 7px dashed transparent;
90+
}
91+
/* add more indentation for 2+ level sub in collapsible mode - Bootstrap normally supports just 1 level sub menus */
92+
.navbar-nav.sm-collapsible ul .dropdown-menu > li > a,
93+
.navbar-nav.sm-collapsible ul .dropdown-menu .dropdown-header {
94+
padding-left: 35px;
95+
}
96+
.navbar-nav.sm-collapsible ul ul .dropdown-menu > li > a,
97+
.navbar-nav.sm-collapsible ul ul .dropdown-menu .dropdown-header {
98+
padding-left: 45px;
99+
}
100+
.navbar-nav.sm-collapsible ul ul ul .dropdown-menu > li > a,
101+
.navbar-nav.sm-collapsible ul ul ul .dropdown-menu .dropdown-header {
102+
padding-left: 55px;
103+
}
104+
.navbar-nav.sm-collapsible ul ul ul ul .dropdown-menu > li > a,
105+
.navbar-nav.sm-collapsible ul ul ul ul .dropdown-menu .dropdown-header {
106+
padding-left: 65px;
107+
}
108+
/* fix SmartMenus sub menus auto width (subMenusMinWidth and subMenusMaxWidth options) */
109+
.navbar-nav .dropdown-menu > li > a {
110+
white-space: normal;
111+
}
112+
.navbar-nav ul.sm-nowrap > li > a {
113+
white-space: nowrap;
114+
}
115+
.navbar-nav.sm-collapsible ul.sm-nowrap > li > a {
116+
white-space: normal;
117+
}
118+
/* fix .navbar-right subs alignment */
119+
.navbar-right ul.dropdown-menu {
120+
left: 0;
121+
right: auto;
122+
}
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
/*!
2+
* SmartMenus jQuery Plugin Bootstrap Addon - v0.3.1 - November 1, 2016
3+
* http://www.smartmenus.org/
4+
*
5+
* Copyright Vasil Dinkov, Vadikom Web Ltd.
6+
* http://vadikom.com
7+
*
8+
* Licensed MIT
9+
*/
10+
11+
(function(factory) {
12+
if (typeof define === 'function' && define.amd) {
13+
// AMD
14+
define(['jquery', 'jquery.smartmenus'], factory);
15+
} else if (typeof module === 'object' && typeof module.exports === 'object') {
16+
// CommonJS
17+
module.exports = factory(require('jquery'));
18+
} else {
19+
// Global jQuery
20+
factory(jQuery);
21+
}
22+
} (function($) {
23+
24+
$.extend($.SmartMenus.Bootstrap = {}, {
25+
keydownFix: false,
26+
init: function() {
27+
// init all navbars that don't have the "data-sm-skip" attribute set
28+
var $navbars = $('ul.navbar-nav:not([data-sm-skip])');
29+
$navbars.each(function() {
30+
var $this = $(this),
31+
obj = $this.data('smartmenus');
32+
// if this navbar is not initialized
33+
if (!obj) {
34+
$this.smartmenus({
35+
36+
// these are some good default options that should work for all
37+
// you can, of course, tweak these as you like
38+
subMenusSubOffsetX: 2,
39+
subMenusSubOffsetY: -6,
40+
subIndicators: false,
41+
collapsibleShowFunction: null,
42+
collapsibleHideFunction: null,
43+
rightToLeftSubMenus: $this.hasClass('navbar-right'),
44+
bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
45+
})
46+
.bind({
47+
// set/unset proper Bootstrap classes for some menu elements
48+
'show.smapi': function(e, menu) {
49+
var $menu = $(menu),
50+
$scrollArrows = $menu.dataSM('scroll-arrows');
51+
if ($scrollArrows) {
52+
// they inherit border-color from body, so we can use its background-color too
53+
$scrollArrows.css('background-color', $(document.body).css('background-color'));
54+
}
55+
$menu.parent().addClass('open');
56+
},
57+
'hide.smapi': function(e, menu) {
58+
$(menu).parent().removeClass('open');
59+
}
60+
});
61+
62+
function onInit() {
63+
// set Bootstrap's "active" class to SmartMenus "current" items (should someone decide to enable markCurrentItem: true)
64+
$this.find('a.current').parent().addClass('active');
65+
// remove any Bootstrap required attributes that might cause conflicting issues with the SmartMenus script
66+
$this.find('a.has-submenu').each(function() {
67+
var $this = $(this);
68+
if ($this.is('[data-toggle="dropdown"]')) {
69+
$this.dataSM('bs-data-toggle-dropdown', true).removeAttr('data-toggle');
70+
}
71+
if ($this.is('[role="button"]')) {
72+
$this.dataSM('bs-role-button', true).removeAttr('role');
73+
}
74+
});
75+
}
76+
77+
onInit();
78+
79+
function onBeforeDestroy() {
80+
$this.find('a.current').parent().removeClass('active');
81+
$this.find('a.has-submenu').each(function() {
82+
var $this = $(this);
83+
if ($this.dataSM('bs-data-toggle-dropdown')) {
84+
$this.attr('data-toggle', 'dropdown').removeDataSM('bs-data-toggle-dropdown');
85+
}
86+
if ($this.dataSM('bs-role-button')) {
87+
$this.attr('role', 'button').removeDataSM('bs-role-button');
88+
}
89+
});
90+
}
91+
92+
obj = $this.data('smartmenus');
93+
94+
// custom "isCollapsible" method for Bootstrap
95+
obj.isCollapsible = function() {
96+
return !/^(left|right)$/.test(this.$firstLink.parent().css('float'));
97+
};
98+
99+
// custom "refresh" method for Bootstrap
100+
obj.refresh = function() {
101+
$.SmartMenus.prototype.refresh.call(this);
102+
onInit();
103+
// update collapsible detection
104+
detectCollapsible(true);
105+
};
106+
107+
// custom "destroy" method for Bootstrap
108+
obj.destroy = function(refresh) {
109+
onBeforeDestroy();
110+
$.SmartMenus.prototype.destroy.call(this, refresh);
111+
};
112+
113+
// keep Bootstrap's default behavior for parent items when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav
114+
// i.e. use the whole item area just as a sub menu toggle and don't customize the carets
115+
if ($this.is('[data-sm-skip-collapsible-behavior]')) {
116+
$this.bind({
117+
// click the parent item to toggle the sub menus (and reset deeper levels and other branches on click)
118+
'click.smapi': function(e, item) {
119+
if (obj.isCollapsible()) {
120+
var $item = $(item),
121+
$sub = $item.parent().dataSM('sub');
122+
if ($sub && $sub.dataSM('shown-before') && $sub.is(':visible')) {
123+
obj.itemActivate($item);
124+
obj.menuHide($sub);
125+
return false;
126+
}
127+
}
128+
}
129+
});
130+
}
131+
132+
// onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class
133+
var winW;
134+
function detectCollapsible(force) {
135+
var newW = obj.getViewportWidth();
136+
if (newW != winW || force) {
137+
var $carets = $this.find('.caret');
138+
if (obj.isCollapsible()) {
139+
$this.addClass('sm-collapsible');
140+
// set "navbar-toggle" class to carets (so they look like a button) if the "data-sm-skip-collapsible-behavior" attribute is not set to the ul.navbar-nav
141+
if (!$this.is('[data-sm-skip-collapsible-behavior]')) {
142+
$carets.addClass('navbar-toggle sub-arrow');
143+
}
144+
} else {
145+
$this.removeClass('sm-collapsible');
146+
if (!$this.is('[data-sm-skip-collapsible-behavior]')) {
147+
$carets.removeClass('navbar-toggle sub-arrow');
148+
}
149+
}
150+
winW = newW;
151+
}
152+
}
153+
detectCollapsible();
154+
$(window).bind('resize.smartmenus' + obj.rootId, detectCollapsible);
155+
}
156+
});
157+
// keydown fix for Bootstrap 3.3.5+ conflict
158+
if ($navbars.length && !$.SmartMenus.Bootstrap.keydownFix) {
159+
// unhook BS keydown handler for all dropdowns
160+
$(document).off('keydown.bs.dropdown.data-api', '.dropdown-menu');
161+
// restore BS keydown handler for dropdowns that are not inside SmartMenus navbars
162+
if ($.fn.dropdown && $.fn.dropdown.Constructor) {
163+
$(document).on('keydown.bs.dropdown.data-api', '.dropdown-menu:not([id^="sm-"])', $.fn.dropdown.Constructor.prototype.keydown);
164+
}
165+
$.SmartMenus.Bootstrap.keydownFix = true;
166+
}
167+
}
168+
});
169+
170+
// init ondomready
171+
$($.SmartMenus.Bootstrap.init);
172+
173+
return $;
174+
}));

doxygen/addons/bootstrap/jquery.smartmenus.bootstrap.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)