From a0681cbf03de6129b0829444f353b9014b94cdf6 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Wed, 13 May 2020 13:19:04 +0200 Subject: [PATCH 1/2] Adding proper fix on the interface language --- src/scripts/coopstarter.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 28dbd00e..1bd306d5 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -374,13 +374,13 @@ async function manageSelectLanguage() { //We retrieve element of the url var pathAfterThePrefix = window.location.pathname.split('/')[2]; - var base_url = location.host + var baseUrl = location.protocol + '//' + location.host //If the selected language is french let languagesList = await item.component.resource['ldp:contains']; languagesList.forEach(async (resource) => { if (item.component.value.languages['@id'] == resource['@id']) { - var redirect = "http://"+base_url+'/' + (await resource.code).toLowerCase() + '/'+pathAfterThePrefix + var redirect = baseUrl + '/' + (await resource.code).toLowerCase() + '/'+pathAfterThePrefix document.location.href = redirect } }); @@ -494,14 +494,16 @@ function addProperFilterToSearchComponents(targetId) { let instance_only = baseElement.querySelectorAll( ".instance_database_only" )[0]; - let checkbox_instance_only = instance_only.querySelector("input"); - if (checkbox_instance_only) { - checkbox_instance_only.onclick = function() { - if (this.checked) { - //We have to retrieve all data-scr needed to make them pointed only on the instance. - //How to? - } - }; + if (instance_only) { + let checkbox_instance_only = instance_only.querySelector("input"); + if (checkbox_instance_only) { + checkbox_instance_only.onclick = function() { + if (this.checked) { + //We have to retrieve all data-scr needed to make them pointed only on the instance. + //How to? + } + }; + } } //MORE CRITERIAS -- GitLab From 9feee96eb89187ca9c25515e4295df8e7116d469 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Wed, 13 May 2020 16:15:29 +0200 Subject: [PATCH 2/2] Some fixes --- src/includes/head.pug | 7 ++++++- src/scripts/coopstarter.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/includes/head.pug b/src/includes/head.pug index 73072a18..10553caa 100644 --- a/src/includes/head.pug +++ b/src/includes/head.pug @@ -25,6 +25,11 @@ head { "entrepreneurProfile": "http://happy-dev.fr/owl/#entrepreneur_profile", "mentorProfile": "http://happy-dev.fr/owl/#mentor_profile", - "account": "http://happy-dev.fr/owl/#account" + "account":"hd:account", + "avatar":"foaf:depiction", + "picture":"foaf:depiction", + "messageSet":"http://happy-dev.fr/owl/#message_set", + "author":"http://happy-dev.fr/owl/#author_user", + "title":"http://happy-dev.fr/owl/#title" } diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 1bd306d5..9e2b4af6 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -159,6 +159,7 @@ function selectHiddenManagement(select_hidden, option_selected) { //Trigerring a reload of the associated form let parent_form = select_hidden.closest("sib-form"); parent_form.component.inputChange(); + parent_form.dispatchEvent(new CustomEvent('formChange')); refreshPagination(); } @@ -171,6 +172,7 @@ function inputHiddenManagement(field, field_search) { field.setAttribute("value", field_search.value); let parent_form = field.closest("sib-form"); parent_form.component.inputChange(); + parent_form.dispatchEvent(new CustomEvent('formChange')); refreshPagination(); } @@ -205,6 +207,7 @@ function selectHiddenManagementForType(tab, form) { let parent_form = select_hidden.closest("sib-form"); if (parent_form) { parent_form.component.inputChange(); + parent_form.dispatchEvent(new CustomEvent('formChange')); refreshPagination(); } }); @@ -239,6 +242,7 @@ function InitManagementForType() { //Trigerring a reload of the associated form let parent_form = select_hidden.closest("sib-form"); parent_form.component.inputChange(); + parent_form.dispatchEvent(new CustomEvent('formChange')); refreshPagination(); }); }); @@ -485,6 +489,7 @@ function addProperFilterToSearchComponents(targetId) { let parent_form = hidden_field.closest("sib-form"); parent_form.component.inputChange(); + parent_form.dispatchEvent(new CustomEvent('formChange')); refreshPagination(); }); }); -- GitLab