ledger_sync 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +71 -17
- data/docs/.gitignore +4 -0
- data/documentation/build.sh +3 -1
- data/documentation/site/_includes/ledgers/{Stripe_summary.md → stripe_summary.md} +0 -0
- data/ledger_sync.gemspec +4 -0
- data/lib/ledger_sync/serialization/type/deserializer_references_one_type.rb +1 -1
- data/lib/ledger_sync/version.rb +1 -1
- metadata +59 -136
- data/docs/CNAME +0 -1
- data/docs/assets/css/brands.min.css +0 -5
- data/docs/assets/css/fontawesome.min.css +0 -5
- data/docs/assets/css/main.css +0 -1924
- data/docs/assets/css/monokai.css +0 -441
- data/docs/assets/js/main.js +0 -214
- data/docs/assets/js/plugins.js +0 -22
- data/docs/assets/js/prism.js +0 -9
- data/docs/assets/webfonts/fa-brands-400.eot +0 -0
- data/docs/assets/webfonts/fa-brands-400.svg +0 -3452
- data/docs/assets/webfonts/fa-brands-400.ttf +0 -0
- data/docs/assets/webfonts/fa-brands-400.woff +0 -0
- data/docs/assets/webfonts/fa-brands-400.woff2 +0 -0
- data/docs/blog/index.html +0 -282
- data/docs/guides/architecture/clients/index.html +0 -458
- data/docs/guides/architecture/index.html +0 -435
- data/docs/guides/architecture/operations/index.html +0 -465
- data/docs/guides/architecture/resources/index.html +0 -461
- data/docs/guides/architecture/results/index.html +0 -426
- data/docs/guides/architecture/searchers/index.html +0 -446
- data/docs/guides/architecture/serialization/index.html +0 -476
- data/docs/guides/community/index.html +0 -412
- data/docs/guides/contribute/console/index.html +0 -424
- data/docs/guides/contribute/deployment/index.html +0 -434
- data/docs/guides/contribute/documentation/index.html +0 -450
- data/docs/guides/contribute/index.html +0 -434
- data/docs/guides/contribute/qa/index.html +0 -436
- data/docs/guides/contribute/testing/index.html +0 -424
- data/docs/guides/customization/custom_resources/index.html +0 -461
- data/docs/guides/customization/custom_serializers/index.html +0 -460
- data/docs/guides/customization/index.html +0 -431
- data/docs/guides/customization/resource_converters/index.html +0 -491
- data/docs/guides/getting-started/get-help/index.html +0 -427
- data/docs/guides/getting-started/index.html +0 -421
- data/docs/guides/getting-started/installation/index.html +0 -433
- data/docs/guides/getting-started/quick-start/index.html +0 -531
- data/docs/guides/index.html +0 -428
- data/docs/guides/ledgers/index.html +0 -429
- data/docs/guides/ledgers/netsuite/index.html +0 -424
- data/docs/guides/ledgers/netsuite_soap/index.html +0 -424
- data/docs/guides/ledgers/quickbooks_online/index.html +0 -424
- data/docs/guides/ledgers/stripe/index.html +0 -424
- data/docs/guides/modern-treasury/index.html +0 -411
- data/docs/guides/tips_and_more/index.html +0 -471
- data/docs/images/1.jpg +0 -0
- data/docs/images/10.jpg +0 -0
- data/docs/images/2.jpg +0 -0
- data/docs/images/3.jpg +0 -0
- data/docs/images/4.jpg +0 -0
- data/docs/images/5.jpg +0 -0
- data/docs/images/6.jpg +0 -0
- data/docs/images/7.jpg +0 -0
- data/docs/images/8.jpg +0 -0
- data/docs/images/9.jpg +0 -0
- data/docs/images/logo.svg +0 -8
- data/docs/index.html +0 -379
- data/docs/overview/index.html +0 -409
- data/docs/posts/introducing-docs/index.html +0 -270
- data/docs/posts/netsuite-authentication/index.html +0 -624
- data/docs/reference/architecture/clients/index.html +0 -332
- data/docs/reference/architecture/index.html +0 -311
- data/docs/reference/architecture/operations/index.html +0 -302
- data/docs/reference/architecture/resources/index.html +0 -335
- data/docs/reference/architecture/results/index.html +0 -302
- data/docs/reference/architecture/searchers/index.html +0 -302
- data/docs/reference/architecture/serialization/index.html +0 -302
- data/docs/reference/index.html +0 -281
- data/docs/reference/netsuite/authentication/index.html +0 -392
- data/docs/reference/netsuite/authentication/token_based_authentication/index.html +0 -486
- data/docs/reference/netsuite/index.html +0 -388
- data/docs/reference/netsuite/resources/account/index.html +0 -484
- data/docs/reference/netsuite/resources/check/index.html +0 -492
- data/docs/reference/netsuite/resources/check_line_item/index.html +0 -460
- data/docs/reference/netsuite/resources/currency/index.html +0 -476
- data/docs/reference/netsuite/resources/customer/index.html +0 -488
- data/docs/reference/netsuite/resources/customer_deposit/index.html +0 -480
- data/docs/reference/netsuite/resources/department/index.html +0 -484
- data/docs/reference/netsuite/resources/deposit/index.html +0 -468
- data/docs/reference/netsuite/resources/deposit_line_item/index.html +0 -460
- data/docs/reference/netsuite/resources/index.html +0 -436
- data/docs/reference/netsuite/resources/invoice/index.html +0 -468
- data/docs/reference/netsuite/resources/invoice_line_item/index.html +0 -456
- data/docs/reference/netsuite/resources/item/index.html +0 -444
- data/docs/reference/netsuite/resources/journal_entry/index.html +0 -488
- data/docs/reference/netsuite/resources/journal_entry_line_item/index.html +0 -464
- data/docs/reference/netsuite/resources/ledger_class/index.html +0 -484
- data/docs/reference/netsuite/resources/location/index.html +0 -468
- data/docs/reference/netsuite/resources/resource/index.html +0 -440
- data/docs/reference/netsuite/resources/subsidiary/index.html +0 -448
- data/docs/reference/netsuite/resources/vendor/index.html +0 -492
- data/docs/reference/netsuite_soap/index.html +0 -303
- data/docs/reference/netsuite_soap/resources/customer/index.html +0 -364
- data/docs/reference/netsuite_soap/resources/index.html +0 -316
- data/docs/reference/netsuite_soap/resources/resource/index.html +0 -336
- data/docs/reference/netsuite_soap/resources/subsidiary/index.html +0 -356
- data/docs/reference/quickbooks_online/authentication/index.html +0 -442
- data/docs/reference/quickbooks_online/errors/index.html +0 -395
- data/docs/reference/quickbooks_online/index.html +0 -393
- data/docs/reference/quickbooks_online/resources/account/index.html +0 -530
- data/docs/reference/quickbooks_online/resources/bill/index.html +0 -534
- data/docs/reference/quickbooks_online/resources/bill_line_item/index.html +0 -496
- data/docs/reference/quickbooks_online/resources/bill_payment/index.html +0 -550
- data/docs/reference/quickbooks_online/resources/bill_payment_line_item/index.html +0 -488
- data/docs/reference/quickbooks_online/resources/currency/index.html +0 -492
- data/docs/reference/quickbooks_online/resources/customer/index.html +0 -514
- data/docs/reference/quickbooks_online/resources/department/index.html +0 -518
- data/docs/reference/quickbooks_online/resources/deposit/index.html +0 -526
- data/docs/reference/quickbooks_online/resources/deposit_line_item/index.html +0 -500
- data/docs/reference/quickbooks_online/resources/expense/index.html +0 -538
- data/docs/reference/quickbooks_online/resources/expense_line_item/index.html +0 -496
- data/docs/reference/quickbooks_online/resources/index.html +0 -484
- data/docs/reference/quickbooks_online/resources/invoice/index.html +0 -526
- data/docs/reference/quickbooks_online/resources/invoice_sales_line_item/index.html +0 -496
- data/docs/reference/quickbooks_online/resources/item/index.html +0 -484
- data/docs/reference/quickbooks_online/resources/journal_entry/index.html +0 -518
- data/docs/reference/quickbooks_online/resources/journal_entry_line_item/index.html +0 -504
- data/docs/reference/quickbooks_online/resources/ledger_class/index.html +0 -518
- data/docs/reference/quickbooks_online/resources/payment/index.html +0 -538
- data/docs/reference/quickbooks_online/resources/payment_line_item/index.html +0 -488
- data/docs/reference/quickbooks_online/resources/preferences/index.html +0 -526
- data/docs/reference/quickbooks_online/resources/primary_email_addr/index.html +0 -484
- data/docs/reference/quickbooks_online/resources/primary_phone/index.html +0 -484
- data/docs/reference/quickbooks_online/resources/resource/index.html +0 -480
- data/docs/reference/quickbooks_online/resources/subsidiary/index.html +0 -488
- data/docs/reference/quickbooks_online/resources/transfer/index.html +0 -522
- data/docs/reference/quickbooks_online/resources/vendor/index.html +0 -526
- data/docs/reference/quickbooks_online/webhooks/index.html +0 -427
- data/docs/reference/stripe/index.html +0 -293
- data/docs/reference/stripe/resources/customer/index.html +0 -366
- data/docs/reference/stripe/resources/index.html +0 -309
- data/docs/reference/stripe/resources/resource/index.html +0 -330
- data/docs/style-guide/index.html +0 -375
- data/documentation/site/Gemfile +0 -11
- data/documentation/site/Gemfile.lock +0 -69
data/docs/assets/css/monokai.css
DELETED
@@ -1,441 +0,0 @@
|
|
1
|
-
.highlight pre {
|
2
|
-
background-color: #272822;
|
3
|
-
color: #fff;
|
4
|
-
}
|
5
|
-
|
6
|
-
.highlight .hll {
|
7
|
-
background-color: #272822;
|
8
|
-
}
|
9
|
-
|
10
|
-
.highlight .c {
|
11
|
-
color: #75715e
|
12
|
-
}
|
13
|
-
|
14
|
-
|
15
|
-
/* Comment */
|
16
|
-
|
17
|
-
.highlight .err {
|
18
|
-
color: #960050;
|
19
|
-
background-color: #1e0010
|
20
|
-
}
|
21
|
-
|
22
|
-
|
23
|
-
/* Error */
|
24
|
-
|
25
|
-
.highlight .k {
|
26
|
-
color: #66d9ef
|
27
|
-
}
|
28
|
-
|
29
|
-
|
30
|
-
/* Keyword */
|
31
|
-
|
32
|
-
.highlight .l {
|
33
|
-
color: #ae81ff
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
/* Literal */
|
38
|
-
|
39
|
-
.highlight .n {
|
40
|
-
color: #f8f8f2
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
/* Name */
|
45
|
-
|
46
|
-
.highlight .o {
|
47
|
-
color: #f92672
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
/* Operator */
|
52
|
-
|
53
|
-
.highlight .p {
|
54
|
-
color: #f8f8f2
|
55
|
-
}
|
56
|
-
|
57
|
-
|
58
|
-
/* Punctuation */
|
59
|
-
|
60
|
-
.highlight .cm {
|
61
|
-
color: #75715e
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
/* Comment.Multiline */
|
66
|
-
|
67
|
-
.highlight .cp {
|
68
|
-
color: #75715e
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
/* Comment.Preproc */
|
73
|
-
|
74
|
-
.highlight .c1 {
|
75
|
-
color: #75715e
|
76
|
-
}
|
77
|
-
|
78
|
-
|
79
|
-
/* Comment.Single */
|
80
|
-
|
81
|
-
.highlight .cs {
|
82
|
-
color: #75715e
|
83
|
-
}
|
84
|
-
|
85
|
-
|
86
|
-
/* Comment.Special */
|
87
|
-
|
88
|
-
.highlight .ge {
|
89
|
-
font-style: italic
|
90
|
-
}
|
91
|
-
|
92
|
-
|
93
|
-
/* Generic.Emph */
|
94
|
-
|
95
|
-
.highlight .gs {
|
96
|
-
font-weight: bold
|
97
|
-
}
|
98
|
-
|
99
|
-
|
100
|
-
/* Generic.Strong */
|
101
|
-
|
102
|
-
.highlight .kc {
|
103
|
-
color: #66d9ef
|
104
|
-
}
|
105
|
-
|
106
|
-
|
107
|
-
/* Keyword.Constant */
|
108
|
-
|
109
|
-
.highlight .kd {
|
110
|
-
color: #66d9ef
|
111
|
-
}
|
112
|
-
|
113
|
-
|
114
|
-
/* Keyword.Declaration */
|
115
|
-
|
116
|
-
.highlight .kn {
|
117
|
-
color: #f92672
|
118
|
-
}
|
119
|
-
|
120
|
-
|
121
|
-
/* Keyword.Namespace */
|
122
|
-
|
123
|
-
.highlight .kp {
|
124
|
-
color: #66d9ef
|
125
|
-
}
|
126
|
-
|
127
|
-
|
128
|
-
/* Keyword.Pseudo */
|
129
|
-
|
130
|
-
.highlight .kr {
|
131
|
-
color: #66d9ef
|
132
|
-
}
|
133
|
-
|
134
|
-
|
135
|
-
/* Keyword.Reserved */
|
136
|
-
|
137
|
-
.highlight .kt {
|
138
|
-
color: #66d9ef
|
139
|
-
}
|
140
|
-
|
141
|
-
|
142
|
-
/* Keyword.Type */
|
143
|
-
|
144
|
-
.highlight .ld {
|
145
|
-
color: #e6db74
|
146
|
-
}
|
147
|
-
|
148
|
-
|
149
|
-
/* Literal.Date */
|
150
|
-
|
151
|
-
.highlight .m {
|
152
|
-
color: #ae81ff
|
153
|
-
}
|
154
|
-
|
155
|
-
|
156
|
-
/* Literal.Number */
|
157
|
-
|
158
|
-
.highlight .s {
|
159
|
-
color: #e6db74
|
160
|
-
}
|
161
|
-
|
162
|
-
|
163
|
-
/* Literal.String */
|
164
|
-
|
165
|
-
.highlight .na {
|
166
|
-
color: #a6e22e
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
/* Name.Attribute */
|
171
|
-
|
172
|
-
.highlight .nb {
|
173
|
-
color: #f8f8f2
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
|
-
/* Name.Builtin */
|
178
|
-
|
179
|
-
.highlight .nc {
|
180
|
-
color: #a6e22e
|
181
|
-
}
|
182
|
-
|
183
|
-
|
184
|
-
/* Name.Class */
|
185
|
-
|
186
|
-
.highlight .no {
|
187
|
-
color: #66d9ef
|
188
|
-
}
|
189
|
-
|
190
|
-
|
191
|
-
/* Name.Constant */
|
192
|
-
|
193
|
-
.highlight .nd {
|
194
|
-
color: #a6e22e
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
/* Name.Decorator */
|
199
|
-
|
200
|
-
.highlight .ni {
|
201
|
-
color: #f8f8f2
|
202
|
-
}
|
203
|
-
|
204
|
-
|
205
|
-
/* Name.Entity */
|
206
|
-
|
207
|
-
.highlight .ne {
|
208
|
-
color: #a6e22e
|
209
|
-
}
|
210
|
-
|
211
|
-
|
212
|
-
/* Name.Exception */
|
213
|
-
|
214
|
-
.highlight .nf {
|
215
|
-
color: #a6e22e
|
216
|
-
}
|
217
|
-
|
218
|
-
|
219
|
-
/* Name.Function */
|
220
|
-
|
221
|
-
.highlight .nl {
|
222
|
-
color: #f8f8f2
|
223
|
-
}
|
224
|
-
|
225
|
-
|
226
|
-
/* Name.Label */
|
227
|
-
|
228
|
-
.highlight .nn {
|
229
|
-
color: #f8f8f2
|
230
|
-
}
|
231
|
-
|
232
|
-
|
233
|
-
/* Name.Namespace */
|
234
|
-
|
235
|
-
.highlight .nx {
|
236
|
-
color: #a6e22e
|
237
|
-
}
|
238
|
-
|
239
|
-
|
240
|
-
/* Name.Other */
|
241
|
-
|
242
|
-
.highlight .py {
|
243
|
-
color: #f8f8f2
|
244
|
-
}
|
245
|
-
|
246
|
-
|
247
|
-
/* Name.Property */
|
248
|
-
|
249
|
-
.highlight .nt {
|
250
|
-
color: #f92672
|
251
|
-
}
|
252
|
-
|
253
|
-
|
254
|
-
/* Name.Tag */
|
255
|
-
|
256
|
-
.highlight .nv {
|
257
|
-
color: #f8f8f2
|
258
|
-
}
|
259
|
-
|
260
|
-
|
261
|
-
/* Name.Variable */
|
262
|
-
|
263
|
-
.highlight .ow {
|
264
|
-
color: #f92672
|
265
|
-
}
|
266
|
-
|
267
|
-
|
268
|
-
/* Operator.Word */
|
269
|
-
|
270
|
-
.highlight .w {
|
271
|
-
color: #f8f8f2
|
272
|
-
}
|
273
|
-
|
274
|
-
|
275
|
-
/* Text.Whitespace */
|
276
|
-
|
277
|
-
.highlight .mf {
|
278
|
-
color: #ae81ff
|
279
|
-
}
|
280
|
-
|
281
|
-
|
282
|
-
/* Literal.Number.Float */
|
283
|
-
|
284
|
-
.highlight .mh {
|
285
|
-
color: #ae81ff
|
286
|
-
}
|
287
|
-
|
288
|
-
|
289
|
-
/* Literal.Number.Hex */
|
290
|
-
|
291
|
-
.highlight .mi {
|
292
|
-
color: #ae81ff
|
293
|
-
}
|
294
|
-
|
295
|
-
|
296
|
-
/* Literal.Number.Integer */
|
297
|
-
|
298
|
-
.highlight .mo {
|
299
|
-
color: #ae81ff
|
300
|
-
}
|
301
|
-
|
302
|
-
|
303
|
-
/* Literal.Number.Oct */
|
304
|
-
|
305
|
-
.highlight .sb {
|
306
|
-
color: #e6db74
|
307
|
-
}
|
308
|
-
|
309
|
-
|
310
|
-
/* Literal.String.Backtick */
|
311
|
-
|
312
|
-
.highlight .sc {
|
313
|
-
color: #e6db74
|
314
|
-
}
|
315
|
-
|
316
|
-
|
317
|
-
/* Literal.String.Char */
|
318
|
-
|
319
|
-
.highlight .sd {
|
320
|
-
color: #e6db74
|
321
|
-
}
|
322
|
-
|
323
|
-
|
324
|
-
/* Literal.String.Doc */
|
325
|
-
|
326
|
-
.highlight .s2 {
|
327
|
-
color: #e6db74
|
328
|
-
}
|
329
|
-
|
330
|
-
|
331
|
-
/* Literal.String.Double */
|
332
|
-
|
333
|
-
.highlight .se {
|
334
|
-
color: #ae81ff
|
335
|
-
}
|
336
|
-
|
337
|
-
|
338
|
-
/* Literal.String.Escape */
|
339
|
-
|
340
|
-
.highlight .sh {
|
341
|
-
color: #e6db74
|
342
|
-
}
|
343
|
-
|
344
|
-
|
345
|
-
/* Literal.String.Heredoc */
|
346
|
-
|
347
|
-
.highlight .si {
|
348
|
-
color: #e6db74
|
349
|
-
}
|
350
|
-
|
351
|
-
|
352
|
-
/* Literal.String.Interpol */
|
353
|
-
|
354
|
-
.highlight .sx {
|
355
|
-
color: #e6db74
|
356
|
-
}
|
357
|
-
|
358
|
-
|
359
|
-
/* Literal.String.Other */
|
360
|
-
|
361
|
-
.highlight .sr {
|
362
|
-
color: #e6db74
|
363
|
-
}
|
364
|
-
|
365
|
-
|
366
|
-
/* Literal.String.Regex */
|
367
|
-
|
368
|
-
.highlight .s1 {
|
369
|
-
color: #e6db74
|
370
|
-
}
|
371
|
-
|
372
|
-
|
373
|
-
/* Literal.String.Single */
|
374
|
-
|
375
|
-
.highlight .ss {
|
376
|
-
color: #e6db74
|
377
|
-
}
|
378
|
-
|
379
|
-
|
380
|
-
/* Literal.String.Symbol */
|
381
|
-
|
382
|
-
.highlight .bp {
|
383
|
-
color: #f8f8f2
|
384
|
-
}
|
385
|
-
|
386
|
-
|
387
|
-
/* Name.Builtin.Pseudo */
|
388
|
-
|
389
|
-
.highlight .vc {
|
390
|
-
color: #f8f8f2
|
391
|
-
}
|
392
|
-
|
393
|
-
|
394
|
-
/* Name.Variable.Class */
|
395
|
-
|
396
|
-
.highlight .vg {
|
397
|
-
color: #f8f8f2
|
398
|
-
}
|
399
|
-
|
400
|
-
|
401
|
-
/* Name.Variable.Global */
|
402
|
-
|
403
|
-
.highlight .vi {
|
404
|
-
color: #f8f8f2
|
405
|
-
}
|
406
|
-
|
407
|
-
|
408
|
-
/* Name.Variable.Instance */
|
409
|
-
|
410
|
-
.highlight .il {
|
411
|
-
color: #ae81ff
|
412
|
-
}
|
413
|
-
|
414
|
-
|
415
|
-
/* Literal.Number.Integer.Long */
|
416
|
-
|
417
|
-
.highlight .gh {}
|
418
|
-
|
419
|
-
|
420
|
-
/* Generic Heading & Diff Header */
|
421
|
-
|
422
|
-
.highlight .gu {
|
423
|
-
color: #75715e;
|
424
|
-
}
|
425
|
-
|
426
|
-
|
427
|
-
/* Generic.Subheading & Diff Unified/Comment? */
|
428
|
-
|
429
|
-
.highlight .gd {
|
430
|
-
color: #f92672;
|
431
|
-
}
|
432
|
-
|
433
|
-
|
434
|
-
/* Generic.Deleted & Diff Deleted */
|
435
|
-
|
436
|
-
.highlight .gi {
|
437
|
-
color: #a6e22e;
|
438
|
-
}
|
439
|
-
|
440
|
-
|
441
|
-
/* Generic.Inserted & Diff Inserted */
|
data/docs/assets/js/main.js
DELETED
@@ -1,214 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Main JS file for theme behaviours
|
3
|
-
*/
|
4
|
-
// Responsive video embeds
|
5
|
-
let videoEmbeds = [
|
6
|
-
'iframe[src*="youtube.com"]',
|
7
|
-
'iframe[src*="vimeo.com"]'
|
8
|
-
];
|
9
|
-
reframe(videoEmbeds.join(','));
|
10
|
-
|
11
|
-
// Remove nav related classes on page load
|
12
|
-
document.body.classList.remove('menu--opened', 'toc--opened');
|
13
|
-
|
14
|
-
// Menu on small screens
|
15
|
-
let menuToggle = document.querySelectorAll('.menu-toggle');
|
16
|
-
if (menuToggle) {
|
17
|
-
for (let i = 0; i < menuToggle.length; i++) {
|
18
|
-
menuToggle[i].addEventListener('click', function (e) {
|
19
|
-
document.body.classList.toggle('menu--opened');
|
20
|
-
e.preventDefault();
|
21
|
-
}, false);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
// Dropdown arrow
|
26
|
-
let mainMenu = document.getElementById('main-navigation');
|
27
|
-
let submenu = mainMenu.querySelectorAll('.submenu');
|
28
|
-
if (submenu) {
|
29
|
-
for (let i = 0; i < submenu.length; i++) {
|
30
|
-
let submenuBtn = document.createElement('button');
|
31
|
-
submenuBtn.setAttribute('class','submenu-toggle');
|
32
|
-
submenuBtn.innerHTML = '<span class="icon-angle-right" aria-hidden="true"></span><span class="screen-reader-text">Sub-menu</span>';
|
33
|
-
submenu[i].parentNode.insertBefore(submenuBtn, submenu[i]);
|
34
|
-
submenuBtn.addEventListener ('click', function() {
|
35
|
-
this.classList.toggle('active');
|
36
|
-
this.nextSibling.classList.toggle('active');
|
37
|
-
});
|
38
|
-
}
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
let guidesNav = document.getElementById('guides-nav');
|
44
|
-
if (guidesNav) {
|
45
|
-
// Docs nav on small screens
|
46
|
-
let guidesNavToggle = document.getElementById('guides-nav-toggle');
|
47
|
-
guidesNavToggle.addEventListener('click', function (e) {
|
48
|
-
document.body.classList.toggle('toc--opened');
|
49
|
-
e.preventDefault();
|
50
|
-
}, false);
|
51
|
-
|
52
|
-
// Submenu toggle
|
53
|
-
let submenuToggle = guidesNav.querySelectorAll('.submenu-toggle');
|
54
|
-
for (let i = 0; i < submenuToggle.length; i++) {
|
55
|
-
submenuToggle[i].addEventListener('click', function (e) {
|
56
|
-
submenuToggle[i].parentNode.classList.toggle('active');
|
57
|
-
}, false);
|
58
|
-
}
|
59
|
-
}
|
60
|
-
|
61
|
-
let pageNav = document.getElementById('page-nav');
|
62
|
-
if (pageNav) {
|
63
|
-
|
64
|
-
let pageToc = document.getElementById('page-nav-inside');
|
65
|
-
let pageContent = document.querySelector('.type-guides .post-content');
|
66
|
-
|
67
|
-
// Create in-page navigation
|
68
|
-
let headerLinks = getHeaderLinks({
|
69
|
-
root: pageContent
|
70
|
-
});
|
71
|
-
renderHeaderLinks(pageToc, headerLinks);
|
72
|
-
|
73
|
-
// Scroll to anchors
|
74
|
-
let scroll = new SmoothScroll('[data-scroll]');
|
75
|
-
let hash = window.decodeURI(location.hash.replace('#', ''));
|
76
|
-
if (hash !== '') {
|
77
|
-
window.setTimeout( function(){
|
78
|
-
let anchor = document.getElementById(hash);
|
79
|
-
if (anchor) {
|
80
|
-
scroll.animateScroll(anchor);
|
81
|
-
}
|
82
|
-
}, 0);
|
83
|
-
}
|
84
|
-
|
85
|
-
// Highlight current anchor
|
86
|
-
let pageTocLinks = pageToc.getElementsByTagName('a');
|
87
|
-
if (pageTocLinks.length > 0) {
|
88
|
-
let spy = new Gumshoe('#page-nav-inside a', {
|
89
|
-
nested: true,
|
90
|
-
nestedClass: 'active-parent'
|
91
|
-
});
|
92
|
-
}
|
93
|
-
|
94
|
-
// Add link to page content headings
|
95
|
-
let pageHeadings = getElementsByTagNames(pageContent, ["h2", "h3"]);
|
96
|
-
for (let i = 0; i < pageHeadings.length; i++) {
|
97
|
-
let heading = pageHeadings[i];
|
98
|
-
if (typeof heading.id !== "undefined" && heading.id !== "") {
|
99
|
-
heading.insertBefore(anchorForId(heading.id), heading.firstChild);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
|
103
|
-
// Copy link url
|
104
|
-
let clipboard = new ClipboardJS('.hash-link', {
|
105
|
-
text: function(trigger) {
|
106
|
-
return window.location.href.replace(window.location.hash,"") + trigger.getAttribute('href');
|
107
|
-
}
|
108
|
-
});
|
109
|
-
}
|
110
|
-
|
111
|
-
function getElementsByTagNames(root, tagNames) {
|
112
|
-
let elements = [];
|
113
|
-
for (let i = 0; i < root.children.length; i++) {
|
114
|
-
let element = root.children[i];
|
115
|
-
let tagName = element.nodeName.toLowerCase();
|
116
|
-
if (tagNames.includes(tagName)) {
|
117
|
-
elements.push(element);
|
118
|
-
}
|
119
|
-
elements = elements.concat(getElementsByTagNames(element, tagNames));
|
120
|
-
}
|
121
|
-
return elements;
|
122
|
-
}
|
123
|
-
|
124
|
-
function createLinksForHeaderElements(elements) {
|
125
|
-
let result = [];
|
126
|
-
let stack = [
|
127
|
-
{
|
128
|
-
level: 0,
|
129
|
-
children: result
|
130
|
-
}
|
131
|
-
];
|
132
|
-
let re = /^h(\d)$/;
|
133
|
-
for (let i = 0; i < elements.length; i++) {
|
134
|
-
let element = elements[i];
|
135
|
-
let tagName = element.nodeName.toLowerCase();
|
136
|
-
let match = re.exec(tagName);
|
137
|
-
if (!match) {
|
138
|
-
console.warn("can not create links to non header element");
|
139
|
-
continue;
|
140
|
-
}
|
141
|
-
let headerLevel = parseInt(match[1], 10);
|
142
|
-
if (!element.id) {
|
143
|
-
if (!element.textContent) {
|
144
|
-
console.warn(
|
145
|
-
"can not create link to element without id and without text content"
|
146
|
-
);
|
147
|
-
continue;
|
148
|
-
}
|
149
|
-
element.id = element.textContent
|
150
|
-
.toLowerCase()
|
151
|
-
.replace(/[^\w]+/g, "_")
|
152
|
-
.replace(/^_/, "")
|
153
|
-
.replace(/_$/, "");
|
154
|
-
}
|
155
|
-
let link = document.createElement("a");
|
156
|
-
link.href = "#" + element.id;
|
157
|
-
link.setAttribute('data-scroll', '');
|
158
|
-
link.appendChild(document.createTextNode(element.textContent));
|
159
|
-
let obj = {
|
160
|
-
id: element.id,
|
161
|
-
level: headerLevel,
|
162
|
-
textContent: element.textContent,
|
163
|
-
element: element,
|
164
|
-
link: link,
|
165
|
-
children: []
|
166
|
-
};
|
167
|
-
if (headerLevel > stack[stack.length - 1].level) {
|
168
|
-
stack[stack.length - 1].children.push(obj);
|
169
|
-
stack.push(obj);
|
170
|
-
} else {
|
171
|
-
while (headerLevel <= stack[stack.length - 1].level && stack.length > 1) {
|
172
|
-
stack.pop();
|
173
|
-
}
|
174
|
-
stack[stack.length - 1].children.push(obj);
|
175
|
-
stack.push(obj);
|
176
|
-
}
|
177
|
-
}
|
178
|
-
return result;
|
179
|
-
}
|
180
|
-
|
181
|
-
function getHeaderLinks(options = {}) {
|
182
|
-
let tagNames = options.tagNames || ["h2", "h3"];
|
183
|
-
let root = options.root || document.body;
|
184
|
-
let headerElements = getElementsByTagNames(root, tagNames);
|
185
|
-
return createLinksForHeaderElements(headerElements);
|
186
|
-
}
|
187
|
-
|
188
|
-
function renderHeaderLinks(element, links) {
|
189
|
-
if (links.length === 0) {
|
190
|
-
return;
|
191
|
-
}
|
192
|
-
let ulElm = document.createElement("ul");
|
193
|
-
for (let i = 0; i < links.length; i++) {
|
194
|
-
let liElm = document.createElement("li");
|
195
|
-
liElm.append(links[i].link);
|
196
|
-
if (links[i].children.length > 0) {
|
197
|
-
renderHeaderLinks(liElm, links[i].children);
|
198
|
-
}
|
199
|
-
ulElm.appendChild(liElm);
|
200
|
-
}
|
201
|
-
element.appendChild(ulElm);
|
202
|
-
}
|
203
|
-
|
204
|
-
function anchorForId(id) {
|
205
|
-
let anchor = document.createElement("a");
|
206
|
-
anchor.setAttribute("class", "hash-link");
|
207
|
-
anchor.setAttribute("data-scroll", "");
|
208
|
-
anchor.href = "#" + id;
|
209
|
-
anchor.innerHTML = '<span class="icon-copy" aria-hidden="true"></span><span class="screen-reader-text">Copy</span>';
|
210
|
-
return anchor;
|
211
|
-
}
|
212
|
-
|
213
|
-
// Syntax Highlighter
|
214
|
-
Prism.highlightAll();
|