From 10177e7fbbf163f7204c36358f23660f180cab58 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Aug 2017 17:58:44 +0000 Subject: [PATCH] Docs: improve JS docs for `comment-reply.js` Props andizer, ireneyoast. Fixes #41548. Built from https://develop.svn.wordpress.org/trunk@41314 git-svn-id: http://core.svn.wordpress.org/trunk@41145 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/comment-reply.js | 35 +++++++++++++++++++++++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/wp-includes/js/comment-reply.js b/wp-includes/js/comment-reply.js index 184726d35e..3ddf7744ce 100644 --- a/wp-includes/js/comment-reply.js +++ b/wp-includes/js/comment-reply.js @@ -1,4 +1,22 @@ +/** + * @summary Handles the addition of the comment form. + * + * @since 2.7.0 + * + * @type {Object} + */ var addComment = { + /** + * @summary Retrieves the elements corresponding to the given IDs. + * + * @since 2.7.0 + * + * @param {string} commId The comment ID. + * @param {string} parentId The parent ID. + * @param {string} respondId The respond ID. + * @param {string} postId The post ID. + * @returns {boolean} Always returns false. + */ moveForm: function( commId, parentId, respondId, postId ) { var div, element, style, cssHidden, t = this, @@ -30,6 +48,11 @@ var addComment = { parent.value = parentId; cancel.style.display = ''; + /** + * @summary Puts back the comment, hides the cancel button and removes the onclick event. + * + * @returns {boolean} Always returns false. + */ cancel.onclick = function() { var t = addComment, temp = t.I( 'wp-temp-form-div' ), @@ -48,8 +71,8 @@ var addComment = { }; /* - * Set initial focus to the first form focusable element. - * Try/catch used just to avoid errors in IE 7- which return visibility + * Sets initial focus to the first form focusable element. + * Uses try/catch just to avoid errors in IE 7- which return visibility * 'inherit' when the visibility value is inherited from an ancestor. */ try { @@ -90,6 +113,14 @@ var addComment = { return false; }, + /** + * @summary Returns the object corresponding to the given ID. + * + * @since 2.7.0 + * + * @param {string} id The ID. + * @returns {Element} The element belonging to the ID. + */ I: function( id ) { return document.getElementById( id ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0453a0ebcc..001b1ad3ea 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41313'; +$wp_version = '4.9-alpha-41314'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.