Make WordPress Core


Ignore:
Timestamp:
11/07/2008 03:13:50 AM (16 years ago)
Author:
azaozz
Message:

Display warning when bulk deleting posts, pages, attachments, comments, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload.php

    r9557 r9560  
    451451
    452452<script type="text/javascript">
    453     jQuery(function($) {
    454         $('#doaction').click(function(e) {
    455             if ( 'attach' == $('#posts-filter select[name="action"]').val() ) {
    456                 e.preventDefault();
    457                 findPosts.open();
    458             }
    459         });
    460         $('#doaction2').click(function(e) {
    461             if ( 'attach' == $('#posts-filter select[name="action2"]').val() ) {
     453/* <![CDATA[ */
     454(function($){
     455    $(document).ready(function(){
     456        $('#doaction, #doaction2').click(function(e){
     457            if ( $('select[name^="action"]').val() == 'delete' ) {
     458                var n = $('#the-list input[type="checkbox"]:checked').length;
     459                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected attachments.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected attachment.\n  'Cancel' to stop, 'OK' to delete.")); ?>';
     460                return showNotice.warn(m);
     461            } else if ( $('select[name^="action"]').val() == 'attach' ) {
    462462                e.preventDefault();
    463463                findPosts.open();
     
    465465        });
    466466    });
     467})(jQuery);
     468/* ]]> */
    467469</script>
     470
    468471<?php
    469472
Note: See TracChangeset for help on using the changeset viewer.