Merge branch 'master' into dpo/switch-to-skypack

This commit is contained in:
Benoit Alessandroni 2020-12-04 12:20:24 +01:00
commit 7ecf48c07d
8 changed files with 49 additions and 47 deletions

View File

@ -11,21 +11,17 @@ export const HublReactivity = {
this.subscribe(); this.subscribe();
} }
}, },
dataSrc: { },
type: String, async fetchData(value) {
default: '', this.resourceId = null;
callback: async function (value) { if (this.nestedField) {
this.resourceId = null; const resource = store.get(value) || await store.getData(value, this.context);
if (this.nestedField) { const nestedResource = await resource[this.nestedField]
const resource = store.get(value) || await store.getData(value, this.context); this.resourceId = nestedResource ? nestedResource['@id'] : null;
const nestedResource = await resource[this.nestedField] } else {
this.resourceId = nestedResource ? nestedResource['@id'] : null; this.resourceId = value;
} else { }
this.resourceId = value; this.subscribe();
}
this.subscribe();
}
},
}, },
subscribe() { subscribe() {
if (this.resourceId && this.targetSrc) { if (this.resourceId && this.targetSrc) {

View File

@ -41,7 +41,7 @@ button.loggedIn(role='log in' onclick="document.querySelector('sib-auth').login(
button.notLoggedIn.mobile-menu-icon.icon-menu#toggleMainMenu button.notLoggedIn.mobile-menu-icon.icon-menu#toggleMainMenu
sib-auth(style='display:none!important') sib-auth(style='display:none!important', auto-login)
sib-auth-provider( sib-auth-provider(
data-authority=`${authority}` data-authority=`${authority}`
data-id=`${authorityName || "authority"}` data-id=`${authorityName || "authority"}`

View File

@ -31,11 +31,11 @@ html(lang="en")
include page-dashboard.pug include page-dashboard.pug
if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users))
#members(hidden, data-view="members").no-sidebar.with-padding #members(hidden, data-view="members", no-render).no-sidebar.with-padding
include page-directory.pug include page-directory.pug
if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers)
#job-offers(hidden, data-view="job-offers").no-sidebar.with-padding #job-offers(hidden, data-view="job-offers", no-render).no-sidebar.with-padding
if (endpoints.post && endpoints.post.joboffers) && (endpoints.get && endpoints.get.joboffers) if (endpoints.post && endpoints.post.joboffers) && (endpoints.get && endpoints.get.joboffers)
hubl-reactivity(data-src=`${endpoints.post.joboffers}current/` target-src=`${endpoints.get.joboffers}`) hubl-reactivity(data-src=`${endpoints.post.joboffers}current/` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.post.joboffers}expired/` target-src=`${endpoints.get.joboffers}`) hubl-reactivity(data-src=`${endpoints.post.joboffers}expired/` target-src=`${endpoints.get.joboffers}`)
@ -49,7 +49,7 @@ html(lang="en")
include page-job-offers.pug include page-job-offers.pug
if endpoints.projects || (endpoints.get && endpoints.get.projects) if endpoints.projects || (endpoints.get && endpoints.get.projects)
#project(hidden, data-view="project").with-sidebar #project(hidden, data-view="project", no-render).with-sidebar
if (endpoints.post && endpoints.post.projects) && (endpoints.get && endpoints.get.projects) if (endpoints.post && endpoints.post.projects) && (endpoints.get && endpoints.get.projects)
hubl-reactivity(data-src=`${endpoints.post.projects}joinable/` target-src=`${endpoints.get.projects}`) hubl-reactivity(data-src=`${endpoints.post.projects}joinable/` target-src=`${endpoints.get.projects}`)
hubl-reactivity(data-src=`${endpoints.post.projects}` target-src=`${endpoints.get.projects}`) hubl-reactivity(data-src=`${endpoints.post.projects}` target-src=`${endpoints.get.projects}`)
@ -61,7 +61,7 @@ html(lang="en")
include page-project.pug include page-project.pug
if endpoints.circles || (endpoints.get && endpoints.get.circles) if endpoints.circles || (endpoints.get && endpoints.get.circles)
#circle(hidden, data-view="circle").with-sidebar #circle(hidden, data-view="circle", no-render).with-sidebar
if (endpoints.post && endpoints.post.circles) && (endpoints.get && endpoints.get.circles) if (endpoints.post && endpoints.post.circles) && (endpoints.get && endpoints.get.circles)
hubl-reactivity(data-src=`${endpoints.post.circles}joinable/` target-src=`${endpoints.get.circles}`) hubl-reactivity(data-src=`${endpoints.post.circles}joinable/` target-src=`${endpoints.get.circles}`)
hubl-reactivity(data-src=`${endpoints.post.circles}` target-src=`${endpoints.get.circles}`) hubl-reactivity(data-src=`${endpoints.post.circles}` target-src=`${endpoints.get.circles}`)
@ -72,29 +72,29 @@ html(lang="en")
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`) hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`)
include page-circle.pug include page-circle.pug
if endpoints.users || (endpoints.get && endpoints.get.users) if endpoints.users || (endpoints.get && endpoints.get.users)
#messages(hidden, data-view="messages").with-sidebar #messages(hidden, data-view="messages", no-render).with-sidebar
include page-messages.pug include page-messages.pug
if endpoints.polls || (endpoints.get && endpoints.get.polls) if endpoints.polls || (endpoints.get && endpoints.get.polls)
#polls(hidden, data-view="polls").with-sidebar #polls(hidden, data-view="polls", no-render).with-sidebar
include page-polls.pug include page-polls.pug
if endpoints.events || (endpoints.get && endpoints.get.events) if endpoints.events || (endpoints.get && endpoints.get.events)
#events(hidden, data-view="events") #events(hidden, data-view="events", no-render)
include page-events.pug include page-events.pug
if endpoints.resources || (endpoints.get && endpoints.get.resources) if endpoints.resources || (endpoints.get && endpoints.get.resources)
#resources(hidden, data-view="resources") #resources(hidden, data-view="resources", no-render)
include page-resources.pug include page-resources.pug
#admin(hidden, data-view="admin").with-sidebar #admin(hidden, data-view="admin", no-render).with-sidebar
include page-admin.pug include page-admin.pug
#about(data-view="about").no-sidebar.with-padding #about(data-view="about", no-render).no-sidebar.with-padding
include page-about.pug include page-about.pug
if (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.uploads || (endpoints.post && endpoints.post.uploads)) && (endpoints.users || (endpoints.post && endpoints.post.users)) if (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.uploads || (endpoints.post && endpoints.post.uploads)) && (endpoints.users || (endpoints.post && endpoints.post.users))
#profile(hidden, data-view="profile").no-sidebar #profile(hidden, data-view="profile", no-render).no-sidebar
include page-profile.pug include page-profile.pug
if analytics if analytics

View File

@ -15,12 +15,12 @@
"project": "project", "project": "project",
"circle": "circle" "circle": "circle"
}, },
"dashboard": "Dahsboard", "dashboard": "Dashboard",
"events": "Events", "events": "Events",
"gov": "Governance", "gov": "Governance",
"resources": "Resources", "resources": "Resources",
"jobBoard": "Job offers", "jobBoard": "Job offers",
"profileDirectory": "Members directory", "profileDirectory": "Profiles directory",
"projects": "Projects", "projects": "Projects",
"circles": "Circles", "circles": "Circles",
"messages": "Messages", "messages": "Messages",

View File

@ -1,5 +1,8 @@
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const resizeChat = () => { const resizeChat = () => {
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")) let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat"))
.map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false) .map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
.filter((el) => el) .filter((el) => el)
@ -19,7 +22,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll("#viewport .chat-view") document.querySelectorAll("#viewport .chat-view")
); );
viewportChat.forEach( viewportChat.forEach(
(c) => (c.style.height = "calc(100vh - 106px - 57px - 4px)") (c) => (c.style.height = isMobile ? (isFirefox && isFirefoxMobile) ? "calc(100vh - 106px - 57px)" : "calc(100vh - 106px)" : "calc(100vh - 64px - 83px)")
); );
} }
} }
@ -33,7 +36,7 @@ document.addEventListener("DOMContentLoaded", () => {
clearInterval(isbody); clearInterval(isbody);
resizeChat(); resizeChat();
} }
}, 15); }, 50);
window.addEventListener("load", () => { window.addEventListener("load", () => {
setTimeout(() => { setTimeout(() => {
@ -41,10 +44,12 @@ document.addEventListener("DOMContentLoaded", () => {
}, 0); }, 0);
}); });
let windowResizing;
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
setTimeout(() => { windowResizing = setTimeout(() => {
clearInterval(windowResizing);
resizeChat(); resizeChat();
}, 0); }, 50);
}); });
document.addEventListener("navigate", () => { document.addEventListener("navigate", () => {

View File

@ -10,8 +10,6 @@ document.addEventListener("DOMContentLoaded", function () {
document document
.querySelector('.loggedIn') .querySelector('.loggedIn')
.setAttribute("style", "display:none !important"); .setAttribute("style", "display:none !important");
} else {
document.querySelector('sib-auth').login();
} }
}); });
}); });

View File

@ -1,11 +1,11 @@
// if('serviceWorker' in navigator) { if('serviceWorker' in navigator) {
// var refreshing; var refreshing;
// navigator.serviceWorker.addEventListener('controllerchange', () => { navigator.serviceWorker.addEventListener('controllerchange', () => {
// if (refreshing) { if (refreshing) {
// return; return;
// } }
// refreshing = true; refreshing = true;
// window.location.reload(); window.location.reload();
// }); });
// navigator.serviceWorker.register('/sw.js'); navigator.serviceWorker.register('/sw.js');
// } }

View File

@ -9,5 +9,8 @@
} }
.avatar-text { .avatar-text {
position: absolute; position: absolute;
top: 2.8rem; top: 7.5rem;
@include breakpoint(lg) {
top: 2.8rem;
}
} }