@internetarchive/ia-topnav 1.4.0 → 1.4.1-alpha-webdev8259.0

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 (53) hide show
  1. package/.prettierignore +1 -1
  2. package/LICENSE +661 -661
  3. package/README.md +147 -147
  4. package/demo/index.html +28 -28
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/src/data/menus.js.map +1 -1
  8. package/dist/src/dropdown-menu.js +26 -26
  9. package/dist/src/dropdown-menu.js.map +1 -1
  10. package/dist/src/ia-topnav.d.ts +4 -1
  11. package/dist/src/ia-topnav.js +96 -81
  12. package/dist/src/ia-topnav.js.map +1 -1
  13. package/dist/src/lib/keyboard-navigation.js.map +1 -1
  14. package/dist/src/login-button.js +17 -17
  15. package/dist/src/login-button.js.map +1 -1
  16. package/dist/src/media-menu.js +21 -21
  17. package/dist/src/media-menu.js.map +1 -1
  18. package/dist/src/models.d.ts +1 -0
  19. package/dist/src/models.js.map +1 -1
  20. package/dist/src/primary-nav.d.ts +3 -1
  21. package/dist/src/primary-nav.js +118 -95
  22. package/dist/src/primary-nav.js.map +1 -1
  23. package/dist/src/styles/login-button.js +87 -87
  24. package/dist/src/styles/login-button.js.map +1 -1
  25. package/dist/src/styles/primary-nav.js +343 -308
  26. package/dist/src/styles/primary-nav.js.map +1 -1
  27. package/dist/src/user-menu.js +13 -13
  28. package/dist/src/user-menu.js.map +1 -1
  29. package/dist/test/ia-topnav.test.js +39 -9
  30. package/dist/test/ia-topnav.test.js.map +1 -1
  31. package/dist/test/primary-nav.test.js +55 -7
  32. package/dist/test/primary-nav.test.js.map +1 -1
  33. package/eslint.config.mjs +53 -53
  34. package/index.ts +4 -3
  35. package/package.json +72 -72
  36. package/prettier.config.js +9 -9
  37. package/src/data/menus.ts +652 -652
  38. package/src/dropdown-menu.ts +132 -132
  39. package/src/ia-topnav.ts +383 -366
  40. package/src/lib/keyboard-navigation.ts +166 -166
  41. package/src/login-button.ts +78 -78
  42. package/src/media-menu.ts +143 -143
  43. package/src/models.ts +65 -63
  44. package/src/primary-nav.ts +324 -296
  45. package/src/styles/login-button.ts +90 -90
  46. package/src/styles/primary-nav.ts +346 -311
  47. package/src/user-menu.ts +32 -32
  48. package/ssl/server.key +28 -28
  49. package/test/ia-topnav.test.ts +381 -343
  50. package/test/primary-nav.test.ts +163 -94
  51. package/tsconfig.json +31 -31
  52. package/web-dev-server.config.mjs +32 -32
  53. package/web-test-runner.config.mjs +41 -41
