@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
@@ -3,7 +3,6 @@ import Events from "../core/Events"
3
3
  import { DOMMixins } from "../dom/DOMMixins"
4
4
  import { DOMEvent } from "../dom/DOMEvent"
5
5
 
6
- import { addClass, removeClass } from "../dom/DOMUtil"
7
6
  import * as DOM from "../dom/DOM"
8
7
  import { webkit as BROWSER_WEBKIT } from "../core/Browser";
9
8
  import { easeInSpline } from "../animation/Ease";
@@ -181,9 +180,9 @@ export class TimeMarker {
181
180
  }
182
181
 
183
182
  if (h <= 56) {
184
- addClass(this._el.content_container, "tl-timemarker-content-container-small");
183
+ this._el.content_container.classList.add("tl-timemarker-content-container-small");
185
184
  } else {
186
- removeClass(this._el.content_container, "tl-timemarker-content-container-small");
185
+ this._el.content_container.classList.remove("tl-timemarker-content-container-small");
187
186
  }
188
187
 
189
188
  // Handle number of lines visible vertically
@@ -154,10 +154,10 @@ export class MenuBar {
154
154
  _initLayout() {
155
155
 
156
156
  // Create Layout
157
- this._el.button_zoomin = DOM.create('button', 'tl-menubar-button', this._el.container);
158
- this._el.button_zoomout = DOM.create('button', 'tl-menubar-button', this._el.container);
159
- this._el.button_forwardtoend = DOM.create('button', 'tl-menubar-button', this._el.container);
160
- this._el.button_backtostart = DOM.create('button', 'tl-menubar-button', this._el.container);
157
+ this._el.button_zoomin = DOM.createButton('tl-menubar-button', this._el.container);
158
+ this._el.button_zoomout = DOM.createButton('tl-menubar-button', this._el.container);
159
+ this._el.button_forwardtoend = DOM.createButton('tl-menubar-button', this._el.container);
160
+ this._el.button_backtostart = DOM.createButton('tl-menubar-button', this._el.container);
161
161
 
162
162
  if (Browser.mobile) {
163
163
  this._el.container.setAttribute("ontouchstart", " ");
@@ -386,7 +386,6 @@
386
386
  }
387
387
  },
388
388
 
389
-
390
389
  {
391
390
  "media": {
392
391
  "url": "https://en.wikipedia.org/wiki/1997_International_Tennis_Championships_%E2%80%93_Doubles",
@@ -561,7 +560,34 @@
561
560
  "text": "Wistia is a commercial video hosting service. I don't even remember who requested that TimelineJS support it, and it's hard to find a suitable test URL, but ... "
562
561
  },
563
562
  "group": "Video"
563
+ },
564
+ {
565
+ "media": {
566
+ "url": "https://de.wikipedia.org/wiki/Beryllium#/media/Datei:Beryl-Quartz-Emerald-Zambia-33mm_0885.jpg",
567
+ "credit": "Wikipedia"
568
+ },
569
+ "start_date": {
570
+ "year": "1929"
571
+ },
572
+ "text": {
573
+ "headline": "Wikimedia Images",
574
+ "text": "Given a link to a wikipedia page about an image, extract best the Wikimedia image URL and use it for the media."
575
+ },
576
+ "group": "Image"
577
+ },
578
+ {
579
+ "media": {
580
+ "url": "https://commons.wikimedia.org/wiki/File:David-Bowie_Chicago_2002-08-08_photoby_Adam-Bielawski-cropped.jpg",
581
+ "credit": "Wikipedia"
582
+ },
583
+ "start_date": {
584
+ "year": "1930"
585
+ },
586
+ "text": {
587
+ "headline": "Wikimedia Commons Image links",
588
+ "text": "Given a link to a wikipedia page about an image, extract best the Wikimedia image URL and use it for the media."
589
+ },
590
+ "group": "Image"
564
591
  }
565
-
566
592
  ]
567
593
  }
@@ -13,6 +13,7 @@
13
13
  hash_bookmark: true,
14
14
  start_at_end: false,
15
15
  autolink: false,
16
+ ga_measurement_id: 'G-LVEFKMG087',
16
17
  sheets_proxy: 'https://sheets-proxy.knightlab.com/proxy/'
17
18
  }
18
19
 
@@ -1,25 +0,0 @@
1
- /* DomUtil
2
- Inspired by Leaflet
3
- DomUtil contains various utility functions for working with DOM
4
- Why are they in DOMUtil and not DOM?
5
- ================================================== */
6
-
7
- function hasClass(el, name) {
8
- return (el.className.length > 0) &&
9
- new RegExp("(^|\\s)" + name + "(\\s|$)").test(el.className);
10
- }
11
-
12
- export function addClass(el, name) {
13
- if (!hasClass(el, name)) {
14
- el.className += (el.className ? ' ' : '') + name;
15
- }
16
- }
17
-
18
- export function removeClass(el, name) {
19
- el.className = el.className.replace(/(\S+)\s*/g, function(w, match) {
20
- if (match === name) {
21
- return '';
22
- }
23
- return w;
24
- }).replace(/^\s+/, '');
25
- }