Make WordPress Core

Changeset 40913


Ignore:
Timestamp:
06/15/2017 01:01:30 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Docs: Add documentation for wp-admin/js/comment.js.

Props ireneyoast, andizer, jipmoors.
Fixes #41065.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/comment.js

    r33422 r40913  
    11/* global postboxes, commentL10n */
     2
     3/**
     4 * @summary Binds to the document ready event.
     5 *
     6 * @since 2.5.0
     7 *
     8 * @param {jQuery} $ The jQuery object.
     9 */
    210jQuery(document).ready( function($) {
    311
     
    1018        $edittimestamp = $timestampdiv.siblings( 'a.edit-timestamp' );
    1119
     20    /**
     21     * @summary Adds event that opens the time stamp form if the form is hidden.
     22     *
     23     * @listens $edittimestamp:click
     24     *
     25     * @param {Event} event The event object.
     26     * @returns {void}
     27     */
    1228    $edittimestamp.click( function( event ) {
    1329        if ( $timestampdiv.is( ':hidden' ) ) {
     30            // Slide down the form and set focus on the first field.
    1431            $timestampdiv.slideDown( 'fast', function() {
    1532                $( 'input, select', $timestampwrap ).first().focus();
     
    1936        event.preventDefault();
    2037    });
     38
     39    /**
     40     * @summary Resets the time stamp values when the cancel button is clicked.
     41     *
     42     * @listens .cancel-timestamp:click
     43     *
     44     * @param {Event} event The event object.
     45     * @returns {void}
     46     */
    2147
    2248    $timestampdiv.find('.cancel-timestamp').click( function( event ) {
     
    3359    });
    3460
     61    /**
     62     * @summary Sets the time stamp values when the ok button is clicked.
     63     *
     64     * @listens .save-timestamp:click
     65     *
     66     * @param {Event} event The event object.
     67     * @returns {void}
     68     */
    3569    $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
    3670        var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
Note: See TracChangeset for help on using the changeset viewer.