Skip to content

Commit 688333d

Browse files
committed
Add automatic range refresh based on time zone
1 parent 701bd7e commit 688333d

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

src/main/java/org/computate/frFR/java/EcrirePageClasse.java

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,12 @@ public void pageCodeClasseJava(String langueNom, JsonObject langueConfig) throws
13151315
wJsRechercheInit.tl(5, "document.querySelector('#pageFacetRangeGap", classeNomSimple, "_", entiteVar, "')?.addEventListener('", "sl-".equals(composantsWebPrefixe) ? "sl-" : "", "change', (event) => {");
13161316
wJsRechercheInit.tl(6, "facetRangeGapChange('", classeNomSimple, "', event.currentTarget);");
13171317
wJsRechercheInit.tl(5, "});");
1318+
wJsRechercheInit.tl(5, "document.querySelector('#pageFacetRangeStart", classeNomSimple, "_", entiteVar, "')?.addEventListener('", "sl-".equals(composantsWebPrefixe) ? "sl-" : "", "change', (event) => {");
1319+
wJsRechercheInit.tl(6, "facetRangeStartChange('", classeNomSimple, "', event.currentTarget);");
1320+
wJsRechercheInit.tl(5, "});");
1321+
wJsRechercheInit.tl(5, "document.querySelector('#pageFacetRangeEnd", classeNomSimple, "_", entiteVar, "')?.addEventListener('", "sl-".equals(composantsWebPrefixe) ? "sl-" : "", "change', (event) => {");
1322+
wJsRechercheInit.tl(6, "facetRangeEndChange('", classeNomSimple, "', event.currentTarget);");
1323+
wJsRechercheInit.tl(5, "});");
13181324
}
13191325

