feature: improve page loading + intl collator
This commit is contained in:
parent
7c0f237bd0
commit
a936a343b5
@ -3,8 +3,7 @@ import SlimSelect from 'https://cdn.skypack.dev/slim-select@1.23';
|
|||||||
|
|
||||||
const HublStatus = widgetFactory(
|
const HublStatus = widgetFactory(
|
||||||
'hubl-status',
|
'hubl-status',
|
||||||
`<label>
|
`<label>\${label}</label>
|
||||||
<div>\${label}</div>
|
|
||||||
<select
|
<select
|
||||||
data-holder
|
data-holder
|
||||||
name="\${name}">
|
name="\${name}">
|
||||||
@ -14,8 +13,7 @@ const HublStatus = widgetFactory(
|
|||||||
<option
|
<option
|
||||||
value="Private"
|
value="Private"
|
||||||
\${value=="Private" ? 'selected' : ''} data-trans="hublStatus.private">Privé</option>
|
\${value=="Private" ? 'selected' : ''} data-trans="hublStatus.private">Privé</option>
|
||||||
</select>
|
</select>`,
|
||||||
</label>`,
|
|
||||||
'',
|
'',
|
||||||
formWidget => {
|
formWidget => {
|
||||||
let select = formWidget.querySelector('select');
|
let select = formWidget.querySelector('select');
|
||||||
|
@ -38,8 +38,15 @@ html(lang="en")
|
|||||||
|
|
||||||
script(src="index.js" defer)
|
script(src="index.js" defer)
|
||||||
|
|
||||||
body.notLoggedIn.bg-color-grey(style='visibility:hidden;')
|
body.bg-color-grey
|
||||||
if endpoints.get && endpoints.post
|
if endpoints.get && endpoints.post
|
||||||
|
.notLoggedIn(style='visibility:hidden;')
|
||||||
|
sib-auth(style='display:none!important', auto-login)
|
||||||
|
sib-auth-provider(
|
||||||
|
data-authority=`${authority}`
|
||||||
|
data-id=`${authorityName || "authority"}`
|
||||||
|
data-client-name=`${clientName || "Hubl"}`
|
||||||
|
)
|
||||||
|
|
||||||
include views/partials/notifications.pug
|
include views/partials/notifications.pug
|
||||||
include views/partials/widgets.pug
|
include views/partials/widgets.pug
|
||||||
@ -124,6 +131,13 @@ html(lang="en")
|
|||||||
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}current/`)
|
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}current/`)
|
||||||
include views/page-job-offers.pug
|
include views/page-job-offers.pug
|
||||||
|
|
||||||
|
.loggedIn(style='position:absolute;top:calc(50% - 10px);left:calc(50% - 40px);')
|
||||||
|
div.loader
|
||||||
|
div
|
||||||
|
div
|
||||||
|
div
|
||||||
|
div
|
||||||
|
|
||||||
if analytics
|
if analytics
|
||||||
each provider in analytics
|
each provider in analytics
|
||||||
if provider.type && provider.url && provider.url
|
if provider.type && provider.url && provider.url
|
||||||
|
@ -187,13 +187,15 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
|
|
||||||
// Detect the lang & initialize, based on the browser or "language" item from localstorage
|
// Detect the lang & initialize, based on the browser or "language" item from localstorage
|
||||||
jsI18n.detectLanguage();
|
jsI18n.detectLanguage();
|
||||||
|
let timer;
|
||||||
(new MutationObserver((mutations) => {
|
(new MutationObserver((mutations) => {
|
||||||
mutations.forEach(mutation => {
|
mutations.forEach(mutation => {
|
||||||
if(mutation.target.attributes["data-trans"] != null) {
|
if(mutation.target.attributes["data-trans"] != null) {
|
||||||
// Render the target of the mutation instantly
|
// Render the target of the mutation instantly
|
||||||
jsI18n.processNode(mutation.target);
|
jsI18n.processNode(mutation.target);
|
||||||
// Then wait one arbitrary second to re-render the whole document in case a widget re-rendered
|
// Then wait one arbitrary second to re-render the whole document in case a widget re-rendered
|
||||||
setTimeout(() => jsI18n.processNode(document.querySelector('body')), 1000);
|
clearTimeout(timer);
|
||||||
|
timer = setTimeout(() => jsI18n.processNode(document.querySelector('body')), 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).observe(document.body, {
|
}).observe(document.body, {
|
||||||
|
@ -7,6 +7,9 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
document
|
document
|
||||||
.querySelectorAll(".notLoggedIn")
|
.querySelectorAll(".notLoggedIn")
|
||||||
.forEach(el => (el.style.visibility = "visible"));
|
.forEach(el => (el.style.visibility = "visible"));
|
||||||
|
document
|
||||||
|
.querySelectorAll(".loggedIn")
|
||||||
|
.forEach(el => (el.style.display = "none"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -127,7 +127,8 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
|
|||||||
id="hubl_project_is_admin"
|
id="hubl_project_is_admin"
|
||||||
fields="is_admin"
|
fields="is_admin"
|
||||||
value-is_admin='true'
|
value-is_admin='true'
|
||||||
widget-is_admin='solid-form-hidden'
|
widget-is_admin='solid-form-checkbox'
|
||||||
|
hidden
|
||||||
)
|
)
|
||||||
|
|
||||||
solid-widget(name='hubl-project-admins')
|
solid-widget(name='hubl-project-admins')
|
||||||
|
@ -123,11 +123,4 @@ div
|
|||||||
|
|
||||||
button.segment.lg-hidden.icon-menu#toggleMainMenu
|
button.segment.lg-hidden.icon-menu#toggleMainMenu
|
||||||
|
|
||||||
sib-auth(style='display:none!important', auto-login)
|
|
||||||
sib-auth-provider(
|
|
||||||
data-authority=`${authority}`
|
|
||||||
data-id=`${authorityName || "authority"}`
|
|
||||||
data-client-name=`${clientName || "Hubl"}`
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user