This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch feature/WW-5444-html5 in repository https://gitbox.apache.org/repos/asf/struts.git
commit 461c06d0c5afde260fdb0f32038a32f2af5bb42e Author: Lukasz Lenart <[email protected]> AuthorDate: Sat Jul 20 08:16:15 2024 +0200 WW-5444 Defines new html5 theme --- .../struts2/showcase/action/Html5Action.java | 14 ++ apps/showcase/src/main/resources/struts.xml | 6 + .../src/main/resources/template/html5/a-close.ftl | 50 +++++++ .../src/main/resources/template/html5/a.ftl | 20 +++ .../main/resources/template/html5/actionerror.ftl | 44 ++++++ .../resources/template/html5/actionmessage.ftl | 44 ++++++ .../src/main/resources/template/html5/checkbox.ftl | 52 +++++++ .../main/resources/template/html5/checkboxlist.ftl | 120 +++++++++++++++++ .../src/main/resources/template/html5/combobox.ftl | 102 ++++++++++++++ .../resources/template/html5/common-attributes.ftl | 25 ++++ .../resources/template/html5/controlfooter.ftl | 20 +++ .../resources/template/html5/controlheader.ftl | 20 +++ .../src/main/resources/template/html5/css.ftl | 35 +++++ .../resources/template/html5/datetextfield.ftl | 21 +++ .../src/main/resources/template/html5/debug.ftl | 92 +++++++++++++ .../main/resources/template/html5/doubleselect.ftl | 21 +++ .../template/html5/dynamic-attributes.ftl | 45 +++++++ .../src/main/resources/template/html5/empty.ftl | 20 +++ .../main/resources/template/html5/fielderror.ftl | 84 ++++++++++++ .../src/main/resources/template/html5/file.ftl | 49 +++++++ .../main/resources/template/html5/form-close.ftl | 22 +++ .../src/main/resources/template/html5/form.ftl | 72 ++++++++++ .../src/main/resources/template/html5/head.ftl | 23 ++++ .../src/main/resources/template/html5/hidden.ftl | 43 ++++++ .../template/html5/inputtransferselect.ftl | 21 +++ .../src/main/resources/template/html5/label.ftl | 42 ++++++ .../src/main/resources/template/html5/link.ftl | 74 ++++++++++ .../src/main/resources/template/html5/nonce.ftl | 25 ++++ .../src/main/resources/template/html5/optgroup.ftl | 71 ++++++++++ .../template/html5/optiontransferselect.ftl | 21 +++ .../src/main/resources/template/html5/password.ftl | 55 ++++++++ .../template/html5/prefixed-dynamic-attributes.ftl | 37 +++++ .../src/main/resources/template/html5/radiomap.ftl | 107 +++++++++++++++ .../src/main/resources/template/html5/reset.ftl | 84 ++++++++++++ .../main/resources/template/html5/script-close.ftl | 21 +++ .../src/main/resources/template/html5/script.ftl | 53 ++++++++ .../resources/template/html5/scripting-events.ftl | 64 +++++++++ .../src/main/resources/template/html5/select.ftl | 149 +++++++++++++++++++++ .../main/resources/template/html5/submit-close.ftl | 29 ++++ .../src/main/resources/template/html5/submit.ftl | 94 +++++++++++++ .../src/main/resources/template/html5/text.ftl | 56 ++++++++ .../src/main/resources/template/html5/textarea.ftl | 65 +++++++++ .../src/main/resources/template/html5/token.ftl | 22 +++ .../main/resources/template/html5/updownselect.ftl | 21 +++ .../src/main/webapp/WEB-INF/html5/index.jsp | 69 ++++++++++ 45 files changed, 2224 insertions(+) diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/Html5Action.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/Html5Action.java new file mode 100644 index 000000000..b80c73d75 --- /dev/null +++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/Html5Action.java @@ -0,0 +1,14 @@ +package org.apache.struts2.showcase.action; + +import com.opensymphony.xwork2.ActionSupport; + +public class Html5Action extends ActionSupport { + + @Override + public String execute() throws Exception { + addActionError("Action error: only html5"); + addActionMessage("Action message: only html5"); + addFieldError("testField","Field error: only html5"); + return super.execute(); + } +} diff --git a/apps/showcase/src/main/resources/struts.xml b/apps/showcase/src/main/resources/struts.xml index 1b57083b3..5c1cf37ff 100644 --- a/apps/showcase/src/main/resources/struts.xml +++ b/apps/showcase/src/main/resources/struts.xml @@ -160,6 +160,12 @@ </action> </package> + <package name="html5" extends="default" namespace="/html5"> + <action name="index" class="org.apache.struts2.showcase.action.Html5Action"> + <result>/WEB-INF/html5/index.jsp</result> + </action> + </package> + </struts> <!-- END SNIPPET: xworkSample --> diff --git a/apps/showcase/src/main/resources/template/html5/a-close.ftl b/apps/showcase/src/main/resources/template/html5/a-close.ftl new file mode 100644 index 000000000..15465dec8 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/a-close.ftl @@ -0,0 +1,50 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<@compress single_line=true> +<a +<#if parameters.id??> + id="${parameters.id}" +</#if> +<#if parameters.href??> + href="${parameters.href?no_esc}" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#if parameters.tabindex??> + tabindex="${parameters.tabindex}" +</#if> +<#if parameters.cssClass??> + class="${parameters.cssClass}" +</#if> +<#if parameters.cssStyle??> + style="${parameters.cssStyle}" +</#if> +<#if parameters.title??> + title="${parameters.title}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +>${tag.escapeHtmlBody()?then(parameters.body, parameters.body?no_esc)}</a> +</@compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/a.ftl b/apps/showcase/src/main/resources/template/html5/a.ftl new file mode 100644 index 000000000..2ffa2ec5d --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/a.ftl @@ -0,0 +1,20 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> \ No newline at end of file diff --git a/apps/showcase/src/main/resources/template/html5/actionerror.ftl b/apps/showcase/src/main/resources/template/html5/actionerror.ftl new file mode 100644 index 000000000..e6586adef --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/actionerror.ftl @@ -0,0 +1,44 @@ +<#ftl strip_whitespace=true strip_text=true/> +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#if (actionErrors?? && actionErrors?size > 0)> + <@compress single_line=true> + <ul + <#if parameters.id??> + id="${parameters.id}" + </#if> + <#if parameters.cssClass??> + class="${parameters.cssClass}" + <#else> + class="errorMessage" + </#if> + <#if parameters.cssStyle??> + style="${parameters.cssStyle}" + </#if> + > + <#list actionErrors as error> + <#if error??><#t/> + <li><span><#if parameters.escape>${error!}<#else>${error!?no_esc}</#if></span></li> + </#if> + </#list> + </ul> + </@compress> +</#if> diff --git a/apps/showcase/src/main/resources/template/html5/actionmessage.ftl b/apps/showcase/src/main/resources/template/html5/actionmessage.ftl new file mode 100644 index 000000000..606c460e3 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/actionmessage.ftl @@ -0,0 +1,44 @@ +<#ftl strip_whitespace=true strip_text=true/> +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#if (actionMessages?? && actionMessages?size > 0 && !parameters.isEmptyList)> + <@compress single_line=true> + <ul + <#if parameters.id??> + id="${parameters.id}" + </#if> + <#if parameters.cssClass??> + class="${parameters.cssClass}" + <#else> + class="actionMessage" + </#if> + <#if parameters.cssStyle??> + style="${parameters.cssStyle}" + </#if> + > + <#list actionMessages as message> + <#if message??><#t/> + <li><span><#if parameters.escape>${message!}<#else>${message!?no_esc}</#if></span></li> + </#if> + </#list> + </ul> + </@compress> +</#if> diff --git a/apps/showcase/src/main/resources/template/html5/checkbox.ftl b/apps/showcase/src/main/resources/template/html5/checkbox.ftl new file mode 100644 index 000000000..134f5d280 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/checkbox.ftl @@ -0,0 +1,52 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<input type="checkbox" name="${parameters.name}" value="${parameters.fieldValue}" +<#if parameters.nameValue?? && parameters.nameValue> + checked="checked" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" +</#if> +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +/> +<#if parameters.submitUnchecked!false> +<input type="hidden" id="__checkbox_${parameters.id}" name="__checkbox_${parameters.name}" value="${parameters.fieldValue}" +<#if parameters.disabled!false> + disabled="disabled" +</#if> + /> +</#if> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/checkboxlist.ftl b/apps/showcase/src/main/resources/template/html5/checkboxlist.ftl new file mode 100644 index 000000000..17745976c --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/checkboxlist.ftl @@ -0,0 +1,120 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<#assign itemCount = 0/> +<#if parameters.list??> +<@s.iterator value="parameters.list"> + <#assign itemCount = itemCount + 1/> + <#if parameters.listKey??> + <#assign itemKey = stack.findValue(parameters.listKey)/> + <#assign itemKeyStr = stack.findString(parameters.listKey)/> + <#else> + <#assign itemKey = stack.findValue('top')/> + <#assign itemKeyStr = stack.findString('top')> + </#if> + <#if parameters.listLabelKey??> + <#-- checks the valueStack for the 'valueKey.' The valueKey is then looked-up in the locale + file for it's localized value. This is then used as a label --> + <#assign itemValue = struts.getText(stack.findString(parameters.listLabelKey))/> + <#elseif parameters.listValue??> + <#assign itemValue = stack.findString(parameters.listValue)!""/> + <#else> + <#assign itemValue = stack.findString('top')/> + </#if> + <#if parameters.listCssClass??> + <#if stack.findString(parameters.listCssClass)??> + <#assign itemCssClass= stack.findString(parameters.listCssClass)/> + <#else> + <#assign itemCssClass = ''/> + </#if> + </#if> + <#if parameters.listCssStyle??> + <#if stack.findString(parameters.listCssStyle)??> + <#assign itemCssStyle= stack.findString(parameters.listCssStyle)/> + <#else> + <#assign itemCssStyle = ''/> + </#if> + </#if> + <#if parameters.listTitle??> + <#if stack.findString(parameters.listTitle)??> + <#assign itemTitle= stack.findString(parameters.listTitle)/> + <#else> + <#assign itemTitle = ''/> + </#if> + </#if> +<input type="checkbox" name="${parameters.name}" value="${itemKeyStr}" +<#if parameters.id?has_content> + id="${parameters.id}-${itemCount}" +<#else> + id="${parameters.name}-${itemCount}" +</#if> +<#if tag.contains(parameters.nameValue, itemKey)> + checked="checked" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#if itemCssClass??> + class="${itemCssClass}" +<#else> +<#if parameters.cssClass?has_content> + class="${parameters.cssClass}" +</#if> +</#if> +<#if itemCssStyle??> + style="${itemCssStyle}" +<#else> +<#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" +</#if> +</#if> +<#if itemTitle??> + title="${itemTitle}" +<#else> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#global evaluate_dynamic_attributes = true/> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + +<label +<#if parameters.id?has_content> + for="${parameters.id}-${itemCount}" +<#else> + for="${parameters.name}-${itemCount}" +</#if> + class="checkboxLabel">${itemValue}</label> +</@s.iterator> +<#else> +</#if> +<input type="hidden" id="__multiselect_${parameters.id}" name="__multiselect_${parameters.name}" + value="" +<#if parameters.disabled!false> + disabled="disabled" +</#if> + /> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/combobox.ftl b/apps/showcase/src/main/resources/template/html5/combobox.ftl new file mode 100644 index 000000000..3056e0935 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/combobox.ftl @@ -0,0 +1,102 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<@s.script> + function autoPopulate_${parameters.escapedId}(targetElement) { + <#if parameters.headerKey?? && parameters.headerValue??> + if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?js_string}') { + return; + } + </#if> + <#if parameters.emptyOption!false> + if (targetElement.options[targetElement.selectedIndex].value == '') { + return; + } + </#if> + targetElement.form.elements['${parameters.name?js_string}'].value=targetElement.options[targetElement.selectedIndex].value; + } +</@s.script> +<#include "/${parameters.templateDir}/html5/text.ftl" /> +<#compress> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> + <#if parameters.list??> + <select onChange="autoPopulate_${parameters.escapedId}(this);" + <#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + > + <#if (parameters.headerKey?? && parameters.headerValue??)> + <option value="${parameters.headerKey}">${parameters.headerValue}</option> + </#if> + <#if parameters.emptyOption!false> + <option value=""></option> + </#if> + <@s.iterator value="parameters.list"> + <#if parameters.listKey??> + <#assign tmpListKey = stack.findString(parameters.listKey) /> + <#else> + <#assign tmpListKey = stack.findString('top') /> + </#if> + <#if parameters.listValue??> + <#assign tmpListValue = stack.findString(parameters.listValue) /> + <#else> + <#assign tmpListValue = stack.findString('top') /> + </#if> + <#if parameters.listCssClass??> + <#if stack.findString(parameters.listCssClass)??> + <#assign itemCssClass= stack.findString(parameters.listCssClass)/> + <#else> + <#assign itemCssClass = ''/> + </#if> + </#if> + <#if parameters.listCssStyle??> + <#if stack.findString(parameters.listCssStyle)??> + <#assign itemCssStyle= stack.findString(parameters.listCssStyle)/> + <#else> + <#assign itemCssStyle = ''/> + </#if> + </#if> + <#if parameters.listTitle??> + <#if stack.findString(parameters.listTitle)??> + <#assign itemTitle= stack.findString(parameters.listTitle)/> + <#else> + <#assign itemTitle = ''/> + </#if> + </#if> + <option value="${tmpListKey}" + <#if (parameters.nameValue == tmpListKey)> + selected="selected" + </#if> + <#if itemCssClass??> + class="${itemCssClass}" + </#if> + <#if itemCssStyle??> + style="${itemCssStyle}" + </#if> + <#if itemTitle??> + title="${itemTitle}" + </#if> + >${tmpListValue}</option> + </@s.iterator> + </select> + </#if> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/common-attributes.ftl b/apps/showcase/src/main/resources/template/html5/common-attributes.ftl new file mode 100644 index 000000000..0bfe73fc5 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/common-attributes.ftl @@ -0,0 +1,25 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#compress> +<#if parameters.accesskey?has_content> + accesskey="${parameters.accesskey}" +</#if> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/controlfooter.ftl b/apps/showcase/src/main/resources/template/html5/controlfooter.ftl new file mode 100644 index 000000000..1626c3cd9 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/controlfooter.ftl @@ -0,0 +1,20 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> diff --git a/apps/showcase/src/main/resources/template/html5/controlheader.ftl b/apps/showcase/src/main/resources/template/html5/controlheader.ftl new file mode 100644 index 000000000..1626c3cd9 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/controlheader.ftl @@ -0,0 +1,20 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> diff --git a/apps/showcase/src/main/resources/template/html5/css.ftl b/apps/showcase/src/main/resources/template/html5/css.ftl new file mode 100644 index 000000000..07220ac9f --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/css.ftl @@ -0,0 +1,35 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#compress> +<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors.get(parameters.name)??/> +<#if parameters.cssClass?has_content && !(hasFieldErrors && parameters.cssErrorClass??)> + class="${parameters.cssClass}" +<#elseif parameters.cssClass?has_content && (hasFieldErrors && parameters.cssErrorClass??)> + class="${parameters.cssClass} ${parameters.cssErrorClass}" +<#elseif !(parameters.cssClass?has_content) && (hasFieldErrors && parameters.cssErrorClass??)> + class="${parameters.cssErrorClass}" +</#if> +<#if parameters.cssStyle?has_content && !(hasFieldErrors && (parameters.cssErrorStyle?? || parameters.cssErrorClass??))> + style="${parameters.cssStyle}" +<#elseif hasFieldErrors && parameters.cssErrorStyle??> + style="${parameters.cssErrorStyle}" +</#if> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/datetextfield.ftl b/apps/showcase/src/main/resources/template/html5/datetextfield.ftl new file mode 100644 index 000000000..25f198f44 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/datetextfield.ftl @@ -0,0 +1,21 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<div>Tag <pre style="display: inline-block"><s:datetextfield/></pre> works only with the JavaTemplates Plugin!</div> diff --git a/apps/showcase/src/main/resources/template/html5/debug.ftl b/apps/showcase/src/main/resources/template/html5/debug.ftl new file mode 100644 index 000000000..889702213 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/debug.ftl @@ -0,0 +1,92 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<@s.script> + function toggleDebug(debugId) { + var debugDiv = document.getElementById(debugId); + if (debugDiv) { + var display = debugDiv.style.display; + if (display == 'none') { + debugDiv.style.display = 'block'; + } else if (display == 'block') { + debugDiv.style.display = 'none'; + } + } + } +</@s.script> + +<style> +<!-- + table.debugTable {border-collapse:collapse; border-spacing:0; background-color:#DDDDDD;} + table.debugTable th, table.debugTable td {padding:2px;} +--> +</style> +<br> + +<a href="#" id="toggle-button">[Debug]</a> +<div style="display:none" id="<#if parameters.id??>${parameters.id}<#else>debug</#if>"> +<h2>Struts ValueStack Debug</h2> +<br> + +<h3>Value Stack Contents</h3> +<table class="debugTable"> + <tr><th>Object</th><th>Property Name</th><th>Property Value</th><th>Property Class</th></tr> + + <#assign index=1> + <#list parameters.stackValues as stackObject> + <tr> + <td rowspan="${stackObject.value.size()}">${stackObject.key}</td> + + <#assign renderRow=false> + <#list stackObject.value.keySet() as propertyName> + <#if renderRow==true></tr><tr><#else> <#assign renderRow=false> </#if> + <td style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;">${propertyName}</td> + <td style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;"><#if stackObject.value.get(propertyName)??>${stackObject.value.get(propertyName).toString()}<#else>null</#if></td> + <td style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;"><#if stackObject.value.get(propertyName)??>${stackObject.value.get(propertyName).class}<#else>null</#if></td> + </tr> + <#assign index= index + 1> + </#list> + </#list> +</table> +<br> + +<h3>Stack Context</h3> +<i>These items are available using the #key notation</i> +<table class="debugTable"> + <tr> + <th>Key</th><th>Value</th> + </tr> + + <#assign index=1> + <#list stack.context.keySet() as contextKey> + <tr style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;"> + <td>${contextKey}</td> + <td><#if stack.context.get(contextKey)??>${struts.toStringSafe(stack.context.get(contextKey))} (${struts.toStringSafe(stack.context.get(contextKey).class)})<#else>null</#if></td> + </tr> + <#assign index= index + 1> + </#list> +</table> +</div> +<@s.script> + document.getElementById('toggle-button').onclick = function() { + toggleDebug('<#if parameters.id??>${parameters.id}<#else>debug</#if>'); + return false; + } +</@s.script> diff --git a/apps/showcase/src/main/resources/template/html5/doubleselect.ftl b/apps/showcase/src/main/resources/template/html5/doubleselect.ftl new file mode 100644 index 000000000..14ff8668c --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/doubleselect.ftl @@ -0,0 +1,21 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<div>Tag <pre style="display: inline-block"><s:doubleselect/></pre> is not supported in this theme!</div> diff --git a/apps/showcase/src/main/resources/template/html5/dynamic-attributes.ftl b/apps/showcase/src/main/resources/template/html5/dynamic-attributes.ftl new file mode 100644 index 000000000..246ec466f --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/dynamic-attributes.ftl @@ -0,0 +1,45 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#compress> +<#function acceptKey(key)> + <#if dynamic_attributes_ignore??> + <#return !key?starts_with(dynamic_attributes_ignore) > + <#else> + <#return true> + </#if> +</#function> +<#if (parameters.dynamicAttributes?? && parameters.dynamicAttributes?size > 0)> +<#assign aKeys = parameters.dynamicAttributes.keySet()> +<#list aKeys?filter(acceptKey) as aKey> +<#assign keyValue = parameters.dynamicAttributes.get(aKey)/> +<#if keyValue?is_string> + <#if evaluate_dynamic_attributes!false == true> + <#assign value = struts.translateVariables(keyValue)!keyValue/> + <#else> + <#assign value = keyValue/> + </#if> +<#else> + <#assign value = keyValue?string/> +</#if> + ${aKey}="${value}" +</#list> +</#if> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/empty.ftl b/apps/showcase/src/main/resources/template/html5/empty.ftl new file mode 100644 index 000000000..1626c3cd9 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/empty.ftl @@ -0,0 +1,20 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> diff --git a/apps/showcase/src/main/resources/template/html5/fielderror.ftl b/apps/showcase/src/main/resources/template/html5/fielderror.ftl new file mode 100644 index 000000000..4381fdcd5 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/fielderror.ftl @@ -0,0 +1,84 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#if fieldErrors??> + <#compress> + <#assign eKeys = fieldErrors.keySet()> + <#assign eKeysSize = eKeys.size()> + <#assign doneStartUlTag=false> + <#assign doneEndUlTag=false> + <#assign haveMatchedErrorField=false> + <#if (fieldErrorFieldNames?size > 0) > + <#list fieldErrorFieldNames as fieldErrorFieldName> + <#list eKeys as eKey> + <#if (eKey = fieldErrorFieldName)> + <#assign haveMatchedErrorField=true> + <#assign eValue = fieldErrors.get(fieldErrorFieldName)> + <#if (haveMatchedErrorField && (!doneStartUlTag))> + <ul + <#if parameters.id?has_content> + id="${parameters.id}" + </#if> + <#if parameters.cssClass?has_content> + class="${parameters.cssClass}" + <#else> + class="errorMessage" + </#if> + <#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" + </#if> + > + <#assign doneStartUlTag=true> + </#if> + <#list eValue as eEachValue> + <li><span><#if parameters.escape>${eEachValue!}<#else>${eEachValue!?no_esc}</#if></span> + </li> + </#list> + </#if> + </#list> + </#list> + <#if (haveMatchedErrorField && (!doneEndUlTag))> + </ul> + <#assign doneEndUlTag=true> + </#if> + <#else> + <#if (eKeysSize > 0)> + <ul + <#if parameters.cssClass?has_content> + class="${parameters.cssClass}" + <#else> + class="errorMessage" + </#if> + <#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" + </#if> + > + <#list eKeys as eKey> + <#assign eValue = fieldErrors.get(eKey)> + <#list eValue as eEachValue> + <li><span><#if parameters.escape>${eEachValue!}<#else>${eEachValue!?no_esc}</#if></span> + </li> + </#list> + </#list> + </ul> + </#if> + </#if> + </#compress> +</#if> diff --git a/apps/showcase/src/main/resources/template/html5/file.ftl b/apps/showcase/src/main/resources/template/html5/file.ftl new file mode 100644 index 000000000..60a486f50 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/file.ftl @@ -0,0 +1,49 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<input type="file" + name="${(parameters.name!"")}" +<#if parameters.get("size")?has_content> + size="${parameters.get("size")}" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#if parameters.accept?has_content> + accept="${parameters.accept}" +</#if> +<#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" +</#if> +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +/> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/form-close.ftl b/apps/showcase/src/main/resources/template/html5/form-close.ftl new file mode 100644 index 000000000..f3aaa7491 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/form-close.ftl @@ -0,0 +1,22 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +</form> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/form.ftl b/apps/showcase/src/main/resources/template/html5/form.ftl new file mode 100644 index 000000000..f0eaa4342 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/form.ftl @@ -0,0 +1,72 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<#if (parameters.validate!false == false)> + <#if parameters.onsubmit?has_content> + ${tag.addParameter('onsubmit', "${parameters.onsubmit}") } + </#if> +</#if> +<form +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#if parameters.name?has_content> + name="${parameters.name}" +</#if> +<#if parameters.onsubmit?has_content> + onsubmit="<#outputformat 'JavaScript'>${parameters.onsubmit}</#outputformat>" +</#if> +<#if parameters.onreset?has_content> + onreset="<#outputformat 'JavaScript'>${parameters.onreset}</#outputformat>" +</#if> +<#if parameters.action?has_content> + action="${parameters.action}" +</#if> +<#if parameters.target?has_content> + target="${parameters.target}" +</#if> +<#if parameters.method?has_content> + method="${parameters.method}" +<#else> + method="post" +</#if> +<#if parameters.enctype?has_content> + enctype="${parameters.enctype}" +</#if> +<#if parameters.cssClass?has_content> + class="${parameters.cssClass}" +</#if> +<#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" +</#if> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +<#if parameters.acceptcharset?has_content> + accept-charset="${parameters.acceptcharset}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +<#if parameters.onreset?has_content> + onreset="${parameters.onreset}" +</#if> +> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/head.ftl b/apps/showcase/src/main/resources/template/html5/head.ftl new file mode 100644 index 000000000..01c5141a9 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/head.ftl @@ -0,0 +1,23 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<@compress single_line=true> +<@s.script src="${base}${parameters.staticContentPath}/utils.js" /> +</@compress> diff --git a/apps/showcase/src/main/resources/template/html5/hidden.ftl b/apps/showcase/src/main/resources/template/html5/hidden.ftl new file mode 100644 index 000000000..7e7184953 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/hidden.ftl @@ -0,0 +1,43 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<input type="hidden" + name="${(parameters.name!"")}" +<#if parameters.nameValue??> + value="<@s.property value="parameters.nameValue"/>" +</#if> +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#if parameters.cssClass?has_content> + class="${parameters.cssClass}" +</#if> +<#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +/> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/inputtransferselect.ftl b/apps/showcase/src/main/resources/template/html5/inputtransferselect.ftl new file mode 100644 index 000000000..066f9534a --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/inputtransferselect.ftl @@ -0,0 +1,21 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<div>Tag <pre style="display: inline-block"><s:inputtransferselect/></pre> is not supported in this theme!</div> \ No newline at end of file diff --git a/apps/showcase/src/main/resources/template/html5/label.ftl b/apps/showcase/src/main/resources/template/html5/label.ftl new file mode 100644 index 000000000..730efb048 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/label.ftl @@ -0,0 +1,42 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<label +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +<#if parameters.for?has_content> + for="${parameters.for}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +> +<#if parameters.nameValue??> +<@s.property value="parameters.nameValue"/> +</#if> +</label> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/link.ftl b/apps/showcase/src/main/resources/template/html5/link.ftl new file mode 100644 index 000000000..891d23763 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/link.ftl @@ -0,0 +1,74 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<@compress single_line=true> + <link + <#if parameters.rel?has_content> + rel="${parameters.rel}" + <#else> + rel="stylesheet" + </#if> + <#if parameters.type?has_content> + type="${parameters.type}" + <#else> + type="text/css" + </#if> + <#if parameters.href?has_content> + href="${parameters.href}" + </#if> + <#if parameters.hreflang?has_content> + hreflang="${parameters.hreflang}" + </#if> + <#if parameters.disabled?has_content && parameters.disabled == "true"> + disabled + </#if> + <#if parameters.media?has_content> + media="${parameters.media}" + <#else> + media="all" + </#if> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + <#if parameters.as?has_content> + as="${parameters.as}" + </#if> + <#if parameters.referrerpolicy?has_content> + referrerpolicy="${parameters.referrerpolicy}" + </#if> + <#if parameters.sizes?has_content> + sizes="${parameters.sizes}" + </#if> + <#if parameters.crossorigin?has_content> + crossorigin="${parameters.crossorigin}" + </#if> + <#if parameters.integrity?has_content> + integrity="${parameters.integrity}" + </#if> + <#if parameters.importance?has_content> + importance="${parameters.importance}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/nonce.ftl" /> + /> +</@compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/nonce.ftl b/apps/showcase/src/main/resources/template/html5/nonce.ftl new file mode 100644 index 000000000..4e1efe179 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/nonce.ftl @@ -0,0 +1,25 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#compress> +<#if parameters.nonce?has_content> + nonce="${parameters.nonce}" +</#if> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/optgroup.ftl b/apps/showcase/src/main/resources/template/html5/optgroup.ftl new file mode 100644 index 000000000..8273a5d00 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/optgroup.ftl @@ -0,0 +1,71 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#if parameters.optGroupInternalListUiBeanList??> + <#compress> + <#assign optGroupInternalListUiBeans=parameters.optGroupInternalListUiBeanList /> + <#list optGroupInternalListUiBeans as optGroupInternalListUiBean> + <optgroup<#rt> + <#if optGroupInternalListUiBean.parameters.label?has_content> + label="${optGroupInternalListUiBean.parameters.label}"<#rt> + </#if> + <#if optGroupInternalListUiBean.parameters.disabled!false> + disabled="disabled"<#rt> + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + > + <#list optGroupInternalListUiBean.parameters.list as optGroupBean> + <#assign trash=stack.push(optGroupBean) /> + <#assign tmpKey=stack.findValue(optGroupInternalListUiBean.parameters.listKey) /> + <#assign tmpValue=stack.findValue(optGroupInternalListUiBean.parameters.listValue) /> + <#assign tmpKeyStr = tmpKey.toString() /> + <#assign optGroupItemCssClass = ''/> + <#if optGroupInternalListUiBean.parameters.listCssClass??> + <#assign optGroupItemCssClass= stack.findString(optGroupInternalListUiBean.parameters.listCssClass)!''/> + </#if> + <#assign optGroupItemCssStyle = ''/> + <#if optGroupInternalListUiBean.parameters.listCssStyle??> + <#assign optGroupItemCssStyle= stack.findString(optGroupInternalListUiBean.parameters.listCssStyle)!''/> + </#if> + <#assign optGroupItemTitle = ''/> + <#if optGroupInternalListUiBean.parameters.listTitle??> + <#assign optGroupItemTitle= stack.findString(optGroupInternalListUiBean.parameters.listTitle)!''/> + </#if> + <option value="${tmpKeyStr}"<#rt> + <#if tag.contains(parameters.nameValue, tmpKey) == true> + selected="selected"<#rt> + </#if> + <#if optGroupItemCssClass?has_content> + class="${optGroupItemCssClass}" + </#if> + <#if optGroupItemCssStyle?has_content> + style="${optGroupItemCssStyle}" + </#if> + <#if optGroupItemTitle?has_content> + title="${optGroupItemTitle}" + </#if> + >${tmpValue}<#t> + </option><#lt> + <#assign trash=stack.pop() /> + </#list> + </optgroup> + </#list> + </#compress> +</#if> diff --git a/apps/showcase/src/main/resources/template/html5/optiontransferselect.ftl b/apps/showcase/src/main/resources/template/html5/optiontransferselect.ftl new file mode 100644 index 000000000..f689f195a --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/optiontransferselect.ftl @@ -0,0 +1,21 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<div>Tag <pre style="display: inline-block"><s:optiontransferselect/></pre> is not supported in this theme!</div> \ No newline at end of file diff --git a/apps/showcase/src/main/resources/template/html5/password.ftl b/apps/showcase/src/main/resources/template/html5/password.ftl new file mode 100644 index 000000000..222aa5947 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/password.ftl @@ -0,0 +1,55 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<input type="password" + name="${(parameters.name!"")}" +<#if parameters.get("size")?has_content> + size="${parameters.get("size")}" +</#if> +<#if parameters.maxlength?has_content> + maxlength="${parameters.maxlength}" +</#if> +<#if parameters.nameValue?? && parameters.showPassword!false> + value="<@s.property value="parameters.nameValue"/>" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#if parameters.readonly!false> + readonly="readonly" +</#if> +<#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" +</#if> +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +/> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/prefixed-dynamic-attributes.ftl b/apps/showcase/src/main/resources/template/html5/prefixed-dynamic-attributes.ftl new file mode 100644 index 000000000..ad1dd1cd5 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/prefixed-dynamic-attributes.ftl @@ -0,0 +1,37 @@ +<#ftl strip_text=true strip_whitespace=true/> +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#macro prefixedDynamicAttributes prefix> +<#if (parameters.dynamicAttributes?? && parameters.dynamicAttributes?size > 0)> +<#assign aKeys = parameters.dynamicAttributes.keySet()> +<#list aKeys as aKey> +<#if aKey?starts_with(prefix)> +<#assign keyValue = parameters.dynamicAttributes.get(aKey)/> +<#if keyValue?is_string> + <#assign value = struts.translateVariables(keyValue)!keyValue/> +<#else> + <#assign value = keyValue?string/> +</#if> + ${aKey?keep_after(prefix)}="${value}" +</#if> +</#list> +</#if> +</#macro> diff --git a/apps/showcase/src/main/resources/template/html5/radiomap.ftl b/apps/showcase/src/main/resources/template/html5/radiomap.ftl new file mode 100644 index 000000000..208f45f1d --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/radiomap.ftl @@ -0,0 +1,107 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> + <@s.iterator value="parameters.list"> + <#if parameters.listKey??> + <#assign itemKey = stack.findValue(parameters.listKey)/> + <#assign itemKeyStr = stack.findString(parameters.listKey)/> + <#else> + <#assign itemKey = stack.findValue('top')/> + <#assign itemKeyStr = stack.findString('top')> + </#if> + <#if parameters.listValueKey??> + <#-- checks the valueStack for the 'valueKey.' The valueKey is then looked-up in the locale + file for it's localized value. This is then used as a label --> + <#assign valueKey = stack.findString(parameters.listValueKey)!''/> + <#if valueKey?has_content> + <#assign itemValue = struts.getText(valueKey) /> + <#else> + <#assign itemValue = parameters.listValueKey /> + </#if> + <#elseif parameters.listValue??> + <#assign itemValue = stack.findString(parameters.listValue)/> + <#else> + <#assign itemValue = stack.findString('top')/> + </#if> + <#if parameters.listCssClass??> + <#if stack.findString(parameters.listCssClass)??> + <#assign itemCssClass= stack.findString(parameters.listCssClass)/> + <#else> + <#assign itemCssClass = ''/> + </#if> + </#if> + <#if parameters.listCssStyle??> + <#if stack.findString(parameters.listCssStyle)??> + <#assign itemCssStyle= stack.findString(parameters.listCssStyle)/> + <#else> + <#assign itemCssStyle = ''/> + </#if> + </#if> + <#if parameters.listTitle??> + <#if stack.findString(parameters.listTitle)??> + <#assign itemTitle= stack.findString(parameters.listTitle)/> + <#else> + <#assign itemTitle = ''/> + </#if> + </#if> + <input type="radio" + <#if parameters.name?has_content> + name="${parameters.name?no_esc}" + </#if> + id="${parameters.id}${itemKeyStr?replace(".", "_")}" + <#if tag.contains(parameters.nameValue!'', itemKey)> + checked="checked" + </#if> + <#if itemKey??> + value="${itemKeyStr}" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#if itemCssClass?has_content> + class="${itemCssClass}" + </#if> + <#if itemCssStyle?has_content> + style="${itemCssStyle}" + </#if> + <#if itemTitle?has_content> + title="${itemTitle}" + <#else> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#global evaluate_dynamic_attributes = true/> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + /> + <label for="${parameters.id}${itemKeyStr?replace(".", "_")}"<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl"/>> + ${itemValue} + </label> + </@s.iterator> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/reset.ftl b/apps/showcase/src/main/resources/template/html5/reset.ftl new file mode 100644 index 000000000..56dc96aa7 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/reset.ftl @@ -0,0 +1,84 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> + <#if parameters.type?? && parameters.type=="button"> + <button type="reset" + <#if parameters.name?has_content> + name="${parameters.name}" + </#if> + <#if parameters.nameValue??> + value="<@s.property value="parameters.nameValue"/>" + </#if> + <#if parameters.cssClass?has_content> + class="${parameters.cssClass}" + </#if> + <#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl"/> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + ><#if parameters.src?has_content> + <img + <#if parameters.label?has_content> + alt="${parameters.label}" + </#if> + <#if parameters.src?has_content> + src="${parameters.src}" + </#if> + /><#else><#if parameters.label?has_content><@s.property value="parameters.label"/></#if></#if></button> + <#else> + <input type="reset" + <#if parameters.name?has_content> + name="${parameters.name}" + </#if> + <#if parameters.nameValue??> + value="<@s.property value="parameters.nameValue"/>" + </#if> + <#if parameters.cssClass?has_content> + class="${parameters.cssClass}" + </#if> + <#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" + </#if> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + /> + </#if> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/script-close.ftl b/apps/showcase/src/main/resources/template/html5/script-close.ftl new file mode 100644 index 000000000..e0f64a41e --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/script-close.ftl @@ -0,0 +1,21 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +</script> diff --git a/apps/showcase/src/main/resources/template/html5/script.ftl b/apps/showcase/src/main/resources/template/html5/script.ftl new file mode 100644 index 000000000..b37b0b7c2 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/script.ftl @@ -0,0 +1,53 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<@compress single_line=true> +<script + <#if parameters.async?has_content && parameters.async == "true"> + async + </#if> + <#if parameters.charset?has_content> + charset="${parameters.charset}" + </#if> + <#if parameters.defer?has_content && parameters.defer=="true"> + defer + </#if> + <#if parameters.type?has_content> + type="${parameters.type}" + </#if> + <#if parameters.src?has_content> + src="${parameters.src}" + </#if> + <#if parameters.referrerpolicy?has_content> + referrerpolicy="${parameters.referrerpolicy}" + </#if> + <#if parameters.nomodule?has_content && parameters.nomodule=="true"> + nomodule + </#if> + <#if parameters.integrity?has_content> + integrity="${parameters.integrity}" + </#if> + <#if parameters.crossorigin?has_content> + crossorigin="${parameters.crossorigin}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/nonce.ftl" />> +</@compress> diff --git a/apps/showcase/src/main/resources/template/html5/scripting-events.ftl b/apps/showcase/src/main/resources/template/html5/scripting-events.ftl new file mode 100644 index 000000000..714ae9d56 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/scripting-events.ftl @@ -0,0 +1,64 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#compress> +<#if parameters.onclick??> + onclick="<#outputformat 'JavaScript'>${parameters.onclick}</#outputformat>" +</#if> +<#if parameters.ondblclick??> + ondblclick="<#outputformat 'JavaScript'>${parameters.ondblclick}</#outputformat>" +</#if> +<#if parameters.onmousedown??> + onmousedown="<#outputformat 'JavaScript'>${parameters.onmousedown}</#outputformat>" +</#if> +<#if parameters.onmouseup??> + onmouseup="<#outputformat 'JavaScript'>${parameters.onmouseup}</#outputformat>" +</#if> +<#if parameters.onmouseover??> + onmouseover="<#outputformat 'JavaScript'>${parameters.onmouseover}</#outputformat>" +</#if> +<#if parameters.onmousemove??> + onmousemove="<#outputformat 'JavaScript'>${parameters.onmousemove}</#outputformat>" +</#if> +<#if parameters.onmouseout??> + onmouseout="<#outputformat 'JavaScript'>${parameters.onmouseout}</#outputformat>" +</#if> +<#if parameters.onfocus??> + onfocus="<#outputformat 'JavaScript'>${parameters.onfocus}</#outputformat>" +</#if> +<#if parameters.onblur??> + onblur="<#outputformat 'JavaScript'>${parameters.onblur}</#outputformat>" +</#if> +<#if parameters.onkeypress??> + onkeypress="<#outputformat 'JavaScript'>${parameters.onkeypress}</#outputformat>" +</#if> +<#if parameters.onkeydown??> + onkeydown="<#outputformat 'JavaScript'>${parameters.onkeydown}</#outputformat>" +</#if> +<#if parameters.onkeyup??> + onkeyup="<#outputformat 'JavaScript'>${parameters.onkeyup}</#outputformat>" +</#if> +<#if parameters.onselect??> + onselect="<#outputformat 'JavaScript'>${parameters.onselect}</#outputformat>" +</#if> +<#if parameters.onchange??> + onchange="<#outputformat 'JavaScript'>${parameters.onchange}</#outputformat>" +</#if> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/select.ftl b/apps/showcase/src/main/resources/template/html5/select.ftl new file mode 100644 index 000000000..d30b3e1ae --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/select.ftl @@ -0,0 +1,149 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> + <#setting number_format="#.#####"> + <select + name="${(parameters.name!"")}" + <#if parameters.get("size")?has_content> + size="${parameters.get("size")}" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#if parameters.id?has_content> + id="${parameters.id}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + <#if parameters.multiple!false> + multiple="multiple" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> + > + <#if parameters.headerKey?? && parameters.headerValue??> + <option value="${parameters.headerKey}" + <#if tag.contains(parameters.nameValue, parameters.headerKey) == true> + selected="selected" + </#if> + >${parameters.headerValue}</option> + </#if> + <#if parameters.emptyOption!false> + <option value=""></option> + </#if> + <@s.iterator value="parameters.list"> + <#if parameters.listKey??> + <#if stack.findValue(parameters.listKey)??> + <#assign itemKey = stack.findValue(parameters.listKey)/> + <#assign itemKeyStr = stack.findString(parameters.listKey)/> + <#else> + <#assign itemKey = ''/> + <#assign itemKeyStr = ''/> + </#if> + <#else> + <#assign itemKey = stack.findValue('top')/> + <#assign itemKeyStr = stack.findString('top')> + </#if> + <#if parameters.listValueKey??> + <#-- checks the valueStack for the 'valueKey.' The valueKey is then looked-up in the locale file for it's + localized value. This is then used as a label --> + <#assign valueKey = stack.findString(parameters.listValueKey)!'' /> + <#if valueKey?has_content> + <#assign itemValue = struts.getText(valueKey) /> + <#else> + <#assign itemValue = parameters.listValueKey /> + </#if> + <#elseif parameters.listValue??> + <#if stack.findString(parameters.listValue)??> + <#assign itemValue = stack.findString(parameters.listValue)/> + <#else> + <#assign itemValue = ''/> + </#if> + <#else> + <#assign itemValue = stack.findString('top')/> + </#if> + <#if parameters.listCssClass??> + <#if stack.findString(parameters.listCssClass)??> + <#assign itemCssClass= stack.findString(parameters.listCssClass)/> + <#else> + <#assign itemCssClass = ''/> + </#if> + </#if> + <#if parameters.listCssStyle??> + <#if stack.findString(parameters.listCssStyle)??> + <#assign itemCssStyle= stack.findString(parameters.listCssStyle)/> + <#else> + <#assign itemCssStyle = ''/> + </#if> + </#if> + <#if parameters.listTitle??> + <#if stack.findString(parameters.listTitle)??> + <#assign itemTitle= stack.findString(parameters.listTitle)/> + <#else> + <#assign itemTitle = ''/> + </#if> + </#if> + <option value="${itemKeyStr}" + <#if tag.contains(parameters.nameValue, itemKey) == true> + selected="selected" + </#if> + <#if itemCssClass?has_content> + class="${itemCssClass}" + </#if> + <#if itemCssStyle?has_content> + style="${itemCssStyle}" + </#if> + <#if itemTitle?has_content> + title="${itemTitle}" + </#if> + >${itemValue}</option> + </@s.iterator> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/optgroup.ftl" /> + </select> + + <#if parameters.multiple!false> + <#if (parameters.id?? && parameters.name??)> + <input type="hidden" id="__multiselect_${parameters.id}" name="__multiselect_${parameters.name}" value="" + </#if> + <#if (parameters.id?? && !parameters.name??)> + <input type="hidden" id="__multiselect_${parameters.id}" name="__multiselect_${parameters.id}" value="" + </#if> + <#if ( !parameters.id?? && parameters.name??)> + <input type="hidden" id="__multiselect_${parameters.id}" name="__multiselect_${parameters.id}" value="" + </#if> + <#if ( !parameters.id?? && !parameters.name??)> + <input type="hidden" id="" name="" value="" + </#if> + + <#if parameters.disabled!false> + disabled="disabled" + </#if> + /> + </#if> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/submit-close.ftl b/apps/showcase/src/main/resources/template/html5/submit-close.ftl new file mode 100644 index 000000000..1211a060c --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/submit-close.ftl @@ -0,0 +1,29 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#compress> +<#if parameters.type?? && parameters.type=="button"> +<#if parameters.body?length gt 0>${tag.escapeHtmlBody()?then(parameters.body, parameters.body?no_esc)}<#elseif parameters.label??><@s.property value="parameters.label"/></#if> +</button> +<#else> +${tag.escapeHtmlBody()?then(parameters.body, parameters.body?no_esc)} +</#if> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/submit.ftl b/apps/showcase/src/main/resources/template/html5/submit.ftl new file mode 100644 index 000000000..e3d60452c --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/submit.ftl @@ -0,0 +1,94 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<#if parameters.type?? && parameters.type=="button"> +<button type="submit" + <#if parameters.id?has_content> + id="${parameters.id}" + </#if> + <#if parameters.name?has_content> + name="${parameters.name}" + </#if> + <#if parameters.nameValue??> + value="<@s.property value="parameters.nameValue"/>" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.cssClass?has_content> + class="${parameters.cssClass}" + </#if> + <#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" + </#if> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl"/> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +> +<#else> +<#if parameters.type?? && parameters.type=="image"> + <input type="image" + <#if parameters.label?has_content> + alt="${parameters.label}" + </#if> + <#if parameters.src?has_content> + src="${parameters.src}" + </#if> + <#else> + <input type="submit" + <#if parameters.nameValue?has_content> + value="<@s.property value="parameters.nameValue"/>" + </#if> + </#if> + <#if parameters.id?has_content> + id="${parameters.id}" + </#if> + <#if parameters.name?has_content> + name="${parameters.name}" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.cssClass?has_content> + class="${parameters.cssClass}" + </#if> + <#if parameters.cssStyle?has_content> + style="${parameters.cssStyle}" + </#if> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +> +</#if> +</#compress> diff --git a/apps/showcase/src/main/resources/template/html5/text.ftl b/apps/showcase/src/main/resources/template/html5/text.ftl new file mode 100644 index 000000000..53b0535bb --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/text.ftl @@ -0,0 +1,56 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> +<input + type="${(parameters.type!"text")}" + name="${(parameters.name!"")}" +<#if parameters.get("size")?has_content> + size="${parameters.get("size")}" +</#if> +<#if parameters.maxlength?has_content> + maxlength="${parameters.maxlength}" +</#if> +<#if parameters.nameValue??> + value="${parameters.nameValue}" +</#if> +<#if parameters.disabled!false> + disabled="disabled" +</#if> +<#if parameters.readonly!false> + readonly="readonly" +</#if> +<#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" +</#if> +<#if parameters.id?has_content> + id="${parameters.id}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> +<#if parameters.title?has_content> + title="${parameters.title}" +</#if> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +/> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/textarea.ftl b/apps/showcase/src/main/resources/template/html5/textarea.ftl new file mode 100644 index 000000000..4fc24f322 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/textarea.ftl @@ -0,0 +1,65 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#compress> + <textarea + name="${(parameters.name!"")}" +<#if parameters.cols?has_content> + cols="${(parameters.cols!"")}" +</#if> + <#if parameters.rows?has_content> + rows="${(parameters.rows!"")}" + </#if> + <#if parameters.wrap?has_content> + wrap="${parameters.wrap}" + </#if> + <#if parameters.disabled!false> + disabled="disabled" + </#if> + <#if parameters.readonly!false> + readonly="readonly" + </#if> + <#if parameters.tabindex?has_content> + tabindex="${parameters.tabindex}" + </#if> + <#if parameters.id?has_content> + id="${parameters.id}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl" /> + <#if parameters.title?has_content> + title="${parameters.title}" + </#if> + <#if parameters.maxlength?has_content> + maxlength="${parameters.maxlength}" + </#if> + <#if parameters.minlength?has_content> + minlength="${parameters.minlength}" + </#if> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> + <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +> +<#if parameters.nameValue??> + <@s.property value="parameters.nameValue"/> +</#if> +</textarea> +</#compress> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> diff --git a/apps/showcase/src/main/resources/template/html5/token.ftl b/apps/showcase/src/main/resources/template/html5/token.ftl new file mode 100644 index 000000000..d063bbbb5 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/token.ftl @@ -0,0 +1,22 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<input type="hidden" name="${parameters.tokenNameField!""}" value="${parameters.name!""}" /> +<input type="hidden" name="${parameters.name!""}" value="${parameters.token!""}" /> \ No newline at end of file diff --git a/apps/showcase/src/main/resources/template/html5/updownselect.ftl b/apps/showcase/src/main/resources/template/html5/updownselect.ftl new file mode 100644 index 000000000..f159ce896 --- /dev/null +++ b/apps/showcase/src/main/resources/template/html5/updownselect.ftl @@ -0,0 +1,21 @@ +<#-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<div>Tag <pre style="display: inline-block"><s:updownselect/></pre> is not supported in this theme!</div> diff --git a/apps/showcase/src/main/webapp/WEB-INF/html5/index.jsp b/apps/showcase/src/main/webapp/WEB-INF/html5/index.jsp new file mode 100644 index 000000000..fb891a3ba --- /dev/null +++ b/apps/showcase/src/main/webapp/WEB-INF/html5/index.jsp @@ -0,0 +1,69 @@ +<!-- +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +--> +<%@ taglib prefix="s" uri="/struts-tags" %> +<!DOCTYPE html> +<html> +<head> + <title>Struts2 Showcase - Html5 theme</title> + <s:url var="bootstrapCss" value="/styles/bootstrap.css" encode="false" includeParams="none"/> + <s:link theme="html5" href="%{bootstrapCss}"/> + <s:url var="mainCss" value="/styles/main.css" encode="false" includeParams="none"/> + <s:link href="%{mainCss}" /> + <s:head theme="html5"/> +</head> + +<body> +<div class="container-fluid"> + <div class="row"> + <div class="col-md-12"> + <div class="hero-unit"> + <h1>Html 5 tags demo</h1> + <p>All the tags on this page are from <i>html5</i> theme. <s:a theme="html5" action="showcase" namespace="/">Back</s:a> to main Showcase App page + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <pre><s:a/></pre> + </div> + <div class="col-md-10"> + <s:a theme="html5" action="index">index</s:a> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <pre><s:actionerror/></pre> + </div> + <div class="col-md-10"> + <s:actionerror theme="html5"/> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <pre><s:actionmessage/></pre> + </div> + <div class="col-md-10"> + <s:actionmessage theme="html5"/> + </div> + </div> +</div> +</body> +</html>
