diff --git a/background/index.html b/background/index.html index 480157c..383b770 100644 --- a/background/index.html +++ b/background/index.html @@ -3,6 +3,7 @@ /usr/space + \ No newline at end of file diff --git a/background/index.js b/background/index.js index df9e152..87ff2b4 100644 --- a/background/index.js +++ b/background/index.js @@ -3,7 +3,7 @@ const fetchJson = (url) => { }; const fetchCalendar = (days = null) => { - let url = 'https://usrspace.at/calendar.php?o=json'; + let url = Config.calenderUrl + '?o=json'; if (days) { url += '&r=' + days; } @@ -11,14 +11,14 @@ const fetchCalendar = (days = null) => { }; const fetchSpaceApi = () => { - return fetchJson('https://usrspace.at/spaceapi'); + return fetchJson(Config.spaceApiUrl); }; const updateBadge = (open) => { let badgeText, badgeColor; if (open) { badgeText = browser.browserAction.setBadgeText({text: 'open'}); - badgeColor = browser.browserAction.setBadgeBackgroundColor({color: '#00ff00'}); + badgeColor = browser.browserAction.setBadgeBackgroundColor({color: Config.openColor}); } else { badgeText = browser.browserAction.setBadgeText({text: ''}); badgeColor = browser.browserAction.setBadgeBackgroundColor({color: null}); @@ -53,4 +53,4 @@ const fetchNewData = () => { fetchNewData(); setInterval(() => { fetchNewData(); -}, 5 * 60 * 1000); \ No newline at end of file +}, Config.refreshTimeout); \ No newline at end of file diff --git a/config.js b/config.js new file mode 100644 index 0000000..cb598d7 --- /dev/null +++ b/config.js @@ -0,0 +1,32 @@ +window.Config = { + refreshTimeout: 1000 * 60 * 5, // 5min, + spaceApiUrl: 'https://usrspace.at/spaceapi', + calenderUrl: 'https://usrspace.at/calendar.php', + openColor: '#00ff00', + quickLinks: [ + { + url: 'https://usrspace.at/', + img: 'icons/font-awesome/home-solid.svg', + alt: 'Home', + text: 'Homepage' + }, + { + url: 'https://www.usrspace.at/w/', + img: 'icons/font-awesome/wikipedia-w-brands.svg', + alt: 'Wiki', + text: 'Wiki' + }, + { + url: 'https://gitlab.usrspace.at/', + img: 'icons/font-awesome/gitlab-brands.svg', + alt: 'Gitlab', + text: 'Gitlab' + }, + { + url: 'https://cloud.usrspace.at/', + img: 'icons/font-awesome/cloud-solid.svg', + alt: 'Cloud', + text: 'NextCloud' + } + ] +}; \ No newline at end of file diff --git a/popup/index.css b/popup/index.css index 1e6fad3..72e175c 100644 --- a/popup/index.css +++ b/popup/index.css @@ -1,5 +1,5 @@ body { - max-width: 360px; + width: 360px; } h2 { diff --git a/popup/index.html b/popup/index.html index 2becedb..d845e7c 100644 --- a/popup/index.html +++ b/popup/index.html @@ -3,7 +3,7 @@ /usr/space - +
@@ -38,6 +38,7 @@

Infos

loading...
+