}
}},
showErrors: function(validator, errorMap, errorList) {
- customShowError(validator,errorMap,errorMap);
+ customShowError("#main-content #network-proxy-edit-form",validator,errorMap,errorMap);
}
});
validator.settings.messages["id"]=$.i18n.prop("id.required.or.alreadyexists");
}
},
showErrors: function(validator, errorMap, errorList) {
- customShowError(validator,errorMap,errorMap);
+ customShowError("#main-content #managed-repository-edit-form",validator,errorMap,errorMap);
}
});
validator.settings.messages["cronExpression"]=$.i18n.prop("cronExpression.notvalid");
}
},*/
showErrors: function(validator, errorMap, errorList) {
- customShowError(validator,errorMap,errorMap);
+ customShowError("#main-content #remote-repository-edit-form",validator,errorMap,errorMap);
}
});
validator.settings.messages["cronExpression"]=$.i18n.prop("cronExpression.notvalid");
/**
* used by validation error to customize error display in the ui
+ * @param selector
* @param validator
* @param errorMap
* @param errorList
*/
-customShowError=function(formId, validator, errorMap, errorList) {
- $( "#"+formId+" div.control-group" ).removeClass( "error" );
- $( "#"+formId+" span.help-inline" ).remove();
+customShowError=function(selector, validator, errorMap, errorList) {
+ $( selector+" div.control-group" ).removeClass( "error" );
+ $( selector+" span.help-inline" ).remove();
for ( var i = 0; errorList[i]; i++ ) {
var error = errorList[i];
var field = $("#"+error.element.id);
window.modalRegisterWindow.modal('show');
$("#user-register-form").validate({
showErrors: function(validator, errorMap, errorList) {
- customShowError("user-register-form",validator,errorMap,errorMap);
+ customShowError("#user-register-form",validator,errorMap,errorMap);
}
});
$("#modal-register").delegate("#modal-register-ok", "click keydown keypress", function(e) {
}
},
showErrors: function(validator, errorMap, errorList) {
- customShowError("user-create",validator,errorMap,errorMap);
+ customShowError("#main-content #user-create",validator,errorMap,errorMap);
}
});
$("#user-login-form").validate({
showErrors: function(validator, errorMap, errorList) {
- customShowError("user-login-form",validator,errorMap,errorMap);
+ customShowError("#user-login-form",validator,errorMap,errorMap);
}
});
$("#modal-login").delegate("#modal-login-ok", "click keydown keypress", function(e) {
}
},
showErrors: function(validator, errorMap, errorList) {
- customShowError("password-change-form",validator,errorMap,errorMap);
+ customShowError("#password-change-form",validator,errorMap,errorMap);
}
});
}
},
showErrors: function(validator, errorMap, errorList) {
- customShowError("user-edit-form",validator,errorMap,errorMap);
+ customShowError("#user-edit-form",validator,errorMap,errorMap);
}
});
/**
* view model used for users grid
*/
- usersViewModel=function() {
+ UsersViewModel=function() {
this.users = ko.observableArray([]);
var self = this;
$("#main-content #user-edit").remove();
$('#main-content #user-create').show();
ko.renderTemplate("redback/user-edit-tmpl", new User(), null, $("#createUserForm").get(0),"replaceChildren");
- $("#main-content #createUserForm #user-create").delegate("#user-create-form-cancel-button", "click keydown", function(e) {
+ $("#main-content #createUserForm #user-create-form-cancel-button").on( "click", function(e) {
e.preventDefault();
activateUsersGridTab();
});
}
},
showErrors: function(validator, errorMap, errorList) {
- customShowError("user-create",validator,errorMap,errorMap);
+ customShowError("#main-content #user-create",validator,errorMap,errorMap);
}
});
$("#main-content #createUserForm #user-create").delegate("#user-create-form-register-button", "click keydown", function(e) {
$("#main-content #users-view-tabs-li-user-edit a").html($.i18n.prop("edit"));
- $("#main-content #user-create").delegate("#user-create-form-cancel-button", "click keydown", function(e) {
+ $("#main-content #user-create #user-create-form-cancel-button").on("click", function(e) {
e.preventDefault();
activateUsersGridTab();
});
}
},
showErrors: function(validator, errorMap, errorList) {
- customShowError("user-create",validator,errorMap,errorMap);
+ customShowError("#main-content #user-create",validator,errorMap,errorMap);
}
});
$("#main-content #user-create").delegate("#user-create-form-save-button", "click keydown", function(e) {
screenChange();
$("#main-content").html(mediumSpinnerImg());
jQuery("#main-content").attr("data-bind",'template: {name:"usersGrid"}');
- window.redbackModel.usersViewModel = new usersViewModel();
+ window.redbackModel.usersViewModel = new UsersViewModel();
window.redbackModel.usersViewModel.loadUsers();
ko.applyBindings(window.redbackModel.usersViewModel,jQuery("#main-content").get(0));
$("#main-content").tab('show');//#users-view-tabs
- $("#main-content a[data-toggle='tab']").on('show', function (e) {
+ $("#main-content #users-view-tabs a[data-toggle='tab']").on('show', function (e) {
//$.log( $(e.target).attr("href") ); // activated tab
//e.relatedTarget // previous tab
if ($(e.target).attr("href")=="#createUserForm") {