| 502 | // hack - check if "Password protected" is checked and password is set |
| 503 | if ( $("#visibility-radio-password").attr('checked') && $('#post_password').val() == '' ) { |
| 504 | $('#post_password').addClass('form-invalid'); |
| 505 | // if password isn't filled, the slide-up event won't happen and so, the post visibility text won't be updated... make it happen. |
| 506 | $('#publish').val( postL10n.update ); |
| 507 | optPublish = $('option[value=publish]', postStatus); |
| 508 | if ( optPublish.length == 0 ) { |
| 509 | postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>'); |
| 510 | } else { |
| 511 | optPublish.html( postL10n.privatelyPublished ); |
| 512 | } |
| 513 | $('option[value=publish]', postStatus).attr('selected', true); |
| 514 | return false; |
| 515 | } else { |
| 516 | $('#post_password').removeClass('form-invalid'); |
| 517 | } |