Commits

Anonymous committed c8122b4

Documentation update for comments.js

  • Participants
  • Parent commits 4cd7a4f

Comments (0)

Files changed (1)

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

 /*
+ * Java Script/JQuery glue for server-side Python code and the comments/fixes
+ * stuff which is being served along with the documentation.
+ *
+ * :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ * Below is a short description of the main functions used to make the tool
+ * work. Internal functions are not listed here.
+ *
  **  
  *** checking/downloading/printing/adding comments and fixes ****************
  **
  *                        This function also validates the form and resets
  *                        it on successful submit.
  *
+ **
+ *** displaying/hiding areas *************************************************
+ **
+ *
  * show_hide_comments(id) -> hide fixes area, show comments area and make sure
  *                           that the main comments/fixes area is shown
  *
  * show_hide_fixes(id) -> hide comments area, show fixes area and make sure
  *                        that the main comments/fixes area is shown
  *
+ * show_hide_submitFixFields(id) -> show/hide additional fields in the post
+ *                                  form for fixes view (when 'I would like
+ *                                  to submit a patch' checkbox is 'true')
+ *                                  and fill them with data if needed
+ *
+ *
  **
  *** rating comments/fixes ***************************************************
  **
  *
  *
  **
- *** deleting comments/fixes ***********************************************
+ *** threading ************************************************************
  **
  *
- * delete_comment(db, id, comment_no)
+ * new_thread(id) -> make a particular comment a new thread before submitting
+ *                   it
  *
+ * reply_to(id, comment_no) -> make a comment a reply to comment 'comment_no'
+ *
+ **
+ *** developer's actions ***************************************************
+ **
+ *
+ * delete_comment(db, id, comment_no) -> delete entry from database 'db'
+ *                                       located in 'id' file under
+ *                                       'comment_no' index
+ *
+ * commit_fix(id, fix_no) -> commit a fix located in 'id' file under
+ *                           'fix_no' index to the repository
  *
  **
  *** general-use functions ************************************************
    }
 
    // A 'factory' function which generates '+' and '-' buttons for every comment.
+   //       'what'  is a kind of database (db for comments or for fixes)
    //         'id'  is a paragraph id.
    // 'comment_no'  is a place of a comment in the list of comments for given
    //               paragraph.
       return ' <a href="#' + id + '" onclick="comments_up_down(\'' + id + '\', \'' + comment_no + '\', \'' + up_down + '\', \'' + what + '\')"><b>' + sign + '</b></a> '
    }
 
-
+   // in fixes view - show proposed diff
    function proposed_fix(c_flag, paragraph) {
       if(!c_flag) {
          return   '<tr>'
       return '';
    }
 
+   // for every comment/fix generate a 'Reply' button
    function link_reply_to(id, comment_no) {
       return 'Comment no.: ' + data[i].comment_no
              + ' (<a href="#" onclick="reply_to(\'' + id + '\', \'' + comment_no + '\')">reply</a>).'
-
    }
 
-   // developer's actions
-
+   /* <developer's actions> */
    function delete_comment_button(db, id, comment_no) {
       return '<a href="#" onclick="delete_comment(\'' + db + '\', \'' + id +  '\', \'' + comment_no + '\')">delete</a>' 
    } 
              +  '</td>'
              + '</tr>' 
    }
+   /* </developer's actions> */
 
    // add the comments for paragraph
    for(i=0; i<data.length; i++) {
 }
 
 function get_date(d) {
+   var month=["January", "February", "March", "April",
+              "May", "June", "July", "August",
+              "September", "October", "November", "December"];
    var t_date = d.getDate();      // Returns the day of the month
    var t_mon = d.getMonth();      // Returns the month as a digit
    var t_year = d.getFullYear();  // Returns 4 digit year
    var t_sec = d.getSeconds();    // Returns seocnds
    return t_hour + ':'
           + (t_min < 10 ? '0' : '') + t_min
-          + ' ' + t_date + '/' + t_mon+1 + '/' + t_year
+          + ', ' + month[t_mon] + ' ' + t_date + ' ' + t_year
 }
 
 // *** threading **********************************************************