move commun function to util.js

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1231993 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-16 13:27:48 +00:00
parent c86c62cd2d
commit 4831643aee
2 changed files with 11 additions and 11 deletions

View File

@ -26,17 +26,6 @@ $(function() {
cache: false
} );
customShowError=function(validator, errorMap, errorList) {
$( "div.clearfix" ).removeClass( "error" );
$( "span.help-inline" ).remove();
for ( var i = 0; errorList[i]; i++ ) {
var error = errorList[i];
var field = $("#"+error.element.id);
field.parents( "div.clearfix" ).addClass( "error" );
field.parent().append( "<span class=\"help-inline\">" + error.message + "</span>" )
}
}
/**
* reccord a cookie for session with the logged user
* @param user see user.js

View File

@ -250,4 +250,15 @@ displayRedbackError=function(obj,idToAppend) {
$.log("displayRedbackError no array");
displayErrorMessage($.i18n.prop( obj.redbackRestError.errorMessages.errorKey, obj.redbackRestError.errorMessages.args ),idToAppend);
}
}
customShowError=function(validator, errorMap, errorList) {
$( "div.clearfix" ).removeClass( "error" );
$( "span.help-inline" ).remove();
for ( var i = 0; errorList[i]; i++ ) {
var error = errorList[i];
var field = $("#"+error.element.id);
field.parents( "div.clearfix" ).addClass( "error" );
field.parent().append( "<span class=\"help-inline\">" + error.message + "</span>" )
}
}