docs/_static/websupport.js
function getComments(id) {
    $.ajax({
     type: 'GET',
     url: opts.getCommentsURL,
     data: {node: id},
     success: function(data, textStatus, request) {
       var ul = $('#cl' + id);
       var speed = 100;
       $('#cf' + id)
         .find('textarea[name="proposal"]')
         .data('source', data.source);

       if (data.comments.length === 0) {
         ul.html('<li>No comments yet.</li>');
         ul.data('empty', true);
       } else {
         // If there are comments, sort them and put them in the list.
         var comments = sortComments(data.comments);
         speed = data.comments.length * 100;
         appendComments(comments, ul);
         ul.data('empty', false);
       }
       $('#cn' + id).slideUp(speed + 200);
       ul.slideDown(speed);
     },
     error: function(request, textStatus, error) {
       showError('Oops, there was a problem retrieving the comments.');
     },
     dataType: 'json'
    });
  }
function getComments(id) {
    $.ajax({
     type: 'GET',
     url: opts.getCommentsURL,
     data: {node: id},
     success: function(data, textStatus, request) {
       var ul = $('#cl' + id);
       var speed = 100;
       $('#cf' + id)
         .find('textarea[name="proposal"]')
         .data('source', data.source);

       if (data.comments.length === 0) {
         ul.html('<li>No comments yet.</li>');
         ul.data('empty', true);
       } else {
         // If there are comments, sort them and put them in the list.
         var comments = sortComments(data.comments);
         speed = data.comments.length * 100;
         appendComments(comments, ul);
         ul.data('empty', false);
       }
       $('#cn' + id).slideUp(speed + 200);
       ul.slideDown(speed);
     },
     error: function(request, textStatus, error) {
       showError('Oops, there was a problem retrieving the comments.');
     },
     dataType: 'json'
    });
  }
function getComments ( id ) { $ . ajax ( { type : 'GET' , url : opts . getCommentsURL , data : { node : id } , success : function ( data , textStatus , request ) { var ul = $ ( '#cl' + id ) ; var speed = 100 ; $ ( '#cf' + id ) . find ( 'textarea[name="proposal"]' ) . data ( 'source' , data . source ) ; if ( data . comments . length === 0 ) { ul . html ( '<li>No comments yet.</li>' ) ; ul . data ( 'empty' , true ) ; } else { // If there are comments, sort them and put them in the list. var comments = sortComments ( data . comments ) ; speed = data . comments . length * 100 ; appendComments ( comments , ul ) ; ul . data ( 'empty' , false ) ; } $ ( '#cn' + id ) . slideUp ( speed + 200 ) ; ul . slideDown ( speed ) ; } , error : function ( request , textStatus , error ) { showError ( 'Oops, there was a problem retrieving the comments.' ) ; } , dataType : 'json' } ) ; }
Perform an ajax request to get comments for a node
and insert the comments into the comments tree.
Perform an ajax request to get comments for a node and insert the comments into the comments tree .