@knight-lab/timelinejs 3.9.1 → 3.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/CONTRIBUTING.md +5 -0
  3. package/dist/css/fonts/font.amatic-andika.css +1 -1
  4. package/dist/css/fonts/font.bevan-pontanosans.css +2 -2
  5. package/dist/css/fonts/font.bitter-raleway.css +1 -1
  6. package/dist/css/fonts/font.default.css +3 -3
  7. package/dist/css/fonts/font.fjalla-average.css +1 -1
  8. package/dist/css/fonts/font.lustria-lato.css +2 -2
  9. package/dist/css/fonts/font.medula-lato.css +3 -3
  10. package/dist/css/fonts/font.opensans-gentiumbook.css +4 -4
  11. package/dist/css/fonts/font.playfair-faunaone.css +2 -2
  12. package/dist/css/fonts/font.pt.css +3 -3
  13. package/dist/css/fonts/font.roboto-megrim.css +2 -2
  14. package/dist/css/fonts/font.unicaone-vollkorn.css +3 -3
  15. package/dist/embed/index.html +1 -1
  16. package/dist/js/locale/en-gb.json +69 -0
  17. package/dist/js/locale/es.json +1 -1
  18. package/dist/js/locale/hi.json +0 -1
  19. package/dist/js/timeline.js +1 -1
  20. package/dist/js/timeline.js.map +1 -1
  21. package/package.json +4 -3
  22. package/src/embed/index.html +1 -1
  23. package/src/js/core/ConfigFactory.js +8 -2
  24. package/src/js/dom/DOM.js +7 -1
  25. package/src/js/language/Language.js +1 -0
  26. package/src/js/language/locale/en-gb.json +69 -0
  27. package/src/js/language/locale/es.json +1 -1
  28. package/src/js/language/locale/hi.json +0 -1
  29. package/src/js/media/MediaType.js +19 -6
  30. package/src/js/media/__tests__/MediaType.test.js +47 -0
  31. package/src/js/media/types/WikipediaImage.js +159 -0
  32. package/src/js/media/types/__tests__/WikipediaImage.test.js +48 -0
  33. package/src/js/net/Net.js +1 -1
  34. package/src/js/slider/Slide.js +3 -4
  35. package/src/js/slider/SlideNav.js +1 -1
  36. package/src/js/slider/StorySlider.js +1 -2
  37. package/src/js/timeline/Timeline.js +14 -22
  38. package/src/js/timenav/TimeEra.js +1 -2
  39. package/src/js/timenav/TimeMarker.js +2 -3
  40. package/src/js/ui/MenuBar.js +4 -4
  41. package/src/template/all-media-types.json +28 -2
  42. package/src/template/index.html +1 -0
  43. package/src/js/dom/DOMUtil.js +0 -25
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ 3.9.3 (2023-06-26)
2
+ -------------------------
3
+ * Update for Google Analytics 4 (GA4)
4
+ * #812 don't throw an error when attempting to report an error fetching config data
5
+ * #799 Deprecate / remove DOMUtil (should be invisible but simplifies code)
6
+
7
+ 3.9.2 (2023-02-07)
8
+ -------------------------
9
+ * #796 support Wikipedia image page URLs
10
+ * #808 Add support for en-GB locale (UK-style date formatting, eg 2 Dec 2022)
11
+ * #814 Ensure that buttons are created with type="button"
12
+
1
13
  3.9.1 (2022-11-29)
2
14
  -------------------------
3
15
  * Adapted to a change in Google Drive sharing links which caused TimelineJS to no longer select the correct media type.
package/CONTRIBUTING.md CHANGED
@@ -26,6 +26,11 @@ Once you've cloned the repository, run `npm install`. Assuming there are no erro
26
26
 
27
27
  Timeline uses `webpack` for bundling, and uses the `webpack-dev-server` as part of the `start` script. This means that you should be able to make edits to the source javascript and less files and they will automatically compile, and the browser should reload.
28
28
 
29
+ ### Building
30
+
31
+ In order to "compile" TimelineJS for use in other contexts, after following the instructions above, run the command `npm run dist`. This will populate a directory, `dist/` in the rool of your checked-out repository, with the javascript and CSS necessary to self-host TimelineJS.
32
+
33
+
29
34
  ### Testing
30
35
 
31
36
  Timeline has a modest suite of tests implemented using `jest`. You can run them using `npm test`. We'd love to have more tests, but have not yet determined a good way to run unit tests against the visual details of timelines. (Let us know if you have suggestions!) It's a good idea to occasionally run `npm test` to make sure you haven't messed anything up.
