* @param errorMap
* @param errorList
*/
-customShowError=function(validator, errorMap, errorList) {
- $( "#main-content div.clearfix" ).removeClass( "error" );
- $( "#main-content span.help-inline" ).remove();
+customShowError=function(formId, validator, errorMap, errorList) {
+ $( "#"+formId+" div.control-group" ).removeClass( "error" );
+ $( "#"+formId+" 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.parents( "div.control-group" ).addClass( "error" );
field.parent().append( "<span class=\"help-inline\">" + error.message + "</span>" );
}
}
-->
<div id="modal-login" class="modal hide fade">
<div class="modal-header">
- <a href="#" class="close">×</a>
+ <a href="#" class="close" data-dismiss="modal">×</a>
<h3>${$.i18n.prop('login.section.title')}</h3>
</div>
<div class="modal-body" id="modal-login-content">
- <form id="user-login-form">
- <div id="modal-login-err-message" class="alert-message error" style="display:none"></div>
+ <form id="user-login-form" class="form-horizontal">
+ <div id="modal-login-err-message" class="alert alert-error" style="display:none"></div>
<fieldset>
- <div class="clearfix">
- <label for="user-login-form-username">${$.i18n.prop('username')}</label>
- <div class="input">
+ <div class="control-group">
+ <label class="control-label" for="user-login-form-username">${$.i18n.prop('username')}</label>
+ <div class="controls">
<input type="text" id="user-login-form-username" name="user-login-form-username" class="required" />
</div>
</div>
- <div class="clearfix">
- <label for="user-login-form-password">${$.i18n.prop('password')}</label>
- <div class="input">
+ <div class="control-group">
+ <label class="control-label" for="user-login-form-password">${$.i18n.prop('password')}</label>
+ <div class="controls">
<input type="password" id="user-login-form-password" name="user-login-form-password" class="required" />
</div>
</div>
</form>
</div>
<div class="modal-footer" id="modal-login-footer">
- <button class="btn primary" onclick="return login();" id="modal-login-ok">${$.i18n.prop('login')}</button>
+ <button class="btn primary" id="modal-login-ok">${$.i18n.prop('login')}</button>
</div>
</div>
loginBox=function(){
screenChange();
+ if (window.modalLoginWindow!=null){
+ window.modalLoginWindow=null;
+ }
if (window.modalLoginWindow==null) {
- $.log("window.modalLoginWindow==null");
window.modalLoginWindow = $("#modal-login").modal();
window.modalLoginWindow.bind('hidden', function () {
$("#modal-login-err-message").hide();
$("#user-login-form").validate({
showErrors: function(validator, errorMap, errorList) {
- customShowError(validator,errorMap,errorMap);
+ customShowError("user-login-form",validator,errorMap,errorMap);
}
});
$("#modal-login").delegate("#modal-login-ok", "click keydown keypress", function(e) {
e.preventDefault();
- $.log("loginBox before login");
login();
});
- $("#modal-login").show();
- window.modalLoginWindow.modal('show');
- $.log("window.modalLoginWindow= modal show");
- $("#modal-login").focus();
+
}
/**