Changeset 63556
- Timestamp:
- 09/09/2026 12:02:40 PM (2 months ago)
- Location:
- trunk
- Files:
-
- 22 edited
-
.eslintrc-jsdoc.js (modified) (1 diff)
-
Gruntfile.js (modified) (6 diffs)
-
src/js/_enqueues/admin/password-toggle.js (modified) (2 diffs)
-
src/js/_enqueues/admin/plugin-install.js (modified) (5 diffs)
-
src/js/_enqueues/admin/privacy-tools.js (modified) (11 diffs)
-
src/js/_enqueues/admin/site-health.js (modified) (4 diffs)
-
src/js/_enqueues/admin/tags-suggest.js (modified) (3 diffs)
-
src/js/_enqueues/admin/user-profile.js (modified) (7 diffs)
-
src/js/_enqueues/lib/embed-template.js (modified) (2 diffs)
-
src/js/_enqueues/lib/link.js (modified) (2 diffs)
-
src/js/_enqueues/lib/nav-menu.js (modified) (4 diffs)
-
src/js/_enqueues/lib/quicktags.js (modified) (2 diffs)
-
src/js/_enqueues/wp/api-request.js (modified) (2 diffs)
-
src/js/_enqueues/wp/autosave.js (modified) (1 diff)
-
src/js/_enqueues/wp/custom-header.js (modified) (1 diff)
-
src/js/_enqueues/wp/customize/controls.js (modified) (16 diffs)
-
src/js/_enqueues/wp/customize/widgets.js (modified) (1 diff)
-
src/js/_enqueues/wp/editor/base.js (modified) (2 diffs)
-
src/js/_enqueues/wp/editor/dfw.js (modified) (2 diffs)
-
src/js/_enqueues/wp/embed.js (modified) (1 diff)
-
src/js/_enqueues/wp/mce-view.js (modified) (6 diffs)
-
src/js/_enqueues/wp/theme-plugin-editor.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.eslintrc-jsdoc.js
r63525 r63556 57 57 'jsdoc/check-syntax': 'error', 58 58 'jsdoc/require-description': 'error', 59 'jsdoc/require-jsdoc': 'error', 59 60 }, 60 61 }, -
trunk/Gruntfile.js
r63464 r63556 155 155 }; 156 156 157 // Load grunt-* tasks. 157 /** 158 * Loads the Grunt tasks for the given dependency. 159 * 160 * @param {string} dependency The name of the Grunt task to load. 161 */ 158 162 function loadGruntTasks( dependency ) { 159 163 var contrib = key === 'contrib' ? 'contrib-' : ''; … … 1798 1802 ] ); 1799 1803 1804 /** 1805 * Searches for the first version control directory in the given set. 1806 * 1807 * @param {string[]} set Array of directory paths to check. 1808 */ 1800 1809 function find( set ) { 1801 1810 var dir; … … 1810 1819 } 1811 1820 1821 /** 1822 * Runs all tasks. 1823 */ 1812 1824 function runAllTasks() { 1813 1825 grunt.log.writeln( 'Cannot determine which files are modified as SVN and GIT are not available.' ); … … 1825 1837 } 1826 1838 1839 /** 1840 * Determines which precommit tasks to run based on modified files detected by version control. 1841 * 1842 * @param {string} type The version control type: 'git' or 'svn'. 1843 */ 1827 1844 function run( type ) { 1828 1845 var command = map[ type ].split( ' ' ); … … 1834 1851 var taskList = []; 1835 1852 1836 // Callback for finding modified paths. 1853 /** 1854 * Checks if the given path appears in the version control status output. 1855 * 1856 * @param {string} path The path to check. 1857 * @return {boolean} True if the path is found, false otherwise. 1858 */ 1837 1859 function testPath( path ) { 1838 1860 var regex = new RegExp( ' ' + path + '$', 'm' ); … … 1840 1862 } 1841 1863 1842 // Callback for finding modified files by extension. 1864 /** 1865 * Checks if files with the given extension appear in the version control status output. 1866 * 1867 * @param {string} extension The file extension to check for. 1868 * @return {boolean} True if the file with the given extension is found, false otherwise. 1869 */ 1843 1870 function testExtension( extension ) { 1844 1871 var regex = new RegExp( '\.' + extension + '$', 'm' ); -
trunk/src/js/_enqueues/admin/password-toggle.js
r56008 r63556 1 /** 2 * @output wp-admin/js/password-toggle.js 3 */ 4 1 5 /** 2 6 * Adds functionality for password visibility buttons to toggle between text and password input types. 3 7 * 4 8 * @since 6.3.0 5 * @output wp-admin/js/password-toggle.js6 9 */ 7 8 10 ( function () { 9 11 var toggleElements, status, input, icon, label, __ = wp.i18n.__; … … 16 18 } ); 17 19 20 /** 21 * Toggles the password input field visibility. 22 */ 18 23 function togglePassword() { 19 24 status = this.getAttribute( 'data-toggle' ); -
trunk/src/js/_enqueues/admin/plugin-install.js
r62691 r63556 7 7 /* global tb_click, tb_remove, tb_position */ 8 8 9 /** 10 * Initializes the plugin install screens. 11 * 12 * @param {JQueryStatic} $ The jQuery object. 13 */ 9 14 jQuery( function( $ ) { 10 15 … … 79 84 }); 80 85 86 /** 87 * Initializes the plugin details modal dialog after the iframe has fully loaded. 88 */ 81 89 function iframeLoaded() { 82 90 var $iframe = tbWindow.find( '#TB_iframeContent' ); … … 110 118 } 111 119 112 /* 113 * Get the tabbable elements and detach/attach the keydown event. 120 /** 121 * Gets the tabbable elements and detaches/attaches the keydown event. 122 * 114 123 * Called after the iframe has fully loaded so we have all the elements we need. 115 124 * Called again each time a Tab gets clicked. … … 134 143 } 135 144 136 // Constrain tabbing within the plugin modal dialog. 145 /** 146 * Constrains tabbing within the plugin modal dialog. 147 * 148 * @param {JQuery.Event} event The keydown event. 149 */ 137 150 function constrainTabbing( event ) { 138 151 if ( 9 !== event.which ) { … … 149 162 } 150 163 151 /* 152 * Open the Plugin details modal. The event is delegated to get also the links 153 * in the plugins search tab, after the Ajax search rebuilds the HTML. It's 154 * delegated on the closest ancestor and not on the body to avoid conflicts 155 * with other handlers, see Trac ticket #43082. 164 /** 165 * Opens the Plugin details modal. 166 * 167 * The event is delegated to get also the links in the plugins search tab, 168 * after the Ajax search rebuilds the HTML. It's delegated on the closest 169 * ancestor and not on the body to avoid conflicts with other handlers, see 170 * Trac ticket #43082. 156 171 */ 157 172 $( '.wrap' ).on( 'click', '.thickbox.open-plugin-details-modal', function( e ) { -
trunk/src/js/_enqueues/admin/privacy-tools.js
r62663 r63556 1 1 /** 2 * Interactions used by the User Privacy tools in WordPress.3 *4 2 * @output wp-admin/js/privacy-tools.js 5 3 */ 6 4 7 // Privacy request action handling. 5 /** 6 * Sets the interactions used by the User Privacy tools in WordPress. 7 * 8 * @param {jQueryStatic} $ The jQuery object. 9 */ 8 10 jQuery( function( $ ) { 9 11 var __ = wp.i18n.__, 10 12 copiedNoticeTimeout; 11 13 14 /** 15 * Sets the state of the action. 16 * 17 * @param {jQuery} $action The action to set the state for. 18 * @param {string} state The state to set the action to. 19 * @return {void} 20 */ 12 21 function setActionState( $action, state ) { 13 22 $action.children().addClass( 'hidden' ); … … 15 24 } 16 25 26 /** 27 * Clears any results row after the request row. 28 * 29 * @param {jQuery} $requestRow The request row to clear results for. 30 * @return {void} 31 */ 17 32 function clearResultsAfterRow( $requestRow ) { 18 33 $requestRow.removeClass( 'has-request-results' ); … … 23 38 } 24 39 40 /** 41 * Appends a results row after the request row. 42 * 43 * @param {jQuery} $requestRow The request row to append the results after. 44 * @param {string} classes The classes to add to the results row. 45 * @param {string} summaryMessage The summary message to display in the results row. 46 * @param {string[]} additionalMessages Additional messages to display in the results row. 47 * @return {void} 48 */ 25 49 function appendResultsAfterRow( $requestRow, classes, summaryMessage, additionalMessages ) { 26 50 var itemList = '', … … 77 101 setExportProgress( 0 ); 78 102 103 /** 104 * Handles a successful export. 105 * 106 * @param {string} zipUrl The URL of the generated ZIP file, if available. 107 * @return {void} 108 */ 79 109 function onExportDoneSuccess( zipUrl ) { 80 110 var summaryMessage = __( 'This user’s personal data export link was sent.' ); … … 97 127 } 98 128 129 /** 130 * Handles an export failure. 131 * 132 * @param {string} errorMessage The error message to display. 133 * @return {void} 134 */ 99 135 function onExportFailure( errorMessage ) { 100 136 var summaryMessage = __( 'An error occurred while attempting to export personal data.' ); … … 109 145 } 110 146 147 /** 148 * Updates the progress of the export process. 149 * 150 * @param {number} exporterIndex The index of the exporter to process. 151 * @return {void} 152 */ 111 153 function setExportProgress( exporterIndex ) { 112 154 var progress = ( exportersCount > 0 ? exporterIndex / exportersCount : 0 ), … … 116 158 } 117 159 160 /** 161 * Performs the next export request. 162 * 163 * @param {number} exporterIndex The index of the exporter to process. 164 * @param {number} pageIndex The index of the page to process for the current exporter. 165 * @return {void} 166 */ 118 167 function doNextExport( exporterIndex, pageIndex ) { 119 168 $.ajax( … … 182 231 setErasureProgress( 0 ); 183 232 233 /** 234 * Handles a successful erasure. 235 * 236 * @return {void} 237 */ 184 238 function onErasureDoneSuccess() { 185 239 var summaryMessage = __( 'No personal data was found for this user.' ), … … 208 262 } 209 263 264 /** 265 * Handles an erasure failure. 266 */ 210 267 function onErasureFailure() { 211 268 var summaryMessage = __( 'An error occurred while attempting to find and erase personal data.' ); … … 218 275 } 219 276 277 /** 278 * Updates the progress of the erasure process. 279 * 280 * @param {number} eraserIndex The index of the eraser to process. 281 * @return {void} 282 */ 220 283 function setErasureProgress( eraserIndex ) { 221 284 var progress = ( erasersCount > 0 ? eraserIndex / erasersCount : 0 ), … … 225 288 } 226 289 290 /** 291 * Performs the next erasure request. 292 * 293 * @param {number} eraserIndex The index of the eraser to process. 294 * @param {number} pageIndex The index of the page to process for the current eraser. 295 * @return {void} 296 */ 227 297 function doNextErasure( eraserIndex, pageIndex ) { 228 298 $.ajax({ -
trunk/src/js/_enqueues/admin/site-health.js
r63406 r63556 1 1 /** 2 * Interactions used by the Site Health modules in WordPress.3 *4 2 * @output wp-admin/js/site-health.js 5 3 */ … … 7 5 /* global ajaxurl, ClipboardJS, SiteHealth, wp */ 8 6 7 /** 8 * Handles the interactions used by the Site Health modules in WordPress. 9 * 10 * @param {JQueryStatic} $ The jQuery object. 11 */ 9 12 jQuery( function( $ ) { 10 13 … … 394 397 } 395 398 399 /** 400 * Get the sizes of the directories in the Site Health Info section. 401 */ 396 402 function getDirectorySizes() { 397 403 var timestamp = ( new Date().getTime() ); … … 435 441 } 436 442 443 /** 444 * Updates the directory sizes in the Site Health Info section. 445 * 446 * @param {Object} data The directory sizes data. 447 */ 437 448 function updateDirSizes( data ) { 438 449 var copyButton = $( 'button.button.copy-button' ); -
trunk/src/js/_enqueues/admin/tags-suggest.js
r63406 r63556 1 /** 2 * @output wp-admin/js/tags-suggest.js 3 */ 4 1 5 /** 2 6 * Default settings for jQuery UI Autocomplete for use with non-hierarchical taxonomies. 3 *4 * @output wp-admin/js/tags-suggest.js5 7 * 6 8 * @param {JQueryStatic} $ The jQuery object. … … 13 15 sprintf = wp.i18n.sprintf; 14 16 17 /** 18 * Splits a string into an array of terms based on the separator. 19 * 20 * @param {string} val The string to split. 21 * @return {string[]} An array of terms. 22 */ 15 23 function split( val ) { 16 24 return val.split( new RegExp( separator + '\\s*' ) ); 17 25 } 18 26 27 /** 28 * Gets the last term from a string based on the separator. 29 * 30 * @param {string} term The string to get the last term from. 31 * @return {string} The last term. 32 */ 19 33 function getLast( term ) { 20 34 return split( term ).pop(); … … 22 36 23 37 /** 24 * Add UI Autocomplete to an input or textarea element with presets for use38 * Adds UI Autocomplete to an input or textarea element with presets for use 25 39 * with non-hierarchical taxonomies. 26 40 * -
trunk/src/js/_enqueues/admin/user-profile.js
r63514 r63556 33 33 isFirefox = ua.indexOf( 'firefox' ) !== -1; 34 34 35 /** 36 * Generates a password and updates the password input field. 37 * 38 * If zxcvbn is not yet loaded, it will wait and try again. If the password 39 * input field is empty or the password wrapper is open, it will set the 40 * password to the generated value. If the user has already entered a 41 * password, it will check the strength of that password. It also binds 42 * the toggle button to show or hide the password and sets the initial state 43 * of the toggle button based on whether the password should be masked or 44 * not. Finally, it updates the label for confirming weak passwords. 45 */ 35 46 function generatePassword() { 36 47 if ( typeof zxcvbn !== 'function' ) { … … 68 79 } 69 80 81 /** 82 * Binds the password input field to update the current password and refresh the password strength area when the user types in the field. 83 */ 70 84 function bindPass1() { 71 85 currentPass = $pass1.val(); … … 90 104 } 91 105 106 /** 107 * Resets the toggle button to show or hide the password. 108 * 109 * @param {boolean} show Whether to show the password or not. 110 */ 92 111 function resetToggle( show ) { 93 112 $toggleButton … … 103 122 } 104 123 124 /** 125 * Binds the toggle button to show or hide the password. Also ensures that the password input type is set to password when the form is submitted. 126 */ 105 127 function bindToggleButton() { 106 128 if ( !! $toggleButton ) { … … 194 216 } 195 217 218 /** 219 * Initializes the password form, including the password strength meter, weak password checkbox, and show/hide password toggle button. 220 */ 196 221 function bindPasswordForm() { 197 222 var $generateButton, … … 310 335 } 311 336 337 /** 338 * Sets CSS classes to the password strength results based on the password strength. 339 */ 312 340 function check_pass_strength() { 313 341 var pass1 = $('#pass1').val(), strength; … … 415 443 } 416 444 445 /** 446 * Toggles the visibility of the weak password checkbox. 447 */ 417 448 function showOrHideWeakPasswordCheckbox() { 418 449 var passStrengthResult = $('#pass-strength-result'); -
trunk/src/js/_enqueues/lib/embed-template.js
r63403 r63556 6 6 * IIFE setup function. 7 7 * 8 * @param {Window} window Global window object.9 * @param {Document} document Global document object.8 * @param {Window} window The global window object. 9 * @param {Document} document The global document object. 10 10 */ 11 11 (function ( window, document ) { … … 18 18 resizing; 19 19 20 /** 21 * Sends a message to the parent window. 22 * 23 * @param {string} message The message type (e.g., 'height', 'link'). 24 * @param {*} value The message value. Type depends on message (number for height, string for link). 25 */ 20 26 function sendEmbedMessage( message, value ) { 21 27 window.parent.postMessage( { -
trunk/src/js/_enqueues/lib/link.js
r59696 r63556 3 3 */ 4 4 5 /* global wpLink */ 6 5 /* global wpLink */ 6 7 /** 8 * The WordPress Link Modal dialog. 9 * 10 * @param {JQueryStatic} $ The jQuery object. 11 * @param {Object} wpLinkL10n The WordPress Link localization object. 12 * @param {Object} wp The WordPress global object. 13 */ 7 14 ( function( $, wpLinkL10n, wp ) { 8 15 var editor, searchTimer, River, Query, correctedURL, … … 13 20 isTouch = ( 'ontouchend' in document ); 14 21 22 /** 23 * Gets the currently selected link in the editor. 24 * 25 * @return {JQuery} The currently selected link element. 26 */ 15 27 function getLink() { 16 28 if ( editor ) { -
trunk/src/js/_enqueues/lib/nav-menu.js
r63514 r63556 1014 1014 }); 1015 1015 1016 /** 1017 * Updates the shared variables used to determine the depth of the menu item being moved. 1018 * 1019 * @param {Object} ui The jQuery UI object for the menu item being moved. 1020 */ 1016 1021 function updateSharedVars(ui) { 1017 1022 var depth; … … 1034 1039 } 1035 1040 1041 /** 1042 * Updates the current depth of the menu item being moved. 1043 * 1044 * @param {Object} ui The jQuery UI object for the menu item being moved. 1045 * @param {number} depth The new depth of the menu item being moved. 1046 * @return {void} 1047 */ 1036 1048 function updateCurrentDepth(ui, depth) { 1037 1049 ui.placeholder.updateDepthClass( depth, currentDepth ); … … 1039 1051 } 1040 1052 1053 /** 1054 * Determines the initial menu max depth class on the body element. 1055 * 1056 * @return {number} The initial menu max depth. 1057 */ 1041 1058 function initialMenuMaxDepth() { 1042 1059 if( ! body[0].className ) return 0; … … 1045 1062 } 1046 1063 1064 /** 1065 * Updates the menu max depth class on the body element. 1066 * 1067 * @param {number} depthChange The change in depth of the menu item being moved. 1068 * @return {void} 1069 */ 1047 1070 function updateMenuMaxDepth( depthChange ) { 1048 1071 var depth, newDepth = menuMaxDepth; -
trunk/src/js/_enqueues/lib/quicktags.js
r63407 r63556 234 234 }; 235 235 236 /** 237 * Escapes HTML special characters in a string. 238 * 239 * @param {string} text The string to escape. 240 * @return {string} The escaped string. 241 */ 236 242 function _escape( text ) { 237 243 text = text || ''; … … 249 255 var t = this; 250 256 257 /** 258 * Initializes the Quicktags buttons for a specific instance. 259 * 260 * @param {string} instanceId The ID of the Quicktags instance to initialize buttons for. 261 */ 251 262 function _init( instanceId ) { 252 263 var canvas, name, settings, theButtons, html, ed, id, i, use, -
trunk/src/js/_enqueues/wp/api-request.js
r63514 r63556 22 22 var wpApiSettings = window.wpApiSettings; 23 23 24 /** 25 * Makes an API request. 26 * 27 * @param {Object} options The options for the API request. 28 * @param {string} [options.url] The full URL for the request. 29 * @param {string} [options.path] The API path (e.g., 'wp/v2/posts'). Used if url is not provided. 30 * @param {string} [options.namespace] The API namespace (e.g., 'wp/v2'). Used with endpoint to build path. 31 * @param {string} [options.endpoint] The API endpoint (e.g., 'posts'). Used with namespace to build path. 32 * @param {string} [options.method] The HTTP method (GET, POST, PUT, DELETE, etc.). 33 * @param {Object} [options.data] The request data to send. 34 * @param {string} [options.data._wpnonce] Nonce for security. 35 * @param {Object} [options.headers] Custom headers to include in the request. 36 * @return {JQueryXHR} The jQuery XHR object. 37 */ 24 38 function apiRequest( options ) { 25 39 options = apiRequest.buildAjaxOptions( options ); … … 27 41 } 28 42 43 /** 44 * Builds the options for the jQuery.ajax request. 45 * 46 * @param {Object} options The options for the API request. 47 * @param {string} [options.url] The full URL for the request. 48 * @param {string} [options.path] The API path (e.g., 'wp/v2/posts'). Used if url is not provided. 49 * @param {string} [options.namespace] The API namespace (e.g., 'wp/v2'). Used with endpoint to build path. 50 * @param {string} [options.endpoint] The API endpoint (e.g., 'posts'). Used with namespace to build path. 51 * @param {string} [options.method] The HTTP method (GET, POST, PUT, DELETE, etc.). 52 * @param {Object} [options.data] The request data to send. 53 * @param {Object} [options.headers] Custom headers to include in the request. 54 * @return {Object} The options for the jQuery.ajax request. 55 */ 29 56 apiRequest.buildAjaxOptions = function( options ) { 30 57 var url = options.url; -
trunk/src/js/_enqueues/wp/autosave.js
r63407 r63556 450 450 */ 451 451 function compare( str1, str2 ) { 452 /** 453 * Removes all whitespace characters from a string. 454 * 455 * @param {string} string The string to remove whitespace from. 456 * @return {string} The string without whitespace characters. 457 */ 452 458 function removeSpaces( string ) { 453 459 return string.toString().replace(/[\x20\t\r\n\f]+/g, ''); -
trunk/src/js/_enqueues/wp/custom-header.js
r63407 r63556 245 245 var prop; 246 246 247 /** 248 * Creates a custom handler instance. 249 * 250 * @return {CustomHandler} A custom handler instance, when called with new. 251 */ 247 252 function CustomHandler() { 248 253 var result = BaseHandler.apply( this, arguments ); -
trunk/src/js/_enqueues/wp/customize/controls.js
r63525 r63556 844 844 ); 845 845 846 /** 847 * Cancels the reminder, preventing the button from being highlighted. 848 */ 846 849 function cancelReminder() { 847 850 canceled = true; … … 1982 1985 }); 1983 1986 1987 /** 1988 * Updates the section header to reflect the expanded state. 1989 */ 1984 1990 function updateSelectedState() { 1985 1991 var el = section.headerContainer.find( '.customize-themes-section-title' ); … … 2026 2032 } 2027 2033 2034 /** 2035 * Expands the section. 2036 */ 2028 2037 function expand() { 2029 2038 … … 2626 2635 .focus(); 2627 2636 2637 /** 2638 * Disables the switch buttons if the theme cannot be switched to. 2639 * 2640 * @return {boolean} True if the switch buttons should be disabled, false otherwise. 2641 */ 2628 2642 function disableSwitchButtons() { 2629 2643 return ! panel.canSwitchTheme( theme.id ); … … 2631 2645 2632 2646 // Temporary special function since supplying SFTP credentials does not work yet. See #42184. 2647 /** 2648 * Disables the install buttons if the theme cannot be installed or if filesystem credentials are needed. 2649 * 2650 * @return {boolean} True if the install buttons should be disabled, false otherwise. 2651 */ 2633 2652 function disableInstallButtons() { 2634 2653 return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded; … … 3138 3157 } 3139 3158 3159 /** 3160 * Toggles the theme switch unavailable notification based on whether switching is possible. 3161 */ 3140 3162 function toggleDisabledNotifications() { 3141 3163 if ( panel.canSwitchTheme() ) { … … 5216 5238 var control = this, panel = api.panel( 'themes' ); 5217 5239 5240 /** 5241 * Disables the preview buttons if the theme cannot be switched to. 5242 * 5243 * @return {boolean} True if the preview buttons should be disabled, false otherwise. 5244 */ 5218 5245 function disableSwitchButtons() { 5219 5246 return ! panel.canSwitchTheme( control.params.theme.id ); … … 5221 5248 5222 5249 // Temporary special function since supplying SFTP credentials does not work yet. See #42184. 5250 /** 5251 * Disables the install buttons if the theme cannot be installed or if filesystem credentials are needed. 5252 * 5253 * @return {boolean} True if the install buttons should be disabled, false otherwise. 5254 */ 5223 5255 function disableInstallButtons() { 5224 5256 return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded; 5225 5257 } 5258 5259 /** 5260 * Updates the state of the preview and install buttons based on whether the theme can be switched to or installed. 5261 */ 5226 5262 function updateButtons() { 5227 5263 control.container.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() ); … … 7337 7373 section.active.bind( updateButtonsState ); 7338 7374 7375 /** 7376 * Highlights the schedule button to remind the user to schedule the changes. 7377 */ 7339 7378 function highlightScheduleButton() { 7340 7379 if ( ! cancelScheduleButtonReminder ) { … … 7351 7390 } 7352 7391 } 7392 7393 /** 7394 * Cancels the highlight reminder for the schedule button. 7395 */ 7353 7396 function cancelHighlightScheduleButton() { 7354 7397 if ( cancelScheduleButtonReminder ) { … … 7592 7635 api.state( 'saving' ).set( true ); 7593 7636 7637 /** 7638 * Captures a setting as modified during the save process. 7639 * 7640 * @param {wp.customize.Setting} setting The setting that was modified. 7641 */ 7594 7642 function captureSettingModifiedDuringSave( setting ) { 7595 7643 modifiedWhileSaving[ setting.id ] = true; … … 8934 8982 var isInsideIframe = false; 8935 8983 8984 /** 8985 * Determine whether the Customizer is in a clean state. 8986 * 8987 * @return {boolean} True if the Customizer is in a clean state, false otherwise. 8988 */ 8936 8989 function isCleanState() { 8937 8990 var defaultChangesetStatus; … … 8970 9023 }); 8971 9024 9025 /** 9026 * Starts prompting the user before unloading the Customizer if there are unsaved changes. 9027 */ 8972 9028 function startPromptingBeforeUnload() { 8973 9029 api.unbind( 'change', startPromptingBeforeUnload ); … … 8989 9045 api.state( 'selectedChangesetDate' ).bind( startPromptingBeforeUnload ); 8990 9046 9047 /** 9048 * Requests to close the Customizer, prompting the user to save changes if necessary. 9049 * 9050 * @return {JQuery.Promise} A promise that resolves if the user is cleared to close the Customizer, or rejects if the user cancels the close. 9051 */ 8991 9052 function requestClose() { 8992 9053 var clearedToClose = $.Deferred(), dismissAutoSave = false, dismissLock = false; … … 9378 9439 } ); 9379 9440 9380 // Autosave changeset. 9441 /** 9442 * Starts autosaving changeset when a change is made. 9443 */ 9381 9444 function startAutosaving() { 9382 9445 var timeoutId, updateChangesetWithReschedule, scheduleChangesetUpdate, updatePending = false; … … 9384 9447 api.unbind( 'change', startAutosaving ); // Ensure startAutosaving only fires once. 9385 9448 9449 /** 9450 * Handles changes to the saved state of the changeset. 9451 * 9452 * @param {boolean} isSaved Whether the changeset is saved or not. 9453 */ 9386 9454 function onChangeSaved( isSaved ) { 9387 9455 if ( ! isSaved && ! api.settings.changeset.autosaved ) { -
trunk/src/js/_enqueues/wp/customize/widgets.js
r63525 r63556 2359 2359 function focusConstructWithBreadcrumb( focusConstruct, returnConstruct ) { 2360 2360 focusConstruct.focus(); 2361 /** 2362 * Determines whether to return focus to the returnConstruct after the focusConstruct is collapsed. 2363 * 2364 * @param {boolean} isExpanded Whether the focusConstruct is expanded. 2365 */ 2361 2366 function onceCollapsed( isExpanded ) { 2362 2367 if ( ! isExpanded ) { -
trunk/src/js/_enqueues/wp/editor/base.js
r63407 r63556 5 5 window.wp = window.wp || {}; 6 6 7 /** 8 * The editor functionality. 9 * 10 * @param {JQueryStatic} $ The jQuery object. 11 * @param {Object} wp The WordPress global object. 12 */ 7 13 ( function( $, wp ) { 8 14 wp.editor = wp.editor || {}; … … 18 24 exports = {}; 19 25 26 /** 27 * Initializes the editor utility functions. 28 */ 20 29 function init() { 21 30 if ( ! tinymce && window.tinymce ) { -
trunk/src/js/_enqueues/wp/editor/dfw.js
r63514 r63556 1361 1361 var position = document.activeElement.compareDocumentPosition( $editor.get( 0 ) ); 1362 1362 1363 /** 1364 * Determines whether the passed element has focus. 1365 * 1366 * @param {jQuery} $el The element to check for focus. 1367 * @return {boolean} True if the element has focus, false otherwise. 1368 */ 1363 1369 function hasFocus( $el ) { 1364 1370 return $.contains( $el.get( 0 ), document.activeElement ); … … 1525 1531 var mceBind, mceUnbind; 1526 1532 1533 /** 1534 * Tracks when the TinyMCE editor receives focus. 1535 */ 1527 1536 function focus() { 1528 1537 editorHasFocus = true; 1529 1538 } 1530 1539 1540 /** 1541 * Tracks when the TinyMCE editor loses focus. 1542 */ 1531 1543 function blur() { 1532 1544 editorHasFocus = false; -
trunk/src/js/_enqueues/wp/embed.js
r63407 r63556 88 88 }; 89 89 90 /** 91 * Initializes the embed script on DOMContentLoaded. 92 */ 90 93 function onLoad() { 91 94 var iframes = document.querySelectorAll( 'iframe.wp-embedded-content' ), -
trunk/src/js/_enqueues/wp/mce-view.js
r63407 r63556 5 5 /* global tinymce */ 6 6 7 /* 7 /** 8 8 * The TinyMCE view API. 9 9 * … … 26 26 * |- registered view 27 27 * | |- ... 28 * 29 * @param {Window} window The global window object. 30 * @param {Object} wp The WordPress global object. 31 * @param {Object} shortcode The shortcode API. 32 * @param {JQueryStatic} $ The jQuery object. 28 33 */ 29 34 ( function( window, wp, shortcode, $ ) { … … 616 621 iframeDoc.close(); 617 622 623 /** 624 * Resizes the iframe to fit its content. 625 */ 618 626 function resize() { 619 627 var $iframe; … … 644 652 } 645 653 654 /** 655 * Adds a MutationObserver to the iframe's body to watch for changes and resize accordingly. 656 */ 646 657 function addObserver() { 647 658 observer = new MutationObserver( _.debounce( resize, 100 ) ); … … 764 775 } )( window, window.wp, window.wp.shortcode, window.jQuery ); 765 776 766 /* 777 /** 767 778 * The WordPress core TinyMCE views. 779 * 768 780 * Views for the gallery, audio, video, playlist and embed shortcodes, 769 781 * and a view for embeddable URLs. 782 * 783 * @param {Window} window The global window object. 784 * @param {Object} views The wp.mce.views object. 785 * @param {Object} media The wp.media object. 786 * @param {JQueryStatic} $ The jQuery object. 770 787 */ 771 788 ( function( window, views, media, $ ) { … … 773 790 schema, parser, serializer; 774 791 792 /** 793 * Verifies that a given string is valid HTML. 794 * 795 * @param {string} string The string to verify. 796 * @return {string} The verified string. 797 */ 775 798 function verifyHTML( string ) { 776 799 var settings = {}; -
trunk/src/js/_enqueues/wp/theme-plugin-editor.js
r63407 r63556 419 419 editor.codemirror.on( 'change', component.onChange ); 420 420 421 /** 422 * Handles the save shortcut (Ctrl+S / Cmd+S). 423 */ 421 424 function onSaveShortcut() { 422 425 component.form.trigger( 'submit' ); … … 602 605 _char = event.key; 603 606 607 /** 608 * Determines whether a character is a printable character. 609 * 610 * @param {string} str The character to check. 611 * @return {boolean} True if the character is printable, false otherwise. 612 */ 604 613 function isPrintableCharacter(str) { 605 614 return str.length === 1 && str.match(/\S/); 606 615 } 607 616 617 /** 618 * Handles printable character key press. 619 * 620 * @param {TreeitemLink} item The tree item link instance. 621 * @return {void} 622 */ 608 623 function printableCharacter(item) { 609 624 if (_char == '*') { … … 809 824 810 825 TreeLinks.prototype.init = function () { 811 826 /** 827 * Finds all treeitems and groups and creates object instances. 828 * 829 * @param {Element} node The DOM node to search for treeitems. 830 * @param {TreeLinks} tree The TreeLinks instance. 831 * @param {TreeitemLink|boolean} group The parent TreeitemLink instance or false if there is no parent. 832 * @return {void} 833 */ 812 834 function findTreeitems(node, tree, group) { 813 835
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)