Changeset 2455

Show
Ignore:
Timestamp:
09/07/08 04:14:55 (3 months ago)
Author:
chrismeller
Message:

Adding mass delete capability to the comments screen. Thanks to arthus for the patch! Closes #351.

Location:
trunk/htdocs/system
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/admin/comments.php

    r2361 r2455  
    4141 
    4242<div class="container transparent item comments controls"> 
    43     <span class="checkboxandselected pct25"> 
     43    <span class="checkboxandselected pct30"> 
    4444        <input type="checkbox" id="master_checkbox" name="master_checkbox"> 
    4545        <label class="selectedtext minor none" for="master_checkbox"><?php _e('None selected'); ?></label> 
     
    6161 
    6262<div class="container transparent item comments controls"> 
    63     <span class="checkboxandselected pct25"> 
     63    <span class="checkboxandselected pct30"> 
    6464        <input type="checkbox" id="master_checkbox_2" name="master_checkbox_2"> 
    6565        <label class="selectedtext minor none" for="master_checkbox_2"><?php _e('None selected'); ?></label> 
  • trunk/htdocs/system/admin/css/admin.css

    r2415 r2455  
    14591459.navigator span { 
    14601460    float: left; 
     1461} 
     1462 
     1463.navigator span span { 
     1464    float:none; 
    14611465} 
    14621466 
  • trunk/htdocs/system/admin/js/admin.js

    r2388 r2455  
    326326        visible = $('.item:not(.hidden):not(.ignore) .checkbox input[type=checkbox]:checked').length; 
    327327         
     328        total= $('.currentposition .total').text(); 
     329         
    328330        count = 0; 
    329331        for (var id in itemManage.selected) { 
     
    342344                this.checked = 1; 
    343345            }); 
    344             $('.item.controls label.selectedtext').removeClass('none').addClass('all').text('All ' + count + ' selected'); 
     346            $('.item.controls label.selectedtext').removeClass('none').addClass('all').html('All ' + count + ' visible selected (<a href="#all" class="everything">Select all ' + total + '</a>)'); 
     347             
     348            $('.item.controls label.selectedtext .everything').click(function() { 
     349                itemManage.checkEverything(); 
     350                return false; 
     351            }); 
     352             
    345353            if(visible != count) { 
    346354                $('.item.controls label.selectedtext').text('All visible selected (' + count + ' total)'); 
     355            } 
     356             
     357            if((total == count) || $('.currentposition .total').length == 0) { 
     358                $('.item.controls label.selectedtext').removeClass('none').addClass('all').addClass('total').html('All ' + total + ' selected'); 
    347359            } 
    348360        } else { 
     
    351363            }); 
    352364            $('.item.controls label.selectedtext').removeClass('none').removeClass('all').text(count + ' selected'); 
     365             
    353366            if(visible != count) { 
    354367                $('.item.controls label.selectedtext').text(count + ' selected (' + visible + ' visible)'); 
    355368            } 
    356369        } 
     370    }, 
     371    checkEverything: function() { 
     372        itemManage.fetch(0, $('.currentposition .total').text(), false, true); 
    357373    }, 
    358374    uncheckAll: function() { 
     
    414430        itemManage.update( 'delete', id ); 
    415431    }, 
    416     fetch: function( offset, limit, resetTimeline ) { 
     432    fetch: function( offset, limit, resetTimeline, silent ) { 
    417433        offset = ( offset == null ) ? 0 : offset; 
    418434        limit = ( limit == null ) ? 20: limit; 
     435        silent = ( silent == null ) ? false: silent; 
    419436        spinner.start(); 
    420437 
     
    425442            dataType: 'json', 
    426443            success: function(json) { 
    427                 itemManage.fetchReplace.html(json.items); 
    428                 // if we have a timeline, replace its content 
    429                 if ( resetTimeline && $('.timeline').length !=0 ) { 
    430                     // we hide and show the timeline to fix a firefox display bug 
    431                     $('.years').html(json.timeline).hide(); 
    432                     spinner.stop(); 
     444                if(silent) { 
     445                    itemManage.selected= json.item_ids; 
    433446                    itemManage.initItems(); 
    434                     $('.years').show(); 
    435                     timeline.reset(); 
    436                     $('input.checkbox').rangeSelect(); 
     447                } else { 
     448                    itemManage.fetchReplace.html(json.items); 
     449                    // if we have a timeline, replace its content 
     450                    if ( resetTimeline && $('.timeline').length !=0 ) { 
     451                        // we hide and show the timeline to fix a firefox display bug 
     452                        $('.years').html(json.timeline).hide(); 
     453                        spinner.stop(); 
     454                        itemManage.initItems(); 
     455                        $('.years').show(); 
     456                        timeline.reset(); 
     457                        $('input.checkbox').rangeSelect(); 
     458                    } 
     459                    else { 
     460                        spinner.stop(); 
     461                        itemManage.initItems(); 
     462                        $('input.checkbox').rangeSelect(); 
     463                    } 
     464                    if ( itemManage.inEdit == true ) { 
     465                        inEdit.init(); 
     466                        inEdit.deactivate(); 
     467                    } 
     468                    findChildren(); 
    437469                } 
    438                 else { 
    439                     spinner.stop(); 
    440                     itemManage.initItems(); 
    441                     $('input.checkbox').rangeSelect(); 
    442                 } 
    443                 if ( itemManage.inEdit == true ) { 
    444                     inEdit.init(); 
    445                     inEdit.deactivate(); 
    446                 } 
    447                 findChildren(); 
     470                 
    448471                spinner.stop(); 
     472                 
    449473            } 
    450474        }); 
     
    824848        var loupeInfo = timelineHandle.getLoupeInfo(); 
    825849 
    826         $('.currentposition').text( loupeInfo.start +'-'+ loupeInfo.end +' of '+ timeline.totalCount ); 
     850        $('.currentposition').html( loupeInfo.start +'-'+ loupeInfo.end +' of <span class="total inline">'+ timeline.totalCount + '</span>'); 
    827851        if ($('.currentposition').css('opacity')) $('.currentposition').animate({opacity: 1}, 500) 
    828852         
  • trunk/htdocs/system/admin/logs.php

    r2361 r2455  
    7676 
    7777    <div class="item controls"> 
    78         <span class="checkboxandselected pct25"> 
     78        <span class="checkboxandselected pct40"> 
    7979            <input type="checkbox" id="master_checkbox" name="master_checkbox"> 
    8080            <label class="selectedtext minor none" for="master_checkbox"><?php _e('None selected'); ?></label> 
  • trunk/htdocs/system/admin/posts.php

    r2361 r2455  
    3838    <input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>"> 
    3939    <input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>"> 
    40     <span class="checkboxandselected pct25"> 
     40    <span class="checkboxandselected pct30"> 
    4141        <input type="checkbox" id="master_checkbox" name="master_checkbox"> 
    4242        <label class="selectedtext minor none" for="master_checkbox"><?php _e('None selected'); ?></label> 
     
    5959    <input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>"> 
    6060    <input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>"> 
    61     <span class="checkboxandselected pct25"> 
     61    <span class="checkboxandselected pct30"> 
    6262        <input type="checkbox" id="master_checkbox_2" name="master_checkbox_2"> 
    6363        <label class="selectedtext minor none" for="master_checkbox_2"><?php _e('None selected'); ?></label> 
  • trunk/htdocs/system/classes/adminhandler.php

    r2435 r2455  
    13481348            $this->theme->years= $years; 
    13491349        } 
     1350         
    13501351    } 
    13511352 
     
    14521453        $items= $this->theme->fetch( 'posts_items' ); 
    14531454        $timeline= $this->theme->fetch( 'timeline_items' ); 
    1454  
     1455         
     1456        $item_ids= array(); 
     1457         
     1458        foreach($this->theme->posts as $post) { 
     1459            $item_ids['p' . $post->id]= 1; 
     1460        } 
     1461         
    14551462        $output= array( 
    14561463            'items' => $items, 
     1464            'item_ids' => $item_ids, 
    14571465            'timeline' => $timeline, 
    14581466        ); 
     
    14751483        $timeline= $this->theme->fetch( 'timeline_items' ); 
    14761484 
     1485        $item_ids= array(); 
     1486         
     1487        foreach($this->theme->comments as $comment) { 
     1488            $item_ids['p' . $comment->id]= 1; 
     1489        } 
     1490         
    14771491        $output= array( 
    14781492            'items' => $items, 
     1493            'item_ids' => $item_ids, 
    14791494            'timeline' => $timeline, 
    14801495        ); 
     
    18531868        $timeline= $this->theme->fetch( 'timeline_items' ); 
    18541869 
     1870        $item_ids= array(); 
     1871         
     1872        foreach($this->theme->logs as $log) { 
     1873            $item_ids['p' . $log->id]= 1; 
     1874        } 
     1875         
    18551876        $output= array( 
    18561877            'items' => $items, 
     1878            'item_ids' => $item_ids, 
    18571879            'timeline' => $timeline, 
    18581880        );