|
23 | 23 | photoboothTools |
24 | 24 | } = deps; |
25 | 25 |
|
| 26 | + const fallbackSource = galleryFallbackSource || (() => config.screensaver.image_source || ''); |
| 27 | + |
26 | 28 | let screensaverTimeout; |
27 | 29 | let screensaverSwitchTimeout; |
28 | 30 | let screensaverFlip = false; |
|
75 | 77 |
|
76 | 78 | api.toggleGalleryText = function toggleGalleryText() { |
77 | 79 | const screensaverText = config.screensaver.text; |
78 | | - const screensaverTextColor = config.screensaver.text_color || '#ffffff'; |
79 | 80 | const baseColor = config.screensaver.text_backdrop_color || '#202020'; |
80 | 81 | const alpha = parseFloat(config.screensaver.text_backdrop_opacity); |
81 | 82 | const safeAlpha = Number.isFinite(alpha) ? Math.min(Math.max(alpha, 0), 1) : 0.55; |
|
110 | 111 | const setSlot = (text) => { |
111 | 112 | resetSlots(); |
112 | 113 | [textTop, textCenter, textBottom].forEach(($el) => { |
113 | | - $el.css('color', screensaverTextColor); |
114 | 114 | $el.css('background', screensaverBackdrop); |
115 | 115 | }); |
116 | 116 | if (showCenter) { |
|
214 | 214 | } |
215 | 215 |
|
216 | 216 | const source = api.resolveSource(); |
217 | | - let finalSource = source; |
218 | | - if (!source) { |
219 | | - finalSource = galleryFallbackSource(); |
220 | | - } |
| 217 | + const finalSource = source || fallbackSource(); |
221 | 218 | if (!finalSource) { |
222 | 219 | api.resetTimer(); |
223 | 220 | return; |
|
241 | 238 | overlay.css('background-image', 'none'); |
242 | 239 | imageEl |
243 | 240 | .one('error', function () { |
244 | | - const fallback = galleryFallbackSource(); |
| 241 | + const fallback = fallbackSource(); |
245 | 242 | if (fallback && fallback !== finalSource) { |
246 | 243 | screensaverLastGallerySource = fallback; |
247 | 244 | $(this).attr('src', urlSafe(fallback)); |
|
0 commit comments