WordPress.org

Make WordPress Core

Changeset 9560


Ignore:
Timestamp:
11/07/08 03:13:50 (7 years ago)
Author:
azaozz
Message:

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

Location:
trunk/wp-admin
Files:
10 edited

Legend:

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

    r9557 r9560  
    290290</div><!-- /wrap --> 
    291291 
     292<script type="text/javascript"> 
     293/* <![CDATA[ */ 
     294(function($){ 
     295    $(document).ready(function(){ 
     296        $('#doaction, #doaction2').click(function(){ 
     297            if ( $('select[name^="action"]').val() == 'delete' ) { 
     298                var n = $('#the-list input[type="checkbox"]:checked').length; 
     299                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected categories.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected category.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     300                return showNotice.warn(m); 
     301            } 
     302        }); 
     303    }); 
     304})(jQuery); 
     305/* ]]> */ 
     306</script> 
     307 
    292308<?php 
    293309inline_edit_term_row('category'); 
  • trunk/wp-admin/css/colors-fresh.css

    r9556 r9560  
    11 
    22.find-box-search { 
    3     background-color: #e4f2fd; 
    4     border-color: #c6d9e9; 
     3    border-color: #dfdfdf; 
     4    background-color: #f1f1f1; 
     5} 
     6 
     7.find-box { 
     8    background-color: #f1f1f1; 
     9} 
     10 
     11.find-box-inside { 
     12    background-color: #fff; 
    513} 
    614 
     
    1119body, 
    1220#wpbody, 
    13 .form-table .pre, 
    14 .find-box-inside { 
     21.form-table .pre { 
    1522    color: #333; 
    1623} 
     
    10221029} 
    10231030 
    1024 #plugin-information .fyi ul, 
    1025 .find-box { 
     1031#plugin-information .fyi ul { 
    10261032    background-color: #eaf3fa; 
    10271033} 
  • trunk/wp-admin/edit-comments.php

    r9557 r9560  
    339339</div> 
    340340 
     341<script type="text/javascript"> 
     342/* <![CDATA[ */ 
     343(function($){ 
     344    $(document).ready(function(){ 
     345        $('#doaction, #doaction2').click(function(){ 
     346            if ( $('select[name^="action"]').val() == 'delete' ) { 
     347                var n = $('#the-comment-list input[type="checkbox"]:checked').length; 
     348                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected comments.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected comment.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     349                return showNotice.warn(m); 
     350            } 
     351        }); 
     352    }); 
     353})(jQuery); 
     354/* ]]> */ 
     355</script> 
     356 
    341357<?php 
    342358wp_comment_reply('-1', true, 'detail'); 
  • trunk/wp-admin/edit-link-categories.php

    r9557 r9560  
    223223</div><!-- /col-container --> 
    224224</div><!-- /wrap --> 
    225 </div> 
    226  
     225 
     226<script type="text/javascript"> 
     227/* <![CDATA[ */ 
     228(function($){ 
     229    $(document).ready(function(){ 
     230        $('#doaction, #doaction2').click(function(){ 
     231            if ( $('select[name^="action"]').val() == 'delete' ) { 
     232                var n = $('#the-list input[type="checkbox"]:checked').length; 
     233                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected link categories.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected link category.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     234                return showNotice.warn(m); 
     235            } 
     236        }); 
     237    }); 
     238})(jQuery); 
     239/* ]]> */ 
     240</script> 
    227241 
    228242<?php inline_edit_term_row('link-category'); ?> 
  • trunk/wp-admin/edit-pages.php

    r9558 r9560  
    306306</div> 
    307307 
     308<script type="text/javascript"> 
     309/* <![CDATA[ */ 
     310(function($){ 
     311    $(document).ready(function(){ 
     312        $('#doaction, #doaction2').click(function(){ 
     313            if ( $('select[name^="action"]').val() == 'delete' ) { 
     314                var n = $('table.post input[type="checkbox"]:checked').length; 
     315                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected pages.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected page.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     316                return showNotice.warn(m); 
     317            } 
     318        }); 
     319    }); 
     320})(jQuery); 
     321/* ]]> */ 
     322</script> 
     323 
    308324<?php include('admin-footer.php'); ?> 
  • trunk/wp-admin/edit-tags.php

    r9557 r9560  
    280280</div><!-- /col-container --> 
    281281</div><!-- /wrap --> 
     282 
     283<script type="text/javascript"> 
     284/* <![CDATA[ */ 
     285(function($){ 
     286    $(document).ready(function(){ 
     287        $('#doaction, #doaction2').click(function(){ 
     288            if ( $('select[name^="action"]').val() == 'delete' ) { 
     289                var n = $('#the-list input[type="checkbox"]:checked').length; 
     290                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected tags.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected tag.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     291                return showNotice.warn(m); 
     292            } 
     293        }); 
     294    }); 
     295})(jQuery); 
     296/* ]]> */ 
     297</script> 
     298 
    282299<?php inline_edit_term_row('tag'); ?> 
    283300 
  • trunk/wp-admin/edit.php

    r9557 r9560  
    321321</div> 
    322322 
     323<script type="text/javascript"> 
     324/* <![CDATA[ */ 
     325(function($){ 
     326    $(document).ready(function(){ 
     327        $('#doaction, #doaction2').click(function(){ 
     328            if ( $('select[name^="action"]').val() == 'delete' ) { 
     329                var n = $('table.post input[type="checkbox"]:checked').length; 
     330                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected posts.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected post.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     331                return showNotice.warn(m); 
     332            } 
     333        }); 
     334    }); 
     335})(jQuery); 
     336/* ]]> */ 
     337</script> 
     338 
    323339<?php include('admin-footer.php'); ?> 
  • trunk/wp-admin/js/common.js

    r9154 r9560  
    1212    } 
    1313}); 
     14 
     15// stub for doing better warnings 
     16(function($){ 
     17    showNotice = { 
     18        warn : function(text) { 
     19            if ( confirm(text) ) 
     20                return true; 
     21 
     22            return false; 
     23        }, 
     24         
     25        note : function(text) { 
     26            alert(text); 
     27        } 
     28    } 
     29})(jQuery); 
     30 
    1431/* 
    1532(function($) { 
  • trunk/wp-admin/link-manager.php

    r9557 r9560  
    272272</div> 
    273273 
     274<script type="text/javascript"> 
     275/* <![CDATA[ */ 
     276(function($){ 
     277    $(document).ready(function(){ 
     278        $('#doaction, #doaction2').click(function(){ 
     279            if ( $('select[name^="action"]').val() == 'delete' ) { 
     280                var n = $('table.widefat input[type="checkbox"]:checked').length; 
     281                var m = n > 1 ? '<?php echo js_escape(__("You are about to delete the selected links.\n  'Cancel' to stop, 'OK' to delete.")); ?>' : '<?php echo js_escape(__("You are about to delete the selected link.\n  'Cancel' to stop, 'OK' to delete.")); ?>'; 
     282                return showNotice.warn(m); 
     283            } 
     284        }); 
     285    }); 
     286})(jQuery); 
     287/* ]]> */ 
     288</script> 
     289 
    274290<?php include('admin-footer.php'); ?> 
  • 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.