docs/_static/websupport.js
function insertComment(comment) {
    var div = createCommentDiv(comment);

    // To avoid stagnating data, don't store the comments children in data.
    comment.children = null;
    div.data('comment', comment);

    var ul = $('#cl' + (comment.node || comment.parent));
    var siblings = getChildren(ul);

    var li = $(document.createElement('li'));
    li.hide();

    // Determine where in the parents children list to insert this comment.
    for(i=0; i < siblings.length; i++) {
      if (comp(comment, siblings[i]) <= 0) {
        $('#cd' + siblings[i].id)
          .parent()
          .before(li.html(div));
        li.slideDown('fast');
        return;
      }
    }

    // If we get here, this comment rates lower than all the others,
    // or it is the only comment in the list.
    ul.append(li.html(div));
    li.slideDown('fast');
  }
function insertComment(comment) {
    var div = createCommentDiv(comment);

    // To avoid stagnating data, don't store the comments children in data.
    comment.children = null;
    div.data('comment', comment);

    var ul = $('#cl' + (comment.node || comment.parent));
    var siblings = getChildren(ul);

    var li = $(document.createElement('li'));
    li.hide();

    // Determine where in the parents children list to insert this comment.
    for(i=0; i < siblings.length; i++) {
      if (comp(comment, siblings[i]) <= 0) {
        $('#cd' + siblings[i].id)
          .parent()
          .before(li.html(div));
        li.slideDown('fast');
        return;
      }
    }

    // If we get here, this comment rates lower than all the others,
    // or it is the only comment in the list.
    ul.append(li.html(div));
    li.slideDown('fast');
  }
function insertComment ( comment ) { var div = createCommentDiv ( comment ) ; // To avoid stagnating data, don't store the comments children in data. comment . children = null ; div . data ( 'comment' , comment ) ; var ul = $ ( '#cl' + ( comment . node || comment . parent ) ) ; var siblings = getChildren ( ul ) ; var li = $ ( document . createElement ( 'li' ) ) ; li . hide ( ) ; // Determine where in the parents children list to insert this comment. for ( i = 0 ; i < siblings . length ; i ++ ) { if ( comp ( comment , siblings [ i ] ) <= 0 ) { $ ( '#cd' + siblings [ i ] . id ) . parent ( ) . before ( li . html ( div ) ) ; li . slideDown ( 'fast' ) ; return ; } } // If we get here, this comment rates lower than all the others, // or it is the only comment in the list. ul . append ( li . html ( div ) ) ; li . slideDown ( 'fast' ) ; }
After adding a new comment, it must be inserted in the correct
location in the comment tree.
After adding a new comment it must be inserted in the correct location in the comment tree .