Docs: Replace @returns tags in JS docs with @return.

Per the documentation standards, `@returns` is an unsupported synonym, `@return` should be used instead:
https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/

See #48303.
Built from https://develop.svn.wordpress.org/trunk@46800


git-svn-id: http://core.svn.wordpress.org/trunk@46600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2019-11-29 18:01:03 +00:00
parent 4a4afbd68c
commit 2a0489ec49
50 changed files with 805 additions and 801 deletions

View File

@@ -44,7 +44,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
* @param {Function} settings.onChangeLintingErrors - Callback for when there are changes to linting errors.
* @param {Function} settings.onUpdateErrorNotice - Callback to update error notice.
*
* @returns {void}
* @return {void}
*/
function configureLinting( editor, settings ) { // eslint-disable-line complexity
var currentErrorAnnotations = [], previouslyShownErrorAnnotations = [];
@@ -52,7 +52,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
/**
* Call the onUpdateErrorNotice if there are new errors to show.
*
* @returns {void}
* @return {void}
*/
function updateErrorNotice() {
if ( settings.onUpdateErrorNotice && ! _.isEqual( currentErrorAnnotations, previouslyShownErrorAnnotations ) ) {
@@ -64,7 +64,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
/**
* Get lint options.
*
* @returns {object} Lint options.
* @return {object} Lint options.
*/
function getLintOptions() { // eslint-disable-line complexity
var options = editor.getOption( 'lint' );
@@ -214,7 +214,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
* @param {Function} settings.onTabNext - Callback to handle tabbing to the next tabbable element.
* @param {Function} settings.onTabPrevious - Callback to handle tabbing to the previous tabbable element.
*
* @returns {void}
* @return {void}
*/
function configureTabbing( codemirror, settings ) {
var $textarea = $( codemirror.getTextArea() );
@@ -273,7 +273,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
* @param {object} [settings.htmlhint] - Rules for HTMLHint.
* @param {object} [settings.jshint] - Rules for JSHint.
*
* @returns {CodeEditorInstance} Instance.
* @return {CodeEditorInstance} Instance.
*/
wp.codeEditor.initialize = function initialize( textarea, settings ) {
var $textarea, codemirror, instanceSettings, instance;

View File

@@ -39,7 +39,7 @@
*
* @access private
*
* @returns {void}
* @return {void}
*/
_createHueOnly: function() {
var self = this,
@@ -65,7 +65,7 @@
* @param {Event} event The event that's being called.
* @param {HTMLElement} ui The HTMLElement containing the color picker.
*
* @returns {void}
* @return {void}
*/
change: function( event, ui ) {
if ( $.isFunction( self.options.change ) ) {
@@ -83,7 +83,7 @@
*
* @access private
*
* @returns {void}
* @return {void}
*/
_create: function() {
// Return early if Iris support is missing.
@@ -186,7 +186,7 @@
* @param {Event} event The event that's being called.
* @param {HTMLElement} ui The HTMLElement containing the color picker.
*
* @returns {void}
* @return {void}
*/
change: function( event, ui ) {
self.toggler.css( { backgroundColor: ui.color.toString() } );
@@ -212,7 +212,7 @@
*
* @access private
*
* @returns {void}
* @return {void}
*/
_addListeners: function() {
var self = this;
@@ -224,7 +224,7 @@
*
* @param {Event} event The event that's being called.
*
* @returs {void}
* @return {void}
*/
self.wrap.on( 'click.wpcolorpicker', function( event ) {
event.stopPropagation();
@@ -233,7 +233,7 @@
/**
* Open or close the color picker depending on the class.
*
* @since 3.5
* @since 3.5.0
*/
self.toggler.click( function(){
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
@@ -251,7 +251,7 @@
*
* @param {Event} event The event that's being called.
*
* @returns {void}
* @return {void}
*/
self.element.change( function( event ) {
var me = $( this ),
@@ -273,7 +273,7 @@
*
* @param {Event} event The event that's being called.
*
* @returns {void}
* @return {void}
*/
self.button.click( function( event ) {
var me = $( this );
@@ -293,7 +293,7 @@
*
* @since 3.5.0
*
* @returns {void}
* @return {void}
*/
open: function() {
this.element.iris( 'toggle' );
@@ -309,7 +309,7 @@
*
* @since 3.5.0
*
* @returns {void}
* @return {void}
*/
close: function() {
this.element.iris( 'toggle' );
@@ -327,7 +327,7 @@
*
* @since 3.5.0
*
* @returns {string} The element's color.
* @return {string} The element's color.
*/
color: function( newColor ) {
if ( newColor === undef ) {
@@ -343,7 +343,7 @@
*
* @since 3.5.0
*
* @returns {boolean|string} The element's color.
* @return {boolean|string} The element's color.
*/
defaultColor: function( newDefaultColor ) {
if ( newDefaultColor === undef ) {

View File

@@ -27,7 +27,7 @@ jQuery(document).ready( function($) {
* @listens $edittimestamp:click
*
* @param {Event} event The event object.
* @returns {void}
* @return {void}
*/
$edittimestamp.click( function( event ) {
if ( $timestampdiv.is( ':hidden' ) ) {
@@ -46,7 +46,7 @@ jQuery(document).ready( function($) {
* @listens .cancel-timestamp:click
*
* @param {Event} event The event object.
* @returns {void}
* @return {void}
*/
$timestampdiv.find('.cancel-timestamp').click( function( event ) {
@@ -68,7 +68,7 @@ jQuery(document).ready( function($) {
* @listens .save-timestamp:click
*
* @param {Event} event The event object.
* @returns {void}
* @return {void}
*/
$timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),

View File

@@ -42,7 +42,7 @@ window.columns = {
*
* @since 2.7.0
*
* @returns {void}
* @return {void}
*/
init : function() {
var that = this;
@@ -64,7 +64,7 @@ window.columns = {
*
* @since 3.0.0
*
* @returns {void}
* @return {void}
*/
saveManageColumnsState : function() {
var hidden = this.hidden();
@@ -82,7 +82,7 @@ window.columns = {
* @since 3.0.0
* @param {string} column The column name.
*
* @returns {void}
* @return {void}
*/
checked : function(column) {
$('.column-' + column).removeClass( 'hidden' );
@@ -95,7 +95,7 @@ window.columns = {
* @since 3.0.0
* @param {string} column The column name.
*
* @returns {void}
* @return {void}
*/
unchecked : function(column) {
$('.column-' + column).addClass( 'hidden' );
@@ -107,7 +107,7 @@ window.columns = {
*
* @since 3.0.0
*
* @returns {string} The hidden column names separated by a comma.
* @return {string} The hidden column names separated by a comma.
*/
hidden : function() {
return $( '.manage-column[id]' ).filter( '.hidden' ).map(function() {
@@ -120,7 +120,7 @@ window.columns = {
*
* @since 3.0.0
*
* @returns {string} String containing the checked column names.
* @return {string} String containing the checked column names.
*/
useCheckboxesForHidden : function() {
this.hidden = function(){
@@ -156,7 +156,7 @@ $document.ready(function(){columns.init();});
*
* @param {jQuery} form The form to validate.
*
* @returns {boolean} Returns true if all required fields are not an empty string.
* @return {boolean} Returns true if all required fields are not an empty string.
*/
window.validateForm = function( form ) {
return !$( form )
@@ -176,7 +176,7 @@ window.validateForm = function( form ) {
*
* @type {{warn: showNotice.warn, note: showNotice.note}}
*
* @returns {void}
* @return {void}
*/
window.showNotice = {
@@ -185,7 +185,7 @@ window.showNotice = {
*
* @since 2.7.0
*
* @returns {boolean} Returns true if the message is confirmed.
* @return {boolean} Returns true if the message is confirmed.
*/
warn : function() {
var msg = commonL10n.warnDelete || '';
@@ -217,7 +217,7 @@ window.showNotice = {
* toggleEvent: screenMeta.toggleEvent, open: screenMeta.open,
* close: screenMeta.close}}
*
* @returns {void}
* @return {void}
*/
window.screenMeta = {
element: null, // #screen-meta
@@ -229,7 +229,7 @@ window.screenMeta = {
*
* @since 3.2.0
*
* @returns {void}
* @return {void}
*/
init: function() {
this.element = $('#screen-meta');
@@ -244,7 +244,7 @@ window.screenMeta = {
*
* @since 3.2.0
*
* @returns {void}
* @return {void}
*/
toggleEvent: function() {
var panel = $( '#' + $( this ).attr( 'aria-controls' ) );
@@ -266,7 +266,7 @@ window.screenMeta = {
* @param {jQuery} panel The screen meta options panel div.
* @param {jQuery} button The toggle button.
*
* @returns {void}
* @return {void}
*/
open: function( panel, button ) {
@@ -279,7 +279,7 @@ window.screenMeta = {
*
* @since 3.2.0
*
* @returns {void}
* @return {void}
*/
panel.slideDown( 'fast', function() {
panel.focus();
@@ -297,7 +297,7 @@ window.screenMeta = {
* @param {jQuery} panel The screen meta options panel div.
* @param {jQuery} button The toggle button.
*
* @returns {void}
* @return {void}
*/
close: function( panel, button ) {
/**
@@ -305,7 +305,7 @@ window.screenMeta = {
*
* @since 3.2.0
*
* @returns {void}
* @return {void}
*/
panel.slideUp( 'fast', function() {
button.removeClass( 'screen-meta-active' ).attr( 'aria-expanded', false );
@@ -322,7 +322,7 @@ window.screenMeta = {
*
* @param {Event} e The event object.
*
* @returns {void}
* @return {void}
*/
$('.contextual-help-tabs').delegate('a', 'click', function(e) {
var link = $(this),
@@ -503,7 +503,7 @@ $document.ready( function() {
*
* @param {Event} e The event object.
*
* @returns {void}
* @return {void}
*/
$adminmenu.on('click.wp-submenu-head', '.wp-submenu-head', function(e){
$(e.target).parent().siblings('a').get(0).click();
@@ -512,7 +512,7 @@ $document.ready( function() {
/**
* Collapses the admin menu.
*
* @returns {void}
* @return {void}
*/
$( '#collapse-button' ).on( 'click.collapse-menu', function() {
var viewportWidth = getViewportWidth() || 961;
@@ -551,7 +551,7 @@ $document.ready( function() {
*
* @since 4.4.0
*
* @returns {void}
* @return {void}
*/
function currentMenuItemHasPopup() {
var $current = $( 'a.wp-has-current-submenu' );
@@ -574,7 +574,7 @@ $document.ready( function() {
*
* @param {jQuery} $menuItem The parent menu item containing the submenu.
*
* @returns {void}
* @return {void}
*/
function adjustSubmenu( $menuItem ) {
var bottomOffset, pageHeight, adjustment, theFold, menutop, wintop, maxtop,
@@ -613,7 +613,7 @@ $document.ready( function() {
*
* @param {Event} e The event object.
*
* @returns {void}
* @return {void}
*/
$body.on( mobileEvent+'.wp-mobile-hover', function(e) {
if ( $adminmenu.data('wp-responsive') ) {
@@ -630,7 +630,7 @@ $document.ready( function() {
*
* @param {Event} event The event object.
*
* @returns {void}
* @return {void}
*/
$adminmenu.find( 'a.wp-has-submenu' ).on( mobileEvent + '.wp-mobile-hover', function( event ) {
var $menuItem = $(this).parent();
@@ -657,7 +657,7 @@ $document.ready( function() {
/**
* Opens the submenu when hovered over the menu item for desktops.
*
* @returns {void}
* @return {void}
*/
over: function() {
var $menuItem = $( this ),
@@ -681,7 +681,7 @@ $document.ready( function() {
/**
* Closes the submenu when no longer hovering the menu item.
*
* @returns {void}
* @return {void}
*/
out: function(){
if ( $adminmenu.data( 'wp-responsive' ) ) {
@@ -701,7 +701,7 @@ $document.ready( function() {
*
* @param {Event} event The event object.
*
* @returns {void}
* @return {void}
*/
$adminmenu.on( 'focus.adminmenu', '.wp-submenu a', function( event ) {
if ( $adminmenu.data( 'wp-responsive' ) ) {
@@ -716,7 +716,7 @@ $document.ready( function() {
*
* @param {Event} event The event object.
*
* @returns {void}
* @return {void}
*/
}).on( 'blur.adminmenu', '.wp-submenu a', function( event ) {
if ( $adminmenu.data( 'wp-responsive' ) ) {
@@ -728,7 +728,7 @@ $document.ready( function() {
/**
* Adjusts the size for the submenu.
*
* @returns {void}
* @return {void}
*/
}).find( 'li.wp-has-submenu.wp-not-current-submenu' ).on( 'focusin.adminmenu', function() {
adjustSubmenu( $( this ) );
@@ -751,7 +751,7 @@ $document.ready( function() {
*
* @since 4.4.0
*
* @returns {void}
* @return {void}
*/
function makeNoticesDismissible() {
$( '.notice.is-dismissible' ).each( function() {
@@ -784,7 +784,7 @@ $document.ready( function() {
*
* This event needs to be delegated. Ticket #37973.
*
* @returns {boolean} Returns whether a checkbox is checked or not.
* @return {boolean} Returns whether a checkbox is checked or not.
*/
$body.on( 'click', 'tbody > tr > .check-column :checkbox', function( event ) {
// Shift click to select a range of checkboxes.
@@ -813,7 +813,7 @@ $document.ready( function() {
/**
* Determines if all checkboxes are checked.
*
* @returns {boolean} Returns true if there are no unchecked checkboxes.
* @return {boolean} Returns true if there are no unchecked checkboxes.
*/
$(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
return ( 0 === unchecked.length );
@@ -832,7 +832,7 @@ $document.ready( function() {
*
* @param {Event} event The event object.
*
* @returns {boolean}
* @return {boolean}
*/
$body.on( 'click.wp-toggle-checkboxes', 'thead .check-column :checkbox, tfoot .check-column :checkbox', function( event ) {
var $this = $(this),
@@ -845,7 +845,7 @@ $document.ready( function() {
/**
* Updates the checked state on the checkbox in the table.
*
* @returns {boolean} True checks the checkbox, False unchecks the checkbox.
* @return {boolean} True checks the checkbox, False unchecks the checkbox.
*/
.prop('checked', function() {
if ( $(this).is(':hidden,:disabled') ) {
@@ -867,7 +867,7 @@ $document.ready( function() {
/**
* Syncs the bulk checkboxes on the top and bottom of the table.
*
* @returns {boolean} True checks the checkbox, False unchecks the checkbox.
* @return {boolean} True checks the checkbox, False unchecks the checkbox.
*/
.prop('checked', function() {
if ( toggle ) {
@@ -883,7 +883,7 @@ $document.ready( function() {
/**
* Shows row actions on focus of its parent container element or any other elements contained within.
*
* @returns {void}
* @return {void}
*/
$( '#wpbody-content' ).on({
focusin: function() {
@@ -918,7 +918,7 @@ $document.ready( function() {
*
* @param {Event} e The event object.
*
* @returns {void}
* @return {void}
*/
$('#newcontent').bind('keydown.wpevent_InsertTab', function(e) {
var el = e.target, selStart, selEnd, val, scroll, sel;
@@ -977,7 +977,7 @@ $document.ready( function() {
*
* The form closest to the pageInput is the post-filter form.
*
* @returns {void}
* @return {void}
*/
pageInput.closest('form').submit( function() {
/*
@@ -992,7 +992,7 @@ $document.ready( function() {
/**
* Resets the bulk actions when the search button is clicked.
*
* @returns {void}
* @return {void}
*/
$('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function () {
$('select[name^="action"]').val('-1');
@@ -1003,7 +1003,7 @@ $document.ready( function() {
*
* @param {Event} e The event object.
*
* @returns {void}
* @return {void}
*/
$('#contextual-help-link, #show-settings-link').on( 'focus.scroll-into-view', function(e){
if ( e.target.scrollIntoView )
@@ -1013,7 +1013,7 @@ $document.ready( function() {
/**
* Disables the submit upload buttons when no data is entered.
*
* @returns {void}
* @return {void}
*/
(function(){
var button, input, form = $('form.wp-upload-form');
@@ -1030,7 +1030,7 @@ $document.ready( function() {
*
* @since 3.5.0
*
* @returns {void}
* @return {void}
*/
function toggleUploadButton() {
// When no inputs have a value, disable the upload buttons.
@@ -1052,7 +1052,7 @@ $document.ready( function() {
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function pinMenu( event ) {
var windowPos = $window.scrollTop(),
@@ -1195,7 +1195,7 @@ $document.ready( function() {
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function resetHeights() {
height = {
@@ -1211,7 +1211,7 @@ $document.ready( function() {
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function unpinMenu() {
if ( isIOS || ! menuIsPinned ) {
@@ -1231,7 +1231,7 @@ $document.ready( function() {
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function setPinMenu() {
resetHeights();
@@ -1260,7 +1260,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
*@returns {void}
* @return {void}
*/
window.wpResponsive = {
@@ -1269,7 +1269,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
init: function() {
var self = this;
@@ -1327,7 +1327,7 @@ $document.ready( function() {
*
* @since 5.3.0
*
* @returns {void}
* @return {void}
*/
maybeDisableSortables: function() {
var width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $window.width() : window.innerWidth;
@@ -1350,7 +1350,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
activate: function() {
setPinMenu();
@@ -1371,7 +1371,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
deactivate: function() {
setPinMenu();
@@ -1385,7 +1385,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
trigger: function() {
var viewportWidth = getViewportWidth();
@@ -1421,7 +1421,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
enableOverlay: function() {
if ( $overlay.length === 0 ) {
@@ -1444,7 +1444,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
disableOverlay: function() {
$toolbarPopups.off( 'click.wp-responsive' );
@@ -1456,7 +1456,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
disableSortables: function() {
if ( $sortables.length ) {
@@ -1472,7 +1472,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
enableSortables: function() {
if ( $sortables.length ) {
@@ -1489,7 +1489,7 @@ $document.ready( function() {
*
* @since 4.5.0
*
* @returns {void}
* @return {void}
*/
function aria_button_if_js() {
$( '.aria-button-if-js' ).attr( 'role', 'button' );
@@ -1504,8 +1504,8 @@ $document.ready( function() {
*
* @since 4.7.0
*
* @returns {number|boolean} The current viewport width or false if the
* browser doesn't support innerWidth (IE < 9).
* @return {number|boolean} The current viewport width or false if the
* browser doesn't support innerWidth (IE < 9).
*/
function getViewportWidth() {
var viewportWidth = false;
@@ -1526,7 +1526,7 @@ $document.ready( function() {
*
* @since 4.7.0
*
* @returns {void}
* @return {void}
*/
function setMenuState() {
var viewportWidth = getViewportWidth() || 961;
@@ -1554,7 +1554,7 @@ $document.ready( function() {
*
* @since 4.7.0
*
* @returns {void}
* @return {void}
*/
$document.on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) {
var $collapseButton = $( '#collapse-button' ),
@@ -1613,7 +1613,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
function triggerEvent() {
$document.trigger( 'wp-window-resized' );
@@ -1624,7 +1624,7 @@ $document.ready( function() {
*
* @since 3.8.0
*
* @returns {void}
* @return {void}
*/
function fireOnce() {
window.clearTimeout( timeout );

View File

@@ -21,7 +21,7 @@
*
* @since 3.5.0
*
* @returns {void}
* @return {void}
*/
$('#background-color').wpColorPicker({
change: function( event, ui ) {
@@ -37,7 +37,7 @@
*
* @since 4.7.0
*
* @returns {void}
* @return {void}
*/
$( 'select[name="background-size"]' ).change( function() {
bgImage.css( 'background-size', $( this ).val() );
@@ -48,7 +48,7 @@
*
* @since 4.7.0
*
* @returns {void}
* @return {void}
*/
$( 'input[name="background-position"]' ).change( function() {
bgImage.css( 'background-position', $( this ).val() );
@@ -59,7 +59,7 @@
*
* @since 3.0.0
*
* @returns {void}
* @return {void}
*/
$( 'input[name="background-repeat"]' ).change( function() {
bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' );
@@ -70,7 +70,7 @@
*
* @since 4.7.0
*
* @returns {void}
* @return {void}
*/
$( 'input[name="background-attachment"]' ).change( function() {
bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' );
@@ -81,7 +81,7 @@
*
* @since 3.5.0
*
* @returns {void}
* @return {void}
*/
$('#choose-from-library-link').click( function( event ) {
var $el = $(this);
@@ -121,7 +121,7 @@
*
* @since 3.5.0
*
* @returns {void}
* @return {void}
*/
frame.on( 'select', function() {
// Grab the selected attachment.

View File

@@ -33,7 +33,7 @@
* @since 3.5.0
* @deprecated 4.1.0
*
* @returns {void}
* @return {void}
*/
$('#choose-from-library-link').click( function( event ) {
var $el = $(this);
@@ -71,7 +71,7 @@
* @since 3.5.0
* @deprecated 4.1.0
*
* @returns {void}
* @return {void}
*/
frame.on( 'select', function() {
// Grab the selected attachment.

View File

@@ -55,7 +55,7 @@
* @since 4.9.0
*
* @param {jQuery.Event} event - Event.
* @returns {void}
* @return {void}
*/
handleEscape: function( event ) {
var notification = this;
@@ -98,7 +98,7 @@
* @param {jQuery} [options.container] - Container element for notifications. This can be injected later.
* @param {boolean} [options.alt] - Whether alternative style should be used when rendering notifications.
*
* @returns {void}
* @return {void}
*/
initialize: function( options ) {
var collection = this;
@@ -137,7 +137,7 @@
*
* @param {string|wp.customize.Notification} notification - Notification object to add. Alternatively code may be supplied, and in that case the second notificationObject argument must be supplied.
* @param {wp.customize.Notification} [notificationObject] - Notification to add when first argument is the code string.
* @returns {wp.customize.Notification} Added notification (or existing instance if it was already added).
* @return {wp.customize.Notification} Added notification (or existing instance if it was already added).
*/
add: function( notification, notificationObject ) {
var collection = this, code, instance;
@@ -211,7 +211,7 @@
* Render notifications area.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
render: function() {
var collection = this,
@@ -304,7 +304,7 @@
* @since 4.9.0
*
* @param {jQuery.Event} event - Event.
* @returns {void}
* @return {void}
*/
constrainFocus: function constrainFocus( event ) {
var collection = this, focusableElements;
@@ -398,7 +398,7 @@
* @since 3.4.0
* @access public
*
* @returns {void}
* @return {void}
*/
preview: function() {
var setting = this, transport;
@@ -419,7 +419,7 @@
* Find controls associated with this setting.
*
* @since 4.6.0
* @returns {wp.customize.Control[]} Controls associated with setting.
* @return {wp.customize.Control[]} Controls associated with setting.
*/
findControls: function() {
var setting = this, controls = [];
@@ -497,7 +497,7 @@
*
* @param {object} [options] Options.
* @param {boolean} [options.unsaved=false] Whether only values not saved yet into a changeset will be returned (differential changes).
* @returns {object} Dirty setting values.
* @return {object} Dirty setting values.
*/
api.dirtyValues = function dirtyValues( options ) {
var values = {};
@@ -535,7 +535,7 @@
* @param {boolean} [args.force=false] - Send request to update even when there are no changes to submit. This can be used to request the latest status of the changeset on the server.
* @param {string} [args.title] - Title to update in the changeset. Optional.
* @param {string} [args.date] - Date to update in the changeset. Optional.
* @returns {jQuery.Promise} Promise resolving with the response data.
* @return {jQuery.Promise} Promise resolving with the response data.
*/
api.requestChangesetUpdate = function requestChangesetUpdate( changes, args ) {
var deferred, request, submittedChanges = {}, data, submittedArgs;
@@ -735,7 +735,7 @@
*
* @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a
* @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} b
* @returns {Number}
* @return {Number}
*/
api.utils.prioritySort = function ( a, b ) {
if ( a.priority() === b.priority() && typeof a.params.instanceNumber === 'number' && typeof b.params.instanceNumber === 'number' ) {
@@ -753,7 +753,7 @@
* @since 4.1.0
*
* @param {jQuery.Event} event
* @returns {boolean}
* @return {boolean}
*/
api.utils.isKeydownButNotEnterEvent = function ( event ) {
return ( 'keydown' === event.type && 13 !== event.which );
@@ -768,7 +768,7 @@
*
* @param {Array|jQuery} listA
* @param {Array|jQuery} listB
* @returns {boolean}
* @return {boolean}
*/
api.utils.areElementListsEqual = function ( listA, listB ) {
var equal = (
@@ -802,7 +802,7 @@
* is canceled. This option exists to accommodate compound buttons
* containing auxiliary UI, such as the Publish button augmented with a
* Settings button.
* @returns {Function} An idempotent function that cancels the reminder.
* @return {Function} An idempotent function that cancels the reminder.
*/
api.utils.highlightButton = function highlightButton( button, options ) {
var animationClass = 'button-see-me',
@@ -849,7 +849,7 @@
*
* @since 4.9.0
*
* @returns {int} Current timestamp.
* @return {int} Current timestamp.
*/
api.utils.getCurrentTimestamp = function getCurrentTimestamp() {
var currentDate, currentClientTimestamp, timestampDifferential;
@@ -893,7 +893,7 @@
*
* @ignore
*
* @returns {string|null} Normalized `transitionend` event name or null if CSS transitions are not supported.
* @return {string|null} Normalized `transitionend` event name or null if CSS transitions are not supported.
*/
normalizedTransitionendEventName = (function () {
var el, transitions, prop;
@@ -1014,7 +1014,7 @@
* Get the element that will contain the notifications.
*
* @since 4.9.0
* @returns {jQuery} Notification container element.
* @return {jQuery} Notification container element.
*/
getNotificationsContainerElement: function() {
var container = this;
@@ -1025,7 +1025,7 @@
* Set up notifications.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
setupNotifications: function() {
var container = this, renderNotifications;
@@ -1056,7 +1056,7 @@
*
* @param {String} parentType
* @param {String} childType
* @returns {Array}
* @return {Array}
*/
_children: function ( parentType, childType ) {
var parent = this,
@@ -1154,7 +1154,7 @@
*
* @param {Boolean} active
* @param {Object} [params]
* @returns {Boolean} False if state already applied.
* @return {Boolean} False if state already applied.
*/
_toggleActive: function ( active, params ) {
var self = this;
@@ -1173,7 +1173,7 @@
/**
* @param {Object} [params]
* @returns {Boolean} False if already active.
* @return {Boolean} False if already active.
*/
activate: function ( params ) {
return this._toggleActive( true, params );
@@ -1181,7 +1181,7 @@
/**
* @param {Object} [params]
* @returns {Boolean} False if already inactive.
* @return {Boolean} False if already inactive.
*/
deactivate: function ( params ) {
return this._toggleActive( false, params );
@@ -1201,7 +1201,7 @@
* @param {Boolean} expanded - The new state to apply.
* @param {Object} [params] - Object containing options for expand/collapse.
* @param {Function} [params.completeCallback] - Function to call when expansion/collapse is complete.
* @returns {Boolean} False if state already applied or active state is false.
* @return {Boolean} False if state already applied or active state is false.
*/
_toggleExpanded: function( expanded, params ) {
var instance = this, previousCompleteCallback;
@@ -1238,7 +1238,7 @@
/**
* @param {Object} [params]
* @returns {Boolean} False if already expanded or if inactive.
* @return {Boolean} False if already expanded or if inactive.
*/
expand: function ( params ) {
return this._toggleExpanded( true, params );
@@ -1246,7 +1246,7 @@
/**
* @param {Object} [params]
* @returns {Boolean} False if already collapsed.
* @return {Boolean} False if already collapsed.
*/
collapse: function ( params ) {
return this._toggleExpanded( false, params );
@@ -1259,7 +1259,7 @@
* @private
*
* @param {function} completeCallback Function to be called after transition is completed.
* @returns {void}
* @return {void}
*/
_animateChangeExpanded: function( completeCallback ) {
// Return if CSS transitions are not supported.
@@ -1362,7 +1362,7 @@
* @since 4.7.0
* @access public
*
* @returns {jQuery} Detached content element.
* @return {jQuery} Detached content element.
*/
getContent: function() {
var construct = this,
@@ -1543,7 +1543,7 @@
*
* @since 4.1.0
*
* @returns {Boolean}
* @return {Boolean}
*/
isContextuallyActive: function () {
var section = this,
@@ -1562,7 +1562,7 @@
*
* @since 4.1.0
*
* @returns {Array}
* @return {Array}
*/
controls: function () {
return this._children( 'section', 'control' );
@@ -1696,7 +1696,7 @@
*
* @param {string} id - ID.
* @param {object} options - Options.
* @returns {void}
* @return {void}
*/
initialize: function( id, options ) {
var section = this;
@@ -1745,7 +1745,7 @@
*
* @since 4.2.0
*
* @returns {void}
* @return {void}
*/
ready: function() {
var section = this;
@@ -1797,7 +1797,7 @@
*
* @since 4.2.0
*
* @returns {Boolean}
* @return {Boolean}
*/
isContextuallyActive: function () {
return this.active();
@@ -1808,7 +1808,7 @@
*
* @since 4.2.0
*
* @returns {void}
* @return {void}
*/
attachEvents: function () {
var section = this, debounced;
@@ -1953,7 +1953,7 @@
* @param {Object} args
* @param {Boolean} args.unchanged
* @param {Function} args.completeCallback
* @returns {void}
* @return {void}
*/
onChangeExpanded: function ( expanded, args ) {
@@ -2043,7 +2043,7 @@
*
* @since 4.9.0
*
* @returns {jQuery}
* @return {jQuery}
*/
getContent: function() {
return this.container.find( '.control-section-content' );
@@ -2054,7 +2054,7 @@
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
loadThemes: function() {
var section = this, params, page, request;
@@ -2165,7 +2165,7 @@
* @since 4.9.0
* @param {Array} themes - Array of theme data to create controls with.
* @param {integer} page - Page of results being loaded.
* @returns {void}
* @return {void}
*/
loadControls: function( themes, page ) {
var newThemeControls = [],
@@ -2194,7 +2194,7 @@
* Determines whether more themes should be loaded, and loads them.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
loadMore: function() {
var section = this, container, bottom, threshold;
@@ -2216,7 +2216,7 @@
* @since 4.9.0
*
* @param {string} term - The raw search input value.
* @returns {void}
* @return {void}
*/
filterSearch: function( term ) {
var count = 0,
@@ -2260,7 +2260,7 @@
* @since 4.9.0
*
* @param {wp.customize.ThemesSection} section - The current theme section, passed through the debouncer.
* @returns {void}
* @return {void}
*/
checkTerm: function( section ) {
var newTerm;
@@ -2277,7 +2277,7 @@
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
filtersChecked: function() {
var section = this,
@@ -2320,7 +2320,7 @@
*
* @param {string} newTerm - New term.
* @param {Array} newTags - New tags.
* @returns {void}
* @return {void}
*/
initializeNewQuery: function( newTerm, newTags ) {
var section = this;
@@ -2353,7 +2353,7 @@
*
* @since 4.2.0
*
* @returns {void}
* @return {void}
*/
renderScreenshots: function() {
var section = this;
@@ -2407,7 +2407,7 @@
*
* @since 4.9.0
*
* @returns {int} Visible count.
* @return {int} Visible count.
*/
getVisibleCount: function() {
return this.contentContainer.find( 'li.customize-control:visible' ).length;
@@ -2418,7 +2418,7 @@
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
updateCount: function( count ) {
var section = this, countEl, displayed;
@@ -2448,7 +2448,7 @@
*
* @since 4.2.0
*
* @returns {void}
* @return {void}
*/
nextTheme: function () {
var section = this;
@@ -2464,7 +2464,7 @@
*
* @since 4.2.0
*
* @returns {wp.customize.ThemeControl|boolean} Next theme.
* @return {wp.customize.ThemeControl|boolean} Next theme.
*/
getNextTheme: function () {
var section = this, control, nextControl, sectionControls, i;
@@ -2486,7 +2486,7 @@
* Advance the modal to the previous theme.
*
* @since 4.2.0
* @returns {void}
* @return {void}
*/
previousTheme: function () {
var section = this;
@@ -2501,7 +2501,7 @@
* Get the previous theme model.
*
* @since 4.2.0
* @returns {wp.customize.ThemeControl|boolean} Previous theme.
* @return {wp.customize.ThemeControl|boolean} Previous theme.
*/
getPreviousTheme: function () {
var section = this, control, nextControl, sectionControls, i;
@@ -2524,7 +2524,7 @@
*
* @since 4.2.0
*
* @returns {void}
* @return {void}
*/
updateLimits: function () {
if ( ! this.getNextTheme() ) {
@@ -2543,7 +2543,7 @@
*
* @deprecated
* @param {string} themeId Theme ID.
* @returns {jQuery.promise} Promise.
* @return {jQuery.promise} Promise.
*/
loadThemePreview: function( themeId ) {
return api.ThemesPanel.prototype.loadThemePreview.call( this, themeId );
@@ -2556,7 +2556,7 @@
*
* @param {object} theme - Theme.
* @param {Function} [callback] - Callback once the details have been shown.
* @returns {void}
* @return {void}
*/
showDetails: function ( theme, callback ) {
var section = this, panel = api.panel( 'themes' );
@@ -2591,7 +2591,7 @@
*
* @since 4.2.0
*
* @returns {void}
* @return {void}
*/
closeDetails: function () {
var section = this;
@@ -2606,7 +2606,7 @@
* @since 4.2.0
*
* @param {jQuery} el - Element to contain focus.
* @returns {void}
* @return {void}
*/
containFocus: function( el ) {
var tabbables;
@@ -2647,7 +2647,7 @@
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
initialize: function() {
var section = this;
@@ -2870,7 +2870,7 @@
*
* @since 4.1.0
*
* @returns {Array}
* @return {Array}
*/
sections: function () {
return this._children( 'panel', 'section' );
@@ -2881,7 +2881,7 @@
*
* @since 4.1.0
*
* @returns {boolean} Whether contextually active.
* @return {boolean} Whether contextually active.
*/
isContextuallyActive: function () {
var panel = this,
@@ -2904,7 +2904,7 @@
* @param {Object} args
* @param {Boolean} args.unchanged
* @param {Function} args.completeCallback
* @returns {void}
* @return {void}
*/
onChangeExpanded: function ( expanded, args ) {
@@ -3032,7 +3032,7 @@
*
* @param {string} id - The ID for the panel.
* @param {object} options - Options.
* @returns {void}
* @return {void}
*/
initialize: function( id, options ) {
var panel = this;
@@ -3046,7 +3046,7 @@
* @since 4.9.0
*
* @param {string} [slug] - Theme slug.
* @returns {boolean} Whether the theme can be switched to.
* @return {boolean} Whether the theme can be switched to.
*/
canSwitchTheme: function canSwitchTheme( slug ) {
if ( slug && slug === api.settings.theme.stylesheet ) {
@@ -3059,7 +3059,7 @@
* Attach events.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
attachEvents: function() {
var panel = this;
@@ -3132,7 +3132,7 @@
* @param {Object} args - Args.
* @param {Boolean} args.unchanged - Whether or not the state changed.
* @param {Function} args.completeCallback - Callback to execute when the animation completes.
* @returns {void}
* @return {void}
*/
onChangeExpanded: function( expanded, args ) {
var panel = this, overlay, sections, hasExpandedSection = false;
@@ -3184,7 +3184,7 @@
* @since 4.9.0
*
* @param {jQuery.Event} event - Event.
* @returns {jQuery.promise} Promise.
* @return {jQuery.promise} Promise.
*/
installTheme: function( event ) {
var panel = this, preview, onInstallSuccess, slug = $( event.target ).data( 'slug' ), deferred = $.Deferred(), request;
@@ -3289,7 +3289,7 @@
* @since 4.9.0
*
* @param {string} themeId Theme ID.
* @returns {jQuery.promise} Promise.
* @return {jQuery.promise} Promise.
*/
loadThemePreview: function( themeId ) {
var panel = this, deferred = $.Deferred(), onceProcessingComplete, urlParser, queryParams;
@@ -3365,7 +3365,7 @@
* @since 4.9.0
*
* @param {jQuery.Event} event - Event.
* @returns {void}
* @return {void}
*/
updateTheme: function( event ) {
wp.updates.maybeRequestFilesystemCredentials( event );
@@ -3395,7 +3395,7 @@
* @since 4.9.0
*
* @param {jQuery.Event} event - Event.
* @returns {void}
* @return {void}
*/
deleteTheme: function( event ) {
var theme, section;
@@ -3492,7 +3492,7 @@
* @param {string} options.description - Description.
* @param {number} [options.instanceNumber] - Order in which this instance was created in relation to other instances.
* @param {object} [options.params] - Deprecated wrapper for the above properties.
* @returns {void}
* @return {void}
*/
initialize: function( id, options ) {
var control = this, deferredSettingIds = [], settings, gatherSettings;
@@ -3633,7 +3633,7 @@
* @since 4.7.0
* @access public
*
* @returns {void}
* @return {void}
*/
linkElements: function () {
var control = this, nodes, radios, element;
@@ -3708,7 +3708,7 @@
/**
* Triggered when the control's markup has been injected into the DOM.
*
* @returns {void}
* @return {void}
*/
ready: function() {
var control = this, newItem;
@@ -3739,7 +3739,7 @@
* including special handling for nav menu items and widgets.
*
* @since 4.6.0
* @returns {jQuery} Setting validation message element.
* @return {jQuery} Setting validation message element.
*/
getNotificationsContainerElement: function() {
var control = this, controlTitle, notificationsContainer;
@@ -3770,7 +3770,7 @@
* Set up notifications.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
setupNotifications: function() {
var control = this, renderNotificationsIfVisible, onSectionAssigned;
@@ -4047,7 +4047,7 @@
*
* @since 4.7.0
* @access private
* @returns {void}
* @return {void}
*/
addNewPage: function () {
var control = this, promise, toggle, container, input, title, select;
@@ -4570,7 +4570,7 @@
*
* @param {wp.media.model.Attachment} attachment
* @param {wp.media.controller.Cropper} controller
* @returns {Object} Options
* @return {Object} Options
*/
calculateImageSelectOptions: function( attachment, controller ) {
var control = controller.get( 'control' ),
@@ -4853,7 +4853,7 @@
*
* @since 4.2.0
*
* @returns {Object} Options
* @return {Object} Options
*/
getInitialHeaderImage: function() {
if ( ! api.get().header_image || ! api.get().header_image_data || _.contains( [ 'remove-header', 'random-default-image', 'random-uploaded-image' ], api.get().header_image ) ) {
@@ -4886,7 +4886,7 @@
*
* @param {wp.media.model.Attachment} attachment
* @param {wp.media.controller.Cropper} controller
* @returns {Object} Options
* @return {Object} Options
*/
calculateImageSelectOptions: function(attachment, controller) {
var xInit = parseInt(_wpCustomizeHeader.data.width, 10),
@@ -5155,7 +5155,7 @@
*
* @since 4.2.0
* @param {Array} terms - An array of terms to search for.
* @returns {boolean} Whether a theme control was activated or not.
* @return {boolean} Whether a theme control was activated or not.
*/
filter: function( terms ) {
var control = this,
@@ -5207,7 +5207,7 @@
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
rerenderAsInstalled: function( installed ) {
var control = this, section;
@@ -5238,7 +5238,7 @@
* @since 4.9.0
* @param {string} id - Unique identifier for the control instance.
* @param {object} options - Options hash for the control instance.
* @returns {void}
* @return {void}
*/
initialize: function( id, options ) {
var control = this;
@@ -5273,7 +5273,7 @@
* Initialize the editor when the containing section is ready and expanded.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
ready: function() {
var control = this;
@@ -5305,7 +5305,7 @@
* Initialize editor.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
initEditor: function() {
var control = this, element, editorSettings = false;
@@ -5356,7 +5356,7 @@
* @since 4.9.0
* @param {Object} [params] - Focus params.
* @param {Function} [params.completeCallback] - Function to call when expansion is complete.
* @returns {void}
* @return {void}
*/
focus: function( params ) {
var control = this, extendedParams = _.extend( {}, params ), originalCompleteCallback;
@@ -5377,7 +5377,7 @@
*
* @since 4.9.0
* @param {object} codeEditorSettings - Code editor settings.
* @returns {void}
* @return {void}
*/
initSyntaxHighlightingEditor: function( codeEditorSettings ) {
var control = this, $textarea = control.container.find( 'textarea' ), settings, suspendEditorUpdate = false;
@@ -5436,7 +5436,7 @@
* Handle tabbing to the field after the editor.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
onTabNext: function onTabNext() {
var control = this, controls, controlIndex, section;
@@ -5454,7 +5454,7 @@
* Handle tabbing to the field before the editor.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
onTabPrevious: function onTabPrevious() {
var control = this, controls, controlIndex, section;
@@ -5473,7 +5473,7 @@
*
* @since 4.9.0
* @param {Array} errorAnnotations - Error annotations.
* @returns {void}
* @return {void}
*/
onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
var control = this, message;
@@ -5496,7 +5496,7 @@
* Initialize plain-textarea editor when syntax highlighting is disabled.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
initPlainTextareaEditor: function() {
var control = this, $textarea = control.container.find( 'textarea' ), textarea = $textarea[0];
@@ -5556,7 +5556,7 @@
* Initialize behaviors.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
ready: function ready() {
var control = this;
@@ -5618,7 +5618,7 @@
* @since 4.9.0
*
* @param {string} datetime - Date/Time string. Accepts Y-m-d[ H:i[:s]] format.
* @returns {object|null} Returns object containing date components or null if parse error.
* @return {object|null} Returns object containing date components or null if parse error.
*/
parseDateTime: function parseDateTime( datetime ) {
var control = this, matches, date, midDayHour = 12;
@@ -5733,7 +5733,7 @@
* Populate setting value from the inputs.
*
* @since 4.9.0
* @returns {boolean} If setting updated.
* @return {boolean} If setting updated.
*/
populateSetting: function populateSetting() {
var control = this, date;
@@ -5794,7 +5794,7 @@
* Check if the date is in the future.
*
* @since 4.9.0
* @returns {boolean} True if future date.
* @return {boolean} True if future date.
*/
isFutureDate: function isFutureDate() {
var control = this;
@@ -5807,7 +5807,7 @@
* @since 4.9.0
* @param {string} hourInTwelveHourFormat - Hour in twelve hour format.
* @param {string} meridian - Either 'am' or 'pm'.
* @returns {string} Hour in twenty four hour format.
* @return {string} Hour in twenty four hour format.
*/
convertHourToTwentyFourHourFormat: function convertHour( hourInTwelveHourFormat, meridian ) {
var hourInTwentyFourHourFormat, hour, midDayHour = 12;
@@ -5832,7 +5832,7 @@
* Populates date inputs in date fields.
*
* @since 4.9.0
* @returns {boolean} Whether the inputs were populated.
* @return {boolean} Whether the inputs were populated.
*/
populateDateInputs: function populateDateInputs() {
var control = this, parsed;
@@ -5914,7 +5914,7 @@
* Initialize behaviors.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
ready: function ready() {
var control = this, element, component, node, url, input, button;
@@ -6042,7 +6042,8 @@
* @type {Function}
* @param {...string} ids - One or more ids for controls to obtain.
* @param {deferredControlsCallback} [callback] - Function called when all supplied controls exist.
* @returns {wp.customize.Control|undefined|jQuery.promise} Control instance or undefined (if function called with one id param), or promise resolving to requested controls.
* @return {wp.customize.Control|undefined|jQuery.promise} Control instance or undefined (if function called with one id param),
* or promise resolving to requested controls.
*
* @example <caption>Loop over all registered controls.</caption>
* wp.customize.control.each( function( control ) { ... } );
@@ -6103,7 +6104,8 @@
* @type {Function}
* @param {...string} ids - One or more ids for sections to obtain.
* @param {deferredSectionsCallback} [callback] - Function called when all supplied sections exist.
* @returns {wp.customize.Section|undefined|jQuery.promise} Section instance or undefined (if function called with one id param), or promise resolving to requested sections.
* @return {wp.customize.Section|undefined|jQuery.promise} Section instance or undefined (if function called with one id param),
* or promise resolving to requested sections.
*
* @example <caption>Loop over all registered sections.</caption>
* wp.customize.section.each( function( section ) { ... } )
@@ -6137,7 +6139,8 @@
* @type {Function}
* @param {...string} ids - One or more ids for panels to obtain.
* @param {deferredPanelsCallback} [callback] - Function called when all supplied panels exist.
* @returns {wp.customize.Panel|undefined|jQuery.promise} Panel instance or undefined (if function called with one id param), or promise resolving to requested panels.
* @return {wp.customize.Panel|undefined|jQuery.promise} Panel instance or undefined (if function called with one id param),
* or promise resolving to requested panels.
*
* @example <caption>Loop over all registered panels.</caption>
* wp.customize.panel.each( function( panel ) { ... } )
@@ -6171,7 +6174,8 @@
* @type {Function}
* @param {...string} codes - One or more codes for notifications to obtain.
* @param {deferredNotificationsCallback} [callback] - Function called when all supplied notifications exist.
* @returns {wp.customize.Notification|undefined|jQuery.promise} notification instance or undefined (if function called with one code param), or promise resolving to requested notifications.
* @return {wp.customize.Notification|undefined|jQuery.promise} Notification instance or undefined (if function called with one code param),
* or promise resolving to requested notifications.
*
* @example <caption>Check if existing notification</caption>
* exists = wp.customize.notifications.has( 'a_new_day_arrived' );
@@ -6600,7 +6604,7 @@
* @param {object} data.activePanels - Active panels.
* @param {object} data.activeSections Active sections.
* @param {object} data.activeControls Active controls.
* @returns {void}
* @return {void}
*/
ready: function( data ) {
var previewer = this, synced = {}, constructs;
@@ -6670,7 +6674,7 @@
* @since 4.7.0
* @access public
*
* @returns {void}
* @return {void}
*/
keepPreviewAlive: function keepPreviewAlive() {
var previewer = this, keepAliveTick, timeoutId, handleMissingKeepAlive, scheduleKeepAliveCheck;
@@ -6731,7 +6735,7 @@
*
* @since 3.4.0
* @access public
* @returns {void}
* @return {void}
*/
refresh: function() {
var previewer = this, onSettingChange;
@@ -6905,7 +6909,7 @@
* @param {object} args
* @param {object} args.settingValidities
* @param {boolean} [args.focusInvalidControl=false]
* @returns {void}
* @return {void}
*/
api._handleSettingValidities = function handleSettingValidities( args ) {
var invalidSettingControls, invalidSettings = [], wasFocused = false;
@@ -6978,7 +6982,7 @@
*
* @since 4.6.0
* @param {string[]} settingIds Setting IDs.
* @returns {object<string, wp.customize.Control>} Mapping setting ids to arrays of controls.
* @return {object<string, wp.customize.Control>} Mapping setting ids to arrays of controls.
*/
api.findControlsForSettings = function findControlsForSettings( settingIds ) {
var controls = {}, settingControls;
@@ -7426,7 +7430,7 @@
* @param {string} [args.status=publish] Status.
* @param {string} [args.date] Date, in local time in MySQL format.
* @param {string} [args.title] Title
* @returns {jQuery.promise} Promise.
* @return {jQuery.promise} Promise.
*/
save: function( args ) {
var previewer = this,
@@ -7699,7 +7703,7 @@
*
* @since 4.9.0
*
* @returns {jQuery.promise} Promise.
* @return {jQuery.promise} Promise.
*/
trash: function trash() {
var request, success, fail;
@@ -8033,7 +8037,7 @@
* @access private
*
* @param {boolean} isIncluded Is UUID included.
* @returns {void}
* @return {void}
*/
populateChangesetUuidParam = function( isIncluded ) {
var urlParser, queryParams;
@@ -8192,7 +8196,7 @@
* @param {object} [args] - Args.
* @param {object} [args.lockUser] - Lock user data.
* @param {boolean} [args.allowOverride=false] - Whether override is allowed.
* @returns {void}
* @return {void}
*/
function startLock( args ) {
if ( args && args.lockUser ) {
@@ -8251,7 +8255,7 @@
/**
* Obtain the URL to restore the autosave.
*
* @returns {string} Customizer URL.
* @return {string} Customizer URL.
*/
function getAutosaveRestorationUrl() {
var urlParser, queryParams;
@@ -8272,7 +8276,7 @@
* Remove parameter from the URL.
*
* @param {Array} params - Parameter names to remove.
* @returns {void}
* @return {void}
*/
function stripParamsFromLocation( params ) {
var urlParser = document.createElement( 'a' ), queryParams, strippedParams = 0;
@@ -8295,7 +8299,7 @@
/**
* Dismiss autosave.
*
* @returns {void}
* @return {void}
*/
function dismissAutosave() {
if ( autosaveDismissed ) {
@@ -8314,7 +8318,7 @@
/**
* Add notification regarding the availability of an autosave to restore.
*
* @returns {void}
* @return {void}
*/
function addAutosaveRestoreNotification() {
var code = 'autosave_available', onStateChange;
@@ -8492,7 +8496,7 @@
* @access private
*
* @param {wp.customize.Panel|wp.customize.Section} container Construct.
* @returns {void}
* @return {void}
*/
changeContainer = function( container ) {
var newInstance = container,
@@ -8604,7 +8608,7 @@
* @since 4.7.0
* @access private
*
* @returns {void}
* @return {void}
*/
updateHeaderHeight = function() {
activeHeader.height = activeHeader.element.outerHeight();
@@ -8619,7 +8623,7 @@
* @param {object} header - Header.
* @param {number} scrollTop - Scroll top.
* @param {number} scrollDirection - Scroll direction, negative number being up and positive being down.
* @returns {void}
* @return {void}
*/
positionStickyHeader = function( header, scrollTop, scrollDirection ) {
var headerElement = header.element,

View File

@@ -387,7 +387,7 @@
*
* @param {Array.<object>} itemTypes List of objects containing type and key.
* @param {string} deprecated Formerly the object parameter.
* @returns {void}
* @return {void}
*/
loadItems: function( itemTypes, deprecated ) {
var self = this, _itemTypes, requestItemTypes = [], params, request, itemTemplate, availableMenuItemContainers = {};
@@ -595,7 +595,7 @@
* @private
*
* @param {jQuery.Event} event Event.
* @returns {void}
* @return {void}
*/
_submitNew: function( event ) {
var container;
@@ -621,7 +621,7 @@
* @private
*
* @param {jQuery} container
* @returns {void}
* @return {void}
*/
submitNew: function( container ) {
var panel = this,
@@ -843,7 +843,7 @@
* @since 4.3.0
* @private
*
* @returns {void}
* @return {void}
*/
saveManageColumnsState: _.debounce( function() {
var panel = this;
@@ -877,7 +877,7 @@
* @since 4.3.0
* @private
*
* @returns {Array} Fields (columns) that are hidden.
* @return {Array} Fields (columns) that are hidden.
*/
hidden: function() {
return $( '.hide-column-tog' ).not( ':checked' ).map( function() {
@@ -973,7 +973,7 @@
* Update the active field class for the content container for a given checkbox toggle.
*
* @this {jQuery}
* @returns {void}
* @return {void}
*/
handleFieldActiveToggle = function() {
var className = 'field-' + $( this ).val() + '-active';
@@ -1166,7 +1166,7 @@
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
highlightNewItemButton: function() {
api.utils.highlightButton( this.contentContainer.find( '.add-new-menu-item' ), { delay: 2000 } );
@@ -1179,7 +1179,7 @@
* @since 4.9.0
*
* @param {string} [name=''] Nav menu name.
* @returns {wp.customize.Menus.MenuSection} Added nav menu.
* @return {wp.customize.Menus.MenuSection} Added nav menu.
*/
api.Menus.createNavMenu = function createNavMenu( name ) {
var customizeId, placeholderId, setting;
@@ -1263,7 +1263,7 @@
* Get number of non-deleted nav menus.
*
* @since 4.9.0
* @returns {number} Count.
* @return {number} Count.
*/
function getNavMenuCount() {
var count = 0;
@@ -1279,7 +1279,7 @@
* Update visibility of notice to prompt users to create menus.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
function updateNoticeVisibility() {
container.find( '.add-new-menu-notice' ).prop( 'hidden', getNavMenuCount() > 0 );
@@ -1290,7 +1290,7 @@
*
* @since 4.9.0
* @param {wp.customize.Setting} setting - Added setting.
* @returns {void}
* @return {void}
*/
function addChangeEventListener( setting ) {
if ( navMenuSettingPattern.test( setting.id ) ) {
@@ -1304,7 +1304,7 @@
*
* @since 4.9.0
* @param {wp.customize.Setting} setting - Removed setting.
* @returns {void}
* @return {void}
*/
function removeChangeEventListener( setting ) {
if ( navMenuSettingPattern.test( setting.id ) ) {
@@ -1439,7 +1439,7 @@
* @since 4.9.0
*
* @param {string|null} locationId - The ID of the location to select. `null` clears all selections.
* @returns {void}
* @return {void}
*/
selectDefaultLocation: function( locationId ) {
var locationControl = api.control( this.id + '[locations]' ),
@@ -1870,7 +1870,7 @@
/**
*
* @returns {number}
* @return {number}
*/
getDepth: function() {
var control = this, setting = control.setting(), depth = 0;
@@ -1962,7 +1962,7 @@
*
* @param {Boolean} expanded
* @param {Object} [params]
* @returns {Boolean} False if state already applied.
* @return {Boolean} False if state already applied.
*/
_toggleExpanded: api.Section.prototype._toggleExpanded,
@@ -1970,7 +1970,7 @@
* @since 4.6.0
*
* @param {Object} [params]
* @returns {Boolean} False if already expanded.
* @return {Boolean} False if already expanded.
*/
expand: api.Section.prototype.expand,
@@ -1990,7 +1990,7 @@
* @since 4.6.0
*
* @param {Object} [params]
* @returns {Boolean} False if already collapsed.
* @return {Boolean} False if already collapsed.
*/
collapse: api.Section.prototype.collapse,
@@ -2428,7 +2428,7 @@
* @since 4.9.0
*
* @param {Object.<string,boolean>} selections - A map of location selections.
* @returns {void}
* @return {void}
*/
setSelections: function( selections ) {
this.container.find( '.menu-location' ).each( function( i, checkboxNode ) {
@@ -2954,7 +2954,7 @@
* Add a new item to this menu.
*
* @param {object} item - Value for the nav_menu_item setting to be created.
* @returns {wp.customize.Menus.controlConstructor.nav_menu_item} The newly-created nav_menu_item control instance.
* @return {wp.customize.Menus.controlConstructor.nav_menu_item} The newly-created nav_menu_item control instance.
*/
addItemToMenu: function( item ) {
var menuControl = this, customizeId, settingArgs, setting, menuItemControl, placeholderId, position = 0, priority = 10;
@@ -3373,7 +3373,7 @@
* @alias wp.customize.Menus~displayNavMenuName
*
* @param {string} name
* @returns {string}
* @return {string}
*/
function displayNavMenuName( name ) {
name = name || '';

View File

@@ -1039,7 +1039,7 @@
* over when copying sanitized values over to the form loaded.
*
* @param {jQuery} container element in which to look for inputs
* @returns {jQuery} inputs
* @return {jQuery} inputs
* @private
*/
_getInputs: function( container ) {
@@ -1051,7 +1051,7 @@
* This string can be used to compare whether or not the form has all of the same fields.
*
* @param {jQuery} inputs
* @returns {string}
* @return {string}
* @private
*/
_getInputsSignature: function( inputs ) {
@@ -1074,7 +1074,7 @@
* Get the state for an input depending on its type.
*
* @param {jQuery|Element} input
* @returns {string|boolean|array|*}
* @return {string|boolean|array|*}
* @private
*/
_getInputState: function( input ) {
@@ -1340,7 +1340,7 @@
*
* @param {Boolean} expanded
* @param {Object} [params]
* @returns {Boolean} False if state already applied.
* @return {Boolean} False if state already applied.
*/
_toggleExpanded: api.Section.prototype._toggleExpanded,
@@ -1348,7 +1348,7 @@
* @since 4.1.0
*
* @param {Object} [params]
* @returns {Boolean} False if already expanded.
* @return {Boolean} False if already expanded.
*/
expand: api.Section.prototype.expand,
@@ -1365,7 +1365,7 @@
* @since 4.1.0
*
* @param {Object} [params]
* @returns {Boolean} False if already collapsed.
* @return {Boolean} False if already collapsed.
*/
collapse: api.Section.prototype.collapse,
@@ -1495,7 +1495,7 @@
/**
* Get the position (index) of the widget in the containing sidebar
*
* @returns {Number}
* @return {Number}
*/
getWidgetSidebarPosition: function() {
var sidebarWidgetIds, position;
@@ -1652,7 +1652,7 @@
/**
* Update the notice.
*
* @returns {void}
* @return {void}
*/
updateNotice = function() {
var activeSectionCount = getActiveSectionCount(), someRenderedMessage, nonRenderedAreaCount, registeredAreaCount;
@@ -1708,7 +1708,7 @@
*
* @since 4.4.0
*
* @returns {boolean}
* @return {boolean}
*/
isContextuallyActive: function() {
var panel = this;
@@ -2061,7 +2061,7 @@
/**
* @param {string} widgetId or an id_base for adding a previously non-existing widget.
* @returns {object|false} widget_form control instance, or false on error.
* @return {object|false} widget_form control instance, or false on error.
*/
addWidget: function( widgetId ) {
var self = this, controlHtml, $widget, controlType = 'widget_form', controlContainer, controlConstructor,
@@ -2330,7 +2330,7 @@
/**
* @param {String} widgetId
* @returns {Object}
* @return {Object}
*/
function parseWidgetId( widgetId ) {
var matches, parsed = {
@@ -2352,7 +2352,7 @@
/**
* @param {String} widgetId
* @returns {String} settingId
* @return {String} settingId
*/
function widgetIdToSettingId( widgetId ) {
var parsed = parseWidgetId( widgetId ), settingId;

View File

@@ -23,7 +23,7 @@ jQuery(document).ready( function($) {
*
* @param {boolean} visible Should it be visible or not.
*
* @returns {void}
* @return {void}
*/
updateWelcomePanel = function( visible ) {
$.post( ajaxurl, {
@@ -72,7 +72,7 @@ jQuery(document).ready( function($) {
*
* @param {string} el Optional. Widget to fetch or none to update all.
*
* @returns {void}
* @return {void}
*/
window.ajaxPopulateWidgets = function(el) {
/**
@@ -81,7 +81,7 @@ jQuery(document).ready( function($) {
* @param {number} i Number of half-seconds to use as the timeout.
* @param {string} id ID of the element which is going to be checked for changes.
*
* @returns {void}
* @return {void}
*/
function show(i, id) {
var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
@@ -127,7 +127,7 @@ jQuery(document).ready( function($) {
*
* @global
*
* @returns {void}
* @return {void}
*/
window.quickPressLoad = function() {
var act = $('#quickpost-action'), t;
@@ -159,7 +159,7 @@ jQuery(document).ready( function($) {
/**
* Highlights the latest post for one second.
*
* @returns {void}
* @return {void}
*/
function highlightLatestPost () {
var latestPost = $('.drafts ul li').first();
@@ -189,7 +189,7 @@ jQuery(document).ready( function($) {
*
* @since 3.6.0
*
* @returns {void}
* @return {void}
*/
function autoResizeTextarea() {
// When IE8 or older is used to render this document, exit.
@@ -285,7 +285,7 @@ jQuery( function( $ ) {
*
* @since 4.8.0
*
* @returns {void}
* @return {void}
*/
init: function() {
if ( app.initialized ) {
@@ -319,7 +319,7 @@ jQuery( function( $ ) {
/**
* Filters events based on entered location.
*
* @returns {void}
* @return {void}
*/
$container.on( 'submit', '.community-events-form', function( event ) {
var location = $.trim( $( '#community-events-location' ).val() );
@@ -356,7 +356,7 @@ jQuery( function( $ ) {
* @param {event|string} action 'show' or 'hide' to specify a state;
* or an event object to flip between states.
*
* @returns {void}
* @return {void}
*/
toggleLocationForm: function( action ) {
var $toggleButton = $( '.community-events-toggle-location' ),
@@ -401,7 +401,7 @@ jQuery( function( $ ) {
*
* @param {Object} requestParams REST API Request parameters object.
*
* @returns {void}
* @return {void}
*/
getEvents: function( requestParams ) {
var initiatedBy,
@@ -455,7 +455,7 @@ jQuery( function( $ ) {
* @param {string} initiatedBy 'user' to indicate that this was triggered manually by the user;
* 'app' to indicate it was triggered automatically by the app itself.
*
* @returns {void}
* @return {void}
*/
renderEventsTemplate: function( templateParams, initiatedBy ) {
var template,

View File

@@ -15,7 +15,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
$( function() {
var $wrap = $( '#postdivrich' ),
@@ -70,7 +70,7 @@
*
* @since 4.6.1
*
* @returns {void}
* @return {void}
*/
var shrinkTextarea = window._.throttle( function() {
var x = window.scrollX || document.documentElement.scrollLeft;
@@ -102,7 +102,7 @@
*
* @since 4.6.1
*
* @returns {void}
* @return {void}
*/
function textEditorResize() {
var length = textEditor.value.length;
@@ -135,7 +135,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function getHeights() {
var windowWidth = $window.width();
@@ -169,7 +169,7 @@
* @param {event} event The TinyMCE editor init event.
* @param {object} editor The editor to bind the vents on.
*
* @returns {void}
* @return {void}
*/
$document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
// VK contains the type of key pressed. VK = virtual keyboard.
@@ -177,7 +177,7 @@
/**
* Hides any float panel with a hover state. Additionally hides tooltips.
*
* @returns {void}
* @return {void}
*/
hideFloatPanels = _.debounce( function() {
! $( '.mce-floatpanel:hover' ).length && window.tinymce.ui.FloatPanel.hideAll();
@@ -204,7 +204,7 @@
/**
* Gets the offset of the editor.
*
* @returns {Number|Boolean} Returns the offset of the editor
* @return {Number|Boolean} Returns the offset of the editor
* or false if there is no offset height.
*/
function mceGetCursorOffset() {
@@ -241,7 +241,7 @@
*
* @param {event} event The event to get the key code from.
*
* @returns {void}
* @return {void}
*/
function mceKeyup( event ) {
var key = event.keyCode;
@@ -270,7 +270,7 @@
*
* @param {string} key The key code of the pressed key.
*
* @returns {void}
* @return {void}
*/
function mceScroll( key ) {
var offset = mceGetCursorOffset(),
@@ -331,7 +331,7 @@
*
* @param {event} event The FullscreenStateChanged event.
*
* @returns {void}
* @return {void}
*/
function mceFullscreenToggled( event ) {
// event.state is true if the editor is fullscreen.
@@ -348,7 +348,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function mceShow() {
$window.on( 'scroll.mce-float-panels', hideFloatPanels );
@@ -367,7 +367,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function mceHide() {
$window.off( 'scroll.mce-float-panels' );
@@ -391,7 +391,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function toggleAdvanced() {
advanced = ! advanced;
@@ -402,7 +402,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
mceBind = function() {
editor.on( 'keyup', mceKeyup );
@@ -427,7 +427,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
mceUnbind = function() {
editor.off( 'keyup', mceKeyup );
@@ -460,7 +460,7 @@
*
* @param {event} event The event that calls this function.
*
* @returns {void}
* @return {void}
*/
function adjust( event ) {
@@ -772,7 +772,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function fullscreenHide() {
textEditorResize();
@@ -786,7 +786,7 @@
*
* @param {function} callback The function to run in the timeout.
*
* @returns {void}
* @return {void}
*/
function initialResize( callback ) {
for ( var i = 1; i < 6; i++ ) {
@@ -799,7 +799,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function afterScroll() {
clearTimeout( scrollTimer );
@@ -811,7 +811,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function on() {
/*
@@ -881,7 +881,7 @@
*
* @since 4.0.0
*
* @returns {void}
* @return {void}
*/
function off() {
var height = parseInt( window.getUserSetting( 'ed_size', 300 ), 10 );
@@ -975,7 +975,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
$( function() {
var $body = $( document.body ),
@@ -1025,7 +1025,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function recalcEditorRect() {
editorRect = $editor.offset();
@@ -1038,7 +1038,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function activate() {
if ( ! _isActive ) {
@@ -1054,7 +1054,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function deactivate() {
if ( _isActive ) {
@@ -1072,7 +1072,7 @@
*
* @since 4.1.0
*
* @returns {boolean} Returns true is _isActive is true.
* @return {boolean} Returns true is _isActive is true.
*/
function isActive() {
return _isActive;
@@ -1083,7 +1083,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function on() {
if ( ! _isOn && _isActive ) {
@@ -1106,7 +1106,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function off() {
if ( _isOn ) {
@@ -1129,7 +1129,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function toggle() {
if ( _isOn ) {
@@ -1144,7 +1144,7 @@
*
* @since 4.1.0
*
* @returns {boolean} Returns true if _isOn is true.
* @return {boolean} Returns true if _isOn is true.
*/
function isOn() {
return _isOn;
@@ -1161,7 +1161,7 @@
*
* @param event The event that triggers this function.
*
* @returns {void}
* @return {void}
*/
function fadeOut( event ) {
var isMac,
@@ -1300,7 +1300,7 @@
*
* @param event The event that triggers this function.
*
* @returns {void}
* @return {void}
*/
function fadeIn( event ) {
if ( faded ) {
@@ -1346,7 +1346,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function maybeFadeIn() {
setTimeout( function() {
@@ -1368,7 +1368,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function fadeOutAdminBar() {
if ( ! fadedAdminBar && faded ) {
@@ -1389,7 +1389,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function fadeInAdminBar() {
if ( fadedAdminBar ) {
@@ -1404,7 +1404,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function fadeOutSlug() {
if ( ! fadedSlug && faded && ! $slug.find( ':focus').length ) {
@@ -1421,7 +1421,7 @@
*
* @since 4.1.0
*
* @returns {void}
* @return {void}
*/
function fadeInSlug() {
if ( fadedSlug ) {
@@ -1442,7 +1442,7 @@
*
* @param {event} event The event to trigger the toggle.
*
* @returns {void}
* @return {void}
*/
function toggleViaKeyboard( event ) {
if ( event.altKey && event.shiftKey && 87 === event.keyCode ) {
@@ -1462,7 +1462,7 @@
* @param {event} event The TinyMCE editor setup event.
* @param {object} editor The editor to add the button to.
*
* @returns {void}
* @return {void}
*/
$document.on( 'tinymce-editor-setup.focus', function( event, editor ) {
editor.addButton( 'dfw', {
@@ -1511,7 +1511,7 @@
* @param {event} event The TinyMCE editor init event.
* @param {object} editor The editor to bind events on.
*
* @returns {void}
* @return {void}
*/
$document.on( 'tinymce-editor-init.focus', function( event, editor ) {
var mceBind, mceUnbind;
@@ -1568,7 +1568,7 @@
* @param {event} event The quicktags init event.
* @param {object} editor The editor to bind events on.
*
* @returns {void}
* @return {void}
*/
$document.on( 'quicktags-init', function( event, editor ) {
var $button;

View File

@@ -26,7 +26,7 @@ window.wp = window.wp || {};
*
* @since 4.3.0
*
* @returns {void}
* @return {void}
*/
$$( document ).on( 'click', function( event ) {
var id, mode,
@@ -47,7 +47,7 @@ window.wp = window.wp || {};
* @since 3.9.0
*
* @param {Object} editor The TinyMCE editor.
* @returns {number} If the height is between 10 and 200 return the height,
* @return {number} If the height is between 10 and 200 return the height,
* else return 30.
*/
function getToolbarHeight( editor ) {
@@ -70,7 +70,7 @@ window.wp = window.wp || {};
*
* @param {string} id The id of the editor you want to change the editor mode for. Default: `content`.
* @param {string} mode The mode you want to switch to. Default: `toggle`.
* @returns {void}
* @return {void}
*/
function switchEditor( id, mode ) {
id = id || 'content';
@@ -202,7 +202,7 @@ window.wp = window.wp || {};
* @param {string} content The test content where the cursor is.
* @param {number} cursorPosition The cursor position inside the content.
*
* @returns {(null|Object)} Null if cursor is not in a tag, Object if the cursor is inside a tag.
* @return {(null|Object)} Null if cursor is not in a tag, Object if the cursor is inside a tag.
*/
function getContainingTagInfo( content, cursorPosition ) {
var lastLtPos = content.lastIndexOf( '<', cursorPosition - 1 ),
@@ -659,7 +659,7 @@ window.wp = window.wp || {};
* and why this solution was chosen.
*
* @param {Object} editor The editor where we must find the selection.
* @returns {(null|Object)} The selection range position in the editor.
* @return {(null|Object)} The selection range position in the editor.
*/
function findBookmarkedPosition( editor ) {
// Get the TinyMCE `window` reference, since we need to access the raw selection.
@@ -1004,7 +1004,7 @@ window.wp = window.wp || {};
* @memberof switchEditors
*
* @param {string} text The text input.
* @returns {string} The formatted text.
* @return {string} The formatted text.
*/
function autop( text ) {
var preserve_linebreaks = false,
@@ -1131,7 +1131,7 @@ window.wp = window.wp || {};
* @memberof switchEditors
*
* @param {String} html The content from the visual editor.
* @returns {String} the filtered content.
* @return {String} the filtered content.
*/
function pre_wpautop( html ) {
var obj = { o: exports, data: html, unfiltered: html };
@@ -1157,7 +1157,7 @@ window.wp = window.wp || {};
* @memberof switchEditors
*
* @param {String} text The content from the text editor.
* @returns {String} filtered content.
* @return {String} filtered content.
*/
function wpautop( text ) {
var obj = { o: exports, data: text, unfiltered: text };

View File

@@ -76,7 +76,7 @@
* The function is sometimes called with a 0 or 1
* instead of true or false.
*
* @returns {void}
* @return {void}
*/
setDisabled : function( el, s ) {
/*
@@ -100,7 +100,7 @@
*
* @param {number} postid The post id.
*
* @returns {void}
* @return {void}
*/
init : function(postid) {
var t = this, old = $('#image-editor-' + t.postid),
@@ -144,7 +144,7 @@
* @param {number} postid The post id.
* @param {number} toggle Is 0 or 1, fades the icon in then 1 and out when 0.
*
* @returns {void}
* @return {void}
*/
toggleEditor : function(postid, toggle) {
var wait = $('#imgedit-wait-' + postid);
@@ -164,7 +164,7 @@
*
* @param {HTMLElement} el The element to create the help window in.
*
* @returns {boolean} Always returns false.
* @return {boolean} Always returns false.
*/
toggleHelp : function(el) {
var $el = $( el );
@@ -186,8 +186,8 @@
*
* @param {number} postid The post id.
*
* @returns {string} The value from the imagedit-save-target input field when available,
* or 'full' when not available.
* @return {string} The value from the imagedit-save-target input field when available,
* or 'full' when not available.
*/
getTarget : function(postid) {
return $('input[name="imgedit-target-' + postid + '"]:checked', '#imgedit-save-target-' + postid).val() || 'full';
@@ -206,7 +206,7 @@
* and 1 when applicable for the x-axis.
* @param {jQuery} el Element.
*
* @returns {void}
* @return {void}
*/
scaleChanged : function( postid, x, el ) {
var w = $('#imgedit-scale-width-' + postid), h = $('#imgedit-scale-height-' + postid),
@@ -239,7 +239,7 @@
*
* @param {number} postid The post id.
*
* @returns {string} The aspect ratio.
* @return {string} The aspect ratio.
*/
getSelRatio : function(postid) {
var x = this.hold.w, y = this.hold.h,
@@ -267,7 +267,7 @@
* @param {number} postid The post id.
* @param {number} setSize 0 or 1, when 1 the image resets to its original size.
*
* @returns {string} JSON string containing the history or an empty string if no history exists.
* @return {string} JSON string containing the history or an empty string if no history exists.
*/
filterHistory : function(postid, setSize) {
// Apply undo state to history.
@@ -333,7 +333,7 @@
* @param {string} nonce The nonce to verify the request.
* @param {function} callback Function to execute when the image is loaded.
*
* @returns {void}
* @return {void}
*/
refreshEditor : function(postid, nonce, callback) {
var t = this, data, img;
@@ -407,10 +407,10 @@
* @param {string} action The action to perform on the image.
* The possible actions are: "scale" and "restore".
*
* @returns {boolean|void} Executes a post request that refreshes the page
* when the action is performed.
* Returns false if a invalid action is given,
* or when the action cannot be performed.
* @return {boolean|void} Executes a post request that refreshes the page
* when the action is performed.
* Returns false if a invalid action is given,
* or when the action cannot be performed.
*/
action : function(postid, nonce, action) {
var t = this, data, w, h, fw, fh;
@@ -472,9 +472,9 @@
* @param {number} postid The post id to get the image from the database.
* @param {string} nonce The nonce to verify the request.
*
* @returns {boolean|void} If the actions are successfully saved a response message is shown.
* Returns false if there is no image editing history,
* thus there are not edit-actions performed on the image.
* @return {boolean|void} If the actions are successfully saved a response message is shown.
* Returns false if there is no image editing history,
* thus there are not edit-actions performed on the image.
*/
save : function(postid, nonce) {
var data,
@@ -538,8 +538,8 @@
* @param {string} nonce The nonce to verify the request.
* @param {object} view The image editor view to be used for the editing.
*
* @returns {void|promise} Either returns void if the button was already activated
* or returns an instance of the image editor, wrapped in a promise.
* @return {void|promise} Either returns void if the button was already activated
* or returns an instance of the image editor, wrapped in a promise.
*/
open : function( postid, nonce, view ) {
this._view = view;
@@ -593,7 +593,7 @@
*
* @param {number} postid The post id.
*
* @returns {void}
* @return {void}
*/
imgLoaded : function(postid) {
var img = $('#image-preview-' + postid), parent = $('#imgedit-crop-' + postid);
@@ -621,7 +621,7 @@
* @param {HTMLElement} image The preview image.
* @param {HTMLElement} parent The preview image container.
*
* @returns {void}
* @return {void}
*/
initCrop : function(postid, image, parent) {
var t = this,
@@ -653,7 +653,7 @@
/**
* Binds mouse down event to the cropping container.
*
* @returns {void}
* @return {void}
*/
parent.children().on( 'mousedown, touchstart', function(e){
var ratio = false, sel, defRatio;
@@ -675,7 +675,7 @@
*
* @ignore
*
* @returns {void}
* @return {void}
*/
onSelectStart: function() {
imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1);
@@ -688,7 +688,7 @@
* @param {object} img jQuery object representing the image.
* @param {object} c The selection.
*
* @returns {object}
* @return {object}
*/
onSelectEnd: function(img, c) {
imageEdit.setCropSelection(postid, c);
@@ -702,7 +702,7 @@
* @param {object} img jQuery object representing the image.
* @param {object} c The selection.
*
* @returns {void}
* @return {void}
*/
onSelectChange: function(img, c) {
var sizer = imageEdit.hold.sizer;
@@ -721,7 +721,7 @@
* @param {number} postid The post id.
* @param {object} c The selection.
*
* @returns {boolean}
* @return {boolean}
*/
setCropSelection : function(postid, c) {
var sel;
@@ -752,7 +752,7 @@
* @param {number} postid The post id.
* @param {bool} warn Warning message.
*
* @returns {void|bool} Returns false if there is a warning.
* @return {void|bool} Returns false if there is a warning.
*/
close : function(postid, warn) {
warn = warn || false;
@@ -792,7 +792,7 @@
*
* @param {number} postid The post id.
*
* @returns {boolean} Returns true if the history is not saved.
* @return {boolean} Returns true if the history is not saved.
*/
notsaved : function(postid) {
var h = $('#imgedit-history-' + postid).val(),
@@ -818,7 +818,7 @@
* @param {number} postid The post id.
* @param {string} nonce The nonce.
*
* @returns {void}
* @return {void}
*/
addStep : function(op, postid, nonce) {
var t = this, elem = $('#imgedit-history-' + postid),
@@ -852,7 +852,7 @@
* @param {string} nonce The nonce.
* @param {object} t The target element.
*
* @returns {boolean}
* @return {boolean}
*/
rotate : function(angle, postid, nonce, t) {
if ( $(t).hasClass('disabled') ) {
@@ -873,7 +873,7 @@
* @param {string} nonce The nonce.
* @param {object} t The target element.
*
* @returns {boolean}
* @return {boolean}
*/
flip : function (axis, postid, nonce, t) {
if ( $(t).hasClass('disabled') ) {
@@ -893,7 +893,7 @@
* @param {string} nonce The nonce.
* @param {object} t The target object.
*
* @returns {void|boolean} Returns false if the crop button is disabled.
* @return {void|boolean} Returns false if the crop button is disabled.
*/
crop : function (postid, nonce, t) {
var sel = $('#imgedit-selection-' + postid).val(),
@@ -921,7 +921,7 @@
* @param {number} postid The post id.
* @param {string} nonce The nonce.
*
* @returns {void|false} Returns false if the undo button is disabled.
* @return {void|false} Returns false if the undo button is disabled.
*/
undo : function (postid, nonce) {
var t = this, button = $('#image-undo-' + postid), elem = $('#imgedit-undone-' + postid),
@@ -954,7 +954,7 @@
* @param {number} postid The post id.
* @param {string} nonce The nonce.
*
* @returns {void}
* @return {void}
*/
redo : function(postid, nonce) {
var t = this, button = $('#image-redo-' + postid), elem = $('#imgedit-undone-' + postid),
@@ -984,9 +984,9 @@
* @param {number} postid The post id.
* @param {jQuery} el The element containing the values.
*
* @returns {void|boolean} Returns false when the x or y value is lower than 1,
* void when the value is not numeric or when the operation
* is successful.
* @return {void|boolean} Returns false when the x or y value is lower than 1,
* void when the value is not numeric or when the operation
* is successful.
*/
setNumSelection : function( postid, el ) {
var sel, elX = $('#imgedit-sel-width-' + postid), elY = $('#imgedit-sel-height-' + postid),
@@ -1040,7 +1040,7 @@
*
* @param {number} num The number.
*
* @returns {number} The number rounded to a whole number.
* @return {number} The number rounded to a whole number.
*/
round : function(num) {
var s;
@@ -1071,7 +1071,7 @@
* @param {number} n The ratio to set.
* @param {jQuery} el The element containing the values.
*
* @returns {void}
* @return {void}
*/
setRatioSelection : function(postid, n, el) {
var sel, r, x = this.intval( $('#imgedit-crop-width-' + postid).val() ),
@@ -1113,8 +1113,8 @@
*
* @param {jQuery} el The html element.
*
* @returns {void|boolean} Returns false if the value is not numeric,
* void when it is.
* @return {void|boolean} Returns false if the value is not numeric,
* void when it is.
*/
validateNumeric: function( el ) {
if ( ! this.intval( $( el ).val() ) ) {

View File

@@ -36,7 +36,7 @@ window.wp = window.wp || {};
* @memberof inlineEditPost
* @since 2.7.0
*
* @returns {void}
* @return {void}
*/
init : function(){
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
@@ -48,7 +48,7 @@ window.wp = window.wp || {};
/**
* Binds the escape key to revert the changes and close the quick editor.
*
* @returns {boolean} The result of revert.
* @return {boolean} The result of revert.
*/
qeRow.keyup(function(e){
// Revert changes if escape key is pressed.
@@ -60,7 +60,7 @@ window.wp = window.wp || {};
/**
* Binds the escape key to revert the changes and close the bulk editor.
*
* @returns {boolean} The result of revert.
* @return {boolean} The result of revert.
*/
bulkRow.keyup(function(e){
// Revert changes if escape key is pressed.
@@ -72,7 +72,7 @@ window.wp = window.wp || {};
/**
* Reverts changes and close the quick editor if the cancel button is clicked.
*
* @returns {boolean} The result of revert.
* @return {boolean} The result of revert.
*/
$( '.cancel', qeRow ).click( function() {
return inlineEditPost.revert();
@@ -81,7 +81,7 @@ window.wp = window.wp || {};
/**
* Saves changes in the quick editor if the save(named: update) button is clicked.
*
* @returns {boolean} The result of save.
* @return {boolean} The result of save.
*/
$( '.save', qeRow ).click( function() {
return inlineEditPost.save(this);
@@ -90,7 +90,7 @@ window.wp = window.wp || {};
/**
* If enter is pressed, and the target is not the cancel button, save the post.
*
* @returns {boolean} The result of save.
* @return {boolean} The result of save.
*/
$('td', qeRow).keydown(function(e){
if ( e.which === 13 && ! $( e.target ).hasClass( 'cancel' ) ) {
@@ -101,7 +101,7 @@ window.wp = window.wp || {};
/**
* Reverts changes and close the bulk editor if the cancel button is clicked.
*
* @returns {boolean} The result of revert.
* @return {boolean} The result of revert.
*/
$( '.cancel', bulkRow ).click( function() {
return inlineEditPost.revert();
@@ -247,7 +247,7 @@ window.wp = window.wp || {};
*
* @param {number|Object} id The id of the clicked post or an element within a post
* table row.
* @returns {boolean} Always returns false at the end of execution.
* @return {boolean} Always returns false at the end of execution.
*/
edit : function(id) {
var t = this, fields, editRow, rowData, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, f, val, pw;
@@ -285,7 +285,7 @@ window.wp = window.wp || {};
/**
* Replaces the image for a Twemoji(Twitter emoji) with it's alternate text.
*
* @returns Alternate text from the image.
* @return {string} Alternate text from the image.
*/
val.find( 'img' ).replaceWith( function() { return this.alt; } );
val = val.text();
@@ -385,9 +385,9 @@ window.wp = window.wp || {};
*
* @since 2.7.0
*
* @param {int} id The id for the post that has been changed.
* @returns {boolean} false, so the form does not submit when pressing
* Enter on a focused field.
* @param {int} id The id for the post that has been changed.
* @return {boolean} False, so the form does not submit when pressing
* Enter on a focused field.
*/
save : function(id) {
var params, fields, page = $('.post_status_page').val() || '';
@@ -453,7 +453,7 @@ window.wp = window.wp || {};
* @memberof inlineEditPost
* @since 2.7.0
*
* @returns {boolean} Always returns false.
* @return {boolean} Always returns false.
*/
revert : function(){
var $tableWideFat = $( '.widefat' ),
@@ -497,8 +497,8 @@ window.wp = window.wp || {};
* @memberof inlineEditPost
* @since 2.7.0
*
* @param {Object} o DOM row object to get the id for.
* @returns {string} The post id extracted from the table row in the object.
* @param {Object} o DOM row object to get the id for.
* @return {string} The post id extracted from the table row in the object.
*/
getId : function(o) {
var id = $(o).closest('tr').attr('id'),

View File

@@ -29,7 +29,7 @@ window.inlineEditTax = {
*
* @this inlineEditTax
* @memberof inlineEditTax
* @returns {void}
* @return {void}
*/
init : function() {
var t = this, row = $('#inline-edit');
@@ -96,7 +96,7 @@ window.inlineEditTax = {
*
* @param {HTMLElement} el An element within the table row or the table row
* itself that we want to quick edit.
* @returns {void}
* @return {void}
*/
toggle : function(el) {
var t = this;
@@ -115,7 +115,7 @@ window.inlineEditTax = {
* @param {string|HTMLElement} id The ID of the term we want to quick edit or an
* element within the table row or the
* table row itself.
* @returns {boolean} Always returns false.
* @return {boolean} Always returns false.
*/
edit : function(id) {
var editRow, rowData, val,
@@ -162,7 +162,7 @@ window.inlineEditTax = {
* @param {string|HTMLElement} id The ID of the term we want to quick edit or an
* element within the table row or the
* table row itself.
* @returns {boolean} Always returns false.
* @return {boolean} Always returns false.
*/
save : function(id) {
var params, fields, tax = $('input[name="taxonomy"]').val() || '';
@@ -255,7 +255,7 @@ window.inlineEditTax = {
*
* @this inlineEditTax
* @memberof inlineEditTax
* @returns {void}
* @return {void}
*/
revert : function() {
var id = $('table.widefat tr.inline-editor').attr('id');
@@ -280,7 +280,7 @@ window.inlineEditTax = {
* @memberof inlineEditTax
*
* @param {HTMLElement} o An element within the table row or the table row itself.
* @returns {string} The ID of the term based on the element.
* @return {string} The ID of the term based on the element.
*/
getId : function(o) {
var id = o.tagName === 'TR' ? o.id : $(o).parents('tr').attr('id'), parts = id.split('-');

View File

@@ -122,8 +122,8 @@ jQuery(document).ready( function($) {
* @ignore
*
* @param {Event} event The event object.
* @returns {boolean} Always returns false to prevent regular link
* functionality.
* @return {boolean} Always returns false to prevent regular link
* functionality.
*/
$('#category-add-toggle').click( function() {
$(this).parents('div:first').toggleClass( 'wp-hidden-children' );

View File

@@ -22,9 +22,9 @@
* @global
*
* @param {string} html The HTML to be sent to the editor.
* @returns {void|boolean} Returns false when both TinyMCE and QTags instances
* are unavailable. This means that the HTML was not
* sent to the editor.
* @return {void|boolean} Returns false when both TinyMCE and QTags instances
* are unavailable. This means that the HTML was not
* sent to the editor.
*/
window.send_to_editor = function( html ) {
var editor,
@@ -71,8 +71,8 @@ window.send_to_editor = function( html ) {
*
* @global
*
* @returns {Object[]} Array containing jQuery objects for all the found
* ThickBox anchors.
* @return {Object[]} Array containing jQuery objects for all the found
* ThickBox anchors.
*/
window.tb_position = function() {
var tbWindow = $('#TB_window'),

View File

@@ -26,7 +26,7 @@
* @param {string} af_name The name of the affected element.
* @param {string} af_val The value of the affected post element.
*
* @returns {boolean} Always returns false.
* @return {boolean} Always returns false.
*/
open: function( af_name, af_val ) {
var overlay = $( '.ui-find-overlay' );
@@ -65,7 +65,7 @@
*
* @memberOf findPosts
*
* @returns {void}
* @return {void}
*/
close: function() {
$('#find-posts-response').empty();
@@ -81,7 +81,7 @@
*
* @memberOf findPosts
*
* @returns {void}
* @return {void}
*/
overlay: function() {
$( '.ui-find-overlay' ).on( 'click', function () {
@@ -100,7 +100,7 @@
*
* @memberOf findPosts
*
* @returns {void}
* @return {void}
*/
send: function() {
var post = {
@@ -138,7 +138,7 @@
* Initializes the file once the DOM is fully loaded and attaches events to the
* various form elements.
*
* @returns {void}
* @return {void}
*/
$( document ).ready( function() {
var settings, $mediaGridWrap = $( '#wp-media-grid' );
@@ -198,7 +198,7 @@
/**
* Enables clicking on the entire table row.
*
* @returns {void}
* @return {void}
*/
$( '.find-box-inside' ).on( 'click', 'tr', function() {
$( this ).find( '.found-radio input' ).prop( 'checked', true );

View File

@@ -27,7 +27,7 @@ window.wp = window.wp || {};
* the password.
* @param {string} password2 The password confirmation.
*
* @returns {number} The password strength score.
* @return {number} The password strength score.
*/
meter : function( password1, blacklist, password2 ) {
if ( ! $.isArray( blacklist ) )
@@ -54,7 +54,7 @@ window.wp = window.wp || {};
*
* @since 3.7.0
*
* @returns {string[]} The array of words to be blacklisted.
* @return {string[]} The array of words to be blacklisted.
*/
userInputBlacklist : function() {
var i, userInputFieldsLength, rawValuesLength, currentField,

View File

@@ -35,7 +35,7 @@ window.wp = window.wp || {};
*
* @param {int} total Total number of comments for this post.
* @param {int} num Optional. Number of comments to fetch, defaults to 20.
* @returns {boolean} Always returns false.
* @return {boolean} Always returns false.
*/
get : function(total, num) {
var st = this.st, data;
@@ -599,7 +599,7 @@ jQuery(document).ready( function($) {
*
* @param {Object} s Taxonomy object which will be added.
*
* @returns {Object}
* @return {Object}
*/
catAddBefore = function( s ) {
if ( !$('#new'+taxonomy).val() ) {
@@ -620,7 +620,7 @@ jQuery(document).ready( function($) {
* @param {Object} r Response.
* @param {Object} s Taxonomy data.
*
* @returns void
* @return {void}
*/
catAddAfter = function( r, s ) {
var sup, drop = $('#new'+taxonomy+'_parent');
@@ -666,7 +666,7 @@ jQuery(document).ready( function($) {
*
* @param {Object} s Request object.
*
* @returns {Object} Data modified with post_ID attached.
* @return {Object} Data modified with post_ID attached.
*/
addBefore: function( s ) {
s.data += '&post_id=' + $('#post_ID').val();
@@ -695,7 +695,7 @@ jQuery(document).ready( function($) {
*
* @ignore
*
* @returns void
* @return {void}
*/
updateVisibility = function() {
// Show sticky for public posts.
@@ -719,7 +719,7 @@ jQuery(document).ready( function($) {
*
* @ignore
*
* @returns {boolean} False when an invalid timestamp has been selected, otherwise True.
* @return {boolean} False when an invalid timestamp has been selected, otherwise True.
*/
updateText = function() {
@@ -941,7 +941,7 @@ jQuery(document).ready( function($) {
*
* @global
*
* @returns void
* @return {void}
*/
function editPermalink() {
var i, slug_value,
@@ -1051,7 +1051,7 @@ jQuery(document).ready( function($) {
*
* @global
*
* @returns void
* @return {void}
*/
window.wptitlehint = function( id ) {
id = id || 'title';

View File

@@ -35,7 +35,7 @@
* @memberof postboxes
* @fires postboxes#postbox-toggled
*
* @returns {void}
* @return {void}
*/
handle_click : function () {
var $el = $( this ),
@@ -96,7 +96,7 @@
* @param {Object} [args]
* @param {Function} args.pbshow A callback that is called when a postbox opens.
* @param {Function} args.pbhide A callback that is called when a postbox closes.
* @returns {void}
* @return {void}
*/
add_postbox_toggles : function (page, args) {
var $handles = $( '.postbox .hndle, .postbox .handlediv' );
@@ -121,7 +121,7 @@
*
* @since 3.2.0
*
* @returns {void}
* @return {void}
*/
$( '.postbox a.dismiss' ).on( 'click.postboxes', function( e ) {
var hide_id = $(this).parents('.postbox').attr('id') + '-hide';
@@ -140,7 +140,7 @@
*
* @fires postboxes#postbox-toggled
*
* @returns {void}
* @return {void}
*/
$('.hide-postbox-tog').bind('click.postboxes', function() {
var $el = $(this),
@@ -174,7 +174,7 @@
*
* @since 2.8.0
*
* @returns {void}
* @return {void}
*/
$('.columns-prefs input[type="radio"]').bind('click.postboxes', function(){
var n = parseInt($(this).val(), 10);
@@ -198,7 +198,7 @@
* @param {Function} args.pbhide A callback that is called when a postbox
* closes.
*
* @returns {void}
* @return {void}
*/
init : function(page, args) {
var isMobile = $( document.body ).hasClass( 'mobile' ),
@@ -275,7 +275,7 @@
* @memberof postboxes
*
* @param {string} page The page we are currently on.
* @returns {void}
* @return {void}
*/
save_state : function(page) {
var closed, hidden;
@@ -306,7 +306,7 @@
* @memberof postboxes
*
* @param {string} page The page we are currently on.
* @returns {void}
* @return {void}
*/
save_order : function(page) {
var postVars, page_columns = $('.columns-prefs input:checked').val() || 0;
@@ -336,7 +336,7 @@
* @memberof postboxes
* @access private
*
* @returns {void}
* @return {void}
*/
_mark_area : function() {
var visible = $('div.postbox:visible').length, side = $('#post-body #side-sortables');
@@ -370,7 +370,7 @@
* @access private
*
* @param {number} n The amount of columns to divide the post edit page in.
* @returns {void}
* @return {void}
*/
_pb_edit : function(n) {
var el = $('.metabox-holder').get(0);
@@ -398,7 +398,7 @@
* @memberof postboxes
* @access private
*
* @returns {void}
* @return {void}
*/
_pb_change : function() {
var check = $( 'label.columns-prefs-1 input[type="radio"]' );

View File

@@ -31,7 +31,7 @@
* @since 4.7.0
*
* @param {object} options Options that are passed to UI Autocomplete. Can be used to override the default settings.
* @returns {object} jQuery instance.
* @return {object} jQuery instance.
*/
$.fn.wpTagsSuggest = function( options ) {
var cache;

View File

@@ -20,7 +20,7 @@ jQuery(document).ready(function($) {
*
* @since 2.8.0
*
* @returns boolean Always returns false to cancel the default event handling.
* @return {boolean} Always returns false to cancel the default event handling.
*/
$( '#the-list' ).on( 'click', '.delete-tag', function() {
var t = $(this), tr = t.parents('tr'), r = true, data;
@@ -37,7 +37,7 @@ jQuery(document).ready(function($) {
*
* @param {string} r The response from the server.
*
* @returns {void}
* @return {void}
*/
$.post(ajaxurl, data, function(r){
if ( '1' == r ) {
@@ -75,7 +75,7 @@ jQuery(document).ready(function($) {
*
* @since 4.8.0
*
* @returns {void}
* @return {void}
*/
$( '#edittag' ).on( 'click', '.delete', function( e ) {
if ( 'undefined' === typeof showNotice ) {
@@ -96,7 +96,7 @@ jQuery(document).ready(function($) {
*
* @since 2.8.0
*
* @returns boolean Always returns false to cancel the default event handling.
* @return {boolean} Always returns false to cancel the default event handling.
*/
$('#submit').click(function(){
var form = $(this).parents('form');
@@ -117,7 +117,7 @@ jQuery(document).ready(function($) {
*
* @param {string} r The response from the server.
*
* @returns {void}
* @return {void}
*/
$.post(ajaxurl, $('#addtag').serialize(), function(r){
var res, parent, term, indent, i;

View File

@@ -36,7 +36,7 @@ wp.themePluginEditor = (function( $ ) {
* @param {jQuery} form - Form element.
* @param {object} settings - Settings.
* @param {object|boolean} settings.codeEditor - Code editor settings (or `false` if syntax highlighting is disabled).
* @returns {void}
* @return {void}
*/
component.init = function init( form, settings ) {
@@ -94,7 +94,7 @@ wp.themePluginEditor = (function( $ ) {
* Set up and display the warning modal.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
component.showWarning = function() {
// Get the text within the modal.
@@ -125,7 +125,7 @@ wp.themePluginEditor = (function( $ ) {
*
* @since 4.9.0
* @param {object} event jQuery event object.
* @returns {void}
* @return {void}
*/
component.constrainTabbing = function( event ) {
var firstTabbable, lastTabbable;
@@ -150,7 +150,7 @@ wp.themePluginEditor = (function( $ ) {
* Dismiss the warning modal.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
component.dismissWarning = function() {
@@ -168,7 +168,7 @@ wp.themePluginEditor = (function( $ ) {
* Callback for when a change happens.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
component.onChange = function() {
component.dirty = true;
@@ -180,7 +180,7 @@ wp.themePluginEditor = (function( $ ) {
*
* @since 4.9.0
* @param {jQuery.Event} event - Event.
* @returns {void}
* @return {void}
*/
component.submit = function( event ) {
var data = {}, request;
@@ -267,7 +267,7 @@ wp.themePluginEditor = (function( $ ) {
* @param {string} notice.message - Message.
* @param {boolean} [notice.dismissible=false] - Dismissible.
* @param {Function} [notice.onDismiss] - Callback for when a user dismisses the notice.
* @returns {jQuery} Notice element.
* @return {jQuery} Notice element.
*/
component.addNotice = function( notice ) {
var noticeElement;
@@ -303,7 +303,7 @@ wp.themePluginEditor = (function( $ ) {
* @since 4.9.0
*
* @param {string} code - Notice code.
* @returns {boolean} Whether a notice was removed.
* @return {boolean} Whether a notice was removed.
*/
component.removeNotice = function( code ) {
if ( component.noticeElements[ code ] ) {
@@ -320,7 +320,7 @@ wp.themePluginEditor = (function( $ ) {
* Initialize code editor.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
component.initCodeEditor = function initCodeEditor() {
var codeEditorSettings, editor;
@@ -332,7 +332,7 @@ wp.themePluginEditor = (function( $ ) {
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
codeEditorSettings.onTabPrevious = function() {
$( '#templateside' ).find( ':tabbable' ).last().focus();
@@ -343,7 +343,7 @@ wp.themePluginEditor = (function( $ ) {
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
codeEditorSettings.onTabNext = function() {
$( '#template' ).find( ':tabbable:not(.CodeMirror-code)' ).first().focus();
@@ -355,7 +355,7 @@ wp.themePluginEditor = (function( $ ) {
* @since 4.9.0
*
* @param {Array} errors - List of linting errors.
* @returns {void}
* @return {void}
*/
codeEditorSettings.onChangeLintingErrors = function( errors ) {
component.lintErrors = errors;
@@ -372,7 +372,7 @@ wp.themePluginEditor = (function( $ ) {
* @since 4.9.0
*
* @param {Array} errorAnnotations - Error annotations.
* @returns {void}
* @return {void}
*/
codeEditorSettings.onUpdateErrorNotice = function onUpdateErrorNotice( errorAnnotations ) {
var message, noticeElement;
@@ -424,7 +424,7 @@ wp.themePluginEditor = (function( $ ) {
* Initialization of the file browser's folder states.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
component.initFileBrowser = function initFileBrowser() {

View File

@@ -1399,7 +1399,7 @@ themes.view.Search = wp.Backbone.View.extend({
*
* @param {string} url - URL to navigate to.
* @param {object} state - State.
* @returns {void}
* @return {void}
*/
function navigateRouter( url, state ) {
var router = this;

View File

@@ -1598,7 +1598,7 @@
* @param {string} response.errorCode Error code for the error that occurred.
* @param {string} response.errorMessage The error that occurred.
* @param {string} action The type of request to perform.
* @returns {boolean} Whether there is an error that needs to be handled or not.
* @return {boolean} Whether there is an error that needs to be handled or not.
*/
wp.updates.maybeHandleCredentialError = function( response, action ) {
if ( wp.updates.shouldRequestFilesystemCredentials && response.errorCode && 'unable_to_connect_to_filesystem' === response.errorCode ) {

View File

@@ -44,7 +44,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* @param {jQuery} options.el - Control field container element.
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
*
* @returns {void}
* @return {void}
*/
initialize: function initialize( options ) {
var control = this;
@@ -97,7 +97,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* A field will only be updated if it is not currently focused, to avoid
* overwriting content that the user is entering.
*
* @returns {void}
* @return {void}
*/
updateFields: function updateFields() {
var control = this, syncInput;
@@ -123,7 +123,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* Show linting error notice.
*
* @param {Array} errorAnnotations - Error annotations.
* @returns {void}
* @return {void}
*/
updateErrorNotice: function( errorAnnotations ) {
var control = this, errorNotice, message = '', customizeSetting;
@@ -164,7 +164,7 @@ wp.customHtmlWidgets = ( function( $ ) {
/**
* Initialize editor.
*
* @returns {void}
* @return {void}
*/
initializeEditor: function initializeEditor() {
var control = this, settings;
@@ -180,7 +180,7 @@ wp.customHtmlWidgets = ( function( $ ) {
*
* @ignore
*
* @returns {void}
* @return {void}
*/
onTabPrevious: function onTabPrevious() {
control.fields.title.focus();
@@ -191,7 +191,7 @@ wp.customHtmlWidgets = ( function( $ ) {
*
* @ignore
*
* @returns {void}
* @return {void}
*/
onTabNext: function onTabNext() {
var tabbables = control.syncContainer.add( control.syncContainer.parent().find( '.widget-position, .widget-control-actions' ) ).find( ':tabbable' );
@@ -204,7 +204,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* @ignore
*
* @param {Array} errorAnnotations - Error notifications.
* @returns {void}
* @return {void}
*/
onChangeLintingErrors: function onChangeLintingErrors( errorAnnotations ) {
control.currentErrorAnnotations = errorAnnotations;
@@ -216,7 +216,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* @ignore
*
* @param {Array} errorAnnotations - Error annotations.
* @returns {void}
* @return {void}
*/
onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 );
@@ -288,7 +288,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* @param {jQuery.Event} event - Event.
* @param {jQuery} widgetContainer - Widget container element.
*
* @returns {void}
* @return {void}
*/
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone, fieldContainer, syncContainer;
@@ -347,7 +347,7 @@ wp.customHtmlWidgets = ( function( $ ) {
*
* @alias wp.customHtmlWidgets.setupAccessibleMode
*
* @returns {void}
* @return {void}
*/
component.setupAccessibleMode = function setupAccessibleMode() {
var widgetForm, idBase, widgetControl, fieldContainer, syncContainer;
@@ -384,7 +384,7 @@ wp.customHtmlWidgets = ( function( $ ) {
*
* @param {jQuery.Event} event - Event.
* @param {jQuery} widgetContainer - Widget container element.
* @returns {void}
* @return {void}
*/
component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) {
var widgetForm, widgetId, widgetControl, idBase;
@@ -415,7 +415,7 @@ wp.customHtmlWidgets = ( function( $ ) {
*
* @param {object} settings - Options for code editor, exported from PHP.
*
* @returns {void}
* @return {void}
*/
component.init = function init( settings ) {
var $document = $( document );

View File

@@ -19,7 +19,7 @@
/**
* Create the default states.
*
* @returns {void}
* @return {void}
*/
createStates: function createStates() {
this.states.add([
@@ -70,7 +70,7 @@
* Map model props to media frame props.
*
* @param {Object} modelProps - Model props.
* @returns {Object} Media frame props.
* @return {Object} Media frame props.
*/
mapModelToMediaFrameProps: function mapModelToMediaFrameProps( modelProps ) {
var control = this, mediaFrameProps;
@@ -82,7 +82,7 @@
/**
* Render preview.
*
* @returns {void}
* @return {void}
*/
renderPreview: function renderPreview() {
var control = this, previewContainer, previewTemplate, attachmentId, attachmentUrl;
@@ -109,7 +109,7 @@
/**
* Open the media audio-edit frame to modify the selected item.
*
* @returns {void}
* @return {void}
*/
editMedia: function editMedia() {
var control = this, mediaFrame, metadata, updateCallback;

View File

@@ -21,7 +21,7 @@
* Create the default states.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
createStates: function createStates() {
this.states.add([
@@ -88,7 +88,7 @@
* @param {Backbone.Model} options.model - Model.
* @param {jQuery} options.el - Control field container element.
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
* @returns {void}
* @return {void}
*/
initialize: function initialize( options ) {
var control = this;
@@ -122,7 +122,7 @@
* Update the selected attachments if necessary.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
updateSelectedAttachments: function updateSelectedAttachments() {
var control = this, newIds, oldIds, removedIds, addedIds, addedQuery;
@@ -155,7 +155,7 @@
* Render preview.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
renderPreview: function renderPreview() {
var control = this, previewContainer, previewTemplate, data;
@@ -176,7 +176,7 @@
* Determine whether there are selected attachments.
*
* @since 4.9.0
* @returns {boolean} Selected.
* @return {boolean} Selected.
*/
isSelected: function isSelected() {
var control = this;
@@ -192,7 +192,7 @@
* Open the media select frame to edit images.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
editMedia: function editMedia() {
var control = this, selection, mediaFrame, mediaFrameProps;
@@ -255,7 +255,7 @@
* Open the media select frame to chose an item.
*
* @since 4.9.0
* @returns {void}
* @return {void}
*/
selectMedia: function selectMedia() {
var control = this, selection, mediaFrame, mediaFrameProps;
@@ -321,7 +321,7 @@
*
* @since 4.9.0
* @param {wp.media.models.Attachment} attachment - Attachment.
* @returns {void}
* @return {void}
*/
handleAttachmentDestroy: function handleAttachmentDestroy( attachment ) {
var control = this;

View File

@@ -40,7 +40,7 @@
/**
* Render preview.
*
* @returns {void}
* @return {void}
*/
renderPreview: function renderPreview() {
var control = this, previewContainer, previewTemplate, fieldsContainer, fieldsTemplate, linkInput;
@@ -64,7 +64,7 @@
/**
* Open the media image-edit frame to modify the selected item.
*
* @returns {void}
* @return {void}
*/
editMedia: function editMedia() {
var control = this, mediaFrame, updateCallback, defaultSync, metadata;
@@ -119,7 +119,7 @@
/**
* Get props which are merged on top of the model when an embed is chosen (as opposed to an attachment).
*
* @returns {Object} Reset/override props.
* @return {Object} Reset/override props.
*/
getEmbedResetProps: function getEmbedResetProps() {
return _.extend(
@@ -138,7 +138,7 @@
* Prevent the image_title attribute from being initially set when adding an image from the media library.
*
* @param {wp.media.view.MediaFrame.Select} mediaFrame - Select frame.
* @returns {Object} Props.
* @return {Object} Props.
*/
getModelPropsFromMediaFrame: function getModelPropsFromMediaFrame( mediaFrame ) {
var control = this;
@@ -151,7 +151,7 @@
/**
* Map model props to preview template props.
*
* @returns {Object} Preview template props.
* @return {Object} Preview template props.
*/
mapModelToPreviewTemplateProps: function mapModelToPreviewTemplateProps() {
var control = this, previewTemplateProps, url;

View File

@@ -21,7 +21,7 @@
/**
* Create the default states.
*
* @returns {void}
* @return {void}
*/
createStates: function createStates() {
this.states.add([
@@ -88,7 +88,7 @@
* Map model props to media frame props.
*
* @param {Object} modelProps - Model props.
* @returns {Object} Media frame props.
* @return {Object} Media frame props.
*/
mapModelToMediaFrameProps: function mapModelToMediaFrameProps( modelProps ) {
var control = this, mediaFrameProps;
@@ -100,7 +100,7 @@
/**
* Fetches embed data for external videos.
*
* @returns {void}
* @return {void}
*/
fetchEmbed: function fetchEmbed() {
var control = this, url;
@@ -144,7 +144,7 @@
*
* @deprecated since 4.9.
*
* @returns {boolean} Whether url is a supported video host.
* @return {boolean} Whether url is a supported video host.
*/
isHostedVideo: function isHostedVideo() {
return true;
@@ -153,7 +153,7 @@
/**
* Render preview.
*
* @returns {void}
* @return {void}
*/
renderPreview: function renderPreview() {
var control = this, previewContainer, previewTemplate, attachmentId, attachmentUrl, poster, html = '', isOEmbed = false, mime, error, urlParser, matches;
@@ -211,7 +211,7 @@
/**
* Open the media image-edit frame to modify the selected item.
*
* @returns {void}
* @return {void}
*/
editMedia: function editMedia() {
var control = this, mediaFrame, metadata, updateCallback;

View File

@@ -45,7 +45,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @param {Object} options - Options.
*
* @returns {void}
* @return {void}
*/
initialize: function initialize( options ) {
_.bindAll( this, 'handleDisplaySettingChange' );
@@ -56,7 +56,7 @@ wp.mediaWidgets = ( function( $ ) {
* Sync changes to the current display settings back into the current customized.
*
* @param {Backbone.Model} displaySettings - Modified display settings.
* @returns {void}
* @return {void}
*/
handleDisplaySettingChange: function handleDisplaySettingChange( displaySettings ) {
this.get( 'selectedDisplaySettings' ).set( displaySettings.attributes );
@@ -71,7 +71,7 @@ wp.mediaWidgets = ( function( $ ) {
* settings.
*
* @param {Backbone.Model} model - Display settings model.
* @returns {Backbone.Model} Display settings model.
* @return {Backbone.Model} Display settings model.
*/
display: function getDisplaySettingsModel( model ) {
var display, selectedDisplaySettings = this.get( 'selectedDisplaySettings' );
@@ -101,7 +101,7 @@ wp.mediaWidgets = ( function( $ ) {
* @since 4.9.0
*
* @param {object} options - Options.
* @returns {void}
* @return {void}
*/
initialize: function( options ) {
var view = this, embedController; // eslint-disable-line consistent-this
@@ -117,7 +117,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* Forked override of {wp.media.view.Embed#refresh()} to suppress irrelevant "link text" field.
*
* @returns {void}
* @return {void}
*/
refresh: function refresh() {
/**
@@ -136,7 +136,7 @@ wp.mediaWidgets = ( function( $ ) {
* Set the disabled state on the Add to Widget button.
*
* @param {boolean} disabled - Disabled.
* @returns {void}
* @return {void}
*/
setAddToWidgetButtonDisabled: function setAddToWidgetButtonDisabled( disabled ) {
this.views.parent.views.parent.views.get( '.media-frame-toolbar' )[0].$el.find( '.media-button-select' ).prop( 'disabled', disabled );
@@ -146,7 +146,7 @@ wp.mediaWidgets = ( function( $ ) {
* Set or clear an error notice.
*
* @param {string} notice - Notice.
* @returns {void}
* @return {void}
*/
setErrorNotice: function setErrorNotice( notice ) {
var embedLinkView = this, noticeContainer; // eslint-disable-line consistent-this
@@ -175,7 +175,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @since 4.9.0
*
* @returns {void}
* @return {void}
*/
updateoEmbed: function() {
var embedLinkView = this, url; // eslint-disable-line consistent-this
@@ -200,7 +200,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Fetch media.
*
* @returns {void}
* @return {void}
*/
fetch: function() {
var embedLinkView = this, fetchSuccess, matches, fileExt, urlParser, url, re, youTubeEmbedMatch; // eslint-disable-line consistent-this
@@ -276,7 +276,7 @@ wp.mediaWidgets = ( function( $ ) {
* The element is getting display:none in the stylesheet, but the underlying method uses
* uses {jQuery.fn.show()} which adds an inline style. This avoids the need for !important.
*
* @returns {void}
* @return {void}
*/
renderFail: function renderFail() {
var embedLinkView = this; // eslint-disable-line consistent-this
@@ -306,7 +306,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Create the default states.
*
* @returns {void}
* @return {void}
*/
createStates: function createStates() {
var mime = this.options.mimeType, specificMimes = [];
@@ -358,7 +358,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @param {wp.Backbone.View} view - Toolbar view.
* @this {wp.media.controller.Library}
* @returns {void}
* @return {void}
*/
mainInsertToolbar: function mainInsertToolbar( view ) {
var controller = this; // eslint-disable-line consistent-this
@@ -374,7 +374,7 @@ wp.mediaWidgets = ( function( $ ) {
* @ignore
*
* @fires wp.media.controller.State#insert()
* @returns {void}
* @return {void}
*/
click: function onClick() {
var state = controller.state(),
@@ -393,7 +393,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @param {wp.Backbone.View} toolbar - Toolbar view.
* @this {wp.media.controller.Library}
* @returns {void}
* @return {void}
*/
mainEmbedToolbar: function mainEmbedToolbar( toolbar ) {
toolbar.view = new wp.media.view.Toolbar.Embed({
@@ -408,7 +408,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* Forked override of {wp.media.view.MediaFrame.Post#embedContent()} to suppress irrelevant "link text" field.
*
* @returns {void}
* @return {void}
*/
embedContent: function embedContent() {
var view = new component.MediaEmbedView({
@@ -489,7 +489,7 @@ wp.mediaWidgets = ( function( $ ) {
* @param {jQuery} options.el - Control field container element.
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
*
* @returns {void}
* @return {void}
*/
initialize: function initialize( options ) {
var control = this;
@@ -593,7 +593,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Update the selected attachment if necessary.
*
* @returns {void}
* @return {void}
*/
updateSelectedAttachment: function updateSelectedAttachment() {
var control = this, attachment;
@@ -619,7 +619,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Sync the model attributes to the hidden inputs, and update previewTemplateProps.
*
* @returns {void}
* @return {void}
*/
syncModelToPreviewProps: function syncModelToPreviewProps() {
var control = this;
@@ -629,7 +629,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Sync the model attributes to the hidden inputs, and update previewTemplateProps.
*
* @returns {void}
* @return {void}
*/
syncModelToInputs: function syncModelToInputs() {
var control = this;
@@ -659,7 +659,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Get template.
*
* @returns {Function} Template.
* @return {Function} Template.
*/
template: function template() {
var control = this;
@@ -672,7 +672,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Render template.
*
* @returns {void}
* @return {void}
*/
render: function render() {
var control = this, titleInput;
@@ -695,7 +695,7 @@ wp.mediaWidgets = ( function( $ ) {
* Render media preview.
*
* @abstract
* @returns {void}
* @return {void}
*/
renderPreview: function renderPreview() {
throw new Error( 'renderPreview must be implemented' );
@@ -704,7 +704,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Whether a media item is selected.
*
* @returns {boolean} Whether selected and no error.
* @return {boolean} Whether selected and no error.
*/
isSelected: function isSelected() {
var control = this;
@@ -720,7 +720,7 @@ wp.mediaWidgets = ( function( $ ) {
* Handle click on link to Media Library to open modal, such as the link that appears when in the missing attachment error notice.
*
* @param {jQuery.Event} event - Event.
* @returns {void}
* @return {void}
*/
handleMediaLibraryLinkClick: function handleMediaLibraryLinkClick( event ) {
var control = this;
@@ -731,7 +731,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Open the media select frame to chose an item.
*
* @returns {void}
* @return {void}
*/
selectMedia: function selectMedia() {
var control = this, selection, mediaFrame, defaultSync, mediaFrameProps, selectionModels = [];
@@ -818,7 +818,7 @@ wp.mediaWidgets = ( function( $ ) {
* Get the instance props from the media selection frame.
*
* @param {wp.media.view.MediaFrame.Select} mediaFrame - Select frame.
* @returns {Object} Props.
* @return {Object} Props.
*/
getModelPropsFromMediaFrame: function getModelPropsFromMediaFrame( mediaFrame ) {
var control = this, state, mediaFrameProps, modelProps;
@@ -867,7 +867,7 @@ wp.mediaWidgets = ( function( $ ) {
* Map media frame props to model props.
*
* @param {Object} mediaFrameProps - Media frame props.
* @returns {Object} Model props.
* @return {Object} Model props.
*/
mapMediaToModelProps: function mapMediaToModelProps( mediaFrameProps ) {
var control = this, mediaFramePropToModelPropMap = {}, modelProps = {}, extension;
@@ -918,7 +918,7 @@ wp.mediaWidgets = ( function( $ ) {
* Map model props to media frame props.
*
* @param {Object} modelProps - Model props.
* @returns {Object} Media frame props.
* @return {Object} Media frame props.
*/
mapModelToMediaFrameProps: function mapModelToMediaFrameProps( modelProps ) {
var control = this, mediaFrameProps = {};
@@ -942,7 +942,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Map model props to previewTemplateProps.
*
* @returns {Object} Preview Template Props.
* @return {Object} Preview Template Props.
*/
mapModelToPreviewTemplateProps: function mapModelToPreviewTemplateProps() {
var control = this, previewTemplateProps = {};
@@ -961,7 +961,7 @@ wp.mediaWidgets = ( function( $ ) {
* Open the media frame to modify the selected item.
*
* @abstract
* @returns {void}
* @return {void}
*/
editMedia: function editMedia() {
throw new Error( 'editMedia not implemented' );
@@ -1009,7 +1009,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Get default attribute values.
*
* @returns {Object} Mapping of property names to their default values.
* @return {Object} Mapping of property names to their default values.
*/
defaults: function() {
var defaults = {};
@@ -1029,7 +1029,7 @@ wp.mediaWidgets = ( function( $ ) {
* @param {string|Object} key - Attribute name or attribute pairs.
* @param {mixed|Object} [val] - Attribute value or options object.
* @param {Object} [options] - Options when attribute name and value are passed separately.
* @returns {wp.mediaWidgets.MediaWidgetModel} This model.
* @return {wp.mediaWidgets.MediaWidgetModel} This model.
*/
set: function set( key, val, options ) {
var model = this, attrs, opts, castedAttrs; // eslint-disable-line consistent-this
@@ -1083,7 +1083,7 @@ wp.mediaWidgets = ( function( $ ) {
/**
* Get props which are merged on top of the model when an embed is chosen (as opposed to an attachment).
*
* @returns {Object} Reset/override props.
* @return {Object} Reset/override props.
*/
getEmbedResetProps: function getEmbedResetProps() {
return {
@@ -1120,7 +1120,7 @@ wp.mediaWidgets = ( function( $ ) {
* @param {jQuery.Event} event - Event.
* @param {jQuery} widgetContainer - Widget container element.
*
* @returns {void}
* @return {void}
*/
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
var fieldContainer, syncContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone;
@@ -1203,7 +1203,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @memberOf wp.mediaWidgets
*
* @returns {void}
* @return {void}
*/
component.setupAccessibleMode = function setupAccessibleMode() {
var widgetForm, widgetId, idBase, widgetControl, ControlConstructor, ModelConstructor, modelAttributes, fieldContainer, syncContainer;
@@ -1257,7 +1257,7 @@ wp.mediaWidgets = ( function( $ ) {
* @param {jQuery.Event} event - Event.
* @param {jQuery} widgetContainer - Widget container element.
*
* @returns {void}
* @return {void}
*/
component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) {
var widgetForm, widgetContent, widgetId, widgetControl, attributes = {};
@@ -1291,7 +1291,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @memberOf wp.mediaWidgets
*
* @returns {void}
* @return {void}
*/
component.init = function init() {
var $document = $( document );

View File

@@ -36,7 +36,7 @@ wp.textWidgets = ( function( $ ) {
* @param {jQuery} options.el - Control field container element.
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
*
* @returns {void}
* @return {void}
*/
initialize: function initialize( options ) {
var control = this;
@@ -105,7 +105,7 @@ wp.textWidgets = ( function( $ ) {
* @since 4.8.1
*
* @param {Array} pointers Pointer IDs to dismiss.
* @returns {void}
* @return {void}
*/
dismissPointers: function dismissPointers( pointers ) {
_.each( pointers, function( pointer ) {
@@ -120,7 +120,7 @@ wp.textWidgets = ( function( $ ) {
* Open available widgets panel.
*
* @since 4.8.1
* @returns {void}
* @return {void}
*/
openAvailableWidgetsPanel: function openAvailableWidgetsPanel() {
var sidebarControl;
@@ -145,7 +145,7 @@ wp.textWidgets = ( function( $ ) {
* A field will only be updated if it is not currently focused, to avoid
* overwriting content that the user is entering.
*
* @returns {void}
* @return {void}
*/
updateFields: function updateFields() {
var control = this, syncInput;
@@ -168,7 +168,7 @@ wp.textWidgets = ( function( $ ) {
/**
* Initialize editor.
*
* @returns {void}
* @return {void}
*/
initializeEditor: function initializeEditor() {
var control = this, changeDebounceDelay = 1000, id, textarea, triggerChangeIfDirty, restoreTextMode = false, needsTextareaChangeTrigger = false, previousValue;
@@ -179,7 +179,7 @@ wp.textWidgets = ( function( $ ) {
/**
* Trigger change if dirty.
*
* @returns {void}
* @return {void}
*/
triggerChangeIfDirty = function() {
var updateWidgetBuffer = 300; // See wp.customize.Widgets.WidgetControl._setupUpdateUI() which uses 250ms for updateWidgetDebounced.
@@ -225,7 +225,7 @@ wp.textWidgets = ( function( $ ) {
/**
* Build (or re-build) the visual editor.
*
* @returns {void}
* @return {void}
*/
function buildEditor() {
var editor, onInit, showPointerElement;
@@ -274,7 +274,7 @@ wp.textWidgets = ( function( $ ) {
* Show a pointer, focus on dismiss, and speak the contents for a11y.
*
* @param {jQuery} pointerElement Pointer element.
* @returns {void}
* @return {void}
*/
showPointerElement = function( pointerElement ) {
pointerElement.show();
@@ -377,7 +377,7 @@ wp.textWidgets = ( function( $ ) {
* @param {jQuery.Event} event - Event.
* @param {jQuery} widgetContainer - Widget container element.
*
* @returns {void}
* @return {void}
*/
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone, fieldContainer, syncContainer;
@@ -442,7 +442,7 @@ wp.textWidgets = ( function( $ ) {
*
* @memberOf wp.textWidgets
*
* @returns {void}
* @return {void}
*/
component.setupAccessibleMode = function setupAccessibleMode() {
var widgetForm, idBase, widgetControl, fieldContainer, syncContainer;
@@ -484,7 +484,7 @@ wp.textWidgets = ( function( $ ) {
*
* @param {jQuery.Event} event - Event.
* @param {jQuery} widgetContainer - Widget container element.
* @returns {void}
* @return {void}
*/
component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) {
var widgetForm, widgetId, widgetControl, idBase;
@@ -513,7 +513,7 @@ wp.textWidgets = ( function( $ ) {
*
* @memberOf wp.textWidgets
*
* @returns {void}
* @return {void}
*/
component.init = function init() {
var $document = $( document );

View File

@@ -41,7 +41,7 @@
* @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed
* from the text.
*
* @return void
* @return {void}
*/
function WordCounter( settings ) {
var key,