package/src/data/menus.ts CHANGED
@@ -1,652 +1,652 @@
1
- // @see https://git.archive.org/www/offshoot/-/blob/main/guides/update-top-nav.md
2
-
3
- import { IATopNavConfig, IATopNavMenuConfig } from '../models';
4
-
5
- export const defaultTopNavConfig: IATopNavConfig = {
6
- // Google Analytics event category
7
- eventCategory: 'TopNav',
8
- // Array of strings representing the values of options that should be hidden from search options
9
- hiddenSearchOptions: [],
10
- // Default value, if more accurate value is not passed in to `buildTopNavMenus()`
11
- waybackPagesArchived: '1 trillion',
12
- };
13
-
14
- /**
15
- * Creates archive.org top navigation configuration
16
- * @param { string } userid archive.org account (immutable) userid
17
- * @param { boolean } localLinks passing in false will ensure all links begin: https://archive.org
18
- * @param { string } waybackPagesArchived label readable 'how many pages in WayBack machine?'
19
- * If you don't pass in something, you'll get the potentially
20
- * older/less accurate version.
21
- * @param { string } itemIdentifier The current item being viewed, to populate admin menu items
22
- * @returns { object }
23
- */
24
- export function buildTopNavMenus(
25
- userid: string = '___USERID___',
26
- baseHost: string = 'https://archive.org',
27
- waybackPagesArchived: string = '',
28
- itemIdentifier: string = '',
29
- ): IATopNavMenuConfig {
30
- if (waybackPagesArchived)
31
- defaultTopNavConfig.waybackPagesArchived = waybackPagesArchived; // update to more accurate val
32
-
33
- return {
34
- audio: {
35
- heading: 'Internet Archive Audio',
36
- iconLinks: [
37
- {
38
- icon: `${baseHost}/services/img/etree`,
39
- title: 'Live Music Archive',
40
- url: `${baseHost}/details/etree`,
41
- },
42
- {
43
- icon: `${baseHost}/services/img/librivoxaudio`,
44
- title: 'Librivox Free Audio',
45
- url: `${baseHost}/details/librivoxaudio`,
46
- },
47
- ],
48
- featuredLinks: [
49
- {
50
- title: 'All Audio',
51
- url: `${baseHost}/details/audio`,
52
- },
53
- {
54
- title: 'Grateful Dead',
55
- url: `${baseHost}/details/GratefulDead`,
56
- },
57
- {
58
- title: 'Netlabels',
59
- url: `${baseHost}/details/netlabels`,
60
- },
61
- {
62
- title: 'Old Time Radio',
63
- url: `${baseHost}/details/oldtimeradio`,
64
- },
65
- {
66
- title: '78 RPMs and Cylinder Recordings',
67
- url: `${baseHost}/details/78rpm`,
68
- },
69
- ],
70
- links: [
71
- {
72
- title: 'Audio Books & Poetry',
73
- url: `${baseHost}/details/audio_bookspoetry`,
74
- },
75
- {
76
- title: 'Computers, Technology and Science',
77
- url: `${baseHost}/details/audio_tech`,
78
- },
79
- {
80
- title: 'Music, Arts & Culture',
81
- url: `${baseHost}/details/audio_music`,
82
- },
83
- {
84
- title: 'News & Public Affairs',
85
- url: `${baseHost}/details/audio_news`,
86
- },
87
- {
88
- title: 'Spirituality & Religion',
89
- url: `${baseHost}/details/audio_religion`,
90
- },
91
- {
92
- title: 'Podcasts',
93
- url: `${baseHost}/details/podcasts`,
94
- },
95
- {
96
- title: 'Radio News Archive',
97
- url: `${baseHost}/details/radio`,
98
- },
99
- ],
100
- mobileAppsLinks: [],
101
- browserExtensionsLinks: [],
102
- archiveItLinks: [],
103
- },
104
- images: {
105
- heading: 'Images',
106
- iconLinks: [
107
- {
108
- icon: `${baseHost}/services/img/metropolitanmuseumofart-gallery`,
109
- title: 'Metropolitan Museum',
110
- url: `${baseHost}/details/metropolitanmuseumofart-gallery`,
111
- },
112
- {
113
- icon: `${baseHost}/services/img/clevelandart`,
114
- title: 'Cleveland Museum of Art',
115
- url: `${baseHost}/details/clevelandart`,
116
- },
117
- ],
118
- featuredLinks: [
119
- {
120
- title: 'All Images',
121
- url: `${baseHost}/details/image`,
122
- },
123
- {
124
- title: 'Flickr Commons',
125
- url: `${baseHost}/details/flickrcommons`,
126
- },
127
- {
128
- title: 'Occupy Wall Street Flickr',
129
- url: `${baseHost}/details/flickr-ows`,
130
- },
131
- {
132
- title: 'Cover Art',
133
- url: `${baseHost}/details/coverartarchive`,
134
- },
135
- {
136
- title: 'USGS Maps',
137
- url: `${baseHost}/details/maps_usgs`,
138
- },
139
- ],
140
- links: [
141
- {
142
- title: 'NASA Images',
143
- url: `${baseHost}/details/nasa`,
144
- },
145
- {
146
- title: 'Solar System Collection',
147
- url: `${baseHost}/details/solarsystemcollection`,
148
- },
149
- {
150
- title: 'Ames Research Center',
151
- url: `${baseHost}/details/amesresearchcenterimagelibrary`,
152
- },
153
- ],
154
- mobileAppsLinks: [],
155
- browserExtensionsLinks: [],
156
- archiveItLinks: [],
157
- },
158
- more: {
159
- links: [
160
- {
161
- title: 'About',
162
- url: `${baseHost}/about/`,
163
- },
164
- {
165
- title: 'Blog',
166
- url: 'https://blog.archive.org',
167
- },
168
- {
169
- title: 'Events',
170
- url: `${baseHost}/events`,
171
- },
172
- {
173
- title: 'Projects',
174
- url: `${baseHost}/projects/`,
175
- },
176
- {
177
- title: 'Help',
178
- url: `${baseHost}/about/faqs.php`,
179
- },
180
- {
181
- title: 'Donate',
182
- url: `${baseHost}/donate?origin=iawww-TopNavDonateButton`,
183
- },
184
- {
185
- title: 'Contact',
186
- url: `${baseHost}/about/contact`,
187
- },
188
- {
189
- title: 'Jobs',
190
- url: `${baseHost}/about/jobs`,
191
- },
192
- {
193
- title: 'Volunteer',
194
- url: `${baseHost}/about/volunteer-positions`,
195
- },
196
- ],
197
- heading: '',
198
- iconLinks: [],
199
- featuredLinks: [],
200
- mobileAppsLinks: [],
201
- browserExtensionsLinks: [],
202
- archiveItLinks: [],
203
- },
204
- software: {
205
- heading: 'Software',
206
- iconLinks: [
207
- {
208
- icon: `${baseHost}/services/img/internetarcade`,
209
- title: 'Internet Arcade',
210
- url: `${baseHost}/details/internetarcade`,
211
- },
212
- {
213
- icon: `${baseHost}/services/img/consolelivingroom`,
214
- title: 'Console Living Room',
215
- url: `${baseHost}/details/consolelivingroom`,
216
- },
217
- ],
218
- featuredLinks: [
219
- {
220
- title: 'All Software',
221
- url: `${baseHost}/details/software`,
222
- },
223
- {
224
- title: 'Old School Emulation',
225
- url: `${baseHost}/details/tosec`,
226
- },
227
- {
228
- title: 'MS-DOS Games',
229
- url: `${baseHost}/details/softwarelibrary_msdos_games`,
230
- },
231
- {
232
- title: 'Historical Software',
233
- url: `${baseHost}/details/historicalsoftware`,
234
- },
235
- {
236
- title: 'Classic PC Games',
237
- url: `${baseHost}/details/classicpcgames`,
238
- },
239
- {
240
- title: 'Software Library',
241
- url: `${baseHost}/details/softwarelibrary`,
242
- },
243
- ],
244
- links: [
245
- {
246
- title: 'Kodi Archive and Support File',
247
- url: `${baseHost}/details/kodi_archive`,
248
- },
249
- {
250
- title: 'Vintage Software',
251
- url: `${baseHost}/details/vintagesoftware`,
252
- },
253
- {
254
- title: 'APK',
255
- url: `${baseHost}/details/apkarchive`,
256
- },
257
- {
258
- title: 'MS-DOS',
259
- url: `${baseHost}/details/softwarelibrary_msdos`,
260
- },
261
- {
262
- title: 'CD-ROM Software',
263
- url: `${baseHost}/details/cd-roms`,
264
- },
265
- {
266
- title: 'CD-ROM Software Library',
267
- url: `${baseHost}/details/cdromsoftware`,
268
- },
269
- {
270
- title: 'Software Sites',
271
- url: `${baseHost}/details/softwaresites`,
272
- },
273
- {
274
- title: 'Tucows Software Library',
275
- url: `${baseHost}/details/tucows`,
276
- },
277
- {
278
- title: 'Shareware CD-ROMs',
279
- url: `${baseHost}/details/cdbbsarchive`,
280
- },
281
- {
282
- title: 'Software Capsules Compilation',
283
- url: `${baseHost}/details/softwarecapsules`,
284
- },
285
- {
286
- title: 'CD-ROM Images',
287
- url: `${baseHost}/details/cdromimages`,
288
- },
289
- {
290
- title: 'ZX Spectrum',
291
- url: `${baseHost}/details/softwarelibrary_zx_spectrum`,
292
- },
293
- {
294
- title: 'DOOM Level CD',
295
- url: `${baseHost}/details/doom-cds`,
296
- },
297
- ],
298
- mobileAppsLinks: [],
299
- browserExtensionsLinks: [],
300
- archiveItLinks: [],
301
- },
302
- texts: {
303
- heading: 'Texts',
304
- iconLinks: [
305
- {
306
- title: 'Open Library',
307
- icon: `${baseHost}/images/widgetOL.png`,
308
- url: 'https://openlibrary.org/',
309
- },
310
- {
311
- title: 'American Libraries',
312
- icon: `${baseHost}/services/img/americana`,
313
- url: `${baseHost}/details/americana`,
314
- },
315
- ],
316
- featuredLinks: [
317
- {
318
- title: 'All Texts',
319
- url: `${baseHost}/details/texts`,
320
- },
321
- {
322
- title: 'Smithsonian Libraries',
323
- url: `${baseHost}/details/smithsonian`,
324
- },
325
- {
326
- title: 'FEDLINK (US)',
327
- url: `${baseHost}/details/fedlink`,
328
- },
329
- {
330
- title: 'Genealogy',
331
- url: `${baseHost}/details/genealogy`,
332
- },
333
- {
334
- title: 'Lincoln Collection',
335
- url: `${baseHost}/details/lincolncollection`,
336
- },
337
- ],
338
- links: [
339
- {
340
- title: 'American Libraries',
341
- url: `${baseHost}/details/americana`,
342
- },
343
- {
344
- title: 'Canadian Libraries',
345
- url: `${baseHost}/details/toronto`,
346
- },
347
- {
348
- title: 'Universal Library',
349
- url: `${baseHost}/details/universallibrary`,
350
- },
351
- {
352
- title: 'Project Gutenberg',
353
- url: `${baseHost}/details/gutenberg`,
354
- },
355
- {
356
- title: "Children's Library",
357
- url: `${baseHost}/details/iacl`,
358
- },
359
- {
360
- title: 'Biodiversity Heritage Library',
361
- url: `${baseHost}/details/biodiversity`,
362
- },
363
- {
364
- title: 'Books by Language',
365
- url: `${baseHost}/details/booksbylanguage`,
366
- },
367
- {
368
- title: 'Folkscanomy',
369
- url: `${baseHost}/details/folkscanomy`,
370
- },
371
- {
372
- title: 'Government Documents',
373
- url: `${baseHost}/details/government-documents`,
374
- },
375
- ],
376
- mobileAppsLinks: [],
377
- browserExtensionsLinks: [],
378
- archiveItLinks: [],
379
- },
380
- web: {
381
- mobileAppsLinks: [
382
- {
383
- url: 'https://apps.apple.com/us/app/wayback-machine/id1201888313',
384
- title: 'Wayback Machine (iOS)',
385
- external: true,
386
- },
387
- {
388
- url: 'https://play.google.com/store/apps/details?id=com.internetarchive.waybackmachine',
389
- title: 'Wayback Machine (Android)',
390
- external: true,
391
- },
392
- ],
393
- browserExtensionsLinks: [
394
- {
395
- url: 'https://chrome.google.com/webstore/detail/wayback-machine/fpnmgdkabkmnadcjpehmlllkndpkmiak',
396
- title: 'Chrome',
397
- external: true,
398
- },
399
- {
400
- url: 'https://addons.mozilla.org/en-US/firefox/addon/wayback-machine_new/',
401
- title: 'Firefox',
402
- external: true,
403
- },
404
- {
405
- url: 'https://apps.apple.com/us/app/wayback-machine/id1472432422?mt=12',
406
- title: 'Safari',
407
- external: true,
408
- },
409
- {
410
- url: 'https://microsoftedge.microsoft.com/addons/detail/wayback-machine/kjmickeoogghaimmomagaghnogelpcpn?hl=en-US',
411
- title: 'Edge',
412
- external: true,
413
- },
414
- ],
415
- archiveItLinks: [
416
- {
417
- url: 'https://www.archive-it.org/explore',
418
- title: 'Explore the Collections',
419
- external: true,
420
- },
421
- {
422
- url: 'https://www.archive-it.org/blog/learn-more/',
423
- title: 'Learn More',
424
- external: true,
425
- },
426
- {
427
- url: 'https://www.archive-it.org/contact-us',
428
- title: 'Build Collections',
429
- external: true,
430
- },
431
- ],
432
- heading: '',
433
- iconLinks: [],
434
- featuredLinks: [],
435
- links: [],
436
- },
437
- video: {
438
- heading: 'Video',
439
- iconLinks: [
440
- {
441
- icon: `${baseHost}/services/img/tv`,
442
- title: 'TV News',
443
- url: `${baseHost}/details/tv`,
444
- },
445
- {
446
- icon: `${baseHost}/services/img/911`,
447
- title: 'Understanding 9/11',
448
- url: `${baseHost}/details/911`,
449
- },
450
- ],
451
- featuredLinks: [
452
- {
453
- title: 'All Video',
454
- url: `${baseHost}/details/movies`,
455
- },
456
- {
457
- title: 'Prelinger Archives',
458
- url: `${baseHost}/details/prelinger`,
459
- },
460
- {
461
- title: 'Democracy Now!',
462
- url: `${baseHost}/details/democracy_now_vid`,
463
- },
464
- {
465
- title: 'Occupy Wall Street',
466
- url: `${baseHost}/details/occupywallstreet`,
467
- },
468
- {
469
- title: 'TV NSA Clip Library',
470
- url: `${baseHost}/details/nsa`,
471
- },
472
- ],
473
- links: [
474
- {
475
- title: 'Animation & Cartoons',
476
- url: `${baseHost}/details/animationandcartoons`,
477
- },
478
- {
479
- title: 'Arts & Music',
480
- url: `${baseHost}/details/artsandmusicvideos`,
481
- },
482
- {
483
- title: 'Computers & Technology',
484
- url: `${baseHost}/details/computersandtechvideos`,
485
- },
486
- {
487
- title: 'Cultural & Academic Films',
488
- url: `${baseHost}/details/culturalandacademicfilms`,
489
- },
490
- {
491
- title: 'Ephemeral Films',
492
- url: `${baseHost}/details/ephemera`,
493
- },
494
- {
495
- title: 'Movies',
496
- url: `${baseHost}/details/moviesandfilms`,
497
- },
498
- {
499
- title: 'News & Public Affairs',
500
- url: `${baseHost}/details/newsandpublicaffairs`,
501
- },
502
- {
503
- title: 'Spirituality & Religion',
504
- url: `${baseHost}/details/spiritualityandreligion`,
505
- },
506
- {
507
- title: 'Sports Videos',
508
- url: `${baseHost}/details/sports`,
509
- },
510
- {
511
- title: 'Television',
512
- url: `${baseHost}/details/television`,
513
- },
514
- {
515
- title: 'Videogame Videos',
516
- url: `${baseHost}/details/gamevideos`,
517
- },
518
- {
519
- title: 'Vlogs',
520
- url: `${baseHost}/details/vlogs`,
521
- },
522
- {
523
- title: 'Youth Media',
524
- url: `${baseHost}/details/youth_media`,
525
- },
526
- ],
527
- mobileAppsLinks: [],
528
- browserExtensionsLinks: [],
529
- archiveItLinks: [],
530
- },
531
- user: [
532
- {
533
- url: `${baseHost}/upload`,
534
- title: 'Upload files',
535
- analyticsEvent: 'UserUpload',
536
- class: 'mobile-upload',
537
- },
538
- {
539
- url: `${baseHost}/details/@${userid}`,
540
- title: 'My uploads',
541
- analyticsEvent: 'UserLibrary',
542
- },
543
- {
544
- url: `${baseHost}/details/@${userid}/loans`,
545
- title: 'My loans',
546
- analyticsEvent: 'UserLoans',
547
- },
548
- {
549
- url: `${baseHost}/details/fav-${userid}`,
550
- title: 'My favorites',
551
- analyticsEvent: 'UserFavorites',
552
- },
553
- {
554
- url: `${baseHost}/details/@${userid}/lists`,
555
- title: 'My lists',
556
- analyticsEvent: 'UserLists',
557
- },
558
- {
559
- url: `${baseHost}/details/@${userid}/collections`,
560
- title: 'My collections',
561
- analyticsEvent: 'UserCollections',
562
- },
563
- {
564
- url: `${baseHost}/details/@${userid}/web-archive`,
565
- title: 'My web archives',
566
- analyticsEvent: 'UserWebArchive',
567
- },
568
- {
569
- url: `${baseHost}/account/settings`,
570
- title: 'Account settings',
571
- analyticsEvent: 'UserSettings',
572
- },
573
- {
574
- url: 'https://help.archive.org',
575
- title: 'Get help',
576
- analyticsEvent: 'UserHelp',
577
- },
578
- {
579
- url: `${baseHost}/account/logout`,
580
- title: 'Log out',
581
- analyticsEvent: 'UserLogOut',
582
- },
583
- ],
584
- userAdmin: [
585
- {
586
- title: 'ADMINS:',
587
- },
588
- {
589
- title: 'item:',
590
- },
591
- {
592
- url: `${baseHost}/editxml/${itemIdentifier}`,
593
- title: 'edit xml',
594
- analyticsEvent: 'AdminUserEditXML',
595
- },
596
- {
597
- url: `${baseHost}/edit.php?redir=1&identifier=${itemIdentifier}`,
598
- title: 'edit files',
599
- analyticsEvent: 'AdminUserEditFiles',
600
- },
601
- {
602
- url: `${baseHost}/download/${itemIdentifier}/`,
603
- title: 'download',
604
- analyticsEvent: 'AdminUserDownload',
605
- },
606
- {
607
- url: `${baseHost}/metadata/${itemIdentifier}/`,
608
- title: 'metadata',
609
- analyticsEvent: 'AdminUserMetadata',
610
- },
611
- {
612
- url: `https://catalogd.archive.org/history/${itemIdentifier}`,
613
- title: 'history',
614
- analyticsEvent: 'AdminUserHistory',
615
- },
616
- {
617
- url: `${baseHost}/manage/${itemIdentifier}`,
618
- title: 'manage',
619
- analyticsEvent: 'AdminUserManager',
620
- },
621
- {
622
- url: `${baseHost}/manage/${itemIdentifier}#make_dark`,
623
- title: 'curate',
624
- analyticsEvent: 'AdminUserCurate',
625
- },
626
- {
627
- url: `${baseHost}/manage/${itemIdentifier}#modify_xml`,
628
- title: 'modify xml',
629
- analyticsEvent: 'AdminUserModifyXML',
630
- },
631
- ],
632
- userAdminFlags: [
633
- {
634
- url: `${baseHost}/services/flags/admin.php?identifier=${itemIdentifier}`,
635
- title: 'manage flags',
636
- analyticsEvent: 'AdminUserManageFlags',
637
- },
638
- ],
639
- signedOut: [
640
- {
641
- url: `${baseHost}/account/signup`,
642
- title: 'Sign up for free',
643
- analyticsEvent: 'AvatarMenu-Signup',
644
- },
645
- {
646
- url: `${baseHost}/login`,
647
- title: 'Log in',
648
- analyticsEvent: 'AvatarMenu-Login',
649
- },
650
- ],
651
- };
652
- }
1
+ // @see https://git.archive.org/www/offshoot/-/blob/main/guides/update-top-nav.md
2
+
3
+ import { IATopNavConfig, IATopNavMenuConfig } from '../models';
4
+
5
+ export const defaultTopNavConfig: IATopNavConfig = {
6
+ // Google Analytics event category
7
+ eventCategory: 'TopNav',
8
+ // Array of strings representing the values of options that should be hidden from search options
9
+ hiddenSearchOptions: [],
10
+ // Default value, if more accurate value is not passed in to `buildTopNavMenus()`
11
+ waybackPagesArchived: '1 trillion',
12
+ };
13
+
14
+ /**
15
+ * Creates archive.org top navigation configuration
16
+ * @param { string } userid archive.org account (immutable) userid
17
+ * @param { boolean } localLinks passing in false will ensure all links begin: https://archive.org
18
+ * @param { string } waybackPagesArchived label readable 'how many pages in WayBack machine?'
19
+ * If you don't pass in something, you'll get the potentially
20
+ * older/less accurate version.
21
+ * @param { string } itemIdentifier The current item being viewed, to populate admin menu items
22
+ * @returns { object }
23
+ */
24
+ export function buildTopNavMenus(
25
+ userid: string = '___USERID___',
26
+ baseHost: string = 'https://archive.org',
27
+ waybackPagesArchived: string = '',
28
+ itemIdentifier: string = '',
29
+ ): IATopNavMenuConfig {
30
+ if (waybackPagesArchived)
31
+ defaultTopNavConfig.waybackPagesArchived = waybackPagesArchived; // update to more accurate val
32
+
33
+ return {
34
+ audio: {
35
+ heading: 'Internet Archive Audio',
36
+ iconLinks: [
37
+ {
38
+ icon: `${baseHost}/services/img/etree`,
39
+ title: 'Live Music Archive',
40
+ url: `${baseHost}/details/etree`,
41
+ },
42
+ {
43
+ icon: `${baseHost}/services/img/librivoxaudio`,
44
+ title: 'Librivox Free Audio',
45
+ url: `${baseHost}/details/librivoxaudio`,
46
+ },
47
+ ],
48
+ featuredLinks: [
49
+ {
50
+ title: 'All Audio',
51
+ url: `${baseHost}/details/audio`,
52
+ },
53
+ {
54
+ title: 'Grateful Dead',
55
+ url: `${baseHost}/details/GratefulDead`,
56
+ },
57
+ {
58
+ title: 'Netlabels',
59
+ url: `${baseHost}/details/netlabels`,
60
+ },
61
+ {
62
+ title: 'Old Time Radio',
63
+ url: `${baseHost}/details/oldtimeradio`,
64
+ },
65
+ {
66
+ title: '78 RPMs and Cylinder Recordings',
67
+ url: `${baseHost}/details/78rpm`,
68
+ },
69
+ ],
70
+ links: [
71
+ {
72
+ title: 'Audio Books & Poetry',
73
+ url: `${baseHost}/details/audio_bookspoetry`,
74
+ },
75
+ {
76
+ title: 'Computers, Technology and Science',
77
+ url: `${baseHost}/details/audio_tech`,
78
+ },
79
+ {
80
+ title: 'Music, Arts & Culture',
81
+ url: `${baseHost}/details/audio_music`,
82
+ },
83
+ {
84
+ title: 'News & Public Affairs',
85
+ url: `${baseHost}/details/audio_news`,
86
+ },
87
+ {
88
+ title: 'Spirituality & Religion',
89
+ url: `${baseHost}/details/audio_religion`,
90
+ },
91
+ {
92
+ title: 'Podcasts',
93
+ url: `${baseHost}/details/podcasts`,
94
+ },
95
+ {
96
+ title: 'Radio News Archive',
97
+ url: `${baseHost}/details/radio`,
98
+ },
99
+ ],
100
+ mobileAppsLinks: [],
101
+ browserExtensionsLinks: [],
102
+ archiveItLinks: [],
103
+ },
104
+ images: {
105
+ heading: 'Images',
106
+ iconLinks: [
107
+ {
108
+ icon: `${baseHost}/services/img/metropolitanmuseumofart-gallery`,
109
+ title: 'Metropolitan Museum',
110
+ url: `${baseHost}/details/metropolitanmuseumofart-gallery`,
111
+ },
112
+ {
113
+ icon: `${baseHost}/services/img/clevelandart`,
114
+ title: 'Cleveland Museum of Art',
115
+ url: `${baseHost}/details/clevelandart`,
116
+ },
117
+ ],
118
+ featuredLinks: [
119
+ {
120
+ title: 'All Images',
121
+ url: `${baseHost}/details/image`,
122
+ },
123
+ {
124
+ title: 'Flickr Commons',
125
+ url: `${baseHost}/details/flickrcommons`,
126
+ },
127
+ {
128
+ title: 'Occupy Wall Street Flickr',
129
+ url: `${baseHost}/details/flickr-ows`,
130
+ },
131
+ {
132
+ title: 'Cover Art',
133
+ url: `${baseHost}/details/coverartarchive`,
134
+ },
135
+ {
136
+ title: 'USGS Maps',
137
+ url: `${baseHost}/details/maps_usgs`,
138
+ },
139
+ ],
140
+ links: [
141
+ {
142
+ title: 'NASA Images',
143
+ url: `${baseHost}/details/nasa`,
144
+ },
145
+ {
146
+ title: 'Solar System Collection',
147
+ url: `${baseHost}/details/solarsystemcollection`,
148
+ },
149
+ {
150
+ title: 'Ames Research Center',
151
+ url: `${baseHost}/details/amesresearchcenterimagelibrary`,
152
+ },
153
+ ],
154
+ mobileAppsLinks: [],
155
+ browserExtensionsLinks: [],
156
+ archiveItLinks: [],
157
+ },
158
+ more: {
159
+ links: [
160
+ {
161
+ title: 'About',
162
+ url: `${baseHost}/about/`,
163
+ },
164
+ {
165
+ title: 'Blog',
166
+ url: 'https://blog.archive.org',
167
+ },
168
+ {
169
+ title: 'Events',
170
+ url: `${baseHost}/events`,
171
+ },
172
+ {
173
+ title: 'Projects',
174
+ url: `${baseHost}/projects/`,
175
+ },
176
+ {
177
+ title: 'Help',
178
+ url: `${baseHost}/about/faqs.php`,
179
+ },
180
+ {
181
+ title: 'Donate',
182
+ url: `${baseHost}/donate?origin=iawww-TopNavDonateButton`,
183
+ },
184
+ {
185
+ title: 'Contact',
186
+ url: `${baseHost}/about/contact`,
187
+ },
188
+ {
189
+ title: 'Jobs',
190
+ url: `${baseHost}/about/jobs`,
191
+ },
192
+ {
193
+ title: 'Volunteer',
194
+ url: `${baseHost}/about/volunteer-positions`,
195
+ },
196
+ ],
197
+ heading: '',
198
+ iconLinks: [],
199
+ featuredLinks: [],
200
+ mobileAppsLinks: [],
201
+ browserExtensionsLinks: [],
202
+ archiveItLinks: [],
203
+ },
204
+ software: {
205
+ heading: 'Software',
206
+ iconLinks: [
207
+ {
208
+ icon: `${baseHost}/services/img/internetarcade`,
209
+ title: 'Internet Arcade',
210
+ url: `${baseHost}/details/internetarcade`,
211
+ },
212
+ {
213
+ icon: `${baseHost}/services/img/consolelivingroom`,
214
+ title: 'Console Living Room',
215
+ url: `${baseHost}/details/consolelivingroom`,
216
+ },
217
+ ],
218
+ featuredLinks: [
219
+ {
220
+ title: 'All Software',
221
+ url: `${baseHost}/details/software`,
222
+ },
223
+ {
224
+ title: 'Old School Emulation',
225
+ url: `${baseHost}/details/tosec`,
226
+ },
227
+ {
228
+ title: 'MS-DOS Games',
229
+ url: `${baseHost}/details/softwarelibrary_msdos_games`,
230
+ },
231
+ {
232
+ title: 'Historical Software',
233
+ url: `${baseHost}/details/historicalsoftware`,
234
+ },
235
+ {
236
+ title: 'Classic PC Games',
237
+ url: `${baseHost}/details/classicpcgames`,
238
+ },
239
+ {
240
+ title: 'Software Library',
241
+ url: `${baseHost}/details/softwarelibrary`,
242
+ },
243
+ ],
244
+ links: [
245
+ {
246
+ title: 'Kodi Archive and Support File',
247
+ url: `${baseHost}/details/kodi_archive`,
248
+ },
249
+ {
250
+ title: 'Vintage Software',
251
+ url: `${baseHost}/details/vintagesoftware`,
252
+ },
253
+ {
254
+ title: 'APK',
255
+ url: `${baseHost}/details/apkarchive`,
256
+ },
257
+ {
258
+ title: 'MS-DOS',
259
+ url: `${baseHost}/details/softwarelibrary_msdos`,
260
+ },
261
+ {
262
+ title: 'CD-ROM Software',
263
+ url: `${baseHost}/details/cd-roms`,
264
+ },
265
+ {
266
+ title: 'CD-ROM Software Library',
267
+ url: `${baseHost}/details/cdromsoftware`,
268
+ },
269
+ {
270
+ title: 'Software Sites',
271
+ url: `${baseHost}/details/softwaresites`,
272
+ },
273
+ {
274
+ title: 'Tucows Software Library',
275
+ url: `${baseHost}/details/tucows`,
276
+ },
277
+ {
278
+ title: 'Shareware CD-ROMs',
279
+ url: `${baseHost}/details/cdbbsarchive`,
280
+ },
281
+ {
282
+ title: 'Software Capsules Compilation',
283
+ url: `${baseHost}/details/softwarecapsules`,
284
+ },
285
+ {
286
+ title: 'CD-ROM Images',
287
+ url: `${baseHost}/details/cdromimages`,
288
+ },
289
+ {
290
+ title: 'ZX Spectrum',
291
+ url: `${baseHost}/details/softwarelibrary_zx_spectrum`,
292
+ },
293
+ {
294
+ title: 'DOOM Level CD',
295
+ url: `${baseHost}/details/doom-cds`,
296
+ },
297
+ ],
298
+ mobileAppsLinks: [],
299
+ browserExtensionsLinks: [],
300
+ archiveItLinks: [],
301
+ },
302
+ texts: {
303
+ heading: 'Texts',
304
+ iconLinks: [
305
+ {
306
+ title: 'Open Library',
307
+ icon: `${baseHost}/images/widgetOL.png`,
308
+ url: 'https://openlibrary.org/',
309
+ },
310
+ {
311
+ title: 'American Libraries',
312
+ icon: `${baseHost}/services/img/americana`,
313
+ url: `${baseHost}/details/americana`,
314
+ },
315
+ ],
316
+ featuredLinks: [
317
+ {
318
+ title: 'All Texts',
319
+ url: `${baseHost}/details/texts`,
320
+ },
321
+ {
322
+ title: 'Smithsonian Libraries',
323
+ url: `${baseHost}/details/smithsonian`,
324
+ },
325
+ {
326
+ title: 'FEDLINK (US)',
327
+ url: `${baseHost}/details/fedlink`,
328
+ },
329
+ {
330
+ title: 'Genealogy',
331
+ url: `${baseHost}/details/genealogy`,
332
+ },
333
+ {
334
+ title: 'Lincoln Collection',
335
+ url: `${baseHost}/details/lincolncollection`,
336
+ },
337
+ ],
338
+ links: [
339
+ {
340
+ title: 'American Libraries',
341
+ url: `${baseHost}/details/americana`,
342
+ },
343
+ {
344
+ title: 'Canadian Libraries',
345
+ url: `${baseHost}/details/toronto`,
346
+ },
347
+ {
348
+ title: 'Universal Library',
349
+ url: `${baseHost}/details/universallibrary`,
350
+ },
351
+ {
352
+ title: 'Project Gutenberg',
353
+ url: `${baseHost}/details/gutenberg`,
354
+ },
355
+ {
356
+ title: "Children's Library",
357
+ url: `${baseHost}/details/iacl`,
358
+ },
359
+ {
360
+ title: 'Biodiversity Heritage Library',
361
+ url: `${baseHost}/details/biodiversity`,
362
+ },
363
+ {
364
+ title: 'Books by Language',
365
+ url: `${baseHost}/details/booksbylanguage`,
366
+ },
367
+ {
368
+ title: 'Folkscanomy',
369
+ url: `${baseHost}/details/folkscanomy`,
370
+ },
371
+ {
372
+ title: 'Government Documents',
373
+ url: `${baseHost}/details/government-documents`,
374
+ },
375
+ ],
376
+ mobileAppsLinks: [],
377
+ browserExtensionsLinks: [],
378
+ archiveItLinks: [],
379
+ },
380
+ web: {
381
+ mobileAppsLinks: [
382
+ {
383
+ url: 'https://apps.apple.com/us/app/wayback-machine/id1201888313',
384
+ title: 'Wayback Machine (iOS)',
385
+ external: true,
386
+ },
387
+ {
388
+ url: 'https://play.google.com/store/apps/details?id=com.internetarchive.waybackmachine',
389
+ title: 'Wayback Machine (Android)',
390
+ external: true,
391
+ },
392
+ ],
393
+ browserExtensionsLinks: [
394
+ {
395
+ url: 'https://chrome.google.com/webstore/detail/wayback-machine/fpnmgdkabkmnadcjpehmlllkndpkmiak',
396
+ title: 'Chrome',
397
+ external: true,
398
+ },
399
+ {
400
+ url: 'https://addons.mozilla.org/en-US/firefox/addon/wayback-machine_new/',
401
+ title: 'Firefox',
402
+ external: true,
403
+ },
404
+ {
405
+ url: 'https://apps.apple.com/us/app/wayback-machine/id1472432422?mt=12',
406
+ title: 'Safari',
407
+ external: true,
408
+ },
409
+ {
410
+ url: 'https://microsoftedge.microsoft.com/addons/detail/wayback-machine/kjmickeoogghaimmomagaghnogelpcpn?hl=en-US',
411
+ title: 'Edge',
412
+ external: true,
413
+ },
414
+ ],
415
+ archiveItLinks: [
416
+ {
417
+ url: 'https://www.archive-it.org/explore',
418
+ title: 'Explore the Collections',
419
+ external: true,
420
+ },
421
+ {
422
+ url: 'https://www.archive-it.org/blog/learn-more/',
423
+ title: 'Learn More',
424
+ external: true,
425
+ },
426
+ {
427
+ url: 'https://www.archive-it.org/contact-us',
428
+ title: 'Build Collections',
429
+ external: true,
430
+ },
431
+ ],
432
+ heading: '',
433
+ iconLinks: [],
434
+ featuredLinks: [],
435
+ links: [],
436
+ },
437
+ video: {
438
+ heading: 'Video',
439
+ iconLinks: [
440
+ {
441
+ icon: `${baseHost}/services/img/tv`,
442
+ title: 'TV News',
443
+ url: `${baseHost}/details/tv`,
444
+ },
445
+ {
446
+ icon: `${baseHost}/services/img/911`,
447
+ title: 'Understanding 9/11',
448
+ url: `${baseHost}/details/911`,
449
+ },
450
+ ],
451
+ featuredLinks: [
452
+ {
453
+ title: 'All Video',
454
+ url: `${baseHost}/details/movies`,
455
+ },
456
+ {
457
+ title: 'Prelinger Archives',
458
+ url: `${baseHost}/details/prelinger`,
459
+ },
460
+ {
461
+ title: 'Democracy Now!',
462
+ url: `${baseHost}/details/democracy_now_vid`,
463
+ },
464
+ {
465
+ title: 'Occupy Wall Street',
466
+ url: `${baseHost}/details/occupywallstreet`,
467
+ },
468
+ {
469
+ title: 'TV NSA Clip Library',
470
+ url: `${baseHost}/details/nsa`,
471
+ },
472
+ ],
473
+ links: [
474
+ {
475
+ title: 'Animation & Cartoons',
476
+ url: `${baseHost}/details/animationandcartoons`,
477
+ },
478
+ {
479
+ title: 'Arts & Music',
480
+ url: `${baseHost}/details/artsandmusicvideos`,
481
+ },
482
+ {
483
+ title: 'Computers & Technology',
484
+ url: `${baseHost}/details/computersandtechvideos`,
485
+ },
486
+ {
487
+ title: 'Cultural & Academic Films',
488
+ url: `${baseHost}/details/culturalandacademicfilms`,
489
+ },
490
+ {
491
+ title: 'Ephemeral Films',
492
+ url: `${baseHost}/details/ephemera`,
493
+ },
494
+ {
495
+ title: 'Movies',
496
+ url: `${baseHost}/details/moviesandfilms`,
497
+ },
498
+ {
499
+ title: 'News & Public Affairs',
500
+ url: `${baseHost}/details/newsandpublicaffairs`,
501
+ },
502
+ {
503
+ title: 'Spirituality & Religion',
504
+ url: `${baseHost}/details/spiritualityandreligion`,
505
+ },
506
+ {
507
+ title: 'Sports Videos',
508
+ url: `${baseHost}/details/sports`,
509
+ },
510
+ {
511
+ title: 'Television',
512
+ url: `${baseHost}/details/television`,
513
+ },
514
+ {
515
+ title: 'Videogame Videos',
516
+ url: `${baseHost}/details/gamevideos`,
517
+ },
518
+ {
519
+ title: 'Vlogs',
520
+ url: `${baseHost}/details/vlogs`,
521
+ },
522
+ {
523
+ title: 'Youth Media',
524
+ url: `${baseHost}/details/youth_media`,
525
+ },
526
+ ],
527
+ mobileAppsLinks: [],
528
+ browserExtensionsLinks: [],
529
+ archiveItLinks: [],
530
+ },
531
+ user: [
532
+ {
533
+ url: `${baseHost}/upload`,
534
+ title: 'Upload files',
535
+ analyticsEvent: 'UserUpload',
536
+ class: 'mobile-upload',
537
+ },
538
+ {
539
+ url: `${baseHost}/details/@${userid}`,
540
+ title: 'My uploads',
541
+ analyticsEvent: 'UserLibrary',
542
+ },
543
+ {
544
+ url: `${baseHost}/details/@${userid}/loans`,
545
+ title: 'My loans',
546
+ analyticsEvent: 'UserLoans',
547
+ },
548
+ {
549
+ url: `${baseHost}/details/fav-${userid}`,
550
+ title: 'My favorites',
551
+ analyticsEvent: 'UserFavorites',
552
+ },
553
+ {
554
+ url: `${baseHost}/details/@${userid}/lists`,
555
+ title: 'My lists',
556
+ analyticsEvent: 'UserLists',
557
+ },
558
+ {
559
+ url: `${baseHost}/details/@${userid}/collections`,
560
+ title: 'My collections',
561
+ analyticsEvent: 'UserCollections',
562
+ },
563
+ {
564
+ url: `${baseHost}/details/@${userid}/web-archive`,
565
+ title: 'My web archives',
566
+ analyticsEvent: 'UserWebArchive',
567
+ },
568
+ {
569
+ url: `${baseHost}/account/settings`,
570
+ title: 'Account settings',
571
+ analyticsEvent: 'UserSettings',
572
+ },
573
+ {
574
+ url: 'https://help.archive.org',
575
+ title: 'Get help',
576
+ analyticsEvent: 'UserHelp',
577
+ },
578
+ {
579
+ url: `${baseHost}/account/logout`,
580
+ title: 'Log out',
581
+ analyticsEvent: 'UserLogOut',
582
+ },
583
+ ],
584
+ userAdmin: [
585
+ {
586
+ title: 'ADMINS:',
587
+ },
588
+ {
589
+ title: 'item:',
590
+ },
591
+ {
592
+ url: `${baseHost}/editxml/${itemIdentifier}`,
593
+ title: 'edit xml',
594
+ analyticsEvent: 'AdminUserEditXML',
595
+ },
596
+ {
597
+ url: `${baseHost}/edit.php?redir=1&identifier=${itemIdentifier}`,
598
+ title: 'edit files',
599
+ analyticsEvent: 'AdminUserEditFiles',
600
+ },
601
+ {
602
+ url: `${baseHost}/download/${itemIdentifier}/`,
603
+ title: 'download',
604
+ analyticsEvent: 'AdminUserDownload',
605
+ },
606
+ {
607
+ url: `${baseHost}/metadata/${itemIdentifier}/`,
608
+ title: 'metadata',
609
+ analyticsEvent: 'AdminUserMetadata',
610
+ },
611
+ {
612
+ url: `https://catalogd.archive.org/history/${itemIdentifier}`,
613
+ title: 'history',
614
+ analyticsEvent: 'AdminUserHistory',
615
+ },
616
+ {
617
+ url: `${baseHost}/manage/${itemIdentifier}`,
618
+ title: 'manage',
619
+ analyticsEvent: 'AdminUserManager',
620
+ },
621
+ {
622
+ url: `${baseHost}/manage/${itemIdentifier}#make_dark`,
623
+ title: 'curate',
624
+ analyticsEvent: 'AdminUserCurate',
625
+ },
626
+ {
627
+ url: `${baseHost}/manage/${itemIdentifier}#modify_xml`,
628
+ title: 'modify xml',
629
+ analyticsEvent: 'AdminUserModifyXML',
630
+ },
631
+ ],
632
+ userAdminFlags: [
633
+ {
634
+ url: `${baseHost}/services/flags/admin.php?identifier=${itemIdentifier}`,
635
+ title: 'manage flags',
636
+ analyticsEvent: 'AdminUserManageFlags',
637
+ },
638
+ ],
639
+ signedOut: [
640
+ {
641
+ url: `${baseHost}/account/signup`,
642
+ title: 'Sign up for free',
643
+ analyticsEvent: 'AvatarMenu-Signup',
644
+ },
645
+ {
646
+ url: `${baseHost}/login`,
647
+ title: 'Log in',
648
+ analyticsEvent: 'AvatarMenu-Login',
649
+ },
650
+ ],
651
+ };
652
+ }