This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch feature/WW-5256-compress in repository https://gitbox.apache.org/repos/asf/struts.git
commit 4038b8e25a1c75c3a0df9f547d04cb2378cc9196 Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Sun Jul 14 09:23:34 2024 +0200 WW-5256 Improves html rendering in simple theme by using compress directive --- core/src/main/resources/template/simple/a-close.ftl | 4 +++- core/src/main/resources/template/simple/actionerror.ftl | 4 +++- core/src/main/resources/template/simple/actionmessage.ftl | 4 +++- core/src/main/resources/template/simple/checkbox.ftl | 2 ++ core/src/main/resources/template/simple/checkboxlist.ftl | 2 ++ core/src/main/resources/template/simple/combobox.ftl | 2 ++ core/src/main/resources/template/simple/css.ftl | 4 +++- core/src/main/resources/template/simple/doubleselect.ftl | 2 ++ core/src/main/resources/template/simple/fielderror.ftl | 4 +++- core/src/main/resources/template/simple/file.ftl | 4 +++- core/src/main/resources/template/simple/form-common.ftl | 4 +++- core/src/main/resources/template/simple/hidden.ftl | 4 +++- core/src/main/resources/template/simple/inputtransferselect.ftl | 2 ++ core/src/main/resources/template/simple/label.ftl | 4 +++- core/src/main/resources/template/simple/link.ftl | 2 ++ core/src/main/resources/template/simple/optgroup.ftl | 4 +++- core/src/main/resources/template/simple/optiontransferselect.ftl | 2 ++ core/src/main/resources/template/simple/password.ftl | 4 +++- .../main/resources/template/simple/prefixed-dynamic-attributes.ftl | 3 ++- core/src/main/resources/template/simple/radiomap.ftl | 2 ++ core/src/main/resources/template/simple/reset.ftl | 4 +++- core/src/main/resources/template/simple/script.ftl | 2 ++ core/src/main/resources/template/simple/scripting-events.ftl | 4 +++- core/src/main/resources/template/simple/select.ftl | 2 ++ core/src/main/resources/template/simple/submit.ftl | 2 ++ core/src/main/resources/template/simple/text.ftl | 4 +++- core/src/main/resources/template/simple/textarea.ftl | 2 ++ core/src/main/resources/template/simple/updownselect.ftl | 2 ++ 28 files changed, 70 insertions(+), 15 deletions(-) diff --git a/core/src/main/resources/template/simple/a-close.ftl b/core/src/main/resources/template/simple/a-close.ftl index 926db795e..2c34d7d8f 100644 --- a/core/src/main/resources/template/simple/a-close.ftl +++ b/core/src/main/resources/template/simple/a-close.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <a<#rt/> <#if attributes.id??> id="${attributes.id}"<#rt/> @@ -43,4 +44,5 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/scripting-events.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> ->${tag.escapeHtmlBody()?then(attributes.body, attributes.body?no_esc)}</a> \ No newline at end of file +>${tag.escapeHtmlBody()?then(attributes.body, attributes.body?no_esc)}</a> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/actionerror.ftl b/core/src/main/resources/template/simple/actionerror.ftl index 4cd9a60b9..3073836fb 100644 --- a/core/src/main/resources/template/simple/actionerror.ftl +++ b/core/src/main/resources/template/simple/actionerror.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if (actionErrors?? && actionErrors?size > 0)> <ul<#rt/> <#if attributes.id??> @@ -38,4 +39,5 @@ </#if> </#list> </ul> -</#if> \ No newline at end of file +</#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/actionmessage.ftl b/core/src/main/resources/template/simple/actionmessage.ftl index 8933c2265..9b5118add 100644 --- a/core/src/main/resources/template/simple/actionmessage.ftl +++ b/core/src/main/resources/template/simple/actionmessage.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if (actionMessages?? && actionMessages?size > 0 && !attributes.isEmptyList)> <ul<#rt/> <#if attributes.id??> @@ -38,4 +39,5 @@ </#if> </#list> </ul> -</#if> \ No newline at end of file +</#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/checkbox.ftl b/core/src/main/resources/template/simple/checkbox.ftl index c1839f3f4..9fd3270e0 100644 --- a/core/src/main/resources/template/simple/checkbox.ftl +++ b/core/src/main/resources/template/simple/checkbox.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <input type="checkbox" name="${attributes.name}" value="${attributes.fieldValue}"<#rt/> <#if attributes.nameValue?? && attributes.nameValue> checked="checked"<#rt/> @@ -46,3 +47,4 @@ </#if> /><#rt/> </#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/checkboxlist.ftl b/core/src/main/resources/template/simple/checkboxlist.ftl index 63cf52e32..25aad312e 100644 --- a/core/src/main/resources/template/simple/checkboxlist.ftl +++ b/core/src/main/resources/template/simple/checkboxlist.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#assign itemCount = 0/> <#if attributes.list??> <@s.iterator value="attributes.list"> @@ -114,3 +115,4 @@ disabled="disabled"<#rt/> </#if> /> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/combobox.ftl b/core/src/main/resources/template/simple/combobox.ftl index 400ae450d..a61295557 100644 --- a/core/src/main/resources/template/simple/combobox.ftl +++ b/core/src/main/resources/template/simple/combobox.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <@s.script> function autoPopulate_${attributes.escapedId}(targetElement) { <#if attributes.headerKey?? && attributes.headerValue??> @@ -99,3 +100,4 @@ </@s.iterator> </select> </#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/css.ftl b/core/src/main/resources/template/simple/css.ftl index ec111c7a7..83203feb8 100644 --- a/core/src/main/resources/template/simple/css.ftl +++ b/core/src/main/resources/template/simple/css.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#assign hasFieldErrors = attributes.name?? && fieldErrors?? && fieldErrors.get(attributes.name)??/> <#if attributes.cssClass?has_content && !(hasFieldErrors && attributes.cssErrorClass??)> class="${attributes.cssClass}"<#rt/> @@ -30,4 +31,5 @@ style="${attributes.cssStyle}"<#rt/> <#elseif hasFieldErrors && attributes.cssErrorStyle??> style="${attributes.cssErrorStyle}"<#rt/> -</#if> \ No newline at end of file +</#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/doubleselect.ftl b/core/src/main/resources/template/simple/doubleselect.ftl index 342f199c2..6833d365d 100644 --- a/core/src/main/resources/template/simple/doubleselect.ftl +++ b/core/src/main/resources/template/simple/doubleselect.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#global dynamic_attributes_ignore = "second-"/> <#include "/${attributes.templateDir}/simple/select.ftl" /> <#assign startCount = 0/><#rt/> @@ -235,3 +236,4 @@ } } </@s.script> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/fielderror.ftl b/core/src/main/resources/template/simple/fielderror.ftl index 1a70e1f8c..df5f42167 100644 --- a/core/src/main/resources/template/simple/fielderror.ftl +++ b/core/src/main/resources/template/simple/fielderror.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if fieldErrors??><#t/> <#assign eKeys = fieldErrors.keySet()><#t/> <#assign eKeysSize = eKeys.size()><#t/> @@ -77,4 +78,5 @@ </ul> </#if><#t/> </#if><#t/> -</#if><#t/> \ No newline at end of file +</#if><#t/> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/file.ftl b/core/src/main/resources/template/simple/file.ftl index 521395871..4621e41bd 100644 --- a/core/src/main/resources/template/simple/file.ftl +++ b/core/src/main/resources/template/simple/file.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <input type="file"<#rt/> name="${(attributes.name!"")}"<#rt/> <#if attributes.get("size")?has_content> @@ -42,4 +43,5 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/scripting-events.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> -/> \ No newline at end of file +/> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/form-common.ftl b/core/src/main/resources/template/simple/form-common.ftl index 035a7b212..cc5c5d94a 100644 --- a/core/src/main/resources/template/simple/form-common.ftl +++ b/core/src/main/resources/template/simple/form-common.ftl @@ -20,6 +20,7 @@ * under the License. */ --> +<@compress single_line=true> <#if (attributes.validate!false == false)><#rt/> <#if attributes.onsubmit?has_content><#rt/> ${tag.addParameter('onsubmit', "${attributes.onsubmit}") } @@ -64,4 +65,5 @@ <#if attributes.acceptcharset?has_content> accept-charset="${attributes.acceptcharset}"<#rt/> </#if> -<#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> \ No newline at end of file +<#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/hidden.ftl b/core/src/main/resources/template/simple/hidden.ftl index 7b0b3c175..cbb3c8fd2 100644 --- a/core/src/main/resources/template/simple/hidden.ftl +++ b/core/src/main/resources/template/simple/hidden.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <input type="hidden"<#rt/> name="${(attributes.name!"")}"<#rt/> <#if attributes.nameValue??> @@ -36,4 +37,5 @@ disabled="disabled"<#rt/> </#if> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> -/> \ No newline at end of file +/> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/inputtransferselect.ftl b/core/src/main/resources/template/simple/inputtransferselect.ftl index c0ff17a14..f4c82d02a 100644 --- a/core/src/main/resources/template/simple/inputtransferselect.ftl +++ b/core/src/main/resources/template/simple/inputtransferselect.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if !stack.findValue("#inputtransferselect_js_included")??><#t/> <@s.script src="${base}${attributes.staticContentPath}/inputtransferselect.js"/> <#assign temporaryVariable = stack.setValue("#inputtransferselect_js_included", "true") /><#t/> @@ -122,3 +123,4 @@ </td> </tr> </table> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/label.ftl b/core/src/main/resources/template/simple/label.ftl index fb6864431..f653d524a 100644 --- a/core/src/main/resources/template/simple/label.ftl +++ b/core/src/main/resources/template/simple/label.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <label<#rt/> <#if attributes.id?has_content> id="${attributes.id}"<#rt/> @@ -35,4 +36,5 @@ <#if attributes.nameValue??> <@s.property value="attributes.nameValue"/><#t/> </#if> -</label> \ No newline at end of file +</label> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/link.ftl b/core/src/main/resources/template/simple/link.ftl index 53a00581d..e92353e3b 100644 --- a/core/src/main/resources/template/simple/link.ftl +++ b/core/src/main/resources/template/simple/link.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <link<#rt/> <#if attributes.rel?has_content> rel="${attributes.rel}"<#rt/> @@ -62,3 +63,4 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /><#rt/> <#include "/${attributes.templateDir}/${attributes.expandTheme}/nonce.ftl" /><#rt/> /> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/optgroup.ftl b/core/src/main/resources/template/simple/optgroup.ftl index 22e74c350..80948700d 100644 --- a/core/src/main/resources/template/simple/optgroup.ftl +++ b/core/src/main/resources/template/simple/optgroup.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if attributes.optGroupInternalListUiBeanList??> <#assign optGroupInternalListUiBeans=attributes.optGroupInternalListUiBeanList /> <#list optGroupInternalListUiBeans as optGroupInternalListUiBean> @@ -66,4 +67,5 @@ </#list> </optgroup> </#list> -</#if> \ No newline at end of file +</#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/optiontransferselect.ftl b/core/src/main/resources/template/simple/optiontransferselect.ftl index abf920cd8..ce75b0cc8 100644 --- a/core/src/main/resources/template/simple/optiontransferselect.ftl +++ b/core/src/main/resources/template/simple/optiontransferselect.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if !stack.findValue("#optiontransferselect_js_included")??><#t/> <@s.script src="${base}${attributes.staticContentPath}/optiontransferselect.js" /> <#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/> @@ -300,3 +301,4 @@ </td> </tr> </table> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/password.ftl b/core/src/main/resources/template/simple/password.ftl index d592ade69..1e2d37b23 100644 --- a/core/src/main/resources/template/simple/password.ftl +++ b/core/src/main/resources/template/simple/password.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <input type="password"<#rt/> name="${(attributes.name!"")}"<#rt/> <#if attributes.get("size")?has_content> @@ -48,4 +49,5 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/scripting-events.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> -/> \ No newline at end of file +/> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/prefixed-dynamic-attributes.ftl b/core/src/main/resources/template/simple/prefixed-dynamic-attributes.ftl index 90a2d1cb8..0ee15b845 100644 --- a/core/src/main/resources/template/simple/prefixed-dynamic-attributes.ftl +++ b/core/src/main/resources/template/simple/prefixed-dynamic-attributes.ftl @@ -1,3 +1,4 @@ +<#ftl strip_text=true> <#-- /* * Licensed to the Apache Software Foundation (ASF) under one @@ -33,4 +34,4 @@ </#if> </#list><#rt/> </#if><#rt/> -</#macro> +</#macro> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/radiomap.ftl b/core/src/main/resources/template/simple/radiomap.ftl index 524bc7f7f..f057275e9 100644 --- a/core/src/main/resources/template/simple/radiomap.ftl +++ b/core/src/main/resources/template/simple/radiomap.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <@s.iterator value="attributes.list"> <#if attributes.listKey??> <#assign itemKey = stack.findValue(attributes.listKey)/> @@ -101,3 +102,4 @@ ${itemValue}<#t/> </label> </@s.iterator> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/reset.ftl b/core/src/main/resources/template/simple/reset.ftl index ba7619972..fa2e2dcdf 100644 --- a/core/src/main/resources/template/simple/reset.ftl +++ b/core/src/main/resources/template/simple/reset.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if attributes.type?? && attributes.type=="button"> <button type="reset"<#rt/> <#if attributes.name?has_content> @@ -77,4 +78,5 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> /> -</#if> \ No newline at end of file +</#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/script.ftl b/core/src/main/resources/template/simple/script.ftl index 51141b626..cde807903 100644 --- a/core/src/main/resources/template/simple/script.ftl +++ b/core/src/main/resources/template/simple/script.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <script<#rt/> <#if attributes.async?has_content && attributes.async == "true"> async<#rt/> @@ -49,3 +50,4 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/nonce.ftl" />> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/scripting-events.ftl b/core/src/main/resources/template/simple/scripting-events.ftl index 45dc8dab4..74d7d699c 100644 --- a/core/src/main/resources/template/simple/scripting-events.ftl +++ b/core/src/main/resources/template/simple/scripting-events.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if attributes.onclick??> onclick="<#outputformat 'JavaScript'>${attributes.onclick}</#outputformat>"<#rt/> </#if> @@ -59,4 +60,5 @@ </#if> <#if attributes.onchange??> onchange="<#outputformat 'JavaScript'>${attributes.onchange}</#outputformat>"<#rt/> -</#if> \ No newline at end of file +</#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/select.ftl b/core/src/main/resources/template/simple/select.ftl index 40dc15ae8..ff0a53389 100644 --- a/core/src/main/resources/template/simple/select.ftl +++ b/core/src/main/resources/template/simple/select.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#setting number_format="#.#####"> <select<#rt/> name="${(attributes.name!"")}"<#rt/> @@ -143,3 +144,4 @@ </#if> /> </#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/submit.ftl b/core/src/main/resources/template/simple/submit.ftl index a6cdf7cd8..eaf7c9654 100644 --- a/core/src/main/resources/template/simple/submit.ftl +++ b/core/src/main/resources/template/simple/submit.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if attributes.type?? && attributes.type=="button"> <button type="submit"<#rt/> <#if attributes.id?has_content> @@ -89,3 +90,4 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> /> </#if> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/text.ftl b/core/src/main/resources/template/simple/text.ftl index 995657ac3..bee10b849 100644 --- a/core/src/main/resources/template/simple/text.ftl +++ b/core/src/main/resources/template/simple/text.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <input<#rt/> type="${(attributes.type!"text")}"<#rt/> name="${(attributes.name!"")}"<#rt/> @@ -49,4 +50,5 @@ <#include "/${attributes.templateDir}/${attributes.expandTheme}/scripting-events.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl" /> <#include "/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl" /> -/> \ No newline at end of file +/> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/textarea.ftl b/core/src/main/resources/template/simple/textarea.ftl index f5c6ce2f9..7937b070b 100644 --- a/core/src/main/resources/template/simple/textarea.ftl +++ b/core/src/main/resources/template/simple/textarea.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <textarea<#rt/> name="${(attributes.name!"")}"<#rt/> <#if attributes.cols?has_content> @@ -59,3 +60,4 @@ <@s.property value="attributes.nameValue"/><#t/> </#if> </textarea> +</@compress> \ No newline at end of file diff --git a/core/src/main/resources/template/simple/updownselect.ftl b/core/src/main/resources/template/simple/updownselect.ftl index a2e652702..23090ecef 100644 --- a/core/src/main/resources/template/simple/updownselect.ftl +++ b/core/src/main/resources/template/simple/updownselect.ftl @@ -18,6 +18,7 @@ * under the License. */ --> +<@compress single_line=true> <#if !stack.findValue("#optiontransferselect_js_included")??><#t/> <@s.script src="${base}${attributes.staticContentPath}/optiontransferselect.js" /><#t/> <#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/> @@ -53,3 +54,4 @@ </#if><#t/> </td></tr> </table> +</@compress> \ No newline at end of file