WW-5255 Fixes <s:script/> and <s:link/> and uses them across tags

This commit is contained in:
Lukasz Lenart
2022-11-02 08:39:49 +01:00
parent 054f1f4cdb
commit 4bb81d5909
37 changed files with 132 additions and 182 deletions
@@ -64,14 +64,14 @@
<title><decorator:title default="Struts2 Showcase"/></title>
<s:url var="bootstrapCss" value='/styles/bootstrap.css' encode='false' includeParams='none'/>
<s:link href="%{bootstrapCss}" rel="stylesheet" type="text/css" media="all"></s:link>
<s:link href="%{bootstrapCss}" rel="stylesheet" type="text/css" media="all"/>
<s:url var="mainCss" value='/styles/main.css' encode='false' includeParams='none'/>
<s:link href="%{mainCss}" rel="stylesheet" type="text/css" media="all"></s:link>
<s:link href="%{mainCss}" rel="stylesheet" type="text/css" media="all"/>
<s:url var="jqueryJs" value='/js/jquery-2.1.4.min.js' encode='false' includeParams='none'/>
<s:script src="%{jqueryJs}"></s:script>
<s:script src="%{jqueryJs}"/>
<s:url var="bootstrapJs" value='/js/bootstrap.min.js' encode='false' includeParams='none'/>
<s:script src="%{bootstrapJs}"></s:script>
<s:script src="%{bootstrapJs}"/>
<s:script type="text/javascript">
$(function () {
var alerts = $('ul.alert').wrap('<div />');
@@ -82,19 +82,22 @@
<!-- Prettify -->
<s:url var="prettifyCss" value='/styles/prettify.css' encode='false' includeParams='none'/>
<s:link href="%{prettifyCss}" rel="stylesheet"></s:link>
<s:link href="%{prettifyCss}" rel="stylesheet"/>
<s:url var="prettifyJs" value='/js/prettify.js' encode='false' includeParams='none'/>
<s:script src="%{prettifyJs}"></s:script>
<s:script src="%{prettifyJs}"/>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<s:script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></s:script>
<s:script src="http://html5shim.googlecode.com/svn/trunk/html5.js"/>
<![endif]-->
<s:script>
jQuery(document).ready(function() { prettyPrint(); } );
</s:script>
<decorator:head/>
</head>
<body id="page-home" onload="prettyPrint();">
<body id="page-home">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
@@ -21,10 +21,10 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
var baseUrl = "<@s.url value="/struts" includeParams="none"/>";
window.open(baseUrl+"/webconsole.html", 'OGNL Console','width=500,height=450,status=no,toolbar=no,menubar=no');
</script>
<@s.script type="text/javascript">
var baseUrl = "<@s.url value="/struts" includeParams="none"/>";
window.open(baseUrl+"/webconsole.html", 'OGNL Console','width=500,height=450,status=no,toolbar=no,menubar=no');
</@s.script>
</head>
<body>
<pre>
@@ -18,5 +18,5 @@
* under the License.
*/
-->
<link <#include "/${parameters.templateDir}/simple/nonce.ftl" /> rel="stylesheet" href="<@s.url value='${parameters.staticContentPath}/css_xhtml/styles.css' includeParams='none' encode='false' />" type="text/css" />
<@s.link rel="stylesheet" href="${base}${parameters.staticContentPath}/css_xhtml/styles.css" type="text/css" />
<#include "/${parameters.templateDir}/simple/head.ftl" />
@@ -18,21 +18,21 @@
* under the License.
*/
-->
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
<@s.script type="text/javascript">
function autoPopulate_${parameters.escapedId}(targetElement) {
<#if parameters.headerKey?? && parameters.headerValue??>
<#if parameters.headerKey?? && parameters.headerValue??>
if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?js_string}') {
return;
}
</#if>
<#if parameters.emptyOption?default(false)>
</#if>
<#if parameters.emptyOption!false>
if (targetElement.options[targetElement.selectedIndex].value == '') {
return;
return;
}
</#if>
</#if>
targetElement.form.elements['${parameters.name?js_string}'].value=targetElement.options[targetElement.selectedIndex].value;
}
</script>
</@s.script>
<#include "/${parameters.templateDir}/simple/text.ftl" />
<br />
<#if parameters.list??>
@@ -18,8 +18,7 @@
* under the License.
*/
-->
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
<!--
<@s.script>
function toggleDebug(debugId) {
var debugDiv = document.getElementById(debugId);
if (debugDiv) {
@@ -31,10 +30,9 @@
}
}
}
-->
</script>
</@s.script>
<style type="text/css">
<style>
<!--
table.debugTable {border-collapse:collapse; border-spacing:0; background-color:#DDDDDD;}
table.debugTable th, table.debugTable td {padding:2px;}
@@ -42,7 +40,7 @@
</style>
<br>
<a href="#" onclick="toggleDebug('<#if parameters.id??>${parameters.id}<#else>debug</#if>');return false;">[Debug]</a>
<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>
@@ -86,3 +84,9 @@
</#list>
</table>
</div>
<@s.script>
document.getElementById('toggle-button').onclick = function() {
toggleDebug('<#if parameters.id??>${parameters.id}<#else>debug</#if>');
return false;
}
</@s.script>
@@ -73,7 +73,7 @@
</#if>
/>
</#if>
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
<@s.script type="text/javascript">
<#assign itemCount = startCount/>
var ${parameters.escapedId}Group = new Array(${parameters.listSize?number?c} + ${startCount});
for (var i = 0; i < (${parameters.listSize?number?c} + ${startCount}); i++) {
@@ -193,4 +193,4 @@
${parameters.escapedId}Temp.options[0].selected = true;
}
}
</script>
</@s.script>
@@ -19,12 +19,11 @@
*/
-->
<#--
<#--
Code that will add javascript needed for tooltips
--><#t/>
<#if (parameters.hasTooltip!false)><#t/>
<#lt/><!-- javascript that is needed for tooltips -->
<#lt/><script type="text/javascript" src='<@s.url value="${parameters.staticContentPath}/domTT.js" includeParams="none" encode="false" />' <#include "/${parameters.templateDir}/simple/nonce.ftl" /> > </script>
<#lt/><link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/domTT.css" includeParams="none" encode="false" />" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> />
</#if><#t/>
<#lt/><!-- javascript that is needed for tooltips -->
<#lt/><@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/domTT.js" />
<#lt/><@s.link rel="stylesheet" type="text/css" href="${base}${parameters.staticContentPath}/domTT.css" />
</#if><#t/>
@@ -21,7 +21,7 @@
</form>
<#if (parameters.customOnsubmitEnabled??)>
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
<@s.script type="text/javascript">
<#--
Enable auto-select of optiontransferselect tag's entries upon containing form's
submission.
@@ -96,7 +96,7 @@
}, true);
</#list>
</#if>
</script>
</@s.script>
</#if>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/form-close-tooltips.ftl" />
@@ -18,4 +18,4 @@
* under the License.
*/
-->
<script src="${base}${parameters.staticContentPath}/utils.js" type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> ></script>
<@s.script src="${base}${parameters.staticContentPath}/utils.js" type="text/javascript" />
@@ -19,7 +19,7 @@
*/
-->
<#if !stack.findValue("#inputtransferselect_js_included")??><#t/>
<script type="text/javascript" src="<@s.url value="${parameters.staticContentPath}/inputtransferselect.js" encode='false' includeParams='none'/>" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> ></script>
<@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/inputtransferselect.js"/>
<#assign temporaryVariable = stack.setValue("#inputtransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table>
@@ -18,48 +18,46 @@
* under the License.
*/
-->
<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" />
<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" />
<link <#include "/${parameters.templateDir}/simple/nonce.ftl" />
<#if parameters.href?has_content>
href="${parameters.href}"<#rt/>
</#if>
<#if parameters.hreflang?has_content>
hreflang="${parameters.hreflang}"<#rt/>
</#if>
<link<#rt/>
<#if parameters.rel?has_content>
rel="${parameters.rel}"<#rt/>
</#if>
<#if parameters.disabled?has_content>
<#if parameters.disabled=="true">
disabled<#rt/>
</#if>
</#if>
<#if parameters.media?has_content>
media="${parameters.media}"<#rt/>
rel="${parameters.rel}"<#rt/>
</#if>
<#if parameters.type?has_content>
type="${parameters.type}"<#rt/>
type="${parameters.type}"<#rt/>
</#if>
<#if parameters.href?has_content>
href="${parameters.href}"<#rt/>
</#if>
<#if parameters.hreflang?has_content>
hreflang="${parameters.hreflang}"<#rt/>
</#if>
<#if parameters.disabled?has_content && parameters.disabled == "true">
disabled<#rt/>
</#if>
<#if parameters.media?has_content>
media="${parameters.media}"<#rt/>
</#if>
<#if parameters.title?has_content>
title="${parameters.title}"<#rt/>
title="${parameters.title}"<#rt/>
</#if>
<#if parameters.as?has_content>
as="${parameters.as}"<#rt/>
as="${parameters.as}"<#rt/>
</#if>
<#if parameters.referrerpolicy?has_content>
referrerpolicy="${parameters.referrerpolicy}"<#rt/>
referrerpolicy="${parameters.referrerpolicy}"<#rt/>
</#if>
<#if parameters.sizes?has_content>
sizes="${parameters.sizes}"<#rt/>
sizes="${parameters.sizes}"<#rt/>
</#if>
<#if parameters.crossorigin?has_content>
crossorigin="${parameters.crossorigin}"<#rt/>
crossorigin="${parameters.crossorigin}"<#rt/>
</#if>
<#if parameters.integrity?has_content>
integrity="${parameters.integrity}"<#rt/>
integrity="${parameters.integrity}"<#rt/>
</#if>
<#if parameters.importance?has_content>
importance="${parameters.importance}"<#rt/>
importance="${parameters.importance}"<#rt/>
</#if>
>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /><#rt/>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /><#rt/>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/nonce.ftl" /><#rt/>/>
@@ -18,4 +18,6 @@
* under the License.
*/
-->
<#if parameters.nonce?has_content>nonce="${parameters.nonce}"<#rt/></#if>
<#if parameters.nonce?has_content><#rt/>
nonce="${parameters.nonce}"<#rt/>
</#if><#rt/>
@@ -19,7 +19,7 @@
*/
-->
<#if !stack.findValue("#optiontransferselect_js_included")??><#t/>
<script type="text/javascript" src="<@s.url value="${parameters.staticContentPath}/optiontransferselect.js" encode='false' includeParams='none'/>" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> ></script>
<@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/optiontransferselect.js" />
<#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table>
@@ -18,36 +18,27 @@
* under the License.
*/
-->
<script <#rt/>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" />
<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" />
<#include "/${parameters.templateDir}/simple/nonce.ftl" />
<#if parameters.async?has_content>
<#if parameters.async=="true">
async<#rt/>
</#if>
<script<#rt/>
<#if parameters.async?has_content && parameters.async == "true">
async<#rt/>
</#if>
<#if parameters.charset?has_content>
charset="${parameters.charset}"<#rt/>
</#if>
<#if parameters.defer?has_content>
<#if parameters.defer=="true">
defer<#rt/>
</#if>
</#if>
<#if parameters.src?has_content>
src="${parameters.src}"<#rt/>
<#if parameters.defer?has_content && parameters.defer=="true">
defer<#rt/>
</#if>
<#if parameters.type?has_content>
type="${parameters.type}"<#rt/>
</#if>
<#if parameters.src?has_content>
src="${parameters.src}"<#rt/>
</#if>
<#if parameters.referrerpolicy?has_content>
referrerpolicy="${parameters.referrerpolicy}"<#rt/>
</#if>
<#if parameters.nomodule?has_content>
<#if parameters.nomodule=="true">
nomodule<#rt/>
</#if>
<#if parameters.nomodule?has_content && parameters.nomodule=="true">
nomodule<#rt/>
</#if>
<#if parameters.integrity?has_content>
integrity="${parameters.integrity}"<#rt/>
@@ -55,4 +46,6 @@
<#if parameters.crossorigin?has_content>
crossorigin="${parameters.crossorigin}"<#rt/>
</#if>
>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" />
<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" />
<#include "/${parameters.templateDir}/${parameters.expandTheme}/nonce.ftl" />>
@@ -19,7 +19,7 @@
*/
-->
<#if !stack.findValue("#optiontransferselect_js_included")??><#t/>
<script type="text/javascript" src="<@s.url value="${parameters.staticContentPath}/optiontransferselect.js" encode='false' includeParams='none'/>" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> ></script>
<@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/optiontransferselect.js" /><#t/>
<#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table>
@@ -52,4 +52,4 @@
</#if><#t/>
</#if><#t/>
</td></tr>
</table>
</table>
@@ -32,7 +32,7 @@ Only the following validators are supported:
END SNIPPET: supported-validators
-->
<#if ((parameters.validate!false == true) && (parameters.performValidation!false == true))>
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
<@s.script type="text/javascript">
function validateForm_${parameters.escapedId}() {
<#--
In case of multiselect fields return only the first value.
@@ -75,7 +75,7 @@ END SNIPPET: supported-validators
var error = "${validator.getMessage(action)?js_string}";
var fieldValue = getFieldValue(field);
<#if validator.validatorType = "required">
if (fieldValue === "") {
addError(field, error);
@@ -152,5 +152,5 @@ END SNIPPET: supported-validators
return !errors;
}
</script>
</#if>
</@s.script>
</#if>
@@ -22,12 +22,12 @@
<#include "/${parameters.templateDir}/simple/form-close.ftl" />
<#include "/${parameters.templateDir}/${parameters.expandTheme}/form-close-validate.ftl" />
<#if parameters.focusElement??>
<script type="text/javascript" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> >
<@s.script type="text/javascript">
StrutsUtils.addOnLoad(function() {
var element = document.getElementById("${parameters.focusElement?js_string}");
if(element) {
element.focus();
}
});
</script>
</@s.script>
</#if>
@@ -19,7 +19,7 @@
*/
-->
<#if parameters.validate!false == true>
<script type="text/javascript" src="${base}${parameters.staticContentPath}/xhtml/validation.js" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> ></script>
<@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/xhtml/validation.js" />
<#if parameters.onsubmit??>
${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.escapedId}();")}
<#else>
@@ -18,5 +18,5 @@
* under the License.
*/
-->
<link rel="stylesheet" href="<@s.url value='${parameters.staticContentPath}/xhtml/styles.css' includeParams='none' encode='false'/>" type="text/css" <#include "/${parameters.templateDir}/simple/nonce.ftl" /> />
<@s.link rel="stylesheet" href="${base}${parameters.staticContentPath}/xhtml/styles.css" type="text/css" />
<#include "/${parameters.templateDir}/simple/head.ftl" />
@@ -1,21 +0,0 @@
<#--
/*
* 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}/simple/link.ftl" />
@@ -1,21 +0,0 @@
<#--
/*
* 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}/simple/script.ftl" />
@@ -243,7 +243,8 @@ public class FreemarkerResultMockedTest extends StrutsInternalTestCase {
EasyMock.expect(servletContext.getRealPath("/template/~~~xhtml/dynamic-attributes.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/nonce.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/nonce.ftl")).andReturn(file.getAbsolutePath());
EasyMock.expect(servletContext.getRealPath("/template/xhtml/nonce.ftl")).andReturn(file.getAbsolutePath());
EasyMock.expect(servletContext.getRealPath("/template/~~~xhtml/nonce.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/script.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/script.ftl")).andReturn(file.getAbsolutePath());
@@ -26,7 +26,7 @@ public class LinkTagTest extends AbstractUITagTest {
private static final String NONCE_VAL = "r4andom";
public void testLinkTagAttributes() {
public void testLinkTagAttributes() throws JspException {
LinkTag tag = new LinkTag();
tag.setHref("mysrc.js");
@@ -40,6 +40,7 @@ public class LinkTagTest extends AbstractUITagTest {
tag.setAs("test");
tag.setDisabled("false");
tag.setTitle("test");
tag.setDynamicAttribute(null, "data-id", "id4test");
doLinkTest(tag);
String s = writer.toString();
@@ -55,7 +56,8 @@ public class LinkTagTest extends AbstractUITagTest {
assertTrue("Incorrect as attribute for link tag", s.contains("as=\"test\""));
assertFalse("Non-existent disabled attribute for link tag", s.contains("disabled"));
assertTrue("Incorrect title attribute for link tag", s.contains("title=\"test\""));
assertTrue("Incorrect nonce attribute for link tag", s.contains("nonce=\"" + NONCE_VAL+"\""));
assertTrue("Incorrect nonce attribute for link tag", s.contains("nonce=\"" + NONCE_VAL + "\""));
assertTrue("Incorrect data-id dynamic attribute for link tag", s.contains("data-id=\"id4test\""));
}
private void doLinkTest(LinkTag tag) {
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -20,4 +18,4 @@
* under the License.
*/
-->
before<@s.action namespace="/tutorial" name="test4" executeResult="true" rethrowException="true"/>after
before<@s.action namespace="/tutorial" name="test4" executeResult="true" rethrowException="true"/>after
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -20,4 +18,4 @@
* under the License.
*/
-->
before<@s.action namespace="/tutorial" name="test3" executeResult="true" rethrowException="true"/>after
before<@s.action namespace="/tutorial" name="test3" executeResult="true" rethrowException="true"/>after<#rt/>
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -20,4 +18,4 @@
* under the License.
*/
-->
<input type="text" onclick="this.alert('${error}')"/>
<input type="text" onclick="this.alert('${error}')"/><#rt />
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -20,4 +18,4 @@
* under the License.
*/
-->
nested
nested<#rt/>
@@ -1,7 +1,5 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -1,8 +1,6 @@
<#ftl attributes={"content_type": "text/xml"} />
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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
@@ -1,2 +1,2 @@
<link rel="stylesheet" href="/static/xhtml/styles.css" type="text/css" nonce="r4nd0m"/>
<script src="/static/utils.js" type="text/javascript" nonce="r4nd0m"></script>
<link rel="stylesheet" type="text/css" href="/static/xhtml/styles.css" nonce="r4nd0m"/>
<script type="text/javascript" src="/static/utils.js" nonce="r4nd0m"></script>
@@ -15,7 +15,7 @@
</table>
</form>
<!--javascript that is needed for tooltips-->
<script type="text/javascript" src='/static/domTT.js'></script>
<script type="text/javascript" src="/static/domTT.js"></script>
<link rel="stylesheet" type="text/css" href="/static/domTT.css"/>
@@ -15,5 +15,5 @@
</table>
</form>
<!--javascript that is needed for tooltips-->
<script type="text/javascript" src='/static/domTT.js'></script>
<link rel="stylesheet" type="text/css" href="/static/domTT.css"/>
<script type="text/javascript" src="/static/domTT.js"></script>
<link rel="stylesheet" type="text/css" href="/static/domTT.css"/>
@@ -16,6 +16,6 @@
</form>
<!--javascript that is needed for tooltips-->
<script type="text/javascript" src='/static/domTT.js'></script>
<script type="text/javascript" src="/static/domTT.js"></script>
<link rel="stylesheet" type="text/css" href="/static/domTT.css"/>
@@ -20,18 +20,26 @@
-->
<!-- Validators -->
<table width="100%">
<tr><th>Field</th><th>Type</th><th>&nbsp;</th></tr>
<tr>
<th>Field</th>
<th>Type</th>
<th>&nbsp;</th>
</tr>
<#assign row = 0>
<#if validators??>
<#foreach i in validators>
<tr <#if i_index%2 gt 0>class="b"<#else>class="a"</#if>>
<td>${i.fieldName!"(see expression)"}</td>
<td>${action.stripPackage(i.class)}</td>
<td>
<a href="#" onClick="window.open('validatorDetails.${extension}?clazz=${clazz}&context=${context}&selected=${row}', 'Validator Details', 'resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=640,height=480');">details</a>
</td>
</tr>
<#assign row = row + 1>
<#if validators??>
<#foreach i in validators>
<tr <#if i_index%2 gt 0>class="b" <#else>class="a"</#if>>
<td>${i.fieldName!"(see expression)"}</td>
<td>${action.stripPackage(i.class)}</td>
<td><a href="#" id="show-validators">details</a></td>
</tr>
<#assign row = row + 1>
</#foreach>
</#if>
</#if>
</table>
<@s.script>
document.getElementById('show-validators').onclick = function() {
window.open('validatorDetails.${extension}?clazz=${clazz}&context=${context}&selected=${row}', 'Validator Details', 'resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=640,height=480');
return false;
}
</@s.script>