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