| | 456 | // hack - check if "Password protected" is checked but password is not set |
| | 457 | if ( $("#visibility-radio-password").attr('checked') && $('#post_password').val() == '' ) { |
| | 458 | $('#post_password').addClass('form-invalid'); |
| | 459 | // if password is blank, the slide-up event won't happen and so, the post visibility won't be updated... |
| | 460 | $('#publish').val( postL10n.update ); |
| | 461 | postStatus = $('#post_status'); |
| | 462 | optPublish = $('option[value=publish]', postStatus); |
| | 463 | if ( optPublish.length == 0 ) { |
| | 464 | postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>'); |
| | 465 | } else { |
| | 466 | optPublish.html( postL10n.privatelyPublished ); |
| | 467 | } |
| | 468 | $('option[value=publish]', postStatus).attr('selected', true); |
| | 469 | return false; |
| | 470 | } else { |
| | 471 | $('#post_password').removeClass('form-invalid'); |
| | 472 | } |