13201326
if("Boolean".equals(entiteNomSimple) && entiteVar.equals(langueConfig.getString(I18n.var_archive))) {
@@ -3083,6 +3089,26 @@ public void ecrirePageHeadJinja(String langueNom, JsonObject i18nPage, Boolean e
30833089
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "GapChange", classeNomSimple, "(", i18nPage.getString(I18n.var_classeNomSimple), ", event) {");
30843090
tl(4, "facet", i18nPage.getString(I18n.var_Gamme), "GapChange(", i18nPage.getString(I18n.var_classeNomSimple), ", event, facet", i18nPage.getString(I18n.var_Gamme), "GapChange", classeNomSimple, "Success, facet", i18nPage.getString(I18n.var_Gamme), "GapChange", classeNomSimple, "Error);");
30853091
tl(3, "}");
3092+
l();
3093+
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Success(pageContent) {");
3094+
tl(0, "{% block facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Success %}{%- endblock facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Success %}");
3095+
tl(3, "}");
3096+
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Error(pageContent) {");
3097+
tl(0, "{% block facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Error %}{%- endblock facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Error %}");
3098+
tl(3, "}");
3099+
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "(", i18nPage.getString(I18n.var_classeNomSimple), ", event) {");
3100+
tl(4, "facet", i18nPage.getString(I18n.var_Gamme), "StartChange(", i18nPage.getString(I18n.var_classeNomSimple), ", event, facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Success, facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "Error);");
3101+
tl(3, "}");
3102+
l();
3103+
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Success(pageContent) {");
3104+
tl(0, "{% block facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Success %}{%- endblock facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Success %}");
3105+
tl(3, "}");
3106+
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Error(pageContent) {");
3107+
tl(0, "{% block facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Error %}{%- endblock facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Error %}");
3108+
tl(3, "}");
3109+
tl(3, "function facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "(", i18nPage.getString(I18n.var_classeNomSimple), ", event) {");
3110+
tl(4, "facet", i18nPage.getString(I18n.var_Gamme), "EndChange(", i18nPage.getString(I18n.var_classeNomSimple), ", event, facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Success, facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "Error);");
3111+
tl(3, "}");
30863112
}
30873113
tl(2, "</script>");
30883114
tl(2, "<script type=\"module\">");
@@ -3139,10 +3165,10 @@ public void ecrirePageHeadJinja(String langueNom, JsonObject i18nPage, Boolean e
31393165
tl(4, "window.varsFq = JSON.parse('{{ toJsonObjectStringInApostrophes(varsFq) }}');");
31403166
tl(4, "window.varsRange = JSON.parse('{{ toJsonObjectStringInApostrophes(varsRange) }}');");
31413167
tl(4, "window.defaultRangeVar = '{{ defaultRangeVar }}';");
3168+
tl(4, "document.querySelector('#siteSidebarToggleRange')?.addEventListener('wa-after-hide', function(e) { document.querySelector('#pageFacetRangeTimeZonePopup').active = false; });");
3169+
tl(4, "document.querySelector('#pageFacetRangeTimeZoneInput')?.addEventListener('input', siteSuggestTimeZone);");
3170+
tl(4, "document.querySelector('#pageFacetRangeTimeZoneInput')?.addEventListener('focus', siteSuggestTimeZone);");
31423171
tl(4, i18nPage.getString(I18n.var_page), i18nPage.getString(I18n.var_Graphique), classeNomSimple, "();");
3143-
3144-
3145-
31463172
tl(4, "{% for key, value in varsQ.items() %}");
31473173
l();
31483174
tl(4, "document.querySelector('#q", classeNomSimple, "_{{ key }}')?.addEventListener('", composantsWebPrefixe, "{% if var == '", classeVarSuggere, "' %}keyup{% else %}", "sl-".equals(composantsWebPrefixe) ? "sl-" : "", "change{% endif %}', event => {");
@@ -5119,6 +5145,26 @@ public void ecrirePageBarreLaterale(String langueNom, JsonObject i18nPage) throw
51195145
tl(8, "</tr>");
51205146
tl(7, "</table>");
51215147

5148+
tl(7, "<div>");
5149+
tl(8, "<wa-popup placement=\"bottom-start\" id=\"pageFacetRangeTimeZonePopup\">");
5150+
t(9, "<wa-input");
5151+
s(" type=\"text\"");
5152+
s(" slot=\"anchor\"");
5153+
s(" placeholder=\"", i18nPage.getString(I18n.str_fuseau_horaire), "\"");
5154+
s(" label=\"", i18nPage.getString(I18n.str_fuseau_horaire), "\"");
5155+
s(" hint=\"", String.format(i18nPage.getString(I18n.str_Le_fuseau_horaire_description), classeCeNom), "\"");
5156+
s(" id=\"pageFacetRangeTimeZoneInput\"");
5157+
s(" data-popup=\"pageFacetRangeTimeZonePopup\"");
5158+
s(" data-list=\"pageFacetRangeTimeZoneList\"");
5159+
s(" autocomplete=\"off\"");
5160+
s(" value=\"{{ defaultZoneId | e }}\"");
5161+
s(" size=\"medium\"");
5162+
s(" appearance=\"outlined\"");
5163+
s(">");
5164+
l("</wa-input>");
5165+
tl(9, "<div id=\"pageFacetRangeTimeZoneList\"></div>");
5166+
tl(8, "</wa-popup>");
5167+
tl(7, "</div>");
51225168
tl(7, "<table>");
51235169
tl(8, "<tr class=\"\">");
51245170
tl(9, "<td class=\"\">");
@@ -5153,7 +5199,7 @@ public void ecrirePageBarreLaterale(String langueNom, JsonObject i18nPage) throw
51535199
s(" name=\"facetRangeStart\"");
51545200
s(" id=\"pageSearchVal-pageFacetRangeStart-", classeNomSimple, "-input\"");
51555201
s(" value=\"{{ formatZonedDateTime(defaultRangeStart, \"yyyy-MM-dd'T'HH:mm\", defaultLocaleId, defaultZoneId) }}\"");
5156-
s(" onchange=\"facet", i18nPage.getString(I18n.var_Gamme), "StartChange('", classeNomSimple, "', this, '{{ defaultZoneId }}'); \"");
5202+
s(" onchange=\"facet", i18nPage.getString(I18n.var_Gamme), "StartChange", classeNomSimple, "('", classeNomSimple, "', this, '{{ defaultZoneId }}'); \"");
51575203
l("></", composantsWebPrefixe, "input></span>");
51585204
tl(9, "</td>");
51595205
tl(8, "</tr>");
@@ -5170,7 +5216,7 @@ public void ecrirePageBarreLaterale(String langueNom, JsonObject i18nPage) throw
51705216
s(" name=\"facetRangeEnd\"");
51715217
s(" id=\"pageSearchVal-pageFacetRangeEnd-", classeNomSimple, "-input\"");
51725218
s(" value=\"{{ formatZonedDateTime(defaultRangeEnd, \"yyyy-MM-dd'T'HH:mm\", defaultLocaleId, defaultZoneId) }}\"");
5173-
s(" onchange=\"facet", i18nPage.getString(I18n.var_Gamme), "EndChange('", classeNomSimple, "', this, '{{ defaultZoneId }}'); \"");
5219+
s(" onchange=\"facet", i18nPage.getString(I18n.var_Gamme), "EndChange", classeNomSimple, "('", classeNomSimple, "', this, '{{ defaultZoneId }}'); \"");
51745220
l("></", composantsWebPrefixe, "input></span>");
51755221
tl(9, "</td>");
51765222
tl(8, "</tr>");

0 commit comments

Comments
 (0)