From 71fbce24e9b92e672aeb4e7cb10994ccfc8d3ac5 Mon Sep 17 00:00:00 2001 From: Thomas Rupprecht Date: Wed, 22 Sep 2021 21:36:54 +0200 Subject: [PATCH] use template strings --- background/index.js | 6 +++--- popup/index.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/background/index.js b/background/index.js index d2b9138..67597f1 100644 --- a/background/index.js +++ b/background/index.js @@ -3,9 +3,9 @@ const fetchJson = (url) => { }; const fetchCalendar = (days = 28) => { - let url = Config.calenderUrl + '?o=json'; + let url = `${Config.calenderUrl}?o=json`; if (days) { - url += '&r=' + days; + url += `&r=${days}`; } return fetchJson(url); }; @@ -35,7 +35,7 @@ const sendNotification = (open) => { type: 'basic', iconUrl: browser.runtime.getURL('icons/logo.svg'), title: 'Space Status', - message: 'Space ist jetzt ' + (open ? 'offen' : 'geschlossen') + '.' + message: `Space ist jetzt ${open ? 'offen' : 'geschlossen'}.` }); }; diff --git a/popup/index.js b/popup/index.js index e24caa6..31f7c60 100644 --- a/popup/index.js +++ b/popup/index.js @@ -49,7 +49,7 @@ const updateNextEvent = (nextEvents) => { divElement.append(timeElement); timeElement.append(dateNode); if (nextEventDateEvent.location) { - const locationNode = document.createTextNode(' (' + nextEventDateEvent.location + ')'); + const locationNode = document.createTextNode(` (${nextEventDateEvent.location})`); divElement.append(locationNode); } calendarElement.append(divElement); @@ -68,10 +68,10 @@ const updateSpaceApiJson = (spaceApi) => { const updateState = (spaceApi) => { const stateElement = document.getElementById('state'); const since = new Date(spaceApi.state.lastchange * 1000); - const sinceStr = ' seit '; + const sinceStr = ` seit `; if (spaceApi.state.open) { - stateElement.innerHTML = 'OffenOffen' + sinceStr; + stateElement.innerHTML = `OffenOffen ${sinceStr}`; } else { - stateElement.innerHTML = 'GeschlossenGeschlossen' + sinceStr; + stateElement.innerHTML = `GeschlossenGeschlossen ${sinceStr}`; } };