ghost 4.29.0 → 4.30.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/core/boot.js +3 -5
- package/core/built/assets/{ghost-dark-b93e2e2dcc4c0e1efa981314f45f8cda.css → ghost-dark-1594d07a0716e0253a78234c8e42d765.css} +1 -1
- package/core/built/assets/{ghost.min-ba8ef5d16b8a6f9072564a368154df72.js → ghost.min-884660873d56fcc3d2a3b9fe94c9f022.js} +3 -3
- package/core/built/assets/{ghost.min-578a1b7e68d1f7ae0003ebe421b7c182.css → ghost.min-c21fea11c3f431994a8ee7c47a8ed145.css} +1 -1
- package/core/built/assets/icons/file-upload.svg +1 -1
- package/core/built/assets/{vendor.min-c450359ad46217cd48c00b277ae54a09.js → vendor.min-a2fd1e62ce6da8911fee8e812d8c6ceb.js} +62 -49
- package/core/frontend/services/theme-engine/i18n/i18n.js +11 -12
- package/core/frontend/services/theme-engine/i18n/index.js +1 -2
- package/core/frontend/services/theme-engine/i18n/theme-i18n.js +5 -4
- package/core/frontend/src/cards/css/audio.css +4 -2
- package/core/frontend/src/cards/css/bookmark.css +3 -2
- package/core/frontend/src/cards/css/button.css +4 -3
- package/core/frontend/src/cards/css/callout.css +4 -4
- package/core/frontend/src/cards/css/file.css +100 -47
- package/core/frontend/src/cards/css/nft.css +1 -7
- package/core/frontend/src/cards/css/product.css +24 -23
- package/core/frontend/src/cards/css/toggle.css +31 -22
- package/core/frontend/src/cards/css/video.css +103 -44
- package/core/frontend/src/cards/js/video.js +81 -13
- package/core/frontend/web/middleware/error-handler.js +2 -2
- package/core/frontend/web/site.js +2 -1
- package/core/server/api/canary/oembed.js +1 -2
- package/core/server/data/db/state-manager.js +5 -8
- package/core/server/lib/image/cached-image-size-from-url.js +3 -4
- package/core/server/lib/image/image-utils.js +2 -2
- package/core/server/lib/image/index.js +1 -2
- package/core/server/run-update-check.js +1 -13
- package/core/server/services/email-analytics/index.js +2 -4
- package/core/server/services/email-analytics/jobs/fetch-latest.js +2 -21
- package/core/server/services/integrations/integrations-service.js +2 -2
- package/core/server/services/invites/index.js +0 -2
- package/core/server/services/invites/invites.js +3 -3
- package/core/server/services/jobs/job-service.js +1 -1
- package/core/server/services/members/api.js +0 -1
- package/core/server/services/members/config.js +4 -7
- package/core/server/services/members/service.js +1 -4
- package/core/server/services/notifications/index.js +0 -2
- package/core/server/services/notifications/notifications.js +4 -5
- package/core/server/services/stripe/index.js +0 -2
- package/core/server/services/twitter-embed.js +2 -1
- package/core/server/web/admin/app.js +4 -2
- package/core/server/web/admin/views/default-prod.html +4 -4
- package/core/server/web/admin/views/default.html +4 -4
- package/core/server/web/api/app.js +3 -2
- package/core/server/web/api/canary/admin/app.js +4 -2
- package/core/server/web/api/canary/content/app.js +4 -2
- package/core/server/web/api/v2/admin/app.js +4 -2
- package/core/server/web/api/v2/content/app.js +4 -2
- package/core/server/web/api/v3/admin/app.js +4 -2
- package/core/server/web/api/v3/content/app.js +4 -2
- package/core/server/web/members/app.js +6 -4
- package/core/server/web/shared/middleware/index.js +0 -4
- package/core/shared/labs.js +2 -2
- package/package.json +17 -16
- package/yarn.lock +82 -65
- package/core/server/web/shared/middleware/error-handler.js +0 -224
|
@@ -1,55 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
.kg-video-card {
|
|
3
|
+
position: relative;
|
|
4
|
+
--seek-before-width: 0%;
|
|
5
|
+
--volume-before-width: 100%;
|
|
6
|
+
--buffered-width: 0%;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
.kg-video-card video {
|
|
10
|
+
display: block;
|
|
2
11
|
max-width: 100%;
|
|
3
12
|
height: auto;
|
|
4
13
|
}
|
|
5
14
|
|
|
6
|
-
.kg-video-
|
|
15
|
+
.kg-video-container {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.kg-video-overlay {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
left: 0;
|
|
7
28
|
display: flex;
|
|
8
29
|
justify-content: center;
|
|
9
30
|
align-items: center;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
background: var(--ghost-accent-color);
|
|
14
|
-
object-fit: cover;
|
|
15
|
-
aspect-ratio: 1/1;
|
|
16
|
-
border-radius: 3px;
|
|
31
|
+
background-image: linear-gradient(180deg,rgba(0,0,0,0.3) 0,transparent 70%,transparent 100%);
|
|
32
|
+
z-index: 999;
|
|
33
|
+
transition: opacity .2s ease-in-out;
|
|
17
34
|
}
|
|
18
35
|
|
|
19
|
-
.kg-video-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
.kg-video-large-play-icon {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
width: 72px;
|
|
41
|
+
height: 72px;
|
|
42
|
+
padding: 0;
|
|
43
|
+
background: rgba(0, 0, 0, 0.5);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
transition: opacity .2s ease-in-out;
|
|
23
46
|
}
|
|
24
47
|
|
|
25
|
-
.kg-video-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
.kg-video-large-play-icon svg {
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: auto;
|
|
51
|
+
margin-left: 2px;
|
|
52
|
+
fill: #fff;
|
|
30
53
|
}
|
|
31
54
|
|
|
32
|
-
.kg-video-
|
|
55
|
+
.kg-video-player-container {
|
|
56
|
+
position: absolute;
|
|
57
|
+
bottom: 0;
|
|
33
58
|
width: 100%;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
font-weight: 700;
|
|
40
|
-
background: transparent;
|
|
59
|
+
height: 80px;
|
|
60
|
+
background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.5));
|
|
61
|
+
z-index: 999;
|
|
62
|
+
transition: opacity .2s ease-in-out;
|
|
63
|
+
|
|
41
64
|
}
|
|
42
65
|
|
|
43
66
|
.kg-video-player {
|
|
67
|
+
position: absolute;
|
|
68
|
+
bottom: 0;
|
|
44
69
|
display: flex;
|
|
45
|
-
flex-grow: 1;
|
|
46
70
|
align-items: center;
|
|
47
|
-
|
|
71
|
+
width: 100%;
|
|
72
|
+
z-index: 9999;
|
|
73
|
+
padding: 12px 16px;
|
|
48
74
|
}
|
|
49
75
|
|
|
50
76
|
.kg-video-current-time {
|
|
51
77
|
min-width: 38px;
|
|
52
78
|
padding: 0 4px;
|
|
79
|
+
color: #fff;
|
|
53
80
|
font-family: inherit;
|
|
54
81
|
font-size: .85em;
|
|
55
82
|
font-weight: 500;
|
|
@@ -58,7 +85,7 @@
|
|
|
58
85
|
}
|
|
59
86
|
|
|
60
87
|
.kg-video-time {
|
|
61
|
-
color:
|
|
88
|
+
color: rgba(255, 255, 255, 0.6);
|
|
62
89
|
font-family: inherit;
|
|
63
90
|
font-size: .85em;
|
|
64
91
|
font-weight: 500;
|
|
@@ -73,7 +100,6 @@
|
|
|
73
100
|
.kg-video-play-icon,
|
|
74
101
|
.kg-video-pause-icon {
|
|
75
102
|
position: relative;
|
|
76
|
-
bottom: 1px;
|
|
77
103
|
padding: 0px 4px 0 0;
|
|
78
104
|
font-size: 0;
|
|
79
105
|
background: transparent;
|
|
@@ -83,11 +109,17 @@
|
|
|
83
109
|
display: none !important;
|
|
84
110
|
}
|
|
85
111
|
|
|
112
|
+
.kg-video-hide-animated {
|
|
113
|
+
opacity: 0 !important;
|
|
114
|
+
transition: opacity .2s ease-in-out;
|
|
115
|
+
cursor: initial;
|
|
116
|
+
}
|
|
117
|
+
|
|
86
118
|
.kg-video-play-icon svg,
|
|
87
119
|
.kg-video-pause-icon svg {
|
|
88
120
|
width: 14px;
|
|
89
121
|
height: 14px;
|
|
90
|
-
fill:
|
|
122
|
+
fill: #fff;
|
|
91
123
|
}
|
|
92
124
|
|
|
93
125
|
.kg-video-seek-slider {
|
|
@@ -95,9 +127,16 @@
|
|
|
95
127
|
margin: 0 4px;
|
|
96
128
|
}
|
|
97
129
|
|
|
130
|
+
@media (max-width: 520px) {
|
|
131
|
+
.kg-video-seek-slider {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
98
136
|
.kg-video-playback-rate {
|
|
99
137
|
min-width: 37px;
|
|
100
138
|
padding: 0 4px;
|
|
139
|
+
color: #fff;
|
|
101
140
|
font-family: inherit;
|
|
102
141
|
font-size: .85em;
|
|
103
142
|
font-weight: 600;
|
|
@@ -107,26 +146,45 @@
|
|
|
107
146
|
white-space: nowrap;
|
|
108
147
|
}
|
|
109
148
|
|
|
149
|
+
@media (max-width: 520px) {
|
|
150
|
+
.kg-video-playback-rate {
|
|
151
|
+
padding-left: 8px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
110
155
|
.kg-video-mute-icon,
|
|
111
156
|
.kg-video-unmute-icon {
|
|
112
157
|
position: relative;
|
|
113
|
-
bottom: 1px;
|
|
158
|
+
bottom: -1px;
|
|
114
159
|
padding: 0 4px;
|
|
115
160
|
font-size: 0;
|
|
116
161
|
background: transparent;
|
|
117
162
|
}
|
|
118
163
|
|
|
164
|
+
@media (max-width: 520px) {
|
|
165
|
+
.kg-video-mute-icon,
|
|
166
|
+
.kg-video-unmute-icon {
|
|
167
|
+
margin-left: auto;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
119
171
|
.kg-video-mute-icon svg,
|
|
120
172
|
.kg-video-unmute-icon svg {
|
|
121
173
|
width: 16px;
|
|
122
174
|
height: 16px;
|
|
123
|
-
fill:
|
|
175
|
+
fill: #fff;
|
|
124
176
|
}
|
|
125
177
|
|
|
126
178
|
.kg-video-volume-slider {
|
|
127
179
|
width: 80px;
|
|
128
180
|
}
|
|
129
181
|
|
|
182
|
+
@media (max-width: 300px) {
|
|
183
|
+
.kg-video-volume-slider {
|
|
184
|
+
display: none;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
130
188
|
.kg-video-seek-slider::before {
|
|
131
189
|
content: "";
|
|
132
190
|
position: absolute;
|
|
@@ -134,7 +192,7 @@
|
|
|
134
192
|
width: var(--seek-before-width) !important;
|
|
135
193
|
height: 4px;
|
|
136
194
|
cursor: pointer;
|
|
137
|
-
background-color:
|
|
195
|
+
background-color: #EBEEF0;
|
|
138
196
|
border-radius: 2px;
|
|
139
197
|
}
|
|
140
198
|
|
|
@@ -145,7 +203,7 @@
|
|
|
145
203
|
width: var(--volume-before-width) !important;
|
|
146
204
|
height: 4px;
|
|
147
205
|
cursor: pointer;
|
|
148
|
-
background-color:
|
|
206
|
+
background-color: #EBEEF0;
|
|
149
207
|
border-radius: 2px;
|
|
150
208
|
}
|
|
151
209
|
|
|
@@ -177,6 +235,7 @@
|
|
|
177
235
|
display: flex;
|
|
178
236
|
align-items: center;
|
|
179
237
|
border: 0;
|
|
238
|
+
cursor: pointer;
|
|
180
239
|
}
|
|
181
240
|
|
|
182
241
|
.kg-video-card input[type="range"] {
|
|
@@ -192,15 +251,15 @@
|
|
|
192
251
|
width: 100%;
|
|
193
252
|
height: 4px;
|
|
194
253
|
cursor: pointer;
|
|
195
|
-
background: rgba(
|
|
254
|
+
background: rgba(255, 255, 255, 0.2);
|
|
196
255
|
border-radius: 2px;
|
|
197
256
|
}
|
|
198
257
|
|
|
199
258
|
.kg-video-card input[type="range"]::-webkit-slider-thumb {
|
|
200
259
|
position: relative;
|
|
201
260
|
box-sizing: content-box;
|
|
202
|
-
width:
|
|
203
|
-
height:
|
|
261
|
+
width: 13px;
|
|
262
|
+
height: 13px;
|
|
204
263
|
margin: -5px 0 0 0;
|
|
205
264
|
border: 0;
|
|
206
265
|
cursor: pointer;
|
|
@@ -220,19 +279,19 @@
|
|
|
220
279
|
width: 100%;
|
|
221
280
|
height: 4px;
|
|
222
281
|
cursor: pointer;
|
|
223
|
-
background: rgba(
|
|
282
|
+
background: rgba(255, 255, 255, 0.2);
|
|
224
283
|
border-radius: 2px;
|
|
225
284
|
}
|
|
226
285
|
|
|
227
286
|
.kg-video-card input[type="range"]::-moz-range-progress {
|
|
228
|
-
background:
|
|
287
|
+
background: #EBEEF0;
|
|
229
288
|
border-radius: 2px;
|
|
230
289
|
}
|
|
231
290
|
|
|
232
291
|
.kg-video-card input[type="range"]::-moz-range-thumb {
|
|
233
292
|
box-sizing: content-box;
|
|
234
|
-
width:
|
|
235
|
-
height:
|
|
293
|
+
width: 13px;
|
|
294
|
+
height: 13px;
|
|
236
295
|
border: 0;
|
|
237
296
|
cursor: pointer;
|
|
238
297
|
background: #fff;
|
|
@@ -261,13 +320,13 @@
|
|
|
261
320
|
}
|
|
262
321
|
|
|
263
322
|
.kg-video-card input[type="range"]::-ms-fill-upper {
|
|
264
|
-
background:
|
|
323
|
+
background: #EBEEF0;
|
|
265
324
|
}
|
|
266
325
|
|
|
267
326
|
.kg-video-card input[type="range"]::-ms-thumb {
|
|
268
327
|
box-sizing: content-box;
|
|
269
|
-
width:
|
|
270
|
-
height:
|
|
328
|
+
width: 13px;
|
|
329
|
+
height: 13px;
|
|
271
330
|
border: 0;
|
|
272
331
|
cursor: pointer;
|
|
273
332
|
background: #fff;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
const handleVideoPlayer = function (videoElementContainer) {
|
|
3
|
-
const
|
|
3
|
+
const videoPlayer = videoElementContainer.querySelector('.kg-video-player');
|
|
4
|
+
const videoPlayerContainer = videoElementContainer.querySelector('.kg-video-player-container');
|
|
4
5
|
const playIconContainer = videoElementContainer.querySelector('.kg-video-play-icon');
|
|
5
6
|
const pauseIconContainer = videoElementContainer.querySelector('.kg-video-pause-icon');
|
|
6
7
|
const seekSlider = videoElementContainer.querySelector('.kg-video-seek-slider');
|
|
@@ -11,6 +12,8 @@
|
|
|
11
12
|
const videoEl = videoElementContainer.querySelector('video');
|
|
12
13
|
const durationContainer = videoElementContainer.querySelector('.kg-video-duration');
|
|
13
14
|
const currentTimeContainer = videoElementContainer.querySelector('.kg-video-current-time');
|
|
15
|
+
const largePlayIcon = videoElementContainer.querySelector('.kg-video-large-play-icon');
|
|
16
|
+
const videoOverlay = videoElementContainer.querySelector('.kg-video-overlay');
|
|
14
17
|
let playbackRates = [{
|
|
15
18
|
rate: 0.75,
|
|
16
19
|
label: '0.7×'
|
|
@@ -30,20 +33,23 @@
|
|
|
30
33
|
|
|
31
34
|
let raf = null;
|
|
32
35
|
let currentPlaybackRateIdx = 1;
|
|
33
|
-
|
|
36
|
+
if (!!videoEl.loop) {
|
|
37
|
+
largePlayIcon.classList.add("kg-video-hide-animated");
|
|
38
|
+
videoOverlay.classList.add("kg-video-hide-animated");
|
|
39
|
+
}
|
|
34
40
|
const whilePlaying = () => {
|
|
35
41
|
seekSlider.value = Math.floor(videoEl.currentTime);
|
|
36
42
|
currentTimeContainer.textContent = calculateTime(seekSlider.value);
|
|
37
|
-
|
|
43
|
+
videoPlayer.style.setProperty('--seek-before-width', `${seekSlider.value / seekSlider.max * 100}%`);
|
|
38
44
|
raf = requestAnimationFrame(whilePlaying);
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
const showRangeProgress = (rangeInput) => {
|
|
42
48
|
if (rangeInput === seekSlider) {
|
|
43
|
-
|
|
49
|
+
videoPlayer.style.setProperty('--seek-before-width', rangeInput.value / rangeInput.max * 100 + '%');
|
|
44
50
|
}
|
|
45
51
|
else {
|
|
46
|
-
|
|
52
|
+
videoPlayer.style.setProperty('--volume-before-width', rangeInput.value / rangeInput.max * 100 + '%');
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
|
|
@@ -65,7 +71,7 @@
|
|
|
65
71
|
const displayBufferedAmount = () => {
|
|
66
72
|
if (videoEl.buffered.length > 0) {
|
|
67
73
|
const bufferedAmount = Math.floor(videoEl.buffered.end(videoEl.buffered.length - 1));
|
|
68
|
-
|
|
74
|
+
videoPlayer.style.setProperty('--buffered-width', `${(bufferedAmount / seekSlider.max) * 100}%`);
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
77
|
|
|
@@ -99,33 +105,84 @@
|
|
|
99
105
|
});
|
|
100
106
|
}
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
videoElementContainer.onmouseover = () => {
|
|
109
|
+
if (!videoEl.loop) {
|
|
110
|
+
videoPlayerContainer.classList.remove("kg-video-hide-animated");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
videoElementContainer.onmouseleave = () => {
|
|
115
|
+
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
|
|
116
|
+
if (isPlaying) {
|
|
117
|
+
videoPlayerContainer.classList.add("kg-video-hide-animated");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
videoElementContainer.addEventListener('click', () => {
|
|
122
|
+
if (!videoEl.loop) {
|
|
123
|
+
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
|
|
124
|
+
if (isPlaying) {
|
|
125
|
+
handleOnPause();
|
|
126
|
+
} else {
|
|
127
|
+
handleOnPlay();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
videoEl.onplay = () => {
|
|
133
|
+
largePlayIcon.classList.add("kg-video-hide-animated");
|
|
134
|
+
videoOverlay.classList.add("kg-video-hide-animated");
|
|
135
|
+
playIconContainer.classList.add("kg-video-hide");
|
|
136
|
+
pauseIconContainer.classList.remove("kg-video-hide");
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const handleOnPlay = () => {
|
|
140
|
+
largePlayIcon.classList.add("kg-video-hide-animated");
|
|
141
|
+
videoOverlay.classList.add("kg-video-hide-animated");
|
|
103
142
|
playIconContainer.classList.add("kg-video-hide");
|
|
104
143
|
pauseIconContainer.classList.remove("kg-video-hide");
|
|
105
144
|
videoEl.play();
|
|
106
145
|
raf = requestAnimationFrame(whilePlaying);
|
|
107
|
-
}
|
|
146
|
+
}
|
|
108
147
|
|
|
109
|
-
|
|
148
|
+
const handleOnPause = () => {
|
|
110
149
|
pauseIconContainer.classList.add("kg-video-hide");
|
|
111
150
|
playIconContainer.classList.remove("kg-video-hide");
|
|
112
151
|
videoEl.pause();
|
|
113
152
|
cancelAnimationFrame(raf);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
largePlayIcon.addEventListener('click', (event) => {
|
|
156
|
+
event.stopPropagation();
|
|
157
|
+
handleOnPlay();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
playIconContainer.addEventListener('click', (event) => {
|
|
161
|
+
event.stopPropagation();
|
|
162
|
+
handleOnPlay();
|
|
114
163
|
});
|
|
115
164
|
|
|
116
|
-
|
|
165
|
+
pauseIconContainer.addEventListener('click', (event) => {
|
|
166
|
+
event.stopPropagation();
|
|
167
|
+
handleOnPause();
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
muteIconContainer.addEventListener('click', (event) => {
|
|
171
|
+
event.stopPropagation();
|
|
117
172
|
muteIconContainer.classList.add("kg-video-hide");
|
|
118
173
|
unmuteIconContainer.classList.remove("kg-video-hide");
|
|
119
174
|
videoEl.muted = false;
|
|
120
175
|
});
|
|
121
176
|
|
|
122
|
-
unmuteIconContainer.addEventListener('click', () => {
|
|
177
|
+
unmuteIconContainer.addEventListener('click', (event) => {
|
|
178
|
+
event.stopPropagation();
|
|
123
179
|
unmuteIconContainer.classList.add("kg-video-hide");
|
|
124
180
|
muteIconContainer.classList.remove("kg-video-hide");
|
|
125
181
|
videoEl.muted = true;
|
|
126
182
|
});
|
|
127
183
|
|
|
128
|
-
playbackRateContainer.addEventListener('click', () => {
|
|
184
|
+
playbackRateContainer.addEventListener('click', (event) => {
|
|
185
|
+
event.stopPropagation();
|
|
129
186
|
let nextPlaybackRate = playbackRates[(currentPlaybackRateIdx + 1) % 5];
|
|
130
187
|
currentPlaybackRateIdx = currentPlaybackRateIdx + 1;
|
|
131
188
|
videoEl.playbackRate = nextPlaybackRate.rate;
|
|
@@ -135,6 +192,7 @@
|
|
|
135
192
|
videoEl.addEventListener('progress', displayBufferedAmount);
|
|
136
193
|
|
|
137
194
|
seekSlider.addEventListener('input', (e) => {
|
|
195
|
+
e.stopPropagation();
|
|
138
196
|
showRangeProgress(e.target);
|
|
139
197
|
currentTimeContainer.textContent = calculateTime(seekSlider.value);
|
|
140
198
|
if (!videoEl.paused) {
|
|
@@ -142,14 +200,24 @@
|
|
|
142
200
|
}
|
|
143
201
|
});
|
|
144
202
|
|
|
145
|
-
seekSlider.addEventListener('change', () => {
|
|
203
|
+
seekSlider.addEventListener('change', (event) => {
|
|
204
|
+
event.stopPropagation();
|
|
146
205
|
videoEl.currentTime = seekSlider.value;
|
|
147
206
|
if (!videoEl.paused) {
|
|
148
207
|
requestAnimationFrame(whilePlaying);
|
|
149
208
|
}
|
|
150
209
|
});
|
|
151
210
|
|
|
211
|
+
volumeSlider.addEventListener('click', (event) => {
|
|
212
|
+
event.stopPropagation();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
seekSlider.addEventListener('click', (event) => {
|
|
216
|
+
event.stopPropagation();
|
|
217
|
+
});
|
|
218
|
+
|
|
152
219
|
volumeSlider.addEventListener('input', (e) => {
|
|
220
|
+
e.stopPropagation();
|
|
153
221
|
const value = e.target.value;
|
|
154
222
|
showRangeProgress(e.target);
|
|
155
223
|
videoEl.volume = value / 100;
|
|
@@ -7,7 +7,7 @@ const config = require('../../../shared/config');
|
|
|
7
7
|
const helpers = require('../../services/routing/helpers');
|
|
8
8
|
|
|
9
9
|
// @TODO: make this properly shared code
|
|
10
|
-
const
|
|
10
|
+
const {prepareError} = require('@tryghost/mw-error-handler');
|
|
11
11
|
|
|
12
12
|
const messages = {
|
|
13
13
|
oopsErrorTemplateHasError: 'Oops, seems there is an error in the error template.',
|
|
@@ -85,7 +85,7 @@ const themeErrorRenderer = (err, req, res, next) => {
|
|
|
85
85
|
|
|
86
86
|
module.exports.handleThemeResponse = [
|
|
87
87
|
// Make sure the error can be served
|
|
88
|
-
|
|
88
|
+
prepareError,
|
|
89
89
|
// Handle the error in Sentry
|
|
90
90
|
sentry.errorHandler,
|
|
91
91
|
// Render the error using theme template
|
|
@@ -20,6 +20,7 @@ const offersService = require('../../server/services/offers');
|
|
|
20
20
|
const customRedirects = require('../../server/services/redirects');
|
|
21
21
|
const siteRoutes = require('./routes');
|
|
22
22
|
const shared = require('../../server/web/shared');
|
|
23
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
23
24
|
const mw = require('./middleware');
|
|
24
25
|
const labs = require('../../shared/labs');
|
|
25
26
|
|
|
@@ -176,7 +177,7 @@ module.exports = function setupSiteApp(options = {}) {
|
|
|
176
177
|
siteApp.use(SiteRouter);
|
|
177
178
|
|
|
178
179
|
// ### Error handlers
|
|
179
|
-
siteApp.use(
|
|
180
|
+
siteApp.use(errorHandler.pageNotFound);
|
|
180
181
|
config.get('apps:internal').forEach((appName) => {
|
|
181
182
|
const app = require(path.join(config.get('paths').internalAppPath, appName));
|
|
182
183
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const KnexMigrator = require('knex-migrator');
|
|
2
2
|
const errors = require('@tryghost/errors');
|
|
3
|
+
const logging = require('@tryghost/logging');
|
|
3
4
|
|
|
4
5
|
const states = {
|
|
5
6
|
READY: 0,
|
|
@@ -8,7 +9,7 @@ const states = {
|
|
|
8
9
|
ERROR: 3
|
|
9
10
|
};
|
|
10
11
|
|
|
11
|
-
const printState = ({state
|
|
12
|
+
const printState = ({state}) => {
|
|
12
13
|
if (state === states.READY) {
|
|
13
14
|
logging.info('Database is in a ready state.');
|
|
14
15
|
}
|
|
@@ -67,13 +68,11 @@ class DatabaseStateManager {
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
async makeReady(
|
|
71
|
+
async makeReady() {
|
|
71
72
|
try {
|
|
72
73
|
let state = await this.getState();
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
printState({state, logging});
|
|
76
|
-
}
|
|
75
|
+
printState({state});
|
|
77
76
|
|
|
78
77
|
if (state === states.READY) {
|
|
79
78
|
return;
|
|
@@ -89,9 +88,7 @@ class DatabaseStateManager {
|
|
|
89
88
|
|
|
90
89
|
state = await this.getState();
|
|
91
90
|
|
|
92
|
-
|
|
93
|
-
printState({state, logging});
|
|
94
|
-
}
|
|
91
|
+
printState({state});
|
|
95
92
|
} catch (error) {
|
|
96
93
|
let errorToThrow = error;
|
|
97
94
|
if (!errors.utils.isGhostError(error)) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const debug = require('@tryghost/debug')('utils:image-size-cache');
|
|
2
2
|
const errors = require('@tryghost/errors');
|
|
3
|
-
|
|
3
|
+
const logging = require('@tryghost/logging');
|
|
4
4
|
class CachedImageSizeFromUrl {
|
|
5
|
-
constructor({
|
|
6
|
-
this.logging = logging;
|
|
5
|
+
constructor({imageSize}) {
|
|
7
6
|
this.imageSize = imageSize;
|
|
8
7
|
this.cache = new Map();
|
|
9
8
|
}
|
|
@@ -37,7 +36,7 @@ class CachedImageSizeFromUrl {
|
|
|
37
36
|
return this.cache.get(url);
|
|
38
37
|
}).catch((err) => {
|
|
39
38
|
debug('Cached image (error):', url);
|
|
40
|
-
|
|
39
|
+
logging.error(err);
|
|
41
40
|
|
|
42
41
|
// in case of error we just attach the url
|
|
43
42
|
this.cache.set(url, url);
|
|
@@ -4,10 +4,10 @@ const Gravatar = require('./gravatar');
|
|
|
4
4
|
const ImageSize = require('./image-size');
|
|
5
5
|
|
|
6
6
|
class ImageUtils {
|
|
7
|
-
constructor({config,
|
|
7
|
+
constructor({config, urlUtils, settingsCache, storageUtils, storage, validator, request}) {
|
|
8
8
|
this.blogIcon = new BlogIcon({config, urlUtils, settingsCache, storageUtils});
|
|
9
9
|
this.imageSize = new ImageSize({config, storage, storageUtils, validator, urlUtils, request});
|
|
10
|
-
this.cachedImageSizeFromUrl = new CachedImageSizeFromUrl({
|
|
10
|
+
this.cachedImageSizeFromUrl = new CachedImageSizeFromUrl({imageSize: this.imageSize});
|
|
11
11
|
this.gravatar = new Gravatar({config, request});
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -4,8 +4,7 @@ const storage = require('../../adapters/storage');
|
|
|
4
4
|
const storageUtils = require('../../adapters/storage/utils');
|
|
5
5
|
const validator = require('@tryghost/validator');
|
|
6
6
|
const config = require('../../../shared/config');
|
|
7
|
-
const logging = require('@tryghost/logging');
|
|
8
7
|
const settingsCache = require('../../../shared/settings-cache');
|
|
9
8
|
const ImageUtils = require('./image-utils');
|
|
10
9
|
|
|
11
|
-
module.exports = new ImageUtils({config,
|
|
10
|
+
module.exports = new ImageUtils({config, urlUtils, settingsCache, storageUtils, storage, validator, request});
|
|
@@ -31,18 +31,6 @@ if (parentPort) {
|
|
|
31
31
|
(async () => {
|
|
32
32
|
const updateCheck = require('./update-check');
|
|
33
33
|
|
|
34
|
-
const logging = {
|
|
35
|
-
info(message) {
|
|
36
|
-
postParentPortMessage(message);
|
|
37
|
-
},
|
|
38
|
-
warn(message) {
|
|
39
|
-
postParentPortMessage(message);
|
|
40
|
-
},
|
|
41
|
-
error(message) {
|
|
42
|
-
postParentPortMessage(message);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
34
|
// INIT required services
|
|
47
35
|
const models = require('./models');
|
|
48
36
|
models.init();
|
|
@@ -54,7 +42,7 @@ if (parentPort) {
|
|
|
54
42
|
await settings.init();
|
|
55
43
|
// Finished INIT
|
|
56
44
|
|
|
57
|
-
await updateCheck(
|
|
45
|
+
await updateCheck();
|
|
58
46
|
|
|
59
47
|
postParentPortMessage(`Ran update check`);
|
|
60
48
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const config = require('../../../shared/config');
|
|
2
|
-
const logging = require('@tryghost/logging');
|
|
3
2
|
const db = require('../../data/db');
|
|
4
3
|
const settings = require('../../../shared/settings-cache');
|
|
5
4
|
const {EmailAnalyticsService} = require('@tryghost/email-analytics-service');
|
|
@@ -9,11 +8,10 @@ const queries = require('./lib/queries');
|
|
|
9
8
|
|
|
10
9
|
module.exports = new EmailAnalyticsService({
|
|
11
10
|
config,
|
|
12
|
-
logging,
|
|
13
11
|
settings,
|
|
14
|
-
eventProcessor: new EventProcessor({db
|
|
12
|
+
eventProcessor: new EventProcessor({db}),
|
|
15
13
|
providers: [
|
|
16
|
-
new MailgunProvider({config, settings
|
|
14
|
+
new MailgunProvider({config, settings})
|
|
17
15
|
],
|
|
18
16
|
queries
|
|
19
17
|
});
|