aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js8
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js4
2 files changed, 10 insertions, 2 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
index 339fdbaf9..c0619a601 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
@@ -520,6 +520,9 @@ $(function() {
this.networkConfiguration=ko.observable(networkConfiguration);
save=function(){
+ if (!$("#main-content #network-proxy-edit-form").valid()){
+ return;
+ }
clearUserMessages();
$.ajax("restServices/archivaServices/archivaAdministrationService/setNetworkConfiguration", {
type: "POST",
@@ -544,6 +547,11 @@ $(function() {
var networkConfiguration=new NetworkConfiguration(data.maxTotal,data.maxTotalPerHost,data.usePooling);
var networkConfigurationViewModel=new NetworkConfigurationViewModel(networkConfiguration);
ko.applyBindings(networkConfigurationViewModel,mainContent.get(0));
+ var validator = $("#main-content #network-proxy-edit-form").validate({
+ showErrors: function(validator, errorMap, errorList) {
+ customShowError(mainContent.find("#network-proxy-edit-form" ).get(0),validator,errorMap,errorMap);
+ }
+ });
}
});
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 08ec9fd9b..eee85a132 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,8 +285,8 @@ displayRestError=function(data,idToAppend){
* @param errorList
*/
customShowError=function(selector, validator, errorMap, errorList) {
- $(selector ).find("div.control-group" ).removeClass( "error" );
- $(selector).find("span.help-inline").remove();
+ $.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();
for ( var i = 0; errorList[i]; i++ ) {
var error = errorList[i];
var field = $("#"+error.element.id);