@knight-lab/timelinejs
Advanced tools
Comparing version 3.8.20 to 3.8.21
@@ -0,1 +1,7 @@ | ||
3.8.21 (2022-04-29) | ||
------------------ | ||
* #704 honor "start_at_end" option when also using "hash_bookmark" option | ||
* #730 Improved Norwegian translations for both bΓΈkmal and nynorsk. | ||
* #710 Improve tests by setting timezone (and adjusting the async handling in `Timeline.test.js`) | ||
3.8.20 (2022-02-16) | ||
@@ -2,0 +8,0 @@ ------------------ |
@@ -0,1 +1,3 @@ | ||
process.env.TZ = 'UTC'; | ||
// For a detailed explanation regarding each configuration property, visit: | ||
@@ -2,0 +4,0 @@ // https://jestjs.io/docs/en/configuration.html |
{ | ||
"name": "@knight-lab/timelinejs", | ||
"version": "3.8.20", | ||
"version": "3.8.21", | ||
"license": "MPL-2.0", | ||
@@ -59,3 +59,4 @@ "description": "TimelineJS v3: A Storytelling Timeline built in JavaScript, made by Northwestern University Knight Lab.", | ||
}, | ||
"contributors": [{ | ||
"contributors": [ | ||
{ | ||
"name": "Zach Wise", | ||
@@ -71,2 +72,2 @@ "email": "wise@northwestern.edu", | ||
] | ||
} | ||
} |
@@ -53,10 +53,14 @@ import { Timeline } from "../timeline/Timeline" | ||
// these tests fail because the timeline config instantiation is async, and the test | ||
// proceeds before it's ready. I still haven't figured out how to make Jest wait | ||
// until it's actually ready, or maybe there's a different problem? | ||
// Full timeline configuration is asynchronous, so these tests need | ||
// to be deferred until the timeline is in a "ready" state. | ||
// However, binding the promise resolution to timeline "on ready" | ||
// results in test failures because of timeout, even when passing | ||
// a longer timeout as the third argument to test (up to 10000ms tried) | ||
// however, when they fire on dataloaded, they pass. This doesn't | ||
// seem satisfying, but better than ignoring failed test results | ||
// since passing is still passing. | ||
test("Ensure options is optional", async() => { | ||
let timeline = await new Promise((resolve) => { | ||
let tl = new Timeline('timeline-embed', TEST_CONFIG) | ||
debugger | ||
tl.on('ready', () => resolve(tl)) | ||
tl.on('dataloaded', () => resolve(tl)) | ||
}); | ||
@@ -69,10 +73,11 @@ // these tests will fail until we figure out how to deal with | ||
// these tests fail because the timeline config instantiation is async, and the test | ||
// proceeds before it's ready. I still haven't figured out how to make Jest wait | ||
// until it's actually ready, or maybe there's a different problem? | ||
test("test remove", () => { | ||
let timeline = new Timeline('timeline-embed', | ||
TEST_CONFIG, { // i don't think this is actually used? | ||
script_path: 'http://localhost:1234/' | ||
}); | ||
test("test remove", async() => { | ||
let timeline = await new Promise((resolve) => { | ||
let tl = new Timeline('timeline-embed', | ||
TEST_CONFIG, { // i don't think this is actually used? | ||
script_path: 'http://localhost:1234/' | ||
}); | ||
tl.on('dataloaded', () => resolve(tl)) | ||
}) | ||
expect(timeline.config).toBeDefined() | ||
@@ -79,0 +84,0 @@ expect(timeline.config.events.length).toBe(2) |
@@ -44,3 +44,3 @@ import { TLDate, BigDate, makeDate, parseDate } from "../TLDate" | ||
var smalldate = makeDate({ year: 2015 }); | ||
expect(smalldate.getTime()).toBe(1420092000000) | ||
expect(smalldate.getTime()).toBe(1420070400000) | ||
}) | ||
@@ -196,3 +196,3 @@ | ||
var floored = early_ce.floor('decade'); | ||
expect(floored.getTime()).toBe(-59326970964000) // 'Early floored dates should not go into the 20th Century') | ||
expect(floored.getTime()).toBe(-59326992000000) // 'Early floored dates should not go into the 20th Century') | ||
@@ -199,0 +199,0 @@ var age_scale = makeDate({ year: 1500000 }); |
@@ -28,12 +28,3 @@ import { Media } from "../Media"; | ||
// Link | ||
if (this.data.link) { | ||
this._el.content_link = this.domCreate("a", "", this._el.content); | ||
this._el.content_link.href = this.data.link; | ||
this._el.content_link.target = "_blank"; | ||
this._el.content_link.setAttribute('rel', 'noopener'); | ||
this._el.content_item = this.domCreate("audio", audio_class, this._el.content_link); | ||
} else { | ||
this._el.content_item = this.domCreate("audio", audio_class, this._el.content); | ||
} | ||
this._el.content_item = this.domCreate("audio", audio_class, this._el.content); | ||
@@ -40,0 +31,0 @@ this._el.content_item.controls = true; |
@@ -28,12 +28,3 @@ import { Media } from "../Media" | ||
// Link | ||
if (this.data.link) { | ||
this._el.content_link = this.domCreate("a", "", this._el.content); | ||
this._el.content_link.href = this.data.link; | ||
this._el.content_link.target = "_blank"; | ||
this._el.content_link.setAttribute('rel', 'noopener'); | ||
this._el.content_item = this.domCreate("img", image_class, this._el.content_link); | ||
} else { | ||
this._el.content_item = this.domCreate("img", image_class, this._el.content); | ||
} | ||
this._el.content_item = this.domCreate("img", image_class, this._el.content); | ||
@@ -40,0 +31,0 @@ if (this.data.alt) { |
@@ -28,11 +28,3 @@ import { Media } from "../Media"; | ||
// Link | ||
if (this.data.link) { | ||
this._el.content_link = this.domCreate("a", "", this._el.content); | ||
this._el.content_link.href = this.data.link; | ||
this._el.content_link.target = "_blank"; | ||
this._el.content_link.setAttribute('rel', 'noopener') | ||
this._el.content_item = this.domCreate("video", video_class, this._el.content_link); | ||
} else { | ||
this._el.content_item = this.domCreate("video", video_class, this._el.content); | ||
} | ||
this._el.content_item = this.domCreate("video", video_class, this._el.content); | ||
@@ -39,0 +31,0 @@ this._el.content_item.controls = true; |
@@ -773,2 +773,7 @@ import * as DOM from "../dom/DOM" | ||
// Go to proper slide | ||
if (isTrue(this.options.start_at_end) || this.options.start_at_slide > this.config.events.length) { | ||
this.goToEnd(); | ||
} else { | ||
this.goTo(this.options.start_at_slide); | ||
} | ||
if (this.options.hash_bookmark) { | ||
@@ -786,8 +791,2 @@ if (window.location.hash != "") { | ||
}, false); | ||
} else { | ||
if (isTrue(this.options.start_at_end) || this.options.start_at_slide > this.config.events.length) { | ||
this.goToEnd(); | ||
} else { | ||
this.goTo(this.options.start_at_slide); | ||
} | ||
} | ||
@@ -998,2 +997,2 @@ | ||
export { Timeline } | ||
export { Timeline } |
@@ -8,3 +8,2 @@ import { classMixin, unlinkify, mergeData } from "../core/Util" | ||
import * as DOM from "../dom/DOM" | ||
import { head } from "lodash"; | ||
@@ -11,0 +10,0 @@ /** |
@@ -262,5 +262,7 @@ { | ||
"media": { | ||
"url": "http://www.kidzone.ws/images-changed/sharks/head.jpg", | ||
"caption": "Sharks!", | ||
"credit": "Kid Zone" | ||
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Moraine_Lake_17092005.jpg/960px-Moraine_Lake_17092005.jpg", | ||
"caption": "Valley of the Ten Peaks and Moraine Lake, Banff National Park, Canada.", | ||
"credit": "Wikipedia Commons", | ||
"link": "https://en.wikipedia.org/wiki/Rocky_Mountains#/media/File:Moraine_Lake_17092005.jpg", | ||
"link_target": "images" | ||
}, | ||
@@ -278,5 +280,7 @@ "start_date": { | ||
"media": { | ||
"url": "https://media.giphy.com/media/nEZkc87t9u68U/source.gif", | ||
"url": "https://media.giphy.com/media/Bzxeif0cR11ny/giphy.gif", | ||
"caption": "Groundhog Day clip", | ||
"credit": "USA Today" | ||
"credit": "USA Today", | ||
"link": "https://giphy.com/gifs/bored-bill-murray-groundhog-day-Bzxeif0cR11ny", | ||
"link_target": "images" | ||
}, | ||
@@ -288,3 +292,3 @@ "start_date": { | ||
"headline": "Image, GIF", | ||
"text": "To embed a GIF, just copy the URL endig in '.gif'." | ||
"text": "To embed a GIF, just copy the URL ending in '.gif'." | ||
}, | ||
@@ -310,5 +314,7 @@ "group": "Image" | ||
"media": { | ||
"url": "http://upload.wikimedia.org/wikipedia/commons/c/c2/Rocky_Mountains.jpeg", | ||
"caption": "Rocky Mountains", | ||
"credit": "Wikipedia Commons" | ||
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Moraine_Lake_17092005.jpg/960px-Moraine_Lake_17092005.jpg", | ||
"caption": "Valley of the Ten Peaks and Moraine Lake, Banff National Park, Canada.", | ||
"credit": "Wikipedia Commons", | ||
"link": "https://en.wikipedia.org/wiki/Rocky_Mountains#/media/File:Moraine_Lake_17092005.jpg", | ||
"link_target": "images" | ||
}, | ||
@@ -341,4 +347,5 @@ "start_date": { | ||
"url": "https://en.wikipedia.org/wiki/1997_International_Tennis_Championships_%E2%80%93_Doubles", | ||
"caption": "1997 Inrternational Tennis Championships - Doubles", | ||
"credit": "Wikipedia" | ||
"caption": "1997 International Tennis Championships - Doubles", | ||
"credit": "Wikipedia", | ||
"link": "https://en.wikipedia.org/wiki/1997_International_Tennis_Championships_%E2%80%93_Doubles" | ||
}, | ||
@@ -444,3 +451,3 @@ "start_date": { | ||
"media": { | ||
"url": "https://file-examples.com/wp-content/uploads/2017/10/file-sample_150kB.pdf", | ||
"url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", | ||
"credit": "file-examples.com" | ||
@@ -472,3 +479,3 @@ }, | ||
"media": { | ||
"url": "https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4", | ||
"url": "https://file-examples.com/storage/fef12739526267ac9a2b543/2017/04/file_example_MP4_480_1_5MG.mp4", | ||
"credit": "file-examples.com" | ||
@@ -488,3 +495,3 @@ }, | ||
"media": { | ||
"url": "https://file-examples-com.github.io/uploads/2020/03/file_example_WEBM_480_900KB.webm", | ||
"url": "https://file-examples.com/storage/fef12739526267ac9a2b543/2020/03/file_example_WEBM_480_900KB.webm", | ||
"credit": "file-examples.com" | ||
@@ -491,0 +498,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
337
3997915
38080