diff --git a/CHANGELOG.md b/CHANGELOG.md index 21857e4..895c21b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file. - Fixed cached API and RSS images not being served by the player after being downloaded. - Fixed blank time/date regions displaying the default clock format on the player. - Fixed the time/date placeholder popup omitting text and math transform help. +- Fixed empty region previews displaying type labels instead of remaining blank. +- Fixed empty weather regions displaying the default weather summary. ## 2.13.2 - 2026-09-11 diff --git a/src/player/regions/weather.js b/src/player/regions/weather.js index 3091bf3..67f6f30 100644 --- a/src/player/regions/weather.js +++ b/src/player/regions/weather.js @@ -69,6 +69,8 @@ function substituteWeatherVariables(html, value) { } function renderWeatherRegion(region, regionContent) { + var value = String(regionContent && regionContent.value || ''); + if (!value.trim()) return ''; var location = getWeatherLocation(regionContent && regionContent.weather_location_id); var snapshot = location && location.responseJson && typeof location.responseJson === 'object' ? location.responseJson : null; var width = Math.max(1, Math.round(Number(region && region.pixelWidth) || 1)); @@ -77,7 +79,6 @@ function renderWeatherRegion(region, regionContent) { var style = 'width:' + width + 'px;height:' + height + 'px;transform:scale(' + scale + ');transform-origin:top left;overflow:hidden;'; if (!location || !snapshot) return '
'; var current = snapshot.current || {}; - var value = String(regionContent && regionContent.value || ''); if (value) { var weatherData = withWeatherUnits(snapshot, location); var fontSize = Math.max(8, Number(regionContent && regionContent.font_size || region && (region.font_size || region.fontSize) || 32) || 32); diff --git a/src/web/public/js/regions/type/html.js b/src/web/public/js/regions/type/html.js index 1a5c6da..2188fdd 100644 --- a/src/web/public/js/regions/type/html.js +++ b/src/web/public/js/regions/type/html.js @@ -44,7 +44,7 @@ function renderPreview(region, value) { var html = normalizePreviewValue(value !== undefined ? value : region).trim(); if (!html) { - return '
HTML
'; + return ''; } if (/^'; diff --git a/src/web/public/js/regions/type/image.js b/src/web/public/js/regions/type/image.js index c0785f8..777344d 100644 --- a/src/web/public/js/regions/type/image.js +++ b/src/web/public/js/regions/type/image.js @@ -21,7 +21,7 @@ var content = value && typeof value === 'object' && value.value !== undefined ? value : null; var src = String(content ? content.value : value || '').trim(); if (!src) { - return '
Image
'; + return ''; } return ''; } diff --git a/src/web/public/js/regions/type/qr-code.js b/src/web/public/js/regions/type/qr-code.js index 517120d..c3043f7 100644 --- a/src/web/public/js/regions/type/qr-code.js +++ b/src/web/public/js/regions/type/qr-code.js @@ -880,7 +880,7 @@ src = svgSrc || buildStyledQrSvgMarkup(value); } if (!src) { - return '
QR Code
'; + return ''; } if (/^data:image\//i.test(src)) { return 'QR code preview'; diff --git a/src/web/public/js/regions/type/rss.js b/src/web/public/js/regions/type/rss.js index d9ba190..183d1ce 100644 --- a/src/web/public/js/regions/type/rss.js +++ b/src/web/public/js/regions/type/rss.js @@ -158,7 +158,7 @@ function getPreviewFallback(item) { if (!item || typeof item !== 'object') { - return '
RSS item
'; + return ''; } var title = String(item.title || '').trim(); @@ -171,7 +171,7 @@ summary.push('

' + sanitizePreviewHtml(description) + '

'); } if (!summary.length) { - return '
RSS item
'; + return ''; } return summary.join(''); } diff --git a/src/web/public/js/regions/type/rtmp.js b/src/web/public/js/regions/type/rtmp.js index ee0ad45..9598d9a 100644 --- a/src/web/public/js/regions/type/rtmp.js +++ b/src/web/public/js/regions/type/rtmp.js @@ -11,7 +11,10 @@ function renderPreview(value, disableAudio) { var content = value && typeof value === 'object' && value.value !== undefined ? value : null; var src = String(content ? content.value : value || '').trim(); - var label = src ? 'RTMP' : 'RTMP stream'; + if (!src) { + return ''; + } + var label = 'RTMP'; if (disableAudio) { label += ' (muted)'; } diff --git a/src/web/public/js/regions/type/text.js b/src/web/public/js/regions/type/text.js index c50697c..fc448bd 100644 --- a/src/web/public/js/regions/type/text.js +++ b/src/web/public/js/regions/type/text.js @@ -29,7 +29,7 @@ var rawValue = value && typeof value === 'object' && value.value !== undefined ? value.value : value; var raw = String(rawValue || ''); if (!raw) { - return '
Empty text
'; + return ''; } var style = styleOrContext && styleOrContext.style ? styleOrContext.style : styleOrContext || {}; diff --git a/src/web/public/js/regions/type/video.js b/src/web/public/js/regions/type/video.js index 8fda7ff..c2f51fc 100644 --- a/src/web/public/js/regions/type/video.js +++ b/src/web/public/js/regions/type/video.js @@ -26,7 +26,7 @@ var content = value && typeof value === 'object' && value.value !== undefined ? value : null; var src = String(content ? content.value : value || '').trim(); if (!src) { - return '
Video
'; + return ''; } return ''; } diff --git a/src/web/public/js/regions/type/weather.js b/src/web/public/js/regions/type/weather.js index 07fea63..8fad3d2 100644 --- a/src/web/public/js/regions/type/weather.js +++ b/src/web/public/js/regions/type/weather.js @@ -148,10 +148,11 @@ function renderPreview(region, content, context) { var locations = context && context.weatherLocations ? context.weatherLocations : []; + var value = String(content && content.value || ''); + if (!value.trim()) return ''; var location = getLocationById(content && content.weather_location_id, locations); var snapshot = getSnapshot(location); - var value = String(content && content.value || ''); - if (!location || !snapshot) return '
Select a weather location with cached data
'; + if (!location || !snapshot) return ''; var weatherData = withWeatherUnits(snapshot, location); if (value) { var fontSize = Math.max(8, Number(content && content.font_size || region && (region.font_size || region.fontSize) || 32) || 32); diff --git a/src/web/public/js/regions/type/webpage.js b/src/web/public/js/regions/type/webpage.js index 4222226..0b8081d 100644 --- a/src/web/public/js/regions/type/webpage.js +++ b/src/web/public/js/regions/type/webpage.js @@ -37,7 +37,7 @@ function renderPreview(region, value) { var src = normalizePreviewValue(value !== undefined ? value : region).trim(); if (!src) { - return '
Webpage
'; + return ''; } return ''; } diff --git a/src/web/public/js/slides/slide-form-preview.js b/src/web/public/js/slides/slide-form-preview.js index 43ab716..45bcb28 100644 --- a/src/web/public/js/slides/slide-form-preview.js +++ b/src/web/public/js/slides/slide-form-preview.js @@ -187,7 +187,7 @@ export function createSlideFormPreviewHelpers(options) { } var raw = String(rawValue || ''); if (!raw) { - return '
Empty text
'; + return ''; } return sanitizePreviewHtml(raw); } diff --git a/src/web/public/js/slides/slide-form-regions.js b/src/web/public/js/slides/slide-form-regions.js index 8237d96..cb9c0f2 100644 --- a/src/web/public/js/slides/slide-form-regions.js +++ b/src/web/public/js/slides/slide-form-regions.js @@ -323,7 +323,7 @@ export function createSlideFormRegionHelpers(options) { } if (!item || typeof item !== 'object') { - return '
RSS item
'; + return ''; } var title = String(item.title || '').trim(); @@ -336,7 +336,7 @@ export function createSlideFormRegionHelpers(options) { summary.push('

' + sanitizePreviewHtml(description) + '

'); } if (!summary.length) { - return '
RSS item
'; + return ''; } return summary.join(''); }