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();
}
},
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) {

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
sib-auth(style='display:none!important')
sib-auth(style='display:none!important', auto-login)
sib-auth-provider(
data-authority=`${authority}`
data-id=`${authorityName || "authority"}`

View File

@ -31,11 +31,11 @@ html(lang="en")
include page-dashboard.pug
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
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)
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}`)
@ -49,7 +49,7 @@ html(lang="en")
include page-job-offers.pug
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)
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}`)
@ -61,7 +61,7 @@ html(lang="en")
include page-project.pug
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)
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}`)
@ -72,29 +72,29 @@ html(lang="en")
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`)
include page-circle.pug
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
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
if endpoints.events || (endpoints.get && endpoints.get.events)
#events(hidden, data-view="events")
#events(hidden, data-view="events", no-render)
include page-events.pug
if endpoints.resources || (endpoints.get && endpoints.get.resources)
#resources(hidden, data-view="resources")
#resources(hidden, data-view="resources", no-render)
include page-resources.pug
#admin(hidden, data-view="admin").with-sidebar
#admin(hidden, data-view="admin", no-render).with-sidebar
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
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
if analytics

View File

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

View File

@ -1,5 +1,8 @@
document.addEventListener("DOMContentLoaded", () => {
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"))
.map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
.filter((el) => el)
@ -19,7 +22,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll("#viewport .chat-view")
);
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);
resizeChat();
}
}, 15);
}, 50);
window.addEventListener("load", () => {
setTimeout(() => {
@ -41,10 +44,12 @@ document.addEventListener("DOMContentLoaded", () => {
}, 0);
});
let windowResizing;
window.addEventListener("resize", () => {
setTimeout(() => {
windowResizing = setTimeout(() => {
clearInterval(windowResizing);
resizeChat();
}, 0);
}, 50);
});
document.addEventListener("navigate", () => {

View File

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

View File

@ -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');
// }
if('serviceWorker' in navigator) {
var refreshing;
navigator.serviceWorker.addEventListener('controllerchange', () => {
if (refreshing) {
return;
}
refreshing = true;
window.location.reload();
});
navigator.serviceWorker.register('/sw.js');
}

View File

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