Skip to content

Commit eb24ca1

Browse files
committed
fixes
1 parent 7d67ef0 commit eb24ca1

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

assets/js/admin/buttons.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ $(function () {
7878
});
7979
});
8080

81+
$('#screensaver-preview-btn').on('click', function (e) {
82+
e.preventDefault();
83+
window.open('../?screensaverPreview=1', '_blank');
84+
return false;
85+
});
86+
8187
$('#layout-generator').on('click', function (ev) {
8288
ev.preventDefault();
8389
window.open('../admin/generator');

assets/js/core.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ const photoBooth = (function () {
8080
screensaverSwitchMs = (config.screensaver.switch_minutes || 1) * 60000,
8181
urlSafe = (src) => (src ? encodeURI(src) : '');
8282

83-
if (!config.screensaver.text_position) {
84-
config.screensaver.text_position = 'center';
85-
}
86-
8783
let timeOut,
8884
chromaFile = '',
8985
currentCollageFile = '',
@@ -94,8 +90,6 @@ const photoBooth = (function () {
9490
endTime,
9591
totalTime;
9692

97-
const galleryFallbackSource = () => config.screensaver.image_source || '';
98-
9993
api.takingPic = false;
10094
api.nextCollageNumber = 0;
10195
api.chromaimage = '';
@@ -183,7 +177,6 @@ const photoBooth = (function () {
183177
screensaverTimeoutMs,
184178
screensaverSwitchMs,
185179
urlSafe,
186-
galleryFallbackSource,
187180
photoboothTools
188181
});
189182

assets/js/screensaver.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
photoboothTools
2424
} = deps;
2525

26+
const fallbackSource = galleryFallbackSource || (() => config.screensaver.image_source || '');
27+
2628
let screensaverTimeout;
2729
let screensaverSwitchTimeout;
2830
let screensaverFlip = false;
@@ -75,7 +77,6 @@
7577

7678
api.toggleGalleryText = function toggleGalleryText() {
7779
const screensaverText = config.screensaver.text;
78-
const screensaverTextColor = config.screensaver.text_color || '#ffffff';
7980
const baseColor = config.screensaver.text_backdrop_color || '#202020';
8081
const alpha = parseFloat(config.screensaver.text_backdrop_opacity);
8182
const safeAlpha = Number.isFinite(alpha) ? Math.min(Math.max(alpha, 0), 1) : 0.55;
@@ -110,7 +111,6 @@
110111
const setSlot = (text) => {
111112
resetSlots();
112113
[textTop, textCenter, textBottom].forEach(($el) => {
113-
$el.css('color', screensaverTextColor);
114114
$el.css('background', screensaverBackdrop);
115115
});
116116
if (showCenter) {
@@ -214,10 +214,7 @@
214214
}
215215

216216
const source = api.resolveSource();
217-
let finalSource = source;
218-
if (!source) {
219-
finalSource = galleryFallbackSource();
220-
}
217+
const finalSource = source || fallbackSource();
221218
if (!finalSource) {
222219
api.resetTimer();
223220
return;
@@ -241,7 +238,7 @@
241238
overlay.css('background-image', 'none');
242239
imageEl
243240
.one('error', function () {
244-
const fallback = galleryFallbackSource();
241+
const fallback = fallbackSource();
245242
if (fallback && fallback !== finalSource) {
246243
screensaverLastGallerySource = fallback;
247244
$(this).attr('src', urlSafe(fallback));

0 commit comments

Comments
 (0)