To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 1105

Show
Ignore:
Timestamp:
04/30/10 14:14:49 (22 months ago)
Author:
johnnyoffline
Message:

history browser tweak

Location:
plugins/apostrophePlugin/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk/modules/a/templates/_historyBrowser.php

    r1045 r1105  
    1414                        </tr> 
    1515                        </thead> 
    16                         <tfoot> 
    17                         <?php if (1): ?> 
    18                           <tr> 
    19                                   <td colspan="3"> 
    20                                     <a href="#" class="a-history-browser-view-more"><?php echo __('View More Revisions', null, 'apostrophe') ?> <img src="/apostrophePlugin/images/a-icon-loader.gif" class="spinner" /></a> 
    21           </td> 
    22                                         <td class="number-of-revisions"></td> 
    23                           </tr> 
    24                         <?php endif ?> 
    25                         </tfoot> 
    26                         <tbody class="a-history-items"> <?php // this replaces the history container, we want to return a list of populated rows <TR></TR> ?> 
     16                        <tbody class="a-history-items"> 
    2717                        <tr class="a-history-item"> 
    2818                                <td class="date"><img src="/apostrophePlugin/images/a-icon-loader.gif"></td> 
     
    3121                        </tr> 
    3222                        </tbody> 
     23                        <tfoot> 
     24                          <tr> 
     25                                  <td colspan="3"> 
     26                                    <a href="#" class="a-history-browser-view-more" id="a-history-browser-view-more"><?php echo __('View More Revisions', null, 'apostrophe') ?> <img src="/apostrophePlugin/images/a-icon-loader.gif" class="spinner" /></a> 
     27          </td> 
     28                                        <td class="number-of-revisions"></td> 
     29                          </tr> 
     30                        </tfoot> 
    3331                </table> 
    3432        </div> 
  • plugins/apostrophePlugin/trunk/modules/a/templates/historySuccess.php

    r1040 r1105  
    6666<script type="text/javascript" charset="utf-8"> 
    6767  $(function() { 
    68                 $('.a-history-browser .a-history-browser-view-more').show(); 
     68                $('#a-history-browser-view-more').show(); 
    6969  }); 
    7070</script> 
     
    7272<script type="text/javascript" charset="utf-8"> 
    7373  $(function() { 
    74                 $('.a-history-browser .a-history-browser-view-more').hide(); 
     74                $('#a-history-browser-view-more').hide().before('&nbsp;'); 
    7575  }); 
    7676</script> 
     
    7979 
    8080<script type="text/javascript" charset="utf-8"> 
     81        $(document).ready(function() { 
    8182 
    82         // Stuff to do as soon as the DOM is ready; 
    83         $('.a-history-browser-view-more').mousedown(function(){ 
    84                 $(this).children('img').fadeIn('fast'); 
    85         }) 
     83                $('.a-history-browser-view-more').mousedown(function(){ 
     84                        $(this).children('img').fadeIn('fast'); 
     85                }) 
    8686 
    87         $('.a-history-item').click(function() { 
     87                $('.a-history-item').click(function() { 
    8888 
    89                 $('.a-history-browser').hide(); 
     89                        $('.a-history-browser').hide(); 
    9090                 
    91           var params = $(this).data('params'); 
     91                  var params = $(this).data('params'); 
    9292         
    93                 var targetArea = "#"+$(this).parent().attr('rel');                                                                                      // this finds the associated area that the history browser is displaying 
    94                 var historyBtn = $(targetArea+ ' .a-area-controls a.a-history');                                // this grabs the history button 
    95                 var cancelBtn = $('#a-history-cancel-button');  // this grabs the cancel button for this area 
    96                 var revertBtn = $('#a-history-revert-button');  // this grabs the history revert button for this area 
     93                        var targetArea = "#"+$(this).parent().attr('rel');                                                              <?php // this finds the associated area that the history browser is displaying ?> 
     94                        var historyBtn = $(targetArea+ ' .a-area-controls a.a-history');        <?php // this grabs the history button ?> 
     95                        var cancelBtn = $('#a-history-cancel-button');                                                                          <?php // this grabs the cancel button for this area ?> 
     96                        var revertBtn = $('#a-history-revert-button');                                                                          <?php // this grabs the history revert button for this area ?> 
    9797                 
    98                 $(historyBtn).siblings('.a-history-options').show(); 
     98                        $(historyBtn).siblings('.a-history-options').show(); 
    9999 
    100           $.post( //User clicks to PREVIEW revision 
    101             <?php echo json_encode(url_for('a/revert')) ?>, 
    102             params.preview, 
    103             function(result) 
    104             { 
    105                                 $('#a-slots-<?php echo "$id-$name" ?>').html(result); 
    106                                 $(targetArea).addClass('previewing-history'); 
    107                                 historyBtn.addClass('a-disabled');                               
    108                                 // $(targetArea+' .a-controls-item').siblings('.cancel, .history').css('display', 'block'); // turn off all controls initially                           
    109                                 // $(targetArea+' .a-controls-item.cancel').addClass('cancel-history');                          
    110                                 // $(targetArea+' .a-history-options').css('display','inline'); 
    111                                 $('.a-page-overlay').hide(); 
    112                                 aUI(targetArea); 
    113             } 
    114           ); 
    115  
    116                 // Assign behaviors to the revert and cancel buttons when THIS history item is clicked 
    117                 revertBtn.click(function(){ 
    118                   $.post( // User clicks Save As Current Revision Button 
     100                  $.post( //User clicks to PREVIEW revision 
    119101                    <?php echo json_encode(url_for('a/revert')) ?>, 
    120                     params.revert, 
     102                    params.preview, 
    121103                    function(result) 
    122104                    { 
    123                                         $('#a-slots-<?php echo "$id-$name" ?>').html(result);                    
    124                                         historyBtn.removeClass('a-disabled');                                            
    125                                         aCloseHistory(); 
    126                                         aUI(targetArea, 'history-revert'); 
    127                         } 
    128                         );       
     105                                        $('#a-slots-<?php echo "$id-$name" ?>').html(result); 
     106                                        $(targetArea).addClass('previewing-history'); 
     107                                        historyBtn.addClass('a-disabled');                               
     108                                        $('.a-page-overlay').hide(); 
     109                                        aUI(targetArea); 
     110                    } 
     111                  ); 
     112 
     113                        // Assign behaviors to the revert and cancel buttons when THIS history item is clicked 
     114                        revertBtn.click(function(){ 
     115                          $.post( // User clicks Save As Current Revision Button 
     116                            <?php echo json_encode(url_for('a/revert')) ?>, 
     117                            params.revert, 
     118                            function(result) 
     119                            { 
     120                                                $('#a-slots-<?php echo "$id-$name" ?>').html(result);                    
     121                                                historyBtn.removeClass('a-disabled');                                            
     122                                                aCloseHistory(); 
     123                                                aUI(targetArea, 'history-revert'); 
     124                                } 
     125                                );       
     126                        }); 
     127                                                 
     128                        cancelBtn.click(function(){  
     129                          $.post( // User clicks CANCEL 
     130                            <?php echo json_encode(url_for('a/revert')) ?>, 
     131                            params.cancel, 
     132                            function(result) 
     133                            { 
     134                                $('#a-slots-<?php echo "$id-$name" ?>').html(result); 
     135                                                historyBtn.removeClass('a-disabled');                                                            
     136                                                aCloseHistory(); 
     137                                                aUI(targetArea); 
     138                                } 
     139                                ); 
     140                        }); 
    129141                }); 
    130                                                  
    131                 cancelBtn.click(function(){  
    132                   $.post( // User clicks CANCEL 
    133                     <?php echo json_encode(url_for('a/revert')) ?>, 
    134                     params.cancel, 
    135                     function(result) 
    136                     { 
    137                         $('#a-slots-<?php echo "$id-$name" ?>').html(result); 
    138                                         historyBtn.removeClass('a-disabled');                                                            
    139                                         aCloseHistory(); 
    140                                         aUI(targetArea); 
    141                         } 
    142                         ); 
     142 
     143                $('.a-history-item').hover(function(){ 
     144                        $(this).css('cursor','pointer'); 
     145                },function(){ 
     146                        $(this).css('cursor','default');                 
    143147                }); 
    144         }); 
    145148 
    146         $('.a-history-item').hover(function(){ 
    147                 $(this).css('cursor','pointer'); 
    148         },function(){ 
    149                 $(this).css('cursor','default');                 
    150         }); 
    151  
     149}); 
    152150</script> 
  • plugins/apostrophePlugin/trunk/web/css/a.css

    r1099 r1105  
    17371737float: left; 
    17381738visibility: hidden; 
     1739position: relative; 
    17391740margin: 0 !important; 
    17401741padding: 0 !important; 
     
    26772678{ 
    26782679border-top: 1px solid #ddd; 
    2679 /*      padding: 8px 4px;*/ 
     2680padding: 8px 4px; 
    26802681} 
    26812682