Author: oching
Date: Fri Aug 31 04:04:54 2007
New Revision: 571430
URL: http://svn.apache.org/viewvc?rev=571430&view=rev
Log:
[MRM-392]
- Added javascript function for submitting the form to a specific action
depending on which textfield the onKeyPress event was invoked
- Added onkeypress action to the property, blacklist pattern and whitelist
pattern textfields
Modified:
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp
Modified:
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp
URL:
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp?rev=571430&r1=571429&r2=571430&view=diff
==============================================================================
---
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp
(original)
+++
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp
Fri Aug 31 04:04:54 2007
@@ -86,9 +86,11 @@
<label for="propertiesEntry">Properties:</label>
</td>
<td>
- <ww:textfield name="propertyKey" size="15" id="propertiesEntry"
theme="simple" /> :
- <ww:textfield name="propertyValue" size="15" id="propertiesValue"
theme="simple" />
- <ww:submit name="action:editProxyConnector!addProperty" value="Add
Property" theme="simple" />
+ <ww:textfield name="propertyKey" size="15" id="propertiesEntry"
theme="simple"
+ onkeypress="submitenter(event,
'editProxyConnector!addProperty.action')" /> :
+ <ww:textfield name="propertyValue" size="15" id="propertiesValue"
theme="simple"
+ onkeypress="submitenter(event,
'editProxyConnector!addProperty.action')"/>
+ <ww:submit name="action:editProxyConnector!addProperty" value="Add
Property" theme="simple" />
</td>
</tr>
@@ -137,7 +139,8 @@
<label for="blackListEntry">Black List:</label>
</td>
<td>
- <ww:textfield name="blackListPattern" size="30" id="blackListEntry"
theme="simple" />
+ <ww:textfield name="blackListPattern" size="30" id="blackListEntry"
theme="simple"
+ onkeypress="submitenter(event,
'editProxyConnector!addBlackListPattern.action')"/>
<ww:submit name="action:editProxyConnector!addBlackListPattern"
value="Add Pattern" theme="simple" />
</td>
</tr>
@@ -180,7 +183,8 @@
<label for="whiteListEntry">White List:</label>
</td>
<td>
- <ww:textfield name="whiteListPattern" size="30" id="whiteListEntry"
theme="simple" />
+ <ww:textfield name="whiteListPattern" size="30" id="whiteListEntry"
theme="simple"
+ onkeypress="submitenter(event,
'editProxyConnector!addWhiteListPattern.action')"/>
<ww:submit name="action:editProxyConnector!addWhiteListPattern"
value="Add Pattern" theme="simple" />
</td>
</tr>
@@ -233,6 +237,43 @@
f.elements[id].value = value;
f.submit();
}
+
+ function submitForm( action )
+ {
+ var f = document.forms['saveProxyConnector'];
+
+ f.action = action;
+ f.submit();
+ }
+
+ function submitenter( e, action )
+ {
+ var keycode;
+
+ if (window.event)
+ {
+ keycode = window.event.keyCode;
+ }
+ else if (e)
+ {
+ keycode = e.which;
+ }
+ else
+ {
+ return true;
+ }
+
+ if (keycode == 13)
+ {
+ submitForm( action );
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+
//-->
</script>