Skip to content

Commit

Permalink
v0.14.1 Release Candidate
Browse files Browse the repository at this point in the history
Allow 'more-info' override in card configuration
  • Loading branch information
vasqued2 authored Jul 20, 2024
1 parent 11b0456 commit 8adc928
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/const.js
Original file line number Diff line number Diff line change
@@ -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/";
Expand Down
23 changes: 18 additions & 5 deletions dist/set_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down Expand Up @@ -73,15 +76,25 @@ 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;
c.logo[oppo] = stateObj.attributes.opponent_logo;
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;
Expand Down

0 comments on commit 8adc928

Please sign in to comment.