aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-03-08 20:40:10 +0000
committerOlivier Lamy <olamy@apache.org>2012-03-08 20:40:10 +0000
commit778b6cdbd73ae3bd2f7afee4c63c462a6a0ee035 (patch)
tree62fccdf256f3dc5f64f510ecc9d60081c218d9fc
parentb9a320a2da64b48cc702bcfaf72fc2776b767b2f (diff)
downloadarchiva-778b6cdbd73ae3bd2f7afee4c63c462a6a0ee035.tar.gz
archiva-778b6cdbd73ae3bd2f7afee4c63c462a6a0ee035.zip
minor cleanup on selector usage
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1298566 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js4
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js5
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html2
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js6
4 files changed, 11 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
index 985f0323b..f060100f0 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
@@ -82,6 +82,10 @@ $(function() {
var screen = $.urlParam('screen');
if(screen){
+ if(screen=='network-proxies'&& hasKarma('archiva-manage-configuration')){
+ displayNetworkProxies();
+ return;
+ }
if(screen=='proxy-connectors'&& hasKarma('archiva-manage-configuration')){
displayProxyConnectors();
return;
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js
index 1127d1e9a..eea73dddb 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js
@@ -270,7 +270,8 @@ $(function() {
}
activateNetworkProxyFormValidation=function(){
- var validator = $("#main-content #network-proxy-edit-form").validate({
+ var editForm=$("#main-content #network-proxy-edit-form");
+ var validator = editForm.validate({
rules: {id: {
required: true,
remote: {
@@ -279,7 +280,7 @@ $(function() {
}
}},
showErrors: function(validator, errorMap, errorList) {
- customShowError("#main-content #network-proxy-edit-form",validator,errorMap,errorMap);
+ customShowError(editForm,validator,errorMap,errorMap);
}
});
validator.settings.messages["id"]=$.i18n.prop("id.required.or.alreadyexists");
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
index cd1ba54cd..701a5ac4d 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
@@ -98,7 +98,7 @@
<form id="network-proxy-edit-form" class="well form-horizontal">
<fieldset id="network-proxy-edit-fieldset">
<div class="control-group">
- <label class="control-label" for="id">${$.i18n.prop('id')}</label>
+ <label class="control-label" for="id">${$.i18n.prop('id')}</label>
<div class="controls">
{{if update}}
<span class="uneditable-input">${$data.networkProxy.id}</span>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
index eee85a132..815605f92 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
@@ -285,11 +285,11 @@ displayRestError=function(data,idToAppend){
* @param errorList
*/
customShowError=function(selector, validator, errorMap, errorList) {
- $.isFunction(selector)? selector.find("div.control-group" ).removeClass( "error" ):$(selector).find("div.control-group" ).removeClass( "error" );
- $.isFunction(selector)? selector.find("span.help-inline").remove():$(selector).find("span.help-inline").remove();
+ $(selector).find("div.control-group" ).removeClass( "error" );
+ $(selector).find("span.help-inline").remove();
for ( var i = 0; errorList[i]; i++ ) {
var error = errorList[i];
- var field = $("#"+error.element.id);
+ var field = $(selector).find("#"+error.element.id);// $.isFunction(selector)? selector.find(fieldSelector ).get(0):$(selector).find(selector);
field.parents( "div.control-group" ).addClass( "error" );
field.parent().append( "<span class=\"help-inline\">" + error.message + "</span>" );
}