@@ -36,7 +36,7 @@ https://www.google.com/fonts/specimen/Andika
36
36
  font-family: 'Andika';
37
37
  font-style: normal;
38
38
  font-weight: 400;
39
- src: url(https://fonts.gstatic.com/s/andika/v22/mem_Ya6iyW-LwqgwarYV.ttf) format('truetype');
39
+ src: url(https://fonts.gstatic.com/s/andika/v25/mem_Ya6iyW-LwqgwarYV.ttf) format('truetype');
40
40
  }
41
41
  /* Font Base
42
42
  ----------------------------------------------------- */
@@ -24,13 +24,13 @@ https://www.google.com/fonts/specimen/Pontano+Sans
24
24
  font-family: 'Bevan';
25
25
  font-style: normal;
26
26
  font-weight: 400;
27
- src: url(https://fonts.gstatic.com/s/bevan/v20/4iCj6KZ0a9NXjG8dWC4.ttf) format('truetype');
27
+ src: url(https://fonts.gstatic.com/s/bevan/v21/4iCj6KZ0a9NXjG8dWC4.ttf) format('truetype');
28
28
  }
29
29
  @font-face {
30
30
  font-family: 'Pontano Sans';
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
- src: url(https://fonts.gstatic.com/s/pontanosans/v13/qFdD35GdgYR8EzR6oBLDHa3axT8I.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/pontanosans/v16/qFdW35GdgYR8EzR6oBLDHa3wyRf8W8eBM6XLOXLMrcGGow.ttf) format('truetype');
34
34
  }
35
35
  /* Font Base
36
36
  ----------------------------------------------------- */
@@ -24,7 +24,7 @@ https://www.google.com/fonts/specimen/Raleway
24
24
  font-family: 'Bitter';
25
25
  font-style: normal;
26
26
  font-weight: 700;
27
- src: url(https://fonts.gstatic.com/s/bitter/v28/raxhHiqOu8IVPmnRc6SY1KXhnF_Y8RHYOLjOWA.ttf) format('truetype');
27
+ src: url(https://fonts.gstatic.com/s/bitter/v32/raxhHiqOu8IVPmnRc6SY1KXhnF_Y8RHYOLjOWA.ttf) format('truetype');
28
28
  }
29
29
  @font-face {
30
30
  font-family: 'Raleway';
@@ -33,19 +33,19 @@ http://www.google.com/webfonts/specimen/PT+Serif
33
33
  font-family: 'PT Sans Narrow';
34
34
  font-style: normal;
35
35
  font-weight: 700;
36
- src: url(https://fonts.gstatic.com/s/ptsansnarrow/v17/BngSUXNadjH0qYEzV7ab-oWlsbg95AiFW_g.ttf) format('truetype');
36
+ src: url(https://fonts.gstatic.com/s/ptsansnarrow/v18/BngSUXNadjH0qYEzV7ab-oWlsbg95AiFW_g.ttf) format('truetype');
37
37
  }
38
38
  @font-face {
39
39
  font-family: 'PT Serif';
40
40
  font-style: italic;
41
41
  font-weight: 400;
42
- src: url(https://fonts.gstatic.com/s/ptserif/v17/EJRTQgYoZZY2vCFuvAFT_r21dw.ttf) format('truetype');
42
+ src: url(https://fonts.gstatic.com/s/ptserif/v18/EJRTQgYoZZY2vCFuvAFT_r21dw.ttf) format('truetype');
43
43
  }
44
44
  @font-face {
45
45
  font-family: 'PT Serif';
46
46
  font-style: normal;
47
47
  font-weight: 400;
48
- src: url(https://fonts.gstatic.com/s/ptserif/v17/EJRVQgYoZZY2vCFuvAFWzro.ttf) format('truetype');
48
+ src: url(https://fonts.gstatic.com/s/ptserif/v18/EJRVQgYoZZY2vCFuvAFWzro.ttf) format('truetype');
49
49
  }
50
50
  /* Font Base
51
51
  ----------------------------------------------------- */
@@ -30,7 +30,7 @@ https://www.google.com/fonts/specimen/Average+Sans
30
30
  font-family: 'Fjalla One';
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
- src: url(https://fonts.gstatic.com/s/fjallaone/v13/Yq6R-LCAWCX3-6Ky7FAFrOF6lw.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/fjallaone/v15/Yq6R-LCAWCX3-6Ky7FAFrOF6lw.ttf) format('truetype');
34
34
  }
35
35
  /* Font Base
36
36
  ----------------------------------------------------- */
@@ -24,13 +24,13 @@ https://www.google.com/fonts/specimen/Lato
24
24
  font-family: 'Lato';
25
25
  font-style: italic;
26
26
  font-weight: 400;
27
- src: url(https://fonts.gstatic.com/s/lato/v23/S6u8w4BMUTPHjxsAXC-v.ttf) format('truetype');
27
+ src: url(https://fonts.gstatic.com/s/lato/v24/S6u8w4BMUTPHjxsAXC-v.ttf) format('truetype');
28
28
  }
29
29
  @font-face {
30
30
  font-family: 'Lato';
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
- src: url(https://fonts.gstatic.com/s/lato/v23/S6uyw4BMUTPHjx4wWw.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjx4wWw.ttf) format('truetype');
34
34
  }
35
35
  @font-face {
36
36
  font-family: 'Lustria';
@@ -24,19 +24,19 @@ https://www.google.com/fonts/specimen/Lato
24
24
  font-family: 'Lato';
25
25
  font-style: italic;
26
26
  font-weight: 300;
27
- src: url(https://fonts.gstatic.com/s/lato/v23/S6u_w4BMUTPHjxsI9w2_Gwfo.ttf) format('truetype');
27
+ src: url(https://fonts.gstatic.com/s/lato/v24/S6u_w4BMUTPHjxsI9w2_Gwfo.ttf) format('truetype');
28
28
  }
29
29
  @font-face {
30
30
  font-family: 'Lato';
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
- src: url(https://fonts.gstatic.com/s/lato/v23/S6uyw4BMUTPHjx4wWw.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjx4wWw.ttf) format('truetype');
34
34
  }
35
35
  @font-face {
36
36
  font-family: 'Lato';
37
37
  font-style: normal;
38
38
  font-weight: 700;
39
- src: url(https://fonts.gstatic.com/s/lato/v23/S6u9w4BMUTPHh6UVSwiPHA.ttf) format('truetype');
39
+ src: url(https://fonts.gstatic.com/s/lato/v24/S6u9w4BMUTPHh6UVSwiPHA.ttf) format('truetype');
40
40
  }
41
41
  @font-face {
42
42
  font-family: 'Medula One';
@@ -24,27 +24,27 @@ http://www.google.com/webfonts/specimen/Gentium+Book+Basic
24
24
  font-family: 'Gentium Book Basic';
25
25
  font-style: italic;
26
26
  font-weight: 400;
27
- src: url(https://fonts.gstatic.com/s/gentiumbookbasic/v16/pe0xMJCbPYBVokB1LHA9bbyaQb8ZGjc4VYF466c.ttf) format('truetype');
27
+ src: url(https://fonts.gstatic.com/s/gentiumbookbasic/v17/pe0xMJCbPYBVokB1LHA9bbyaQb8ZGjc4VYF466c.ttf) format('truetype');
28
28
  }
29
29
  @font-face {
30
30
  font-family: 'Gentium Book Basic';
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
- src: url(https://fonts.gstatic.com/s/gentiumbookbasic/v16/pe0zMJCbPYBVokB1LHA9bbyaQb8ZGjc4ULF_.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/gentiumbookbasic/v17/pe0zMJCbPYBVokB1LHA9bbyaQb8ZGjc4ULF_.ttf) format('truetype');
34
34
  }
35
35
  @font-face {
36
36
  font-family: 'Open Sans';
37
37
  font-style: normal;
38
38
  font-weight: 400;
39
39
  font-stretch: normal;
40
- src: url(https://fonts.gstatic.com/s/opensans/v34/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVc.ttf) format('truetype');
40
+ src: url(https://fonts.gstatic.com/s/opensans/v35/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVc.ttf) format('truetype');
41
41
  }
42
42
  @font-face {
43
43
  font-family: 'Open Sans';
44
44
  font-style: normal;
45
45
  font-weight: 800;
46
46
  font-stretch: normal;
47
- src: url(https://fonts.gstatic.com/s/opensans/v34/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1x4gaVc.ttf) format('truetype');
47
+ src: url(https://fonts.gstatic.com/s/opensans/v35/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1x4gaVc.ttf) format('truetype');
48
48
  }
49
49
  /* Font Base
50
50
  ----------------------------------------------------- */
@@ -43,13 +43,13 @@ https://www.google.com/fonts/specimen/Unica+One
43
43
  font-family: 'Fauna One';
44
44
  font-style: normal;
45
45
  font-weight: 400;
46
- src: url(https://fonts.gstatic.com/s/faunaone/v13/wlpzgwTPBVpjpCuwkuEB3kZP.ttf) format('truetype');
46
+ src: url(https://fonts.gstatic.com/s/faunaone/v15/wlpzgwTPBVpjpCuwkuEB3kZP.ttf) format('truetype');
47
47
  }
48
48
  @font-face {
49
49
  font-family: 'Unica One';
50
50
  font-style: normal;
51
51
  font-weight: 400;
52
- src: url(https://fonts.gstatic.com/s/unicaone/v13/DPEuYwWHyAYGVTSmalsRcd3b.ttf) format('truetype');
52
+ src: url(https://fonts.gstatic.com/s/unicaone/v15/DPEuYwWHyAYGVTSmalsRcd3b.ttf) format('truetype');
53
53
  }
54
54
  /* Font Base
55
55
  ----------------------------------------------------- */
@@ -31,19 +31,19 @@ http://www.google.com/webfonts/specimen/PT+Serif
31
31
  font-family: 'PT Sans Narrow';
32
32
  font-style: normal;
33
33
  font-weight: 700;
34
- src: url(https://fonts.gstatic.com/s/ptsansnarrow/v17/BngSUXNadjH0qYEzV7ab-oWlsbg95AiFW_g.ttf) format('truetype');
34
+ src: url(https://fonts.gstatic.com/s/ptsansnarrow/v18/BngSUXNadjH0qYEzV7ab-oWlsbg95AiFW_g.ttf) format('truetype');
35
35
  }
36
36
  @font-face {
37
37
  font-family: 'PT Serif';
38
38
  font-style: italic;
39
39
  font-weight: 400;
40
- src: url(https://fonts.gstatic.com/s/ptserif/v17/EJRTQgYoZZY2vCFuvAFT_r21dw.ttf) format('truetype');
40
+ src: url(https://fonts.gstatic.com/s/ptserif/v18/EJRTQgYoZZY2vCFuvAFT_r21dw.ttf) format('truetype');
41
41
  }
42
42
  @font-face {
43
43
  font-family: 'PT Serif';
44
44
  font-style: normal;
45
45
  font-weight: 400;
46
- src: url(https://fonts.gstatic.com/s/ptserif/v17/EJRVQgYoZZY2vCFuvAFWzro.ttf) format('truetype');
46
+ src: url(https://fonts.gstatic.com/s/ptserif/v18/EJRVQgYoZZY2vCFuvAFWzro.ttf) format('truetype');
47
47
  }
48
48
  /* Font Base
49
49
  ----------------------------------------------------- */
@@ -30,13 +30,13 @@ https://www.google.com/fonts/specimen/Megrim
30
30
  font-family: 'Roboto Slab';
31
31
  font-style: normal;
32
32
  font-weight: 300;
33
- src: url(https://fonts.gstatic.com/s/robotoslab/v24/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjo0oSmb2Rm.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjo0oSmb2Rm.ttf) format('truetype');
34
34
  }
35
35
  @font-face {
36
36
  font-family: 'Roboto Slab';
37
37
  font-style: normal;
38
38
  font-weight: 400;
39
- src: url(https://fonts.gstatic.com/s/robotoslab/v24/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISmb2Rm.ttf) format('truetype');
39
+ src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISmb2Rm.ttf) format('truetype');
40
40
  }
41
41
  /* Font Base
42
42
  ----------------------------------------------------- */
@@ -24,19 +24,19 @@ https://www.google.com/fonts/specimen/Unica+One
24
24
  font-family: 'Vollkorn';
25
25
  font-style: italic;
26
26
  font-weight: 400;
27
- src: url(https://fonts.gstatic.com/s/vollkorn/v21/0ybuGDoxxrvAnPhYGxksckM2WMCpRjDj-DJGWlmeObE.ttf) format('truetype');
27
+ src: url(https://fonts.gstatic.com/s/vollkorn/v22/0ybuGDoxxrvAnPhYGxksckM2WMCpRjDj-DJGWlmeObE.ttf) format('truetype');
28
28
  }
29
29
  @font-face {
30
30
  font-family: 'Vollkorn';
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
- src: url(https://fonts.gstatic.com/s/vollkorn/v21/0ybgGDoxxrvAnPhYGzMlQLzuMasz6Df2MHGeHmmZ.ttf) format('truetype');
33
+ src: url(https://fonts.gstatic.com/s/vollkorn/v22/0ybgGDoxxrvAnPhYGzMlQLzuMasz6Df2MHGeHmmZ.ttf) format('truetype');
34
34
  }
35
35
  @font-face {
36
36
  font-family: 'Unica One';
37
37
  font-style: normal;
38
38
  font-weight: 400;
39
- src: url(https://fonts.gstatic.com/s/unicaone/v13/DPEuYwWHyAYGVTSmalsRcd3b.ttf) format('truetype');
39
+ src: url(https://fonts.gstatic.com/s/unicaone/v15/DPEuYwWHyAYGVTSmalsRcd3b.ttf) format('truetype');
40
40
  }
41
41
  /* Font Base
42
42
  ----------------------------------------------------- */
@@ -150,7 +150,7 @@
150
150
  var options = optionsFromUrlParams();
151
151
  createEmbedDiv('timeline-embed', options.width, options.height);
152
152
  // ga_property_id is not something we let users override
153
- options.ga_property_id = 'UA-27829802-4';
153
+ options.ga_measurement_id = 'G-LVEFKMG087'
154
154
  if (typeof(options.source) == 'undefined') {
155
155
  options.source = '1xuY4upIooEeszZ_lCmeNx24eSFWe0rHe9ZdqH2xqVNk' // women in computing
156
156
  }
@@ -0,0 +1,69 @@
1
+ {
2
+ "lang": "en-gb",
3
+ "date": {
4
+ "month_abbr": [
5
+ "Jan",
6
+ "Feb",
7
+ "Mar",
8
+ "Apr",
9
+ "May",
10
+ "Jun",
11
+ "Jul",
12
+ "Aug",
13
+ "Sep",
14
+ "Oct",
15
+ "Nov",
16
+ "Dec"
17
+ ],
18
+ "day_abbr": [
19
+ "Sun",
20
+ "Mon",
21
+ "Tue",
22
+ "Wed",
23
+ "Thu",
24
+ "Fri",
25
+ "Sat"
26
+ ],
27
+ "day": [
28
+ "Sunday",
29
+ "Monday",
30
+ "Tuesday",
31
+ "Wednesday",
32
+ "Thursday",
33
+ "Friday",
34
+ "Saturday"
35
+ ],
36
+ "month": [
37
+ "January",
38
+ "February",
39
+ "March",
40
+ "April",
41
+ "May",
42
+ "June",
43
+ "July",
44
+ "August",
45
+ "September",
46
+ "October",
47
+ "November",
48
+ "December"
49
+ ]
50
+ },
51
+ "api": {
52
+ "wikipedia": "en"
53
+ },
54
+ "messages": {
55
+ "comment": "There is no need to repeat message keys because the fallback is English and this file only exists to control date formatting."
56
+ },
57
+ "dateformats": {
58
+ "full_long": "d mmm yyyy 'at' HH:MM TT",
59
+ "full_short": "d mmm",
60
+ "full": "d mmmm yyyy",
61
+ "month_short": "mmm",
62
+ "time_no_seconds_small_date": "HH:MM TT'<br/><small>'d mmmm yyyy'</small>'",
63
+ "month": "mmmm yyyy",
64
+ "time_no_seconds_short": "HH:MM TT",
65
+ "time_short": "HH:MM:ss",
66
+ "year": "yyyy",
67
+ "full_long_small_date": "HH:MM TT'<br/><small>d mmm yyyy'</small>'"
68
+ }
69
+ }
@@ -54,7 +54,7 @@
54
54
  "messages": {
55
55
  "loading": "cargando",
56
56
  "return_to_title": "Volver al título",
57
- "swipe_nav": "Desliza para ver",
57
+ "swipe_to_navigate": "Desliza para ver<br><span class='tl-button'>OK</span>",
58
58
  "wikipedia": "Desde Wikipedia, la enciclopedia libre",
59
59
  "loading_content": "cargando",
60
60
  "loading_timeline": "La cronología esta cargando"
@@ -54,7 +54,6 @@
54
54
  "messages": {
55
55
  "loading": "लोड हो रहा है",
56
56
  "return_to_title": "शीर्षक पर लौटें",
57
- "swipe_nav": "Swipe to Navigate",
58
57
  "read_more": "और पढ़ें",
59
58
  "wikipedia": "विकिपीडिया, मुक्त विश्वकोश से",
60
59
  "loading_timeline": "टाइमलाइन लोड हो रहा है",