Make WordPress Core

Ticket #13821: 13821-1.diff

File 13821-1.diff, 1.7 KB (added by kapeels, 14 years ago)
  • wp-admin/js/post.dev.js

     
    499499                });
    500500
    501501                $('.save-timestamp', '#timestampdiv').click(function () { // crazyhorse - multiple ok cancels
     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                        }
    502518                        if ( updateText() ) {
    503519                                $('#timestampdiv').slideUp("normal");
    504520                                $('#timestampdiv').siblings('a.edit-timestamp').show();