Dotclear


Ignore:
Timestamp:
11/09/13 11:40:06 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
2.6
Message:

Refactoring of expandContent for list (entries, comments, trackback).
Addresses #1848

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_post.js

    r2527 r2531  
    1 dotclear.commentExpander = function(line) { 
    2      $('<a href="#"><img src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/></a>') 
    3           .click(function(e) { 
    4                dotclear.toggleArrow(this); 
    5                dotclear.viewCommentContent(line); 
    6                e.preventDefault(); 
    7           }) 
    8           .prependTo($(line).children().get(0)); // first td 
    9 }; 
    10  
    11 dotclear.toggleArrow = function(link,action) { 
    12      action = action || ''; 
    13      var img = $(link).children().get(0); 
    14      if (action=='') { 
    15           if (img.alt==dotclear.img_plus_alt) { 
    16                action = 'open'; 
    17           } else { 
    18                action = 'close'; 
    19           } 
    20      } 
    21  
    22      if (action=='open') { 
    23           img.src = dotclear.img_minus_src; 
    24           img.alt = dotclear.img_minus_alt; 
    25      } else { 
    26           img.src = dotclear.img_plus_src; 
    27           img.alt = dotclear.img_plus_alt; 
    28      } 
    29  
    30      return action; 
    31 } 
    32  
    331dotclear.viewCommentContent = function(line,action) { 
    342     var commentId = $(line).attr('id').substr(1); 
     
    140108                
    141109               excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html(); 
    142                post_content    = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html(); 
     110               post_content   = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html(); 
    143111                
    144112               var params = { 
     
    276244 
    277245     $('#comments').onetabload(function() { 
    278           $('#form-comments .comments-list tr.line').each(function() { 
    279                dotclear.commentExpander(this); 
     246          $.expandContent({ 
     247               lines:$('#form-comments .comments-list tr.line'), 
     248               callback:dotclear.viewCommentContent 
    280249          }); 
    281250          $('#form-comments .checkboxes-helpers').each(function() { 
     
    287256 
    288257     $('#trackbacks').onetabload(function() { 
    289           $('#form-trackbacks .comments-list tr.line').each(function() { 
    290                dotclear.commentExpander(this); 
     258          $.expandContent({ 
     259               lines:$('#form-trackbacks .comments-list tr.line'), 
     260               callback:dotclear.viewCommentContent 
    291261          }); 
    292262          $('#form-trackbacks .checkboxes-helpers').each(function() { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map