1. Daniel Neuhäuser
  2. sphinx-vala-domain

Commits

Georg Brandl  committed 9a8e090

Add header and use docstring convention.

  • Participants
  • Parent commits 8fc7862
  • Branches default

Comments (0)

Files changed (1)

File sphinx/themes/basic/static/websupport.js

View file
+/*
+ * websupport.js
+ * ~~~~~~~~~~~~~
+ *
+ * sphinx.websupport utilties for all documentation.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
 (function($) {
   $.fn.autogrow = function(){
     return this.each(function(){
     });
   }
 
-  /*
-   Set comp, which is a comparator function used for sorting and
-   inserting comments into the list.
-  */
+  /**
+   * Set comp, which is a comparator function used for sorting and
+   * inserting comments into the list.
+   */
   function setComparator() {
     // If the first three letters are "asc", sort in ascending order
     // and remove the prefix.
     $('a.' + by).removeAttr('href').addClass('sel');
   }
 
-  /*
-   Create a comp function. If the user has preferences stored in
-   the sortBy cookie, use those, otherwise use the default.
-  */
+  /**
+   * Create a comp function. If the user has preferences stored in
+   * the sortBy cookie, use those, otherwise use the default.
+   */
   function initComparator() {
     by = 'rating'; // Default to sort by rating.
     // If the sortBy cookie is set, use that instead.
     setComparator();
   }
 
-  /*
-   Show a comment div.
-  */
+  /**
+   * Show a comment div.
+   */
   function show(id) {
     $('#ao' + id).hide();
     $('#ah' + id).show();
     });
   }
 
-  /*
-   Hide a comment div.
-  */
+  /**
+   * Hide a comment div.
+   */
   function hide(id) {
     $('#ah' + id).hide();
     $('#ao' + id).show();
     });
   }
 
-  /*
-   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.
+   */
   function getComments(id) {
     $.ajax({
      type: 'GET',
     });
   }
 
-  /*
-   Add a comment via ajax and insert the comment into the comment tree.
-  */
+  /**
+   * Add a comment via ajax and insert the comment into the comment tree.
+   */
   function addComment(form) {
     // Disable the form that is being submitted.
     form.find('textarea,input').attr('disabled', 'disabled');
     });
   }
 
-  /*
-   Recursively append comments to the main comment list and children
-   lists, creating the comment tree.
-  */
+  /**
+   * Recursively append comments to the main comment list and children
+   * lists, creating the comment tree.
+   */
   function appendComments(comments, ul) {
     $.each(comments, function() {
       var div = createCommentDiv(this);
     });
   }
 
-  /*
-   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.
+   */
   function insertComment(comment) {
     var div = createCommentDiv(comment);
 
     textarea.slideUp('fast');
   }
 
-  /*
-   Handle when the user clicks on a sort by link.
-  */
+  /**
+   * Handle when the user clicks on a sort by link.
+   */
   function handleReSort(link) {
     var classes = link.attr('class').split(/\s+/);
     for (var i=0; i<classes.length; i++) {
     });
   }
 
-  /*
-   Function to process a vote when a user clicks an arrow.
-  */
+  /**
+   * Function to process a vote when a user clicks an arrow.
+   */
   function handleVote(link) {
     if (!opts.voting) {
       showError("You'll need to login to vote.");
     });
   }
 
-  /*
-   Open a reply form used to reply to an existing comment.
-  */
+  /**
+   * Open a reply form used to reply to an existing comment.
+   */
   function openReply(id) {
     // Swap out the reply link for the hide link
     $('#rl' + id).hide();
     div.slideDown('fast');
   }
 
-  /*
-   Close the reply form opened with openReply.
-  */
+  /**
+   * Close the reply form opened with openReply.
+   */
   function closeReply(id) {
     // Remove the reply div from the DOM.
     $('#rd' + id).slideUp('fast', function() {
     $('#rl' + id).show();
   }
 
-  /*
-   Recursively sort a tree of comments using the comp comparator.
-  */
+  /**
+   * Recursively sort a tree of comments using the comp comparator.
+   */
   function sortComments(comments) {
     comments.sort(comp);
     $.each(comments, function() {
     return comments;
   }
 
-  /*
-   Get the children comments from a ul. If recursive is true,
-   recursively include childrens' children.
-  */
+  /**
+   * Get the children comments from a ul. If recursive is true,
+   * recursively include childrens' children.
+   */
   function getChildren(ul, recursive) {
     var children = [];
     ul.children().children("[id^='cd']")
     return children;
   }
 
-  /*
-   Create a div to display a comment in.
-  */
+  /**
+   * Create a div to display a comment in.
+   */
   function createCommentDiv(comment) {
     // Prettify the comment rating.
     comment.pretty_rating = comment.rating + ' point' +
     return div;
   }
 
-  /*
-   A simple template renderer. Placeholders such as <%id%> are replaced
-   by context['id'] with items being escaped. Placeholders such as <#id#>
-   are not escaped.
-  */
+  /**
+   * A simple template renderer. Placeholders such as <%id%> are replaced
+   * by context['id'] with items being escaped. Placeholders such as <#id#>
+   * are not escaped.
+   */
   function renderTemplate(template, context) {
     var esc = $(document.createElement('div'));
 
       .fadeOut("slow");
   }
 
-  /*
-   Add a link the user uses to open the comments popup.
-  */
+  /**
+   * Add a link the user uses to open the comments popup.
+   */
   $.fn.comment = function() {
     return this.each(function() {
       var id = $(this).attr('id').substring(1);