created: async function () {
let that = this;
- this.isDark = 'overrideDark' in localStorage ?
+ this.isDark = 'overrideDark' in localStorage ?
JSON.parse(localStorage.overrideDark) : matchMedia("(prefers-color-scheme: dark)").matches;
if ('vlayout' in localStorage) {
this.vlayout = JSON.parse(localStorage.vlayout)
}
-
+
this.checkOffline();
try {
this.config = await this.getConfig();
}
// Look for a new message if an endpoint is provided.
- if (this.config.message.url) {
+ if (this.config.message && this.config.message.url) {
this.getMessage(this.config.message.url).then(function(message){
// keep the original config value if no value is provided by the endpoint
for (const prop of ['title','style','content']) {
},
toggleLayout: function() {
this.vlayout = !this.vlayout;
- localStorage.vlayout = this.vlayout;
- },
+ localStorage.vlayout = this.vlayout;
+ },
}
});
props: ['item'],
template: `<div>
<div class="card">
- <a :href="item.url">
+ <a :href="item.url" :target="item.target">
<div class="card-content">
<div class="media">
<div v-if="item.logo" class="media-left">
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
- navigator.serviceWorker.register('/worker.js');
+ navigator.serviceWorker.register('worker.js');
});
}