[ Index ]

PHP Cross Reference of WordPress




/wp-includes/js/ -> comment-reply.js (summary)

Handles the addition of the comment form.

File Size: 444 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions


Functions that are not part of a class:

ready()   X-Ref
Sets up object variables after the DOM is ready.

since: 5.1.1

init( context )   X-Ref
Add events to links classed .comment-reply-link.

Searches the context for reply links and adds the JavaScript events
required to move the comment form. To allow for lazy loading of
comments this method is exposed as window.commentReply.init().

since: 5.1.0
param: {HTMLElement} context The parent DOM element to search for links.

replyLinks( context )   X-Ref
Return all links classed .comment-reply-link.

since: 5.1.0
return: {HTMLCollection|NodeList|Array}
param: {HTMLElement} context The parent DOM element to search for links.

cancelEvent( event )   X-Ref
Cancel event handler.

since: 5.1.0
param: {Event} event The calling event.

clickEvent( event )   X-Ref
Click event handler.

since: 5.1.0
param: {Event} event The calling event.

observeChanges()   X-Ref
Creates a mutation observer to check for newly inserted comments.

since: 5.1.0

handleChanges( mutationRecords )   X-Ref
Handles DOM changes, calling init() if any new nodes are added.

since: 5.1.0
param: {Array} mutationRecords Array of MutationRecord objects.

getDataAttribute( element, attribute )   X-Ref
Backward compatible getter of data-* attribute.

Uses element.dataset if it exists, otherwise uses getAttribute.

since: 5.1.0
return: {string}
param: {HTMLElement} Element DOM element with the attribute.
param: {string}      Attribute the attribute to get.

getElementById( elementId )   X-Ref
Get element by ID.

Local alias for document.getElementById.

since: 5.1.0
param: {HTMLElement} The requested element.

moveForm( addBelowId, commentId, respondId, postId, replyTo )   X-Ref
Moves the reply form from its current position to the reply location.

since: 2.7.0
param: {string} addBelowId HTML ID of element the form follows.
param: {string} commentId  Database ID of comment being replied to.
param: {string} respondId  HTML ID of 'respond' element.
param: {string} postId     Database ID of the post.
param: {string} replyTo    Form heading content.

addPlaceHolder( respondElement )   X-Ref
Add placeholder element.

Places a place holder element above the #respond element for
the form to be returned to if needs be.

since: 2.7.0
param: {HTMLelement} respondElement the #respond element holding comment form.

Generated: Mon May 17 01:00:05 2021 Cross-referenced by PHPXref 0.7.1