From 8adc928c4af79ec1dcc561a2a2775168f9f5dcaf Mon Sep 17 00:00:00 2001 From: David Date: Fri, 19 Jul 2024 22:06:52 -0400 Subject: [PATCH] v0.14.1 Release Candidate Allow 'more-info' override in card configuration --- README.md | 6 +++--- dist/const.js | 2 +- dist/set_defaults.js | 23 ++++++++++++++++++----- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3cb1848..feb4d25 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,9 @@ Add a Manual card to the dashboard and enter the YAML to configure it as desired | `show_timeouts` | Specifies if timeout indicators should be shown. | `true` | No | `true` `false` | | `show_rank` | Specifies if team rank should be shown. | `true` | No | `true` `false` | | `show_league` | Specifies if league should be shown at the top of the card. | `false` | No | `true` `false` | -| `team_url` | Provides an override url when the Home logo is tapped. | No override | No | Any valid URL (i.e. "https://www.espn.com") | -| `opponent_url` | Provides an override url when the Oppenent logo is tapped. | No override | No | Any valid URL (i.e. "https://www.espn.com") | -| `bottom_url` | Provides an override url when the bottom of the card is tapped. | No override | No | Any valid URL (i.e. "https://www.espn.com") | +| `team_url` | Provides an override url when the Home logo is tapped or 'more-info' to allow for more-info to be displayed on double-tap. | No override | No | Any valid URL (i.e. "https://www.espn.com") or "more-info" | +| `opponent_url` | Provides an override url when the Oppenent logo is tapped or 'more-info' to allow for more-info to be displayed on double-tap. | No override | No | Any valid URL (i.e. "https://www.espn.com") or "more-info" | +| `bottom_url` | Provides an override url when the bottom of the card is tapped or 'more-info' to allow for more-info to be displayed double-tap. | No override | No | Any valid URL (i.e. "https://www.espn.com") or "more-info" | ### Examples #### Example 1 diff --git a/dist/const.js b/dist/const.js index 485ed62..f2af43f 100644 --- a/dist/const.js +++ b/dist/const.js @@ -1,4 +1,4 @@ -export let VERSION = "v0.14.0"; +export let VERSION = "v0.14.1"; export let GOLF_HEADSHOT_URL = "https://a.espncdn.com/i/headshots/golf/players/full/"; export let MMA_HEADSHOT_URL = "https://a.espncdn.com/i/headshots/mma/players/full/"; diff --git a/dist/set_defaults.js b/dist/set_defaults.js index f58e681..9c3b09b 100644 --- a/dist/set_defaults.js +++ b/dist/set_defaults.js @@ -38,9 +38,12 @@ export function setDefaults(t, lang, stateObj, c, o, sport, team, oppo) { c.timeoutsDisplay = 'inline'; c.rankDisplay = 'inline'; c.seriesSummaryDisplay = 'none'; - c.bottomURL = o.bottomURL; - c.bottomURL = o.bottomURL || stateObj.attributes.event_url; - + if (o.bottomURL == 'more-info') { + c.bottomURL = null; + } + else { + c.bottomURL = o.bottomURL || stateObj.attributes.event_url; + } if (o.show_timeouts == false) { c.timeoutsDisplay = 'none'; } @@ -73,7 +76,12 @@ export function setDefaults(t, lang, stateObj, c, o, sport, team, oppo) { c.logoError[team] = ERROR_HEADSHOT_URL; c.logoBG[team] = stateObj.attributes.team_logo; c.name[team] = stateObj.attributes.team_name; - c.url[team] = o.teamURL || stateObj.attributes.team_url ; + if (o.teamURL == 'more-info') { + c.url[team] = null; + } + else { + c.url[team] = o.teamURL || stateObj.attributes.team_url ; + } c.rank[team] = stateObj.attributes.team_rank; c.record[team] = stateObj.attributes.team_record; c.winner[team] = stateObj.attributes.team_winner || false; @@ -81,7 +89,12 @@ export function setDefaults(t, lang, stateObj, c, o, sport, team, oppo) { c.logoError[oppo] = ERROR_HEADSHOT_URL; c.logoBG[oppo] = stateObj.attributes.opponent_logo; c.name[oppo] = stateObj.attributes.opponent_name; - c.url[oppo] = o.opponentURL || stateObj.attributes.opponent_url ; + if (o.opponentURL == 'more-info') { + c.url[oppo] = null; + } + else { + c.url[oppo] = o.opponentURL || stateObj.attributes.opponent_url ; + } c.rank[oppo] = stateObj.attributes.opponent_rank; c.record[oppo] = stateObj.attributes.opponent_record; c.winner[oppo] = stateObj.attributes.opponent_winner || false;