From 2381659e575bb51fbd3f118f79795272fb2ab108 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Mon, 30 Nov 2020 16:37:42 +0100 Subject: [PATCH 1/6] feature: enable no-render --- src/index.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.pug b/src/index.pug index 8365b4b..c0fce5d 100644 --- a/src/index.pug +++ b/src/index.pug @@ -24,7 +24,7 @@ html(lang="en") nav#main__menu.left-menu.jsLeftMenu include menu-left.pug - main#viewport.content.notLoggedIn + main#viewport.content.notLoggedIn(no-render) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) #dashboard(hidden, data-view="dashboard").no-sidebar.with-padding From cc2c1628056459f508a10799c40211ed8c5ff716 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Tue, 1 Dec 2020 16:04:47 +0000 Subject: [PATCH 2/6] fix: context for avatar --- src/dependencies.pug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index a6a4718..d6cec94 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -65,5 +65,6 @@ script(data-default-context, type="application/ld+json") | "object": "http://happy-dev.fr/owl/#object", | "author": "http://happy-dev.fr/owl/#author", | "account": "http://happy-dev.fr/owl/#account", - | "jabberID": "foaf:jabberID" + | "jabberID": "foaf:jabberID", + | "picture": "foaf:depiction" | } From f4ea9ec9caa58415f0a457355c5d23f114ee5596 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Mon, 30 Nov 2020 16:37:42 +0100 Subject: [PATCH 3/6] feature: enable no-render --- src/index.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.pug b/src/index.pug index 8365b4b..c0fce5d 100644 --- a/src/index.pug +++ b/src/index.pug @@ -24,7 +24,7 @@ html(lang="en") nav#main__menu.left-menu.jsLeftMenu include menu-left.pug - main#viewport.content.notLoggedIn + main#viewport.content.notLoggedIn(no-render) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) #dashboard(hidden, data-view="dashboard").no-sidebar.with-padding From 63e64b0ed6ffadb7ecbbcd37b07605d8a20c5ab0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Wed, 2 Dec 2020 10:09:01 +0100 Subject: [PATCH 4/6] fix: no-render --- src/index.pug | 2 +- src/scripts/firefox-scroll.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.pug b/src/index.pug index 6de9a9e..0fd12f3 100644 --- a/src/index.pug +++ b/src/index.pug @@ -24,7 +24,7 @@ html(lang="en") nav#main__menu.left-menu.jsLeftMenu include menu-left.pug - main#viewport.content.notLoggedIn(no-render) + main#viewport.content.notLoggedIn if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) #dashboard(hidden, data-view="dashboard").no-sidebar.with-padding diff --git a/src/scripts/firefox-scroll.js b/src/scripts/firefox-scroll.js index 4405aa6..3b9bb18 100644 --- a/src/scripts/firefox-scroll.js +++ b/src/scripts/firefox-scroll.js @@ -1,6 +1,8 @@ document.addEventListener("DOMContentLoaded", () => { const resizeChat = () => { - let isMobile = window.innerHeight < 993; + let isMobile = window.innerWidth < 993; + let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + let isFirefoxMobile = navigator.platform.toLowerCase().indexOf("mobile") > -1 || navigator.platform.toLowerCase().indexOf("tablet") > -1; let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat")) .map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false) .filter((el) => el) @@ -19,10 +21,8 @@ document.addEventListener("DOMContentLoaded", () => { let viewportChat = Array.from( document.querySelectorAll("#viewport .chat-view") ); - let headerOffset = document.querySelector('#header').offsetHeight; - let intermediateOffset = Array.from(document.querySelectorAll(".content-box__header")).filter(el=>el.offsetParent!==null?el:null)[0].offsetHeight; viewportChat.forEach( - (c) => (c.style.height = isMobile ? "calc(100vh - "+String(headerOffset+intermediateOffset)+"px - 57px)" : "calc(100vh - "+String(headerOffset+intermediateOffset)+"px)") + (c) => (c.style.height = isMobile ? (isFirefox && isFirefoxMobile) ? "calc(100vh - 106px - 57px)" : "calc(100vh - 106px)" : "calc(100vh - 64px - 83px)") ); } } From 354807c512d83dbb207a5456729f9f8ed61ffb84 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Wed, 2 Dec 2020 10:35:21 +0100 Subject: [PATCH 5/6] fix: no-render --- src/components/hubl-reactivity.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/components/hubl-reactivity.js b/src/components/hubl-reactivity.js index 2dc766c..400a4e2 100644 --- a/src/components/hubl-reactivity.js +++ b/src/components/hubl-reactivity.js @@ -11,21 +11,17 @@ export const HublReactivity = { this.subscribe(); } }, - dataSrc: { - type: String, - default: '', - callback: async function (value) { - this.resourceId = null; - if (this.nestedField) { - const resource = store.get(value) || await store.getData(value, this.context); - const nestedResource = await resource[this.nestedField] - this.resourceId = nestedResource ? nestedResource['@id'] : null; - } else { - this.resourceId = value; - } - this.subscribe(); - } - }, + }, + async fetchData(value) { + this.resourceId = null; + if (this.nestedField) { + const resource = store.get(value) || await store.getData(value, this.context); + const nestedResource = await resource[this.nestedField] + this.resourceId = nestedResource ? nestedResource['@id'] : null; + } else { + this.resourceId = value; + } + this.subscribe(); }, subscribe() { if (this.resourceId && this.targetSrc) { From 1d1f8de324ed83791c793b687e84375a173cc3ed Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 3 Dec 2020 10:58:08 +0000 Subject: [PATCH 6/6] feature: activate sw --- src/scripts/register-sw.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/scripts/register-sw.js b/src/scripts/register-sw.js index c479a12..5b375a8 100644 --- a/src/scripts/register-sw.js +++ b/src/scripts/register-sw.js @@ -1,11 +1,11 @@ -// if('serviceWorker' in navigator) { - // var refreshing; - // navigator.serviceWorker.addEventListener('controllerchange', () => { - // if (refreshing) { - // return; - // } - // refreshing = true; - // window.location.reload(); - // }); - // navigator.serviceWorker.register('/sw.js'); -// } \ No newline at end of file +if('serviceWorker' in navigator) { + var refreshing; + navigator.serviceWorker.addEventListener('controllerchange', () => { + if (refreshing) { + return; + } + refreshing = true; + window.location.reload(); + }); + navigator.serviceWorker.register('/sw.js'); +} \ No newline at end of file