@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,261 @@
1
+ <?js
2
+ var self = this;
3
+ var isGlobalPage;
4
+ docs.forEach(function(doc, i) {
5
+ ?>
6
+
7
+ <?js
8
+ // we only need to check this once
9
+ if (typeof isGlobalPage === 'undefined') {
10
+ isGlobalPage = (doc.kind === 'globalobj');
11
+ }
12
+ ?>
13
+ <div style="background: yellow; padding: 10px; margin: 10px; border: 1px solid red;">
14
+ DEBUG: doc.kind = <?js= doc.kind ?><br>
15
+ DEBUG: packageInfo = <?js= JSON.stringify(packageInfo) ?><br>
16
+ DEBUG: typeof packageInfo = <?js= typeof packageInfo ?>
17
+ </div>
18
+ <?js if (doc.kind === 'mainpage' || (doc.kind === 'package')) { ?>
19
+ <?js if (packageInfo && packageInfo.version) { ?>
20
+ <div class="package-version-info">
21
+ <p class="package-version"><?js= t('version') ?>: v<?js= packageInfo.version ?></p>
22
+ </div>
23
+ <?js } ?>
24
+ <?js= self.partial('mainpage.tmpl', doc) ?>
25
+ <?js } else if (doc.kind === 'source') { ?>
26
+ <?js= self.partial('source.tmpl', doc) ?>
27
+ <?js } else { ?>
28
+
29
+ <section>
30
+
31
+ <?js if (((doc.ancestors && doc.ancestors.length) || doc.name || doc.variation) || (doc.kind === 'module' && doc.modules)) { ?>
32
+ <header>
33
+ <?js if (!doc.longname || doc.kind !== 'module') { ?>
34
+ <?js if ((doc.ancestors && doc.ancestors.length) || doc.name || doc.variation) { ?>
35
+ <h1 id="<?js= doc.name ?>-title" class="has-anchor">
36
+ <?js if (doc.ancestors && doc.ancestors.length) { ?>
37
+ <span class="ancestors"><?js= doc.ancestors.join('') ?></span>
38
+ <?js } ?>
39
+ <?js= doc.name ?>
40
+ <?js if (doc.variation) { ?>
41
+ <sup class="variation"><?js= doc.variation ?></sup>
42
+ <?js } ?>
43
+ </h1>
44
+ <?js } ?>
45
+ <?js if (doc.classdesc) { ?>
46
+ <div class="class-description"><?js= doc.classdesc ?></div>
47
+ <?js } ?>
48
+ <?js } else if (doc.kind === 'module' && doc.modules) { ?>
49
+ <?js doc.modules.forEach(function(module) { ?>
50
+ <?js if (module.name && self.displayModuleHeader) { ?>
51
+ <h1 id="<?js= module.name ?>-title" class="has-anchor">
52
+ <?js= module.name ?>
53
+ </h1>
54
+ <?js if (module.version) { ?>
55
+ <p class="module-version"><?js= t('version') ?>: v<?js= module.version ?></p>
56
+ <?js } ?>
57
+ <?js } ?>
58
+ <?js if (module.classdesc) { ?>
59
+ <div class="class-description"><?js= module.classdesc ?></div>
60
+ <?js } ?>
61
+ <?js }) ?>
62
+ <?js } ?>
63
+ </header>
64
+ <?js } ?>
65
+
66
+ <article>
67
+ <div class="container-overview">
68
+ <?js if (doc.kind === 'module' && doc.modules) { ?>
69
+ <?js if (doc.description) { ?>
70
+ <div class="description"><?js= doc.description ?></div>
71
+ <?js } ?>
72
+
73
+ <?js doc.modules.forEach(function(module) { ?>
74
+ <?js= self.partial('method.tmpl', module) ?>
75
+ <?js }) ?>
76
+ <?js } else if (doc.kind === 'class' || (doc.kind === 'namespace' && doc.signature)) { ?>
77
+ <?js= self.partial('method.tmpl', doc) ?>
78
+ <?js } else { ?>
79
+ <?js if (doc.description) { ?>
80
+ <div class="description"><?js= doc.description ?></div>
81
+ <?js } ?>
82
+
83
+ <?js= self.partial('details.tmpl', doc) ?>
84
+
85
+ <?js if (doc.examples && doc.examples.length) { ?>
86
+ <h2 id="example" class="has-anchor">Example<?js= doc.examples.length > 1? 's':'' ?></h2>
87
+ <?js= self.partial('examples.tmpl', doc.examples) ?>
88
+ <?js } ?>
89
+ <?js } ?>
90
+ </div>
91
+
92
+ <?js if (doc.augments && doc.augments.length) { ?>
93
+ <h2 id="Extends" class="subsection-title has-anchor"><?js= t('extends') ?></h2>
94
+
95
+ <?js= self.partial('augments.tmpl', doc) ?>
96
+ <?js } ?>
97
+
98
+ <?js if (doc.requires && doc.requires.length) { ?>
99
+ <h2 id="requires" class="subsection-title has-anchor"><?js= t('requires') ?></h2>
100
+
101
+ <ul><?js doc.requires.forEach(function(r) { ?>
102
+ <li><?js= self.linkto(r, r) ?></li>
103
+ <?js }); ?></ul>
104
+ <?js } ?>
105
+
106
+ <?js
107
+ var shouldExcludeInherited = { ...(self.excludeInherited ? { inherited: {isUndefined: true} } : {}) };
108
+ var classes = self.find({kind: 'class', memberof: doc.longname, ...shouldExcludeInherited } );
109
+ if (!isGlobalPage && classes && classes.length) {
110
+ ?>
111
+ <h2 id="classes" class="subsection-title has-anchor"><?js= t('classes') ?></h2>
112
+
113
+ <dl><?js classes.forEach(function(c) { ?>
114
+ <dt><?js= self.linkto(c.longname, c.name) ?></dt>
115
+ <dd><?js if (c.summary) { ?><?js= c.summary ?><?js } ?></dd>
116
+ <?js }); ?></dl>
117
+ <?js } ?>
118
+
119
+ <?js
120
+ var interfaces = self.find({kind: 'interface', memberof: doc.longname, ...shouldExcludeInherited});
121
+ if (!isGlobalPage && interfaces && interfaces.length) {
122
+ ?>
123
+ <h2 id="interfaces" class="subsection-title has-anchor"><?js= t('interfaces') ?></h2>
124
+
125
+ <dl><?js interfaces.forEach(function(i) { ?>
126
+ <dt><?js= self.linkto(i.longname, i.name) ?></dt>
127
+ <dd><?js if (i.summary) { ?><?js= i.summary ?><?js } ?></dd>
128
+ <?js }); ?></dl>
129
+ <?js } ?>
130
+
131
+ <?js
132
+ var mixins = self.find({kind: 'mixin', memberof: doc.longname, ...shouldExcludeInherited});
133
+ if (!isGlobalPage && mixins && mixins.length) {
134
+ ?>
135
+ <h2 id="mixins" class="subsection-title has-anchor"><?js= t('mixins') ?></h2>
136
+
137
+ <dl><?js mixins.forEach(function(m) { ?>
138
+ <dt><?js= self.linkto(m.longname, m.name) ?></dt>
139
+ <dd><?js if (m.summary) { ?><?js= m.summary ?><?js } ?></dd>
140
+ <?js }); ?></dl>
141
+ <?js } ?>
142
+
143
+ <?js
144
+ var namespaces = self.find({kind: 'namespace', memberof: doc.longname, ...shouldExcludeInherited});
145
+ if (!isGlobalPage && namespaces && namespaces.length) {
146
+ ?>
147
+ <h2 id="namespaces" class="subsection-title has-anchor"><?js= t('namespaces') ?></h2>
148
+
149
+ <dl><?js namespaces.forEach(function(n) { ?>
150
+ <dt><?js= self.linkto(n.longname, n.name) ?></dt>
151
+ <dd><?js if (n.summary) { ?><?js= n.summary ?><?js } ?></dd>
152
+ <?js }); ?></dl>
153
+ <?js } ?>
154
+
155
+ <?js
156
+ // Add independent Properties section
157
+ // Collect property information directly from members
158
+ var allMembers = self.find({kind: 'member', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
159
+
160
+ // Filter out module exports for global pages
161
+ if (isGlobalPage && allMembers && allMembers.length && allMembers.forEach) {
162
+ allMembers = allMembers.filter(function(m) {
163
+ return m.longname && m.longname.indexOf('module:') !== 0;
164
+ });
165
+ }
166
+
167
+ if (allMembers && allMembers.length && allMembers.forEach) {
168
+ // Create a temporary properties array
169
+ var propertiesData = {
170
+ properties: allMembers.map(function(member) {
171
+ return {
172
+ name: member.name,
173
+ type: member.type,
174
+ description: member.description || '',
175
+ nullable: member.nullable,
176
+ optional: member.optional,
177
+ defaultvalue: member.defaultvalue
178
+ };
179
+ })
180
+ };
181
+ ?>
182
+ <h2 id="properties" class="subsection-title has-anchor"><?js= t('properties') ?></h2>
183
+ <?js= self.partial('properties.tmpl', propertiesData) ?>
184
+ <?js } ?>
185
+
186
+ <?js
187
+ var members = self.find({kind: 'member', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
188
+
189
+ // symbols that are assigned to module.exports are not globals, even though they're not a memberof anything
190
+ if (isGlobalPage && members && members.length && members.forEach) {
191
+ members = members.filter(function(m) {
192
+ return m.longname && m.longname.indexOf('module:') !== 0;
193
+ });
194
+ }
195
+
196
+ // Filter out properties, only show methods
197
+ if (members && members.length && members.forEach) {
198
+ members = members.filter(function(m) {
199
+ // Hide all properties, only show methods
200
+ return false;
201
+ });
202
+ }
203
+
204
+ if (members && members.length && members.forEach) {
205
+ ?>
206
+ <h2 id="members" class="subsection-title has-anchor"><?js= t('members') ?></h2>
207
+
208
+ <?js members.forEach(function(p) { ?>
209
+ <?js= self.partial('members.tmpl', p) ?>
210
+ <?js }); ?>
211
+ <?js } ?>
212
+
213
+ <?js
214
+ var methods = self.find({kind: 'function', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
215
+ if (methods && methods.length && methods.forEach) {
216
+ ?>
217
+ <h2 id="methods" class="subsection-title has-anchor"><?js= t('methods') ?></h2>
218
+
219
+ <?js methods.forEach(function(m) { ?>
220
+ <?js= self.partial('method.tmpl', m) ?>
221
+ <?js }); ?>
222
+ <?js } ?>
223
+
224
+ <?js
225
+ var typedefs = self.find({kind: 'typedef', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
226
+ if (typedefs && typedefs.length && typedefs.forEach) {
227
+ ?>
228
+ <h2 id="type-definitions" class="subsection-title has-anchor"><?js= t('type_definitions') ?></h2>
229
+
230
+ <?js typedefs.forEach(function(e) {
231
+ if (e.signature) {
232
+ ?>
233
+ <?js= self.partial('method.tmpl', e) ?>
234
+ <?js
235
+ }
236
+ else {
237
+ ?>
238
+ <?js= self.partial('members.tmpl', e) ?>
239
+ <?js
240
+ }
241
+ }); ?>
242
+ <?js } ?>
243
+
244
+ <?js
245
+ var events = self.find({kind: 'event', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, ...shouldExcludeInherited});
246
+ if (events && events.length && events.forEach) {
247
+ ?>
248
+ <h2 id="events" class="subsection-title has-anchor"><?js= t('events') ?></h2>
249
+
250
+ <?js events.forEach(function(e) { ?>
251
+ <?js= self.partial('method.tmpl', e) ?>
252
+ <?js }); ?>
253
+ <?js } ?>
254
+ </article>
255
+
256
+ </section>
257
+ <?js } ?>
258
+
259
+ <?js }); ?>
260
+
261
+ <?js= self.partial('include-target-script-and-styles.tmpl', arguments[0].filename) ?>
@@ -0,0 +1,207 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+ var defaultObjectClass = '';
5
+ var loopVar = 0;
6
+ var detailsKeys = [
7
+ 'copyright',
8
+ 'defaultvalue',
9
+ 'deprecated',
10
+ 'license',
11
+ 'overrides',
12
+ 'since',
13
+ 'version',
14
+ ]
15
+ var hasToPrintDetails = (data.meta && self.outputSourceFiles) ||
16
+ (data.author && author.length) ||
17
+ (data.mixes && data.mixes.length) ||
18
+ (data.inherited && data.inherits && !data.overrides) ||
19
+ (data.implementations && data.implementations.length) ||
20
+ (data.implements && data.implements.length) ||
21
+ (data.tutorials && tutorials.length) ||
22
+ (data.see && see.length) ||
23
+ (data.todo && todo.length)
24
+
25
+
26
+ // // Check if the default value is an object or array; if so, apply code highlighting
27
+ if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvaluetype === 'array')) {
28
+ data.defaultvalue = "<pre class='prettyprint'><code class='nohljsln compact'>" + data.defaultvalue + "</code></pre>";
29
+ }
30
+
31
+ // Check whether to print details or not
32
+ for(; loopVar < detailsKeys.length; loopVar += 1) {
33
+ if(data[detailsKeys[loopVar]]) {
34
+ hasToPrintDetails = true
35
+ break
36
+ }
37
+ }
38
+
39
+ ?>
40
+
41
+ <?js
42
+ var properties = data.properties;
43
+ if (properties && properties.length && properties.forEach) {
44
+ ?>
45
+
46
+ <b class="subsection-title"><?js= t('properties') ?></b>
47
+
48
+ <?js= this.partial('properties.tmpl', data) ?>
49
+
50
+ <?js } ?>
51
+
52
+ <?js if(hasToPrintDetails) { ?>
53
+ <dl class="details">
54
+
55
+ <?js if (data.version) {?>
56
+ <div class="details-item-container">
57
+ <dt class="tag-version bold"><?js= t('version') ?></dt>
58
+ <dd class="tag-version"><ul><li><?js= version ?></li></ul></dd>
59
+ </div>
60
+ <?js } ?>
61
+
62
+ <?js if (data.since) {?>
63
+ <div class="details-item-container">
64
+ <dt class="tag-since bold"><?js= t('since') ?></dt>
65
+ <dd class="tag-since"><ul><li><?js= since ?></li></ul></dd>
66
+ </div>
67
+ <?js } ?>
68
+
69
+ <?js if (data.inherited && data.inherits && !data.overrides) { ?>
70
+ <div class="details-item-container">
71
+ <dt class="inherited-from bold"><?js= t('inherited_from') ?></dt>
72
+ <dd class="inherited-from"><ul><li>
73
+ <?js= this.linkto(data.inherits, this.htmlsafe(data.inherits)) ?>
74
+ </li></ul></dd>
75
+ </div>
76
+ <?js } ?>
77
+
78
+ <?js if (data.overrides) { ?>
79
+ <div class="details-item-container">
80
+ <dt class="tag-overrides bold"><?js= t('overrides') ?></dt>
81
+ <dd class="tag-overrides"><ul><li>
82
+ <?js= this.linkto(data.overrides, this.htmlsafe(data.overrides)) ?>
83
+ </li></ul></dd>
84
+ </div>
85
+ <?js } ?>
86
+
87
+ <?js if (data.implementations && data.implementations.length) { ?>
88
+ <div class="details-item-container">
89
+ <dt class="implementations bold"><?js= t('implementations') ?></dt>
90
+ <dd class="implementations"><ul>
91
+ <?js data.implementations.forEach(function(impl) { ?>
92
+ <li><?js= self.linkto(impl, self.htmlsafe(impl)) ?></li>
93
+ <?js }); ?>
94
+ </ul></dd>
95
+ </div>
96
+ <?js } ?>
97
+
98
+ <?js if (data.implements && data.implements.length) { ?>
99
+ <div class="details-item-container">
100
+ <dt class="implements bold"><?js= t('implements') ?></dt>
101
+ <dd class="implements"><ul>
102
+ <?js data.implements.forEach(function(impl) { ?>
103
+ <li><?js= self.linkto(impl, self.htmlsafe(impl)) ?></li>
104
+ <?js }); ?>
105
+ </ul></dd>
106
+ </div>
107
+ <?js } ?>
108
+
109
+ <?js if (data.mixes && data.mixes.length) { ?>
110
+ <div class="details-item-container">
111
+ <dt class="mixes bold"><?js= t('mixes_in') ?></dt>
112
+
113
+ <dd class="mixes"><ul>
114
+ <?js data.mixes.forEach(function(a) { ?>
115
+ <li><?js= self.linkto(a, a) ?></li>
116
+ <?js }); ?>
117
+ </ul></dd>
118
+ </div>
119
+ <?js } ?>
120
+
121
+ <?js if (data.deprecated) { ?>
122
+ <div class="details-item-container">
123
+ <dt class="important tag-deprecated bold"><?js= t('deprecated') ?></dt><?js
124
+ if (data.deprecated === true) { ?><dd class="tag-deprecated"><ul><li><?js= t('yes') ?></li></ul></dd><?js }
125
+ else { ?><dd><ul><li><?js= data.deprecated ?></li></ul></dd><?js }
126
+ ?>
127
+ </div>
128
+ <?js } ?>
129
+
130
+ <?js if (data.author && author.length) {?>
131
+ <div class="details-item-container">
132
+ <dt class="tag-author bold"><?js= t('author') ?></dt>
133
+ <dd class="tag-author">
134
+ <ul><?js author.forEach(function(a) { ?>
135
+ <li><?js= self.resolveAuthorLinks(a) ?></li>
136
+ <?js }); ?></ul>
137
+ </dd>
138
+ </div>
139
+ <?js } ?>
140
+
141
+ <?js if (data.copyright) {?>
142
+ <div class="details-item-container">
143
+ <dt class="tag-copyright bold"><?js= t('copyright') ?></dt>
144
+ <dd class="tag-copyright"><ul><li><?js= copyright ?></li></ul></dd>
145
+ </div>
146
+ <?js } ?>
147
+
148
+ <?js if (data.license) {?>
149
+ <div class="details-item-container">
150
+ <dt class="tag-license bold"><?js= t('license') ?></dt>
151
+ <dd class="tag-license"><ul><li><?js= license ?></li></ul></dd>
152
+ </div>
153
+ <?js } ?>
154
+
155
+ <?js if (data.defaultvalue) {?>
156
+ <div class="details-item-container">
157
+ <dt class="tag-default bold"><?js= t('default_value') ?></dt>
158
+ <dd class="tag-default"><ul>
159
+ <li data-skip-pre-process="true"><?js= data.defaultvalue ?></li>
160
+ </ul></dd>
161
+ </div>
162
+ <?js } ?>
163
+
164
+ <?js if (data.meta && self.outputSourceFiles) {?>
165
+ <div class="details-item-container">
166
+ <dt class="tag-source bold"><?js= t('source') ?></dt>
167
+ <dd class="tag-source"><ul><li>
168
+ <?js= self.linkto(meta.shortpath) ?>, <?js= self.linkto(meta.shortpath, 'line ' + meta.lineno, null, 'line' + meta.lineno) ?>
169
+ </li></ul></dd>
170
+ </div>
171
+ <?js } ?>
172
+
173
+ <?js if (data.tutorials && tutorials.length) {?>
174
+ <div class="details-item-container">
175
+ <dt class="tag-tutorial bold"><?js= t('tutorials') ?></dt>
176
+ <dd class="tag-tutorial">
177
+ <ul><?js tutorials.forEach(function(t) { ?>
178
+ <li><?js= self.tutoriallink(t) ?></li>
179
+ <?js }); ?></ul>
180
+ </dd>
181
+ </div>
182
+ <?js } ?>
183
+
184
+ <?js if (data.see && see.length) {?>
185
+ <div class="details-item-container">
186
+ <dt class="tag-see bold"><?js= t('see') ?></dt>
187
+ <dd class="tag-see">
188
+ <ul><?js see.forEach(function(s) { ?>
189
+ <li><?js= self.linkto(s) ?></li>
190
+ <?js }); ?></ul>
191
+ </dd>
192
+ </div>
193
+ <?js } ?>
194
+
195
+ <?js if (data.todo && todo.length) {?>
196
+ <div class="details-item-container">
197
+ <dt class="tag-todo bold"><?js= t('todo') ?></dt>
198
+ <dd class="tag-todo">
199
+ <ul><?js todo.forEach(function(t) { ?>
200
+ <li><?js= t ?></li>
201
+ <?js }); ?></ul>
202
+ </dd>
203
+ </div>
204
+ <?js } ?>
205
+ </dl>
206
+
207
+ <?js } ?>
@@ -0,0 +1,3 @@
1
+ <?js var data = obj; ?>
2
+ <pre class="prettyprint"><code><?js= data ?></code>
3
+ </pre>
@@ -0,0 +1,48 @@
1
+ <?js
2
+ var data = obj;
3
+ var self = this;
4
+ var codepen = this.codepen;
5
+ var enable_for = codepen.enable_for || [];
6
+
7
+ data.forEach(function(example) {
8
+
9
+ if (example.caption) {
10
+ ?>
11
+ <p class="code-caption"><?js= example.caption ?></p>
12
+ <?js } ?>
13
+ <div class="rel">
14
+ <pre class="prettyprint"><code><?js= self.htmlsafe(example.code) ?></code></pre>
15
+
16
+ <?js
17
+ if(enable_for.findIndex(function (val) { return val === "examples"}) !== -1) {
18
+ var options = codepen.options || {};
19
+ var optionsString = '';
20
+
21
+ var code = `${options.js}
22
+ ${example.code}
23
+ `
24
+
25
+ var jsonString = JSON.stringify(code)
26
+ .replace(/"/g, "&quot;")
27
+ .replace(/'/g, "&apos;");
28
+
29
+ var optionsKey = Object.keys(options).filter((key) => key !== 'js' )
30
+ optionsKey.map((key, idx) => {
31
+ optionsString += '"' + key +'": "' + options[key].replace(/"/g, "&quot;").replace(/'/g, "&apos;") + '"';
32
+ if(idx !== optionsKey.length - 1) {
33
+ optionsString += ','
34
+ }
35
+ })
36
+
37
+ ?>
38
+ <form action="https://codepen.io/pen/define" method="POST" target="_blank" class="codepen-form">
39
+ <input type="hidden" name="data" value='{"title": "<?js= example.caption || t('example') ?>", "js": <?js= jsonString ?>, <?js= optionsString ?> }' />
40
+ <button class="icon-button codepen-button" type="submit" value="Create New Pen with Prefilled Data" aria-label='<?js= t('open_in_codepen') ?>'>
41
+ <svg><use xlink:href="#codepen-icon"></use></svg>
42
+ </button>
43
+ </form>
44
+ <?js } ?>
45
+ </div>
46
+ <?js
47
+ });
48
+ ?>
@@ -0,0 +1,32 @@
1
+ <?js
2
+ var data = obj;
3
+ ?>
4
+ <?js if (data.description && data.type && data.type.names) { ?>
5
+ <dl>
6
+ <dt>
7
+ <div class="param-desc">
8
+ <?js= data.description ?>
9
+ </div>
10
+ </dt>
11
+ <dd></dd>
12
+ <dt>
13
+ <dl>
14
+ <dt>
15
+ Type
16
+ </dt>
17
+ <dd>
18
+ <?js= this.partial('type.tmpl', data.type.names) ?>
19
+ </dd>
20
+ </dl>
21
+ </dt>
22
+ <dd></dd>
23
+ </dl>
24
+ <?js } else { ?>
25
+ <div class="param-desc">
26
+ <?js if (data.description) { ?>
27
+ <?js= data.description ?>
28
+ <?js } else if (data.type && data.type.names) { ?>
29
+ <?js= this.partial('type.tmpl', data.type.names) ?>
30
+ <?js } ?>
31
+ </div>
32
+ <?js } ?>
@@ -0,0 +1,30 @@
1
+ <script>
2
+ // Initialize tooltips with i18n support
3
+ document.addEventListener('DOMContentLoaded', function() {
4
+ if (typeof tippy !== 'undefined') {
5
+ // eslint-disable-next-line no-undef
6
+ tippy(".home-button", {
7
+ content: "<?js= t('home_tooltip') ?>",
8
+ delay: 500,
9
+ });
10
+
11
+ // eslint-disable-next-line no-undef
12
+ tippy(".theme-toggle", {
13
+ content: "<?js= t('toggle_theme_tooltip') ?>",
14
+ delay: 500,
15
+ });
16
+
17
+ // eslint-disable-next-line no-undef
18
+ tippy(".search-button", {
19
+ content: "<?js= t('search_tooltip') ?>",
20
+ delay: 500,
21
+ });
22
+
23
+ // eslint-disable-next-line no-undef
24
+ tippy(".font-size", {
25
+ content: "<?js= t('font_size_tooltip') ?>",
26
+ delay: 500,
27
+ });
28
+ }
29
+ });
30
+ </script>
@@ -0,0 +1,77 @@
1
+ <svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
2
+ style="display:none">
3
+ <defs>
4
+ <symbol id="home-icon" viewBox="0 0 24 24">
5
+ <path fill="none" d="M0 0h24v24H0z" />
6
+ <path d="M19 21H5a1 1 0 0 1-1-1v-9H1l10.327-9.388a1 1 0 0 1 1.346 0L23 11h-3v9a1 1 0 0 1-1 1zM6 19h12V9.157l-6-5.454-6 5.454V19z" />
7
+ </symbol>
8
+ <symbol id="copy-icon" viewbox="0 0 488.3 488.3">
9
+ <g>
10
+ <path
11
+ d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z" />
12
+ <path
13
+ d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z" />
14
+ </g>
15
+ </symbol>
16
+ <symbol id='search-icon' viewBox="0 0 512 512">
17
+ <g>
18
+ <g>
19
+ <path
20
+ d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z" />
21
+ </g>
22
+ </g>
23
+ <g>
24
+ <g>
25
+ <path
26
+ d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z" />
27
+ </g>
28
+ </g>
29
+ </symbol>
30
+ <symbol id="font-size-icon" viewBox="0 0 24 24">
31
+ <path fill="none" d="M0 0h24v24H0z" />
32
+ <path
33
+ d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" />
34
+ </symbol>
35
+ <symbol id="add-icon" viewBox="0 0 24 24">
36
+ <path fill="none" d="M0 0h24v24H0z" />
37
+ <path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z" />
38
+ </symbol>
39
+ <symbol id="minus-icon" viewBox="0 0 24 24">
40
+ <path fill="none" d="M0 0h24v24H0z" />
41
+ <path d="M5 11h14v2H5z" />
42
+ </symbol>
43
+ <symbol id="dark-theme-icon" viewBox="0 0 24 24">
44
+ <path fill="none" d="M0 0h24v24H0z" />
45
+ <path
46
+ d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z" />
47
+ </symbol>
48
+ <symbol id="light-theme-icon" viewBox="0 0 24 24">
49
+ <path fill="none" d="M0 0h24v24H0z" />
50
+ <path
51
+ d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z" />
52
+ </symbol>
53
+ <symbol id="reset-icon" viewBox="0 0 24 24">
54
+ <path fill="none" d="M0 0h24v24H0z"/>
55
+ <path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/>
56
+ </symbol>
57
+
58
+ <symbol id="down-icon" viewBox="0 0 16 16">
59
+ <path fill-rule="evenodd" clip-rule="evenodd"
60
+ d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z">
61
+ </path>
62
+ </symbol>
63
+
64
+ <symbol id="codepen-icon" viewBox="0 0 24 24">
65
+ <path fill="none" d="M0 0h24v24H0z"/>
66
+ <path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/>
67
+ </symbol>
68
+ <symbol id="close-icon" viewBox="0 0 24 24">
69
+ <path fill="none" d="M0 0h24v24H0z"/>
70
+ <path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/>
71
+ </symbol>
72
+ <symbol id="menu-icon" viewBox="0 0 24 24">
73
+ <path fill="none" d="M0 0h24v24H0z"/>
74
+ <path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/>
75
+ </symbol>
76
+ </defs>
77
+ </svg>