@knight-lab/timelinejs 3.8.18 → 3.8.21
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/{CHANGELOG → CHANGELOG.md} +67 -8
- package/RELEASING.md +2 -2
- package/dist/css/fonts/font.abril-droidsans.css +3 -3
- package/dist/css/fonts/font.amatic-andika.css +3 -3
- package/dist/css/fonts/font.bevan-pontanosans.css +2 -2
- package/dist/css/fonts/font.bitter-raleway.css +4 -4
- package/dist/css/fonts/font.clicker-garamond.css +2 -2
- package/dist/css/fonts/font.dancing-ledger.css +3 -3
- package/dist/css/fonts/font.default.css +4 -4
- package/dist/css/fonts/font.fjalla-average.css +2 -2
- package/dist/css/fonts/font.georgia-helvetica.css +6 -6
- package/dist/css/fonts/font.lustria-lato.css +3 -3
- package/dist/css/fonts/font.medula-lato.css +4 -4
- package/dist/css/fonts/font.oldstandard.css +2 -2
- package/dist/css/fonts/font.opensans-gentiumbook.css +6 -4
- package/dist/css/fonts/font.playfair-faunaone.css +5 -5
- package/dist/css/fonts/font.playfair.css +3 -3
- package/dist/css/fonts/font.pt.css +4 -4
- package/dist/css/fonts/font.roboto-megrim.css +8 -8
- package/dist/css/fonts/font.rufina-sintony.css +4 -4
- package/dist/css/fonts/font.ubuntu.css +3 -3
- package/dist/css/fonts/font.unicaone-vollkorn.css +3 -3
- package/dist/embed/old-index.html +128 -18
- package/dist/js/locale/nb.json +76 -0
- package/dist/js/locale/nn.json +76 -0
- package/dist/js/timeline-min.js +2 -10
- package/dist/js/timeline.js +2 -10
- package/dist/js/timeline.js.map +1 -1
- package/dist/timeline3.zip +0 -0
- package/jest.config.js +2 -0
- package/package.json +4 -3
- package/src/embed/old-index.html +128 -18
- package/src/js/__tests__/Timeline.test.js +28 -8
- package/src/js/core/Util.js +1 -1
- package/src/js/date/__tests__/TLDate.test.js +2 -2
- package/src/js/index.js +1 -1
- package/src/js/language/locale/nb.json +76 -0
- package/src/js/language/locale/nn.json +76 -0
- package/src/js/media/types/Audio.js +7 -11
- package/src/js/media/types/Image.js +3 -12
- package/src/js/media/types/PDF.js +2 -2
- package/src/js/media/types/Video.js +7 -10
- package/src/js/timeline/Timeline.js +6 -7
- package/src/js/timenav/TimeEra.js +0 -1
- package/src/less/fonts/font.georgia-helvetica.less +2 -2
- package/src/less/fonts/font.roboto-megrim.less +2 -2
- package/src/template/all-media-types.json +68 -38
- package/src/template/index.html +4 -1
- package/src/template/my-own-timeline.csv +14 -0
package/dist/timeline3.zip
CHANGED
|
Binary file
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knight-lab/timelinejs",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.21",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "TimelineJS v3: A Storytelling Timeline built in JavaScript, made by Northwestern University Knight Lab.",
|
|
6
6
|
"dependencies": {
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"stage_latest": "npm run dist && node tasks/stage.js latest",
|
|
57
57
|
"stage_dev": "npm run dist && node tasks/stage.js dev"
|
|
58
58
|
},
|
|
59
|
-
"contributors": [
|
|
59
|
+
"contributors": [
|
|
60
|
+
{
|
|
60
61
|
"name": "Zach Wise",
|
|
61
62
|
"email": "wise@northwestern.edu",
|
|
62
63
|
"url": "https://github.com/zachwise"
|
|
@@ -67,4 +68,4 @@
|
|
|
67
68
|
"url": "https://github.com/JoeGermuska"
|
|
68
69
|
}
|
|
69
70
|
]
|
|
70
|
-
}
|
|
71
|
+
}
|
package/src/embed/old-index.html
CHANGED
|
@@ -8,8 +8,21 @@
|
|
|
8
8
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
9
9
|
<meta name="apple-touch-fullscreen" content="yes">
|
|
10
10
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
|
11
|
-
|
|
12
|
-
<link rel="
|
|
11
|
+
<!-- FAVICONS -->
|
|
12
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.knightlab.com/libs/orangeline/latest/assets/favicons/apple-touch-icon.png">
|
|
13
|
+
<link rel="icon" type="image/png" href="https://cdn.knightlab.com/libs/orangeline/latest/assets/favicons/favicon-32x32.png" sizes="32x32">
|
|
14
|
+
<link rel="icon" type="image/png" href="https://cdn.knightlab.com/libs/orangeline/latest/assets/favicons/favicon-16x16.png" sizes="16x16">
|
|
15
|
+
<link rel="manifest" href="https://cdn.knightlab.com/libs/orangeline/latest/assets/favicons/manifest.json">
|
|
16
|
+
<link rel="mask-icon" href="https://cdn.knightlab.com/libs/orangeline/latest/assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
|
17
|
+
<!--
|
|
18
|
+
If we want to support loading different versions of timeline like we used to,
|
|
19
|
+
this isn't good enough. We used that to get the non-minimized version, for debugging,
|
|
20
|
+
but now maybe sourcemaps are a better alternative?
|
|
21
|
+
-->
|
|
22
|
+
<script id='timeline-script-tag' type="text/javascript" src="https://cdn.knightlab.com/libs/timeline3/3.8.1/js/timeline.js"></script>
|
|
23
|
+
<link rel="stylesheet" href="https://cdn.knightlab.com/libs/timeline3/3.8.1/css/timeline.css">
|
|
24
|
+
<!-- Google Analytics should be handled by Timeline -->
|
|
25
|
+
|
|
13
26
|
<base target="_blank">
|
|
14
27
|
|
|
15
28
|
<!-- Style-->
|
|
@@ -36,25 +49,122 @@
|
|
|
36
49
|
<div id="timeline-embed"></div>
|
|
37
50
|
<!-- Override -->
|
|
38
51
|
<script type="text/javascript">
|
|
39
|
-
|
|
52
|
+
function ready(fn) {
|
|
53
|
+
if (document.readyState != 'loading') {
|
|
54
|
+
fn();
|
|
55
|
+
} else {
|
|
56
|
+
document.addEventListener('DOMContentLoaded', fn);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setPageLanguage() {
|
|
61
|
+
var lang = window.location.href.match(/&lang=([a-zA-Z]*?)&?/);
|
|
62
|
+
|
|
63
|
+
if (lang) {
|
|
64
|
+
document.getElementsByTagName('html')[0].setAttribute('lang', lang[1]);
|
|
65
|
+
}
|
|
40
66
|
|
|
41
|
-
if (lang) {
|
|
42
|
-
document.getElementsByTagName('html')[0].setAttribute('lang', lang[1]);
|
|
43
67
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
68
|
+
|
|
69
|
+
function computeEmbedPath() {
|
|
70
|
+
var trim_point = window.location.href.indexOf('embed/index.html');
|
|
71
|
+
if (trim_point > 0) {
|
|
72
|
+
return window.location.href.substring(0, trim_point); // supports https access via https://s3.amazonaws.com/cdn.knightlab.com/libs/timeline/latest/embed/index.html
|
|
73
|
+
}
|
|
74
|
+
return "https://cdn.knightlab.com/libs/timeline3/latest/";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function addOembedTag() {
|
|
78
|
+
// it's not clear that any tools execute this JS to get the URL, but maybe?
|
|
79
|
+
var oembed_link = document.createElement('link');
|
|
80
|
+
oembed_link['rel'] = 'alternate';
|
|
81
|
+
oembed_link['type'] = 'application/json+oembed';
|
|
82
|
+
oembed_link['href'] = 'https://oembed.knightlab.com/timeline/?url=' + encodeURIComponent(window.location.href);
|
|
83
|
+
document.head.appendChild(oembed_link);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function createEmbedDiv(containerId, width, height) {
|
|
87
|
+
|
|
88
|
+
if (typeof(width) != 'string' && typeof(width) != 'number') {
|
|
89
|
+
width = '100%'
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (typeof(height) != 'string' && typeof(height) != 'number') {
|
|
93
|
+
height = '100%'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// default containerId would be 'timeline-embed'
|
|
97
|
+
t = document.createElement('div');
|
|
98
|
+
t.style.position = 'relative';
|
|
99
|
+
|
|
100
|
+
te = document.getElementById(containerId);
|
|
101
|
+
te.appendChild(t);
|
|
102
|
+
te.classList.add("tl-timeline-embed");
|
|
103
|
+
|
|
104
|
+
if (width.toString().match("%")) {
|
|
105
|
+
te.style.width = width.split("%")[0] + "%";
|
|
106
|
+
} else {
|
|
107
|
+
width = Number(width) - 2;
|
|
108
|
+
te.style.width = (width) + 'px';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (height.toString().match("%")) {
|
|
112
|
+
te.style.height = height;
|
|
113
|
+
te.classList.add("tl-timeline-full-embed");
|
|
114
|
+
} else if (width.toString().match("%")) {
|
|
115
|
+
te.classList.add("tl-timeline-full-embed");
|
|
116
|
+
height = Number(height) - 16;
|
|
117
|
+
te.style.height = (height) + 'px';
|
|
118
|
+
} else {
|
|
119
|
+
height = height - 16;
|
|
120
|
+
te.style.height = (height) + 'px';
|
|
121
|
+
}
|
|
49
122
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Parse all URL parameters as possible Timeline options.
|
|
126
|
+
* Timeline itself will use or ignore these based on actual
|
|
127
|
+
* supported options.
|
|
128
|
+
*/
|
|
129
|
+
function optionsFromUrlParams() {
|
|
130
|
+
var param_str = window.location.href.slice(window.location.href.indexOf('?') + 1);
|
|
131
|
+
|
|
132
|
+
if (param_str.match('#')) {
|
|
133
|
+
param_str = param_str.split('#')[0];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
param_str = param_str.split('&');
|
|
137
|
+
|
|
138
|
+
var url_vars = {}
|
|
139
|
+
|
|
140
|
+
for (var i = 0; i < param_str.length; i++) {
|
|
141
|
+
var uv = param_str[i].split('=');
|
|
142
|
+
url_vars[uv[0]] = uv[1];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return url_vars;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
ready(function() {
|
|
149
|
+
setPageLanguage();
|
|
150
|
+
var embed_path = computeEmbedPath();
|
|
151
|
+
addOembedTag();
|
|
152
|
+
|
|
153
|
+
var options = optionsFromUrlParams();
|
|
154
|
+
createEmbedDiv('timeline-embed', options.width, options.height);
|
|
155
|
+
// ga_property_id is not something we let users override
|
|
156
|
+
options.ga_property_id = 'UA-27829802-4';
|
|
157
|
+
if (typeof(options.source) == 'undefined') {
|
|
158
|
+
options.source = '1xuY4upIooEeszZ_lCmeNx24eSFWe0rHe9ZdqH2xqVNk' // women in computing
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
options.soundcite = true;
|
|
162
|
+
|
|
163
|
+
window.options = options
|
|
164
|
+
window.timeline = new TL.Timeline('timeline-embed', options.source, options)
|
|
165
|
+
|
|
166
|
+
})
|
|
55
167
|
</script>
|
|
56
|
-
<script type="text/javascript" src="https://cdn.knightlab.com/libs/timeline3/3.6.6/js/timeline-embed-cdn.js"></script>
|
|
57
|
-
<!-- END Timeline Embed-->
|
|
58
168
|
</body>
|
|
59
169
|
|
|
60
|
-
</html>
|
|
170
|
+
</html>
|
|
@@ -49,16 +49,36 @@ beforeEach(() => {
|
|
|
49
49
|
document.body.innerHTML =
|
|
50
50
|
'<div id="timeline-embed"></div>';
|
|
51
51
|
})
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
|
|
53
|
+
// Full timeline configuration is asynchronous, so these tests need
|
|
54
|
+
// to be deferred until the timeline is in a "ready" state.
|
|
55
|
+
// However, binding the promise resolution to timeline "on ready"
|
|
56
|
+
// results in test failures because of timeout, even when passing
|
|
57
|
+
// a longer timeout as the third argument to test (up to 10000ms tried)
|
|
58
|
+
// however, when they fire on dataloaded, they pass. This doesn't
|
|
59
|
+
// seem satisfying, but better than ignoring failed test results
|
|
60
|
+
// since passing is still passing.
|
|
61
|
+
test("Ensure options is optional", async() => {
|
|
62
|
+
let timeline = await new Promise((resolve) => {
|
|
63
|
+
let tl = new Timeline('timeline-embed', TEST_CONFIG)
|
|
64
|
+
tl.on('dataloaded', () => resolve(tl))
|
|
65
|
+
});
|
|
66
|
+
// these tests will fail until we figure out how to deal with
|
|
67
|
+
// the fact that the config creation/setting is async
|
|
68
|
+
// tried some things waiting for
|
|
69
|
+
expect(timeline.config).toBeDefined()
|
|
55
70
|
})
|
|
56
71
|
|
|
57
|
-
test("test remove", () => {
|
|
58
|
-
let timeline = new
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
test("test remove", async() => {
|
|
73
|
+
let timeline = await new Promise((resolve) => {
|
|
74
|
+
let tl = new Timeline('timeline-embed',
|
|
75
|
+
TEST_CONFIG, { // i don't think this is actually used?
|
|
76
|
+
script_path: 'http://localhost:1234/'
|
|
77
|
+
});
|
|
78
|
+
tl.on('dataloaded', () => resolve(tl))
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
expect(timeline.config).toBeDefined()
|
|
62
82
|
expect(timeline.config.events.length).toBe(2)
|
|
63
83
|
expect(timeline.config.event_dict['vimeo']).toBeTruthy()
|
|
64
84
|
timeline.removeId('vimeo')
|
package/src/js/core/Util.js
CHANGED
|
@@ -521,7 +521,7 @@ export function linkify(text, targets, is_touch) {
|
|
|
521
521
|
* as a direct image link. Some services have predictable transformations we can use rather than explain to people
|
|
522
522
|
* this subtlety.
|
|
523
523
|
*/
|
|
524
|
-
export function
|
|
524
|
+
export function transformMediaURL(url) {
|
|
525
525
|
return url.replace(/(.*)www.dropbox.com\/(.*)/, '$1dl.dropboxusercontent.com/$2')
|
|
526
526
|
}
|
|
527
527
|
|
|
@@ -41,7 +41,7 @@ test("before and after", () => {
|
|
|
41
41
|
|
|
42
42
|
test("small dates are human so time is UNIX Epoch based", () => {
|
|
43
43
|
var smalldate = makeDate({ year: 2015 });
|
|
44
|
-
expect(smalldate.getTime()).toBe(
|
|
44
|
+
expect(smalldate.getTime()).toBe(1420070400000)
|
|
45
45
|
})
|
|
46
46
|
|
|
47
47
|
test("big dates are cosmological", () => {
|
|
@@ -192,7 +192,7 @@ test("test TLDate.floor", () => {
|
|
|
192
192
|
|
|
193
193
|
var early_ce = makeDate(-59149708181438); // 8/14/95 (95 not 1995)
|
|
194
194
|
var floored = early_ce.floor('decade');
|
|
195
|
-
expect(floored.getTime()).toBe(-
|
|
195
|
+
expect(floored.getTime()).toBe(-59326992000000) // 'Early floored dates should not go into the 20th Century')
|
|
196
196
|
|
|
197
197
|
var age_scale = makeDate({ year: 1500000 });
|
|
198
198
|
expect(() => {
|
package/src/js/index.js
CHANGED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lang": "nb",
|
|
3
|
+
"date": {
|
|
4
|
+
"month_abbr": [
|
|
5
|
+
"Jan.",
|
|
6
|
+
"Feb.",
|
|
7
|
+
"Mars",
|
|
8
|
+
"Apr.",
|
|
9
|
+
"Mai",
|
|
10
|
+
"Juni",
|
|
11
|
+
"Juli",
|
|
12
|
+
"Aug.",
|
|
13
|
+
"Sep.",
|
|
14
|
+
"Okt.",
|
|
15
|
+
"Nov.",
|
|
16
|
+
"Des."
|
|
17
|
+
],
|
|
18
|
+
"day_abbr": [
|
|
19
|
+
"Søn.",
|
|
20
|
+
"Man.",
|
|
21
|
+
"Tir.",
|
|
22
|
+
"Ons.",
|
|
23
|
+
"Tor.",
|
|
24
|
+
"Fre.",
|
|
25
|
+
"Lør."
|
|
26
|
+
],
|
|
27
|
+
"day": [
|
|
28
|
+
"Søndag",
|
|
29
|
+
"Mandag",
|
|
30
|
+
"Tirsdag",
|
|
31
|
+
"Onsdag",
|
|
32
|
+
"Torsdag",
|
|
33
|
+
"Fredag",
|
|
34
|
+
"Lørdag"
|
|
35
|
+
],
|
|
36
|
+
"month": [
|
|
37
|
+
"Januar",
|
|
38
|
+
"Februar",
|
|
39
|
+
"Mars",
|
|
40
|
+
"April",
|
|
41
|
+
"Mai",
|
|
42
|
+
"Juni",
|
|
43
|
+
"Juli",
|
|
44
|
+
"August",
|
|
45
|
+
"September",
|
|
46
|
+
"Oktober",
|
|
47
|
+
"November",
|
|
48
|
+
"Desember"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"api": {
|
|
52
|
+
"wikipedia": "no"
|
|
53
|
+
},
|
|
54
|
+
"messages": {
|
|
55
|
+
"loading": "Laster",
|
|
56
|
+
"contract_timeline": "Krymp tidslinje",
|
|
57
|
+
"return_to_title": "Tilbake til tittel",
|
|
58
|
+
"wikipedia": "Fra Wikipedia, den frie encyklopedi",
|
|
59
|
+
"loading_content": "Laster innhold",
|
|
60
|
+
"expand_timeline": "Utvid tidslinje",
|
|
61
|
+
"loading_timeline": "Laster tidslinje... ",
|
|
62
|
+
"swipe_to_navigate": "Sveip for å navigere<br><span class='tl-button'>OK</span>"
|
|
63
|
+
},
|
|
64
|
+
"dateformats": {
|
|
65
|
+
"full_long": "dddd',' d. mmm',' yyyy 'kl.' HH:MM",
|
|
66
|
+
"full_short": "d. mmm",
|
|
67
|
+
"full": "d. mmmm',' yyyy",
|
|
68
|
+
"month_short": "mmm",
|
|
69
|
+
"time_no_seconds_small_date": "HH:MM'<br/><small>'d. mmmm',' yyyy'</small>'",
|
|
70
|
+
"month": "mmmm yyyy",
|
|
71
|
+
"time_no_seconds_short": "HH:MM",
|
|
72
|
+
"time_short": "HH:MM:ss",
|
|
73
|
+
"year": "yyyy",
|
|
74
|
+
"full_long_small_date": "HH:MM'<br/><small>'dddd',' d. mmm',' yyyy'</small>'"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lang": "nn",
|
|
3
|
+
"date": {
|
|
4
|
+
"month_abbr": [
|
|
5
|
+
"Jan.",
|
|
6
|
+
"Feb.",
|
|
7
|
+
"Mars",
|
|
8
|
+
"Apr.",
|
|
9
|
+
"Mai",
|
|
10
|
+
"Juni",
|
|
11
|
+
"Juli",
|
|
12
|
+
"Aug.",
|
|
13
|
+
"Sep.",
|
|
14
|
+
"Okt.",
|
|
15
|
+
"Nov.",
|
|
16
|
+
"Des."
|
|
17
|
+
],
|
|
18
|
+
"day_abbr": [
|
|
19
|
+
"Søn.",
|
|
20
|
+
"Mån.",
|
|
21
|
+
"Tys.",
|
|
22
|
+
"Ons.",
|
|
23
|
+
"Tor.",
|
|
24
|
+
"Fre.",
|
|
25
|
+
"Lau."
|
|
26
|
+
],
|
|
27
|
+
"day": [
|
|
28
|
+
"Søndag",
|
|
29
|
+
"Måndag",
|
|
30
|
+
"Tysdag",
|
|
31
|
+
"Onsdag",
|
|
32
|
+
"Torsdag",
|
|
33
|
+
"Fredag",
|
|
34
|
+
"Laurdag"
|
|
35
|
+
],
|
|
36
|
+
"month": [
|
|
37
|
+
"Januar",
|
|
38
|
+
"Februar",
|
|
39
|
+
"Mars",
|
|
40
|
+
"April",
|
|
41
|
+
"Mai",
|
|
42
|
+
"Juni",
|
|
43
|
+
"Juli",
|
|
44
|
+
"August",
|
|
45
|
+
"September",
|
|
46
|
+
"Oktober",
|
|
47
|
+
"November",
|
|
48
|
+
"Desember"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"api": {
|
|
52
|
+
"wikipedia": "nn"
|
|
53
|
+
},
|
|
54
|
+
"messages": {
|
|
55
|
+
"loading": "Lastar",
|
|
56
|
+
"contract_timeline": "Krymp tidslinje",
|
|
57
|
+
"return_to_title": "Tilbake til tittel",
|
|
58
|
+
"wikipedia": "Frå Wikipedia, det frie oppslagsverket",
|
|
59
|
+
"loading_content": "Lastar innhold",
|
|
60
|
+
"expand_timeline": "Utvid tidslinje",
|
|
61
|
+
"loading_timeline": "Lastar tidslinje... ",
|
|
62
|
+
"swipe_to_navigate": "Sveip for å navigere<br><span class='tl-button'>OK</span>"
|
|
63
|
+
},
|
|
64
|
+
"dateformats": {
|
|
65
|
+
"full_long": "dddd',' d. mmm',' yyyy 'kl.' HH:MM",
|
|
66
|
+
"full_short": "d. mmm",
|
|
67
|
+
"full": "d. mmmm',' yyyy",
|
|
68
|
+
"month_short": "mmm",
|
|
69
|
+
"time_no_seconds_small_date": "HH:MM'<br/><small>'d. mmmm',' yyyy'</small>'",
|
|
70
|
+
"month": "mmmm yyyy",
|
|
71
|
+
"time_no_seconds_short": "HH:MM",
|
|
72
|
+
"time_short": "HH:MM:ss",
|
|
73
|
+
"year": "yyyy",
|
|
74
|
+
"full_long_small_date": "HH:MM'<br/><small>'dddd',' d. mmm',' yyyy'</small>'"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Media } from "../Media";
|
|
2
|
+
import { transformMediaURL } from "../../core/Util";
|
|
2
3
|
import * as Browser from "../../core/Browser"
|
|
3
4
|
import { trace } from "../../core/Util";
|
|
4
5
|
|
|
@@ -17,19 +18,14 @@ export default class Audio extends Media {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
createMedia() {
|
|
21
|
+
//Transform URL for Dropbox
|
|
22
|
+
var url = transformMediaURL(this.data.url),
|
|
23
|
+
self = this;
|
|
24
|
+
|
|
20
25
|
var self = this,
|
|
21
26
|
audio_class = "tl-media-item tl-media-audio tl-media-shadow";
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
if (this.data.link) {
|
|
25
|
-
this._el.content_link = this.domCreate("a", "", this._el.content);
|
|
26
|
-
this._el.content_link.href = this.data.link;
|
|
27
|
-
this._el.content_link.target = "_blank";
|
|
28
|
-
this._el.content_link.setAttribute('rel', 'noopener');
|
|
29
|
-
this._el.content_item = this.domCreate("audio", audio_class, this._el.content_link);
|
|
30
|
-
} else {
|
|
31
|
-
this._el.content_item = this.domCreate("audio", audio_class, this._el.content);
|
|
32
|
-
}
|
|
28
|
+
this._el.content_item = this.domCreate("audio", audio_class, this._el.content);
|
|
33
29
|
|
|
34
30
|
this._el.content_item.controls = true;
|
|
35
31
|
this._el.source_item = this.domCreate("source", "", this._el.content_item);
|
|
@@ -39,7 +35,7 @@ export default class Audio extends Media {
|
|
|
39
35
|
self.onMediaLoaded();
|
|
40
36
|
});
|
|
41
37
|
|
|
42
|
-
this._el.source_item.src =
|
|
38
|
+
this._el.source_item.src = url;
|
|
43
39
|
this._el.source_item.type = this._getType(this.data.url, this.data.mediatype.match_str);
|
|
44
40
|
this._el.content_item.innerHTML += "Your browser doesn't support HTML5 audio with " + this._el.source_item.type;
|
|
45
41
|
this.player_element = this._el.content_item
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Media } from "../Media"
|
|
2
|
-
import { unhtmlify,
|
|
2
|
+
import { unhtmlify, transformMediaURL } from "../../core/Util"
|
|
3
3
|
import * as Browser from "../../core/Browser"
|
|
4
4
|
|
|
5
5
|
export default class Image extends Media {
|
|
@@ -25,16 +25,7 @@ export default class Image extends Media {
|
|
|
25
25
|
image_class = "tl-media-item tl-media-image"
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
if (this.data.link) {
|
|
30
|
-
this._el.content_link = this.domCreate("a", "", this._el.content);
|
|
31
|
-
this._el.content_link.href = this.data.link;
|
|
32
|
-
this._el.content_link.target = "_blank";
|
|
33
|
-
this._el.content_link.setAttribute('rel', 'noopener');
|
|
34
|
-
this._el.content_item = this.domCreate("img", image_class, this._el.content_link);
|
|
35
|
-
} else {
|
|
36
|
-
this._el.content_item = this.domCreate("img", image_class, this._el.content);
|
|
37
|
-
}
|
|
28
|
+
this._el.content_item = this.domCreate("img", image_class, this._el.content);
|
|
38
29
|
|
|
39
30
|
if (this.data.alt) {
|
|
40
31
|
this._el.content_item.alt = this.data.alt;
|
|
@@ -57,7 +48,7 @@ export default class Image extends Media {
|
|
|
57
48
|
}
|
|
58
49
|
|
|
59
50
|
getImageURL(w, h) {
|
|
60
|
-
return
|
|
51
|
+
return transformMediaURL(this.data.url);
|
|
61
52
|
}
|
|
62
53
|
|
|
63
54
|
_updateMediaDisplay(layout) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Media } from "../Media";
|
|
2
|
-
import {
|
|
2
|
+
import { transformMediaURL } from "../../core/Util";
|
|
3
3
|
import * as Browser from "../../core/Browser"
|
|
4
4
|
|
|
5
5
|
export default class PDF extends Media {
|
|
6
6
|
|
|
7
7
|
_loadMedia() {
|
|
8
|
-
var url =
|
|
8
|
+
var url = transformMediaURL(this.data.url),
|
|
9
9
|
self = this;
|
|
10
10
|
|
|
11
11
|
// Create Dom element
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Media } from "../Media";
|
|
2
2
|
import * as Browser from "../../core/Browser"
|
|
3
|
+
import { transformMediaURL } from "../../core/Util";
|
|
3
4
|
|
|
4
5
|
export default class Video extends Media {
|
|
5
6
|
_loadMedia() {
|
|
@@ -16,19 +17,15 @@ export default class Video extends Media {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
createMedia() {
|
|
20
|
+
//Transform URL for Dropbox
|
|
21
|
+
var url = transformMediaURL(this.data.url),
|
|
22
|
+
self = this;
|
|
23
|
+
|
|
19
24
|
var self = this,
|
|
20
25
|
video_class = "tl-media-item tl-media-video tl-media-shadow";
|
|
21
26
|
|
|
22
27
|
// Link
|
|
23
|
-
|
|
24
|
-
this._el.content_link = this.domCreate("a", "", this._el.content);
|
|
25
|
-
this._el.content_link.href = this.data.link;
|
|
26
|
-
this._el.content_link.target = "_blank";
|
|
27
|
-
this._el.content_link.setAttribute('rel', 'noopener')
|
|
28
|
-
this._el.content_item = this.domCreate("video", video_class, this._el.content_link);
|
|
29
|
-
} else {
|
|
30
|
-
this._el.content_item = this.domCreate("video", video_class, this._el.content);
|
|
31
|
-
}
|
|
28
|
+
this._el.content_item = this.domCreate("video", video_class, this._el.content);
|
|
32
29
|
|
|
33
30
|
this._el.content_item.controls = true;
|
|
34
31
|
this._el.source_item = this.domCreate("source", "", this._el.content_item);
|
|
@@ -38,7 +35,7 @@ export default class Video extends Media {
|
|
|
38
35
|
self.onMediaLoaded();
|
|
39
36
|
});
|
|
40
37
|
|
|
41
|
-
this._el.source_item.src =
|
|
38
|
+
this._el.source_item.src = url;
|
|
42
39
|
this._el.source_item.type = this._getType(this.data.url, this.data.mediatype.match_str);
|
|
43
40
|
this._el.content_item.innerHTML += "Your browser doesn't support HTML5 video with " + this._el.source_item.type;
|
|
44
41
|
this.player_element = this._el.content_item
|
|
@@ -770,6 +770,11 @@ class Timeline {
|
|
|
770
770
|
if (this._loaded.storyslider && this._loaded.timenav) {
|
|
771
771
|
this.fire("loaded", this.config);
|
|
772
772
|
// Go to proper slide
|
|
773
|
+
if (isTrue(this.options.start_at_end) || this.options.start_at_slide > this.config.events.length) {
|
|
774
|
+
this.goToEnd();
|
|
775
|
+
} else {
|
|
776
|
+
this.goTo(this.options.start_at_slide);
|
|
777
|
+
}
|
|
773
778
|
if (this.options.hash_bookmark) {
|
|
774
779
|
if (window.location.hash != "") {
|
|
775
780
|
this.goToId(window.location.hash.replace("#event-", ""));
|
|
@@ -782,12 +787,6 @@ class Timeline {
|
|
|
782
787
|
the_timeline.goToId(window.location.hash.replace("#event-", ""));
|
|
783
788
|
}
|
|
784
789
|
}, false);
|
|
785
|
-
} else {
|
|
786
|
-
if (isTrue(this.options.start_at_end) || this.options.start_at_slide > this.config.events.length) {
|
|
787
|
-
this.goToEnd();
|
|
788
|
-
} else {
|
|
789
|
-
this.goTo(this.options.start_at_slide);
|
|
790
|
-
}
|
|
791
790
|
}
|
|
792
791
|
|
|
793
792
|
}
|
|
@@ -993,4 +992,4 @@ class Timeline {
|
|
|
993
992
|
|
|
994
993
|
classMixin(Timeline, I18NMixins, Events)
|
|
995
994
|
|
|
996
|
-
export { Timeline }
|
|
995
|
+
export { Timeline }
|
|
@@ -5,7 +5,6 @@ import * as Browser from "../core/Browser"
|
|
|
5
5
|
import { removeClass } from "../dom/DOMUtil";
|
|
6
6
|
import { easeInSpline } from "../animation/Ease";
|
|
7
7
|
import * as DOM from "../dom/DOM"
|
|
8
|
-
import { head } from "lodash";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* A TimeEra represents a span of time marked along the edge of the time
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// Headings
|
|
26
26
|
@font-size-headings: 42px;
|
|
27
27
|
@font-headings-lineheight: @font-size-headings;
|
|
28
|
-
@font-headings-text-transform:
|
|
28
|
+
@font-headings-text-transform: none;
|
|
29
29
|
@font-size-headings-small: 24px;
|
|
30
30
|
@font-headings-weight: 800;
|
|
31
31
|
@font-size-headline-title: 46px;
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
// Navigation
|
|
37
37
|
@font-navigation-text-transform: none;
|
|
38
38
|
|
|
39
|
-
@import "_font.base.less";
|
|
39
|
+
@import "_font.base.less";
|
|
@@ -29,7 +29,7 @@ https://www.google.com/fonts/specimen/Megrim
|
|
|
29
29
|
// Headings
|
|
30
30
|
@font-size-headings: 46px;
|
|
31
31
|
@font-headings-lineheight: @font-size-headings;
|
|
32
|
-
@font-headings-text-transform:
|
|
32
|
+
@font-headings-text-transform: none;
|
|
33
33
|
@font-size-headings-small: 24px;
|
|
34
34
|
@font-headings-weight: 400;
|
|
35
35
|
@font-size-headline-title: 58px;
|
|
@@ -40,4 +40,4 @@ https://www.google.com/fonts/specimen/Megrim
|
|
|
40
40
|
// Navigation
|
|
41
41
|
@font-navigation-text-transform: none;
|
|
42
42
|
|
|
43
|
-
@import "_font.base.less";
|
|
43
|
+
@import "_font.base.less";
|