@qubit-ltd/jsdoc-theme 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +260 -0
  2. package/LICENSE +21 -0
  3. package/README.md +798 -0
  4. package/clean-jsdoc-theme-defaults.js +37 -0
  5. package/clean-jsdoc-theme-helper.js +186 -0
  6. package/helpers/Environment.html +3 -0
  7. package/helpers/down-arrow.js +9 -0
  8. package/helpers/i18n.js +106 -0
  9. package/i18n/en.json +76 -0
  10. package/i18n/zh.json +76 -0
  11. package/package.json +83 -0
  12. package/publish.js +1133 -0
  13. package/static/fonts/Inconsolata-Regular.ttf +0 -0
  14. package/static/fonts/OpenSans-Regular.ttf +0 -0
  15. package/static/fonts/WorkSans-Bold.ttf +0 -0
  16. package/static/scripts/core.js +720 -0
  17. package/static/scripts/core.min.js +23 -0
  18. package/static/scripts/resize.js +90 -0
  19. package/static/scripts/search.js +269 -0
  20. package/static/scripts/search.min.js +6 -0
  21. package/static/scripts/third-party/Apache-License-2.0.txt +202 -0
  22. package/static/scripts/third-party/fuse.js +1749 -0
  23. package/static/scripts/third-party/hljs-line-num-original.js +367 -0
  24. package/static/scripts/third-party/hljs-line-num.js +1 -0
  25. package/static/scripts/third-party/hljs-original.js +5260 -0
  26. package/static/scripts/third-party/hljs.js +1 -0
  27. package/static/scripts/third-party/popper.js +1287 -0
  28. package/static/scripts/third-party/tippy.js +1499 -0
  29. package/static/scripts/third-party/tocbot.js +757 -0
  30. package/static/scripts/third-party/tocbot.min.js +1 -0
  31. package/static/styles/clean-jsdoc-theme-base.css +1257 -0
  32. package/static/styles/clean-jsdoc-theme-dark.css +412 -0
  33. package/static/styles/clean-jsdoc-theme-light.css +482 -0
  34. package/static/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  35. package/static/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  36. package/static/styles/clean-jsdoc-theme.min.css +1 -0
  37. package/tmpl/augments.tmpl +10 -0
  38. package/tmpl/container.tmpl +261 -0
  39. package/tmpl/details.tmpl +207 -0
  40. package/tmpl/example.tmpl +3 -0
  41. package/tmpl/examples.tmpl +48 -0
  42. package/tmpl/exceptions.tmpl +32 -0
  43. package/tmpl/i18n-tooltips.tmpl +30 -0
  44. package/tmpl/icons.tmpl +77 -0
  45. package/tmpl/include-target-script-and-styles.tmpl +43 -0
  46. package/tmpl/layout.tmpl +169 -0
  47. package/tmpl/mainpage.tmpl +10 -0
  48. package/tmpl/members.tmpl +42 -0
  49. package/tmpl/method.tmpl +190 -0
  50. package/tmpl/mobile-sidebar.tmpl +21 -0
  51. package/tmpl/navbar-actions.tmpl +25 -0
  52. package/tmpl/navbar-menu.tmpl +25 -0
  53. package/tmpl/navbar.tmpl +14 -0
  54. package/tmpl/params.tmpl +131 -0
  55. package/tmpl/properties.tmpl +109 -0
  56. package/tmpl/returns.tmpl +19 -0
  57. package/tmpl/search.tmpl +17 -0
  58. package/tmpl/sidebar-items.tmpl +33 -0
  59. package/tmpl/sidebar-title.tmpl +8 -0
  60. package/tmpl/sidebar.tmpl +9 -0
  61. package/tmpl/source.tmpl +13 -0
  62. package/tmpl/toc.tmpl +4 -0
  63. package/tmpl/tutorial.tmpl +32 -0
  64. package/tmpl/type.tmpl +13 -0
