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 '
' + sanitizePreviewHtml(description) + '
'); } if (!summary.length) { - return ''; + 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 ''; + 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 ''; + 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 '' + sanitizePreviewHtml(description) + '
'); } if (!summary.length) { - return ''; + return ''; } return summary.join(''); }