From 7555851743d2f0bbe1597c75cda87b684f10c6a6 Mon Sep 17 00:00:00 2001 From: Andrew Perkins Date: Thu, 20 Jun 2024 18:41:31 +1000 Subject: [PATCH] weather@mockturtl: Add line break to Override options (#6103) --- weather@mockturtl/README.md | 1 + .../files/weather@mockturtl/3.8/weather-applet.js | 6 ++++-- weather@mockturtl/src/3_8/utils.ts | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/weather@mockturtl/README.md b/weather@mockturtl/README.md index f165007fe0a..b925626072e 100644 --- a/weather@mockturtl/README.md +++ b/weather@mockturtl/README.md @@ -184,6 +184,7 @@ The setting allows you to make the applet display basically anything in the form | `{country}` | Country name shown in the popup | | `{search_entry}` | Search entry text in manual location (or location store) | | `{last_updated}` | Formatted last updated time | +| `{br}` | Line Break | ## Run script when the weather data changes diff --git a/weather@mockturtl/files/weather@mockturtl/3.8/weather-applet.js b/weather@mockturtl/files/weather@mockturtl/3.8/weather-applet.js index b46c83d6d6c..25ffd0fcc63 100644 --- a/weather@mockturtl/files/weather@mockturtl/3.8/weather-applet.js +++ b/weather@mockturtl/files/weather@mockturtl/3.8/weather-applet.js @@ -9360,7 +9360,8 @@ function InjectValues(text, weather, config, inCommand = false) { .replace(/{{city}}/g, Literal(city)) .replace(/{{country}}/g, Literal(country)) .replace(/{{search_entry}}/g, Literal(searchEntry)) - .replace(/{{last_updated}}/g, Literal(lastUpdatedTime)); + .replace(/{{last_updated}}/g, Literal(lastUpdatedTime)) + .replace(/{{br}}/g, Literal("\n")); } return text.replace(/{t}/g, temp) .replace(/{u}/g, tempUnit) @@ -9377,7 +9378,8 @@ function InjectValues(text, weather, config, inCommand = false) { .replace(/{city}/g, city) .replace(/{country}/g, country) .replace(/{search_entry}/g, searchEntry) - .replace(/{last_updated}/g, lastUpdatedTime); + .replace(/{last_updated}/g, lastUpdatedTime) + .replace(/{br}/g, "\n"); } function CapitalizeFirstLetter(description) { if ((description == undefined || description == null)) { diff --git a/weather@mockturtl/src/3_8/utils.ts b/weather@mockturtl/src/3_8/utils.ts index 012da8ef54e..e6a9de4fc08 100644 --- a/weather@mockturtl/src/3_8/utils.ts +++ b/weather@mockturtl/src/3_8/utils.ts @@ -96,7 +96,8 @@ export function InjectValues(text: string, weather: WeatherData, config: Config, .replace(/{{city}}/g, Literal(city)) .replace(/{{country}}/g, Literal(country)) .replace(/{{search_entry}}/g, Literal(searchEntry)) - .replace(/{{last_updated}}/g, Literal(lastUpdatedTime)); + .replace(/{{last_updated}}/g, Literal(lastUpdatedTime)) + .replace(/{{br}}/g, Literal("\n")); } return text.replace(/{t}/g, temp) @@ -114,7 +115,8 @@ export function InjectValues(text: string, weather: WeatherData, config: Config, .replace(/{city}/g, city) .replace(/{country}/g, country) .replace(/{search_entry}/g, searchEntry) - .replace(/{last_updated}/g, lastUpdatedTime); + .replace(/{last_updated}/g, lastUpdatedTime) + .replace(/{br}/g, "\n"); } export function CapitalizeFirstLetter(description: string): string {