@@ -0,0 +1,43 @@
1
+ <?js
2
+
3
+ const filename = obj.replace('.html', '')
4
+ const scripts = []
5
+ const styles = []
6
+
7
+
8
+ if(Array.isArray(this.includeScript)) {
9
+ for (const script of this.includeScript) {
10
+ if(typeof script === 'object') {
11
+ for (const target of script.targets) {
12
+ if(filename === target) {
13
+ scripts.push(script.filepath)
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+
20
+ if(Array.isArray(this.includeCss)) {
21
+ for (const style of this.includeCss) {
22
+ if(typeof style === 'object') {
23
+ for (const target of style.targets) {
24
+ if(filename === target) {
25
+ styles.push(style.filepath)
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+
33
+ ?>
34
+
35
+ <?js scripts.forEach(function(source){ ?>
36
+ <script src="<?js= source ?>"></script>
37
+ <?js }) ?>
38
+
39
+ <?js styles.forEach(function(source){ ?>
40
+ <script>
41
+ document.head.innerHTML += '<link type="text/css" rel="stylesheet" href="<?js= source ?>">'
42
+ </script>
43
+ <?js }) ?>
@@ -0,0 +1,169 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" style="font-size: 16px">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+ <!-- Adding favicon -->
9
+ <?js if(this.favicon != undefined) { ?>
10
+ <link rel="icon" href="<?js= this.favicon?>" />
11
+ <?js } ?>
12
+
13
+ <!-- Adding meta -->
14
+ <?js if(this.meta != undefined) { ?>
15
+ <?js this.meta.forEach(function(src){ ?>
16
+ <meta <?js= Object.keys(src).map(key=> `${key}="${src[key]}"`).join(" ") ?> />
17
+ <?js }) ?>
18
+ <?js } ?>
19
+
20
+ <!-- Adding external script-->
21
+ <?js if(this.dynamicScriptSrc != undefined) { ?>
22
+ <?js this.dynamicScriptSrc.forEach(function(src){ ?>
23
+ <script <?js= Object.keys(src).map(key=> `${key}="${src[key]}"`).join(" ") ?> ></script>
24
+ <?js }) ?>
25
+ <?js } ?>
26
+
27
+ <!-- Adding external style-->
28
+ <?js if(this.dynamicStyleSrc != undefined) { ?>
29
+ <?js this.dynamicStyleSrc.forEach(function(src){ ?>
30
+ <link <?js= Object.keys(src).map(key=> `${key}="${src[key]}"`).join(" ") ?> />
31
+ <?js }) ?>
32
+ <?js } ?>
33
+
34
+ <!-- Adding scripts-->
35
+ <?js if(this.includeScript != undefined) { ?>
36
+ <?js this.includeScript.forEach(function(source){ ?>
37
+ <?js if(typeof source === 'string') { ?>
38
+ <script src="<?js= source ?>"></script>
39
+ <?js } ?>
40
+ <?js }) ?>
41
+ <?js } ?>
42
+
43
+ <!-- Adding style-->
44
+ <?js if(this.includeCss != undefined) { ?>
45
+ <?js this.includeCss.forEach(function(source){ ?>
46
+ <?js if(typeof source === 'string') { ?>
47
+ <link type="text/css" rel="stylesheet" href="<?js= source ?>">
48
+ <?js } ?>
49
+ <?js }) ?>
50
+ <?js } ?>
51
+
52
+
53
+ <title>
54
+ <?js= title ?>
55
+ </title>
56
+
57
+ <!--[if lt IE 9]>
58
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
59
+ <![endif]-->
60
+
61
+ <script src="scripts/third-party/hljs.js" defer></script>
62
+ <script src="scripts/third-party/hljs-line-num.js" defer></script>
63
+ <script src="scripts/third-party/popper.js" defer></script>
64
+ <script src="scripts/third-party/tippy.js" defer></script>
65
+ <script src="scripts/third-party/tocbot.min.js"></script>
66
+
67
+ <script>
68
+ var baseURL = "/"
69
+ var locationPathname = ""
70
+
71
+ // Global variables
72
+ <?js if (this.baseURL) { ?>
73
+ baseURL = "<?js= this.baseURL ?>"
74
+ baseURL = baseURL.replace(/https?:\/\//i, '')
75
+ baseURL = baseURL.substr(baseURL.indexOf("/"))
76
+ <?js } else { ?>
77
+ locationPathname = document.location.pathname
78
+ baseURL = locationPathname.substr(0, locationPathname.lastIndexOf("/") + 1)
79
+ <?js } ?>
80
+
81
+ </script>
82
+
83
+ <!-- clean jsdoc theme -->
84
+ <?js if (this.shouldRemoveScrollbarStyle) { ?>
85
+ <link rel="stylesheet" href="styles/clean-jsdoc-theme-without-scrollbar.min.css">
86
+ <?js } else { ?>
87
+ <link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css">
88
+ <?js } ?>
89
+
90
+ <?js if(this.dynamicStyle != undefined ) { ?>
91
+ <style>
92
+ <?js= this.dynamicStyle ?>
93
+ </style>
94
+ <?js } ?>
95
+ <?js= this.partial('icons.tmpl') ?>
96
+
97
+ </head>
98
+
99
+ <body data-theme="<?js= this.theme?>">
100
+
101
+ <div class="sidebar-container">
102
+ <?js= this.partial('sidebar.tmpl') ?>
103
+ </div>
104
+
105
+ <div class="navbar-container" id="VuAckcnZhf">
106
+ <?js= this.partial('navbar.tmpl') ?>
107
+ </div>
108
+
109
+ <div class="toc-container">
110
+ <?js= this.partial('toc.tmpl') ?>
111
+ </div>
112
+
113
+ <div class="body-wrapper">
114
+ <div class="main-content">
115
+ <div class="main-wrapper">
116
+ <?js= content ?>
117
+
118
+ <?js if(this.footer) {?>
119
+
120
+ <footer class="footer" id="PeOAagUepe">
121
+ <div class="wrapper">
122
+ <?js= this.footer ?>
123
+ </div>
124
+ </footer>
125
+ <?js } ?>
126
+
127
+ </div>
128
+ </div>
129
+
130
+ </div>
131
+
132
+ <?js if(this.navbar.search) { ?>
133
+ <?js= this.partial('search.tmpl')?>
134
+ <?js } ?>
135
+
136
+ <?js= this.partial('mobile-sidebar.tmpl') ?>
137
+
138
+ <script type="text/javascript" src="scripts/core.min.js"></script>
139
+
140
+ <?js if(this.navbar.search !== 'false') { ?>
141
+ <script src="scripts/search.min.js" defer></script>
142
+ <script src="scripts/third-party/fuse.js" defer></script>
143
+ <?js } ?>
144
+
145
+ <?js if(this.dynamicScript != undefined ) { ?>
146
+ <script type="text/javascript">
147
+ <?js= this.dynamicScript ?>
148
+ </script>
149
+ <?js } ?>
150
+
151
+
152
+ <script type="text/javascript">
153
+ var tocbotInstance = tocbot.init({
154
+ tocSelector: '#eed4d2a0bfd64539bb9df78095dec881',
155
+ contentSelector: '.main-content',
156
+ headingSelector: 'h1, h2, h3',
157
+ hasInnerContainers: true,
158
+ scrollContainer: '.main-content',
159
+ headingsOffset: 130,
160
+ onClick: bringLinkToView
161
+ });
162
+
163
+ </script>
164
+
165
+ <?js= this.partial('i18n-tooltips.tmpl') ?>
166
+
167
+ </body>
168
+
169
+ </html>
@@ -0,0 +1,10 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+ ?>
5
+
6
+ <?js if (data.readme) { ?>
7
+ <section class="readme">
8
+ <article><?js= data.readme ?></article>
9
+ </section>
10
+ <?js } ?>
@@ -0,0 +1,42 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+ ?>
5
+ <h3 class="name has-anchor" id="<?js= id ?>">
6
+ <?js= data.attribs + name + (data.signature ? data.signature : '') ?>
7
+ </h3>
8
+
9
+ <?js if (data.summary) { ?>
10
+ <div class="summary"><?js= summary ?></div>
11
+ <?js } ?>
12
+
13
+ <?js if (data.description) { ?>
14
+ <div class="description">
15
+ <?js= data.description ?>
16
+ </div>
17
+ <?js } ?>
18
+
19
+ <?js if (data.type && data.type.names) {?>
20
+ <div class="member-item-container flex">
21
+ <strong><?js= t('type') ?>: </strong>
22
+ <ul>
23
+ <li>
24
+ <?js= self.partial('type.tmpl', data.type.names) ?>
25
+ </li>
26
+ </ul>
27
+ </div>
28
+ <?js } ?>
29
+
30
+ <?js= this.partial('details.tmpl', data) ?>
31
+
32
+ <?js if (data.fires && fires.length) { ?>
33
+ <b><?js= t('fires') ?>:</b>
34
+ <ul><?js fires.forEach(function(f) { ?>
35
+ <li><?js= self.linkto(f) ?></li>
36
+ <?js }); ?></ul>
37
+ <?js } ?>
38
+
39
+ <?js if (data.examples && examples.length) { ?>
40
+ <b><?js= examples.length > 1 ? t('examples') : t('example') ?></b>
41
+ <?js= this.partial('examples.tmpl', examples) ?>
42
+ <?js } ?>
@@ -0,0 +1,190 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+
5
+ ?>
6
+ <?js
7
+ // Check if this is a class with an explicit constructor
8
+ var hasExplicitConstructor = false;
9
+ if (data.kind === 'class') {
10
+ // Only consider constructor-specific documentation, not class-level documentation
11
+ hasExplicitConstructor = data.params && data.params.length > 0 ||
12
+ (data.description && data.description !== data.classdesc) ||
13
+ data.examples && data.examples.length > 0 ||
14
+ data.see && data.see.length > 0 ||
15
+ data.since;
16
+ // Note: We exclude @author as it's typically class-level, not constructor-specific
17
+ }
18
+ ?>
19
+ <?js if (data.kind !== 'module' && !data.hideconstructor) { ?>
20
+ <?js if (data.kind === 'class' && data.classdesc && hasExplicitConstructor) { ?>
21
+ <h2 id="constructor" class="has-anchor"><?js= t('constructor') ?></h2>
22
+ <?js } ?>
23
+
24
+ <?js if (data.kind !== 'class' || hasExplicitConstructor) { ?>
25
+ <h3 class="name has-anchor" id="<?js= id ?>">
26
+ <?js= data.attribs + (kind === 'class' ? 'new ' : '') + name + (data.signature || '') ?>
27
+ </h3>
28
+ <?js } ?>
29
+
30
+ <?js if (data.summary) { ?>
31
+ <div class="summary"><?js= summary ?></div>
32
+ <?js } ?>
33
+ <?js } ?>
34
+
35
+ <?js if (data.kind !== 'module' && data.description) { ?>
36
+ <div class="description">
37
+ <?js= data.description ?>
38
+ </div>
39
+ <?js } ?>
40
+
41
+ <?js if (data.augments && data.alias && data.alias.indexOf('module:') === 0) { ?>
42
+ <div class="method-member-container mt-20">
43
+ <strong><?js= t('extends') ?>:</strong>
44
+ <?js= self.partial('augments.tmpl', data) ?>
45
+ </div>
46
+ <?js } ?>
47
+
48
+
49
+ <?js if (kind === 'event' && data.type && data.type.names) {?>
50
+ <div class="method-member-container mt-20">
51
+ <strong><?js= t('type') ?>:</strong>
52
+ <ul>
53
+ <li>
54
+ <?js= self.partial('type.tmpl', data.type.names) ?>
55
+ </li>
56
+ </ul>
57
+ </div>
58
+ <?js } ?>
59
+
60
+ <?js if (data['this']) { ?>
61
+ <div class="method-member-container mt-20">
62
+ <strong><?js= t('this') ?>:</strong>
63
+ <ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
64
+ </div>
65
+ <?js } ?>
66
+
67
+ <?js if (data.params && params.length && !data.hideconstructor) { ?>
68
+ <div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
69
+ <strong><?js= t('parameters') ?>:</strong>
70
+ <?js= this.partial('params.tmpl', params) ?>
71
+ </div>
72
+ <?js } ?>
73
+
74
+ <?js= this.partial('details.tmpl', data) ?>
75
+
76
+ <?js if (data.kind !== 'module' && data.requires && data.requires.length) { ?>
77
+ <div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
78
+ <strong><?js= t('requires') ?>:</strong>
79
+ <ul>
80
+ <?js data.requires.forEach(function(r) { ?>
81
+ <li><?js= self.linkto(r) ?></li>
82
+ <?js }); ?>
83
+ </ul>
84
+ </div>
85
+ <?js } ?>
86
+
87
+ <?js if (data.fires && fires.length) { ?>
88
+ <div class="method-member-container flex w-100 overflow-auto mt-20">
89
+ <strong><?js= t('fires') ?>:</strong>
90
+ <ul>
91
+ <?js fires.forEach(function(f) { ?>
92
+ <li><?js= self.linkto(f) ?></li>
93
+ <?js }); ?>
94
+ </ul>
95
+ </div>
96
+ <?js } ?>
97
+
98
+ <?js if (data.listens && listens.length) { ?>
99
+ <div class="method-member-container flex w-100 overflow-auto mt-20">
100
+ <strong><?js= t('listens_to_events') ?>:</strong>
101
+ <ul>
102
+ <?js listens.forEach(function(f) { ?>
103
+ <li><?js= self.linkto(f) ?></li>
104
+ <?js }); ?>
105
+ </ul>
106
+ </div>
107
+ <?js } ?>
108
+
109
+ <?js if (data.listeners && listeners.length) { ?>
110
+ <div class="method-member-container mt-20">
111
+ <strong><?js= t('listeners_of_this_event') ?>:</strong>
112
+ <ul>
113
+ <?js listeners.forEach(function(f) { ?>
114
+ <li><?js= self.linkto(f) ?></li>
115
+ <?js }); ?>
116
+ </ul>
117
+ </div>
118
+ <?js } ?>
119
+
120
+ <?js if (data.modifies && modifies.length) {?>
121
+ <div class="method-member-container mt-20">
122
+ <strong><?js= t('modifies') ?>:</strong>
123
+ <?js if (modifies.length > 1) { ?>
124
+ <ul>
125
+ <?js modifies.forEach(function(r) { ?>
126
+ <li><?js= self.partial('type.tmpl', r) ?></li>
127
+ <?js }); ?>
128
+ </ul>
129
+
130
+ <?js } else { modifies.forEach(function(r) { ?>
131
+ <?js= self.partial('type.tmpl', r) ?>
132
+ <?js });} ?>
133
+ </div>
134
+ <?js } ?>
135
+
136
+
137
+ <?js if (data.exceptions && exceptions.length) { ?>
138
+ <div class="method-member-container mt-20">
139
+ <strong><?js= t('throws') ?>:</strong>
140
+ <?js if (exceptions.length > 1) { ?>
141
+ <ul>
142
+ <?js exceptions.forEach(function(r) { ?>
143
+ <li><?js= self.partial('exceptions.tmpl', r) ?></li>
144
+ <?js }); ?>
145
+ </ul>
146
+ <?js } else { exceptions.forEach(function(r) { ?>
147
+ <?js= self.partial('exceptions.tmpl', r) ?>
148
+ <?js });} ?>
149
+ </div>
150
+ <?js } ?>
151
+
152
+ <?js if (data.returns && returns.length) { ?>
153
+ <div class="method-member-container mt-20">
154
+ <strong><?js= t('returns') ?>:</strong>
155
+ <?js if (returns.length > 1) { ?>
156
+ <ul>
157
+ <?js returns.forEach(function(r) { ?>
158
+ <li><?js= self.partial('returns.tmpl', r) ?></li>
159
+ <?js }); ?>
160
+ </ul>
161
+
162
+ <?js } else { returns.forEach(function(r) { ?>
163
+ <?js= self.partial('returns.tmpl', r) ?>
164
+ <?js });} ?>
165
+ </div>
166
+ <?js } ?>
167
+
168
+ <?js if (data.yields && yields.length) { ?>
169
+ <div class="method-member-container mt-20">
170
+ <strong><?js= t('yields') ?>:</strong>
171
+ <?js if (yields.length > 1) { ?>
172
+ <ul>
173
+ <?js yields.forEach(function(r) { ?>
174
+ <li><?js= self.partial('returns.tmpl', r) ?></li>
175
+ <?js }); ?>
176
+ </ul>
177
+
178
+ <?js } else { yields.forEach(function(r) { ?>
179
+ <?js= self.partial('returns.tmpl', r) ?>
180
+ <?js });} ?>
181
+ </div>
182
+ <?js } ?>
183
+
184
+
185
+ <?js if (data.examples && examples.length) { ?>
186
+ <div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
187
+ <strong><?js= examples.length > 1 ? t('examples') : t('example') ?></strong>
188
+ <?js= this.partial('examples.tmpl', examples) ?>
189
+ </div>
190
+ <?js } ?>
@@ -0,0 +1,21 @@
1
+ <div class="mobile-menu-icon-container">
2
+ <button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu">
3
+ <svg><use xlink:href="#menu-icon"></use></svg>
4
+ </button>
5
+ </div>
6
+
7
+ <div id="mobile-sidebar" class="mobile-sidebar-container">
8
+ <div class="mobile-sidebar-wrapper">
9
+ <?js= this.partial('sidebar-title.tmpl') ?>
10
+ <div class="mobile-nav-links">
11
+ <?js= this.partial('navbar-menu.tmpl', '-mobile') ?>
12
+ </div>
13
+ <div class="mobile-sidebar-items-c">
14
+ <?js= this.partial('sidebar-items.tmpl') ?>
15
+ </div>
16
+ <div class="mobile-navbar-actions">
17
+ <?js= this.partial('navbar-actions.tmpl') ?>
18
+ </div>
19
+ </div>
20
+
21
+ </div>
@@ -0,0 +1,25 @@
1
+ <?js
2
+ var data = this.navbar
3
+ ?>
4
+ <div class="navbar-right-item">
5
+ <button class="icon-button home-button" aria-label='go-to-homepage'>
6
+ <svg><use xlink:href="#home-icon"></use></svg>
7
+ </button>
8
+ </div>
9
+ <?js if(data.search) { ?>
10
+ <div class="navbar-right-item">
11
+ <button class="icon-button search-button" aria-label='open-search'>
12
+ <svg><use xlink:href="#search-icon"></use></svg>
13
+ </button>
14
+ </div>
15
+ <?js } ?>
16
+ <div class="navbar-right-item">
17
+ <button class="icon-button theme-toggle" aria-label='toggle-theme'>
18
+ <svg><use class="theme-svg-use" xlink:href="#<?js= (this.theme === 'dark' ? 'light' : 'dark') ?>-theme-icon"></use></svg>
19
+ </button>
20
+ </div>
21
+ <div class="navbar-right-item">
22
+ <button class="icon-button font-size" aria-label='change-font-size'>
23
+ <svg><use xlink:href="#font-size-icon"></use></svg>
24
+ </button>
25
+ </div>
@@ -0,0 +1,25 @@
1
+ <?js
2
+ var data = this.navbar
3
+ var idSuffix = obj || ''
4
+ if(data.menu) { ?>
5
+ <?js
6
+ data.menu.forEach(function(item) {
7
+ var className = item.class || '';
8
+ var id = item.id || '';
9
+ var target = item.target || '';
10
+ className += ' navbar-item'
11
+ if(id) {
12
+ id += idSuffix
13
+ }
14
+ ?>
15
+
16
+ <div class="<?js=className ?>">
17
+ <a id="<?js= id ?>" href="<?js= item.link ?>" target="<?js= target ?>">
18
+ <?js= item.title?>
19
+ </a>
20
+ </div>
21
+
22
+ <?js
23
+ })
24
+ }
25
+ ?>
@@ -0,0 +1,14 @@
1
+ <?js
2
+ var data = this.navbar;
3
+ ?>
4
+
5
+ <nav class="navbar">
6
+ <div class="navbar-left-items">
7
+ <?js= this.partial('navbar-menu.tmpl') ?>
8
+
9
+ </div>
10
+
11
+ <div class="navbar-right-items">
12
+ <?js= this.partial('navbar-actions.tmpl') ?>
13
+ </div>
14
+ <nav>
@@ -0,0 +1,131 @@
1
+ <?js
2
+ var params = obj;
3
+
4
+ /* sort subparams under their parent params (like opts.classname) */
5
+ var parentParam = null;
6
+ params.forEach(function(param, i) {
7
+ var paramRegExp;
8
+
9
+ if (!param) {
10
+ return;
11
+ }
12
+
13
+ if (parentParam && parentParam.name && param.name) {
14
+ try {
15
+ paramRegExp = new RegExp('^(?:' + parentParam.name + '(?:\\[\\])*)\\.(.+)$');
16
+ }
17
+ catch (e) {
18
+ // there's probably a typo in the JSDoc comment that resulted in a weird
19
+ // parameter name
20
+ return;
21
+ }
22
+
23
+ if ( paramRegExp.test(param.name) ) {
24
+ param.name = RegExp.$1;
25
+ parentParam.subparams = parentParam.subparams || [];
26
+ parentParam.subparams.push(param);
27
+ params[i] = null;
28
+ }
29
+ else {
30
+ parentParam = param;
31
+ }
32
+ }
33
+ else {
34
+ parentParam = param;
35
+ }
36
+ });
37
+
38
+ /* determine if we need extra columns, "attributes" and "default" */
39
+ params.hasAttributes = false;
40
+ params.hasDefault = false;
41
+ params.hasName = false;
42
+
43
+ params.forEach(function(param) {
44
+ if (!param) { return; }
45
+
46
+ if (param.optional || param.nullable || param.variable) {
47
+ params.hasAttributes = true;
48
+ }
49
+
50
+ if (param.name) {
51
+ params.hasName = true;
52
+ }
53
+
54
+ if (typeof param.defaultvalue !== 'undefined') {
55
+ params.hasDefault = true;
56
+ }
57
+ });
58
+ ?>
59
+
60
+ <table class="params">
61
+ <thead>
62
+ <tr>
63
+ <?js if (params.hasName) {?>
64
+ <th><?js= t('name') ?></th>
65
+ <?js } ?>
66
+
67
+ <th><?js= t('type') ?></th>
68
+
69
+ <?js if (params.hasAttributes) {?>
70
+ <th><?js= t('attributes') ?></th>
71
+ <?js } ?>
72
+
73
+ <?js if (params.hasDefault) {?>
74
+ <th><?js= t('default') ?></th>
75
+ <?js } ?>
76
+
77
+ <th class="last"><?js= t('description') ?></th>
78
+ </tr>
79
+ </thead>
80
+
81
+ <tbody>
82
+ <?js
83
+ var self = this;
84
+ params.forEach(function(param) {
85
+ if (!param) { return; }
86
+ ?>
87
+
88
+ <tr>
89
+ <?js if (params.hasName) {?>
90
+ <td class="name"><code><?js= param.name ?></code></td>
91
+ <?js } ?>
92
+
93
+ <td class="type">
94
+ <?js if (param.type && param.type.names) {?>
95
+ <?js= self.partial('type.tmpl', param.type.names) ?>
96
+ <?js } ?>
97
+ </td>
98
+
99
+ <?js if (params.hasAttributes) {?>
100
+ <td class="attributes">
101
+ <?js if (param.optional) { ?>
102
+ &lt;<?js= t('optional') ?>><br>
103
+ <?js } ?>
104
+
105
+ <?js if (param.nullable) { ?>
106
+ &lt;<?js= t('nullable') ?>><br>
107
+ <?js } ?>
108
+
109
+ <?js if (param.variable) { ?>
110
+ &lt;<?js= t('repeatable') ?>><br>
111
+ <?js } ?>
112
+ </td>
113
+ <?js } ?>
114
+
115
+ <?js if (params.hasDefault) {?>
116
+ <td class="default">
117
+ <?js if (typeof param.defaultvalue !== 'undefined') { ?>
118
+ <?js= self.htmlsafe(param.defaultvalue) ?>
119
+ <?js } ?>
120
+ </td>
121
+ <?js } ?>
122
+
123
+ <td class="description last"><?js= param.description ?><?js if (param.subparams) { ?>
124
+ <h6><?js= t('properties') ?></h6>
125
+ <?js= self.partial('params.tmpl', param.subparams) ?>
126
+ <?js } ?></td>
127
+ </tr>
128
+
129
+ <?js }); ?>
130
+ </tbody>
131
+ </table>