]>
git.immae.eu Git - github/bastienwirtz/homer.git/blob - app.js
13 that
.getConfig().then(function (config
) {
15 }).catch(function () {
19 document
.addEventListener('visibilitychange', function () {
20 if (document
.visibilityState
== "visible") {
26 checkOffline: function () {
28 return fetch(window
.location
.href
+ "?alive", {
33 }).catch(function () {
37 getConfig: function (event
) {
38 return fetch('config.yml').then(function (response
) {
39 if (response
.status
!= 200) {
42 return response
.text().then(function (body
) {
43 return jsyaml
.load(body
);
50 Vue
.component('service', {
55 <div class="card-content">
57 <div v-if="item.logo" class="media-left">
58 <figure class="image is-48x48">
59 <img :src="item.logo" />
62 <div v-if="item.icon" class="media-left">
63 <figure class="image is-48x48">
64 <i style="font-size: 35px" :class="item.icon"></i>
67 <div class="media-content">
68 <p class="title is-4">{{ item.name }}</p>
69 <p class="subtitle is-6">{{ item.subtitle }}</p>
72 <strong class="tag" v-if="item.tag">#{{ item.tag }}</strong>
78 if ('serviceWorker' in navigator
) {
79 window
.addEventListener('load', function () {
80 navigator
.serviceWorker
.register('/worker.js');