-
diff --git jsdoc.conf.json jsdoc.conf.json
index b9282788b..be602827a 100644
|
|
|
|
| 2 | 2 | "plugins": [], |
| 3 | 3 | "recurseDepth": 10, |
| 4 | 4 | "source": { |
| 5 | | "include": ["src/wp-includes/js"], |
| | 5 | "include": [ |
| | 6 | "src/wp-includes/js", |
| | 7 | "src/wp-admin/js" |
| | 8 | ], |
| 6 | 9 | "exclude": [ |
| | 10 | "src/wp-includes/js/codemirror", |
| 7 | 11 | "src/wp-includes/js/tinymce", |
| 8 | 12 | "src/wp-includes/js/crop", |
| 9 | 13 | "src/wp-includes/js/imgareaselect", |
| 10 | 14 | "src/wp-includes/js/jcrop", |
| 11 | 15 | "src/wp-includes/js/jquery", |
| 12 | | "src/wp-includes/js/mediaelement", |
| | 16 | "src/wp-includes/js/mediaelement/mediaelement.js", |
| | 17 | "src/wp-includes/js/mediaelement/mediaelement-and-player.js", |
| | 18 | "src/wp-includes/js/plupload/handlers.js", |
| | 19 | "src/wp-includes/js/plupload/moxie.js", |
| | 20 | "src/wp-includes/js/plupload/plupload.full.min.js", |
| | 21 | "src/wp-includes/js/plupload/plupload.js", |
| 13 | 22 | "src/wp-includes/js/swfupload", |
| 14 | 23 | "src/wp-includes/js/thickbox", |
| 15 | 24 | "src/wp-includes/js/media-audiovideo.js", |
| … |
… |
|
| 35 | 44 | }, |
| 36 | 45 | "opts": { |
| 37 | 46 | "template": "./node_modules/ink-docstrap/template", |
| 38 | | "recurse": true |
| | 47 | "recurse": true, |
| | 48 | "private": true |
| 39 | 49 | } |
| 40 | 50 | } |
-
diff --git src/wp-admin/js/code-editor.js src/wp-admin/js/code-editor.js
index 5c826726f..3710c3723 100644
|
|
|
|
| 1 | 1 | if ( 'undefined' === typeof window.wp ) { |
| | 2 | /** |
| | 3 | * @namespace wp |
| | 4 | */ |
| 2 | 5 | window.wp = {}; |
| 3 | 6 | } |
| 4 | 7 | if ( 'undefined' === typeof window.wp.codeEditor ) { |
| | 8 | /** |
| | 9 | * @namespace wp.codeEditor |
| | 10 | */ |
| 5 | 11 | window.wp.codeEditor = {}; |
| 6 | 12 | } |
| 7 | 13 | |
| … |
… |
if ( 'undefined' === typeof window.wp.codeEditor ) { |
| 33 | 39 | * @param {object} settings.codeMirror - Settings for CodeMirror. |
| 34 | 40 | * @param {Function} settings.onChangeLintingErrors - Callback for when there are changes to linting errors. |
| 35 | 41 | * @param {Function} settings.onUpdateErrorNotice - Callback to update error notice. |
| | 42 | * |
| 36 | 43 | * @returns {void} |
| 37 | 44 | */ |
| 38 | 45 | function configureLinting( editor, settings ) { // eslint-disable-line complexity |
| … |
… |
if ( 'undefined' === typeof window.wp.codeEditor ) { |
| 202 | 209 | * @param {object} settings.codeMirror - Settings for CodeMirror. |
| 203 | 210 | * @param {Function} settings.onTabNext - Callback to handle tabbing to the next tabbable element. |
| 204 | 211 | * @param {Function} settings.onTabPrevious - Callback to handle tabbing to the previous tabbable element. |
| | 212 | * |
| 205 | 213 | * @returns {void} |
| 206 | 214 | */ |
| 207 | 215 | function configureTabbing( codemirror, settings ) { |
| … |
… |
if ( 'undefined' === typeof window.wp.codeEditor ) { |
| 240 | 248 | } |
| 241 | 249 | |
| 242 | 250 | /** |
| 243 | | * @typedef {object} CodeEditorInstance |
| | 251 | * @typedef {object} wp.codeEditor~CodeEditorInstance |
| 244 | 252 | * @property {object} settings - The code editor settings. |
| 245 | 253 | * @property {CodeMirror} codemirror - The CodeMirror instance. |
| 246 | 254 | */ |
| … |
… |
if ( 'undefined' === typeof window.wp.codeEditor ) { |
| 260 | 268 | * @param {object} [settings.csslint] - Rules for CSSLint. |
| 261 | 269 | * @param {object} [settings.htmlhint] - Rules for HTMLHint. |
| 262 | 270 | * @param {object} [settings.jshint] - Rules for JSHint. |
| | 271 | * |
| 263 | 272 | * @returns {CodeEditorInstance} Instance. |
| 264 | 273 | */ |
| 265 | 274 | wp.codeEditor.initialize = function initialize( textarea, settings ) { |
-
diff --git src/wp-admin/js/color-picker.js src/wp-admin/js/color-picker.js
index 7574820c6..8b4bc603f 100644
|
|
|
|
| 14 | 14 | * |
| 15 | 15 | * Creates a jQuery UI color picker that is used in the theme customizer. |
| 16 | 16 | * |
| | 17 | * @class $.widget.wp.wpColorPicker |
| | 18 | * |
| 17 | 19 | * @since 3.5.0 |
| 18 | 20 | */ |
| 19 | | ColorPicker = { |
| | 21 | ColorPicker = /** @lends $.widget.wp.wpColorPicker.prototype */{ |
| 20 | 22 | options: { |
| 21 | 23 | defaultColor: false, |
| 22 | 24 | change: false, |
| … |
… |
|
| 56 | 58 | /** |
| 57 | 59 | * @summary Handles the onChange event if one has been defined in the options. |
| 58 | 60 | * |
| | 61 | * @ignore |
| | 62 | * |
| 59 | 63 | * @param {Event} event The event that's being called. |
| 60 | 64 | * @param {HTMLElement} ui The HTMLElement containing the color picker. |
| 61 | 65 | * |
| … |
… |
|
| 179 | 183 | * |
| 180 | 184 | * @since 3.5.0 |
| 181 | 185 | * |
| | 186 | * @ignore |
| | 187 | * |
| 182 | 188 | * @param {Event} event The event that's being called. |
| 183 | 189 | * @param {HTMLElement} ui The HTMLElement containing the color picker. |
| 184 | 190 | * |
-
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 5151a1269..802574300 100644
|
|
|
|
| 2 | 2 | (function( exports, $ ){ |
| 3 | 3 | var Container, focus, normalizedTransitionendEventName, api = wp.customize; |
| 4 | 4 | |
| 5 | | /** |
| 6 | | * A notification that is displayed in a full-screen overlay. |
| 7 | | * |
| 8 | | * @since 4.9.0 |
| 9 | | * @class |
| 10 | | * @augments wp.customize.Notification |
| 11 | | */ |
| 12 | | api.OverlayNotification = api.Notification.extend({ |
| | 5 | api.OverlayNotification = api.Notification.extend(/** @lends wp.customize.OverlayNotification.prototype */{ |
| 13 | 6 | |
| 14 | 7 | /** |
| 15 | 8 | * Whether the notification should show a loading spinner. |
| … |
… |
|
| 20 | 13 | loading: false, |
| 21 | 14 | |
| 22 | 15 | /** |
| 23 | | * Initialize. |
| | 16 | * A notification that is displayed in a full-screen overlay. |
| | 17 | * |
| | 18 | * @constructs wp.customize.OverlayNotification |
| | 19 | * @augments wp.customize.Notification |
| 24 | 20 | * |
| 25 | 21 | * @since 4.9.0 |
| 26 | 22 | * |
| … |
… |
|
| 68 | 64 | } |
| 69 | 65 | }); |
| 70 | 66 | |
| 71 | | /** |
| 72 | | * A collection of observable notifications. |
| 73 | | * |
| 74 | | * @since 4.9.0 |
| 75 | | * @class |
| 76 | | * @augments wp.customize.Values |
| 77 | | */ |
| 78 | | api.Notifications = api.Values.extend({ |
| | 67 | api.Notifications = api.Values.extend(/** @lends wp.customize.Notifications.prototype */{ |
| 79 | 68 | |
| 80 | 69 | /** |
| 81 | 70 | * Whether the alternative style should be used. |
| … |
… |
|
| 94 | 83 | defaultConstructor: api.Notification, |
| 95 | 84 | |
| 96 | 85 | /** |
| 97 | | * Initialize notifications area. |
| | 86 | * A collection of observable notifications. |
| 98 | 87 | * |
| 99 | 88 | * @since 4.9.0 |
| 100 | | * @constructor |
| | 89 | * |
| | 90 | * @constructs wp.customize.Notifications |
| | 91 | * @augments wp.customize.Values |
| | 92 | * |
| 101 | 93 | * @param {object} options - Options. |
| 102 | 94 | * @param {jQuery} [options.container] - Container element for notifications. This can be injected later. |
| 103 | 95 | * @param {boolean} [options.alt] - Whether alternative style should be used when rendering notifications. |
| | 96 | * |
| 104 | 97 | * @returns {void} |
| 105 | | * @this {wp.customize.Notifications} |
| 106 | 98 | */ |
| 107 | 99 | initialize: function( options ) { |
| 108 | 100 | var collection = this; |
| … |
… |
|
| 181 | 173 | * @param {object} args - Args. |
| 182 | 174 | * @param {boolean} [args.sort=false] - Whether to return the notifications sorted. |
| 183 | 175 | * @return {Array.<wp.customize.Notification>} Notifications. |
| 184 | | * @this {wp.customize.Notifications} |
| 185 | 176 | */ |
| 186 | 177 | get: function( args ) { |
| 187 | 178 | var collection = this, notifications, errorTypePriorities, params; |
| … |
… |
|
| 217 | 208 | * |
| 218 | 209 | * @since 4.9.0 |
| 219 | 210 | * @returns {void} |
| 220 | | * @this {wp.customize.Notifications} |
| 221 | 211 | */ |
| 222 | 212 | render: function() { |
| 223 | 213 | var collection = this, |
| … |
… |
|
| 340 | 330 | } |
| 341 | 331 | }); |
| 342 | 332 | |
| 343 | | /** |
| 344 | | * A Customizer Setting. |
| 345 | | * |
| 346 | | * A setting is WordPress data (theme mod, option, menu, etc.) that the user can |
| 347 | | * draft changes to in the Customizer. |
| 348 | | * |
| 349 | | * @see PHP class WP_Customize_Setting. |
| 350 | | * |
| 351 | | * @since 3.4.0 |
| 352 | | * @class |
| 353 | | * @augments wp.customize.Value |
| 354 | | * @augments wp.customize.Class |
| 355 | | */ |
| 356 | | api.Setting = api.Value.extend({ |
| | 333 | api.Setting = api.Value.extend(/** @lends wp.customize.Setting.prototype */{ |
| 357 | 334 | |
| 358 | 335 | /** |
| 359 | 336 | * Default params. |
| … |
… |
|
| 367 | 344 | }, |
| 368 | 345 | |
| 369 | 346 | /** |
| 370 | | * Initialize. |
| | 347 | * A Customizer Setting. |
| | 348 | * |
| | 349 | * A setting is WordPress data (theme mod, option, menu, etc.) that the user can |
| | 350 | * draft changes to in the Customizer. |
| | 351 | * |
| | 352 | * @see PHP class WP_Customize_Setting. |
| | 353 | * |
| | 354 | * @constructs wp.customize.Setting |
| | 355 | * @augments wp.customize.Value |
| 371 | 356 | * |
| 372 | 357 | * @since 3.4.0 |
| 373 | 358 | * |
| … |
… |
|
| 448 | 433 | /** |
| 449 | 434 | * Current change count. |
| 450 | 435 | * |
| | 436 | * @alias wp.customize._latestRevision |
| | 437 | * |
| 451 | 438 | * @since 4.7.0 |
| 452 | 439 | * @type {number} |
| 453 | 440 | * @protected |
| … |
… |
|
| 457 | 444 | /** |
| 458 | 445 | * Last revision that was saved. |
| 459 | 446 | * |
| | 447 | * @alias wp.customize._lastSavedRevision |
| | 448 | * |
| 460 | 449 | * @since 4.7.0 |
| 461 | 450 | * @type {number} |
| 462 | 451 | * @protected |
| … |
… |
|
| 466 | 455 | /** |
| 467 | 456 | * Latest revisions associated with the updated setting. |
| 468 | 457 | * |
| | 458 | * @alias wp.customize._latestSettingRevision |
| | 459 | * |
| 469 | 460 | * @since 4.7.0 |
| 470 | 461 | * @type {object} |
| 471 | 462 | * @protected |
| … |
… |
|
| 495 | 486 | /** |
| 496 | 487 | * Get the dirty setting values. |
| 497 | 488 | * |
| | 489 | * @alias wp.customize.dirtyValues |
| | 490 | * |
| 498 | 491 | * @since 4.7.0 |
| 499 | 492 | * @access public |
| 500 | 493 | * |
| … |
… |
|
| 526 | 519 | /** |
| 527 | 520 | * Request updates to the changeset. |
| 528 | 521 | * |
| | 522 | * @alias wp.customize.requestChangesetUpdate |
| | 523 | * |
| 529 | 524 | * @since 4.7.0 |
| 530 | 525 | * @access public |
| 531 | 526 | * |
| … |
… |
|
| 661 | 656 | /** |
| 662 | 657 | * Watch all changes to Value properties, and bubble changes to parent Values instance |
| 663 | 658 | * |
| | 659 | * @alias wp.customize.utils.bubbleChildValueChanges |
| | 660 | * |
| 664 | 661 | * @since 4.1.0 |
| 665 | 662 | * |
| 666 | 663 | * @param {wp.customize.Class} instance |
| … |
… |
|
| 679 | 676 | /** |
| 680 | 677 | * Expand a panel, section, or control and focus on the first focusable element. |
| 681 | 678 | * |
| | 679 | * @alias wp.customize~focus |
| | 680 | * |
| 682 | 681 | * @since 4.1.0 |
| 683 | 682 | * |
| 684 | 683 | * @param {Object} [params] |
| … |
… |
|
| 726 | 725 | * |
| 727 | 726 | * If a.priority() === b.priority(), then sort by their respective params.instanceNumber. |
| 728 | 727 | * |
| | 728 | * @alias wp.customize.utils.prioritySort |
| | 729 | * |
| 729 | 730 | * @since 4.1.0 |
| 730 | 731 | * |
| 731 | 732 | * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a |
| … |
… |
|
| 743 | 744 | /** |
| 744 | 745 | * Return whether the supplied Event object is for a keydown event but not the Enter key. |
| 745 | 746 | * |
| | 747 | * @alias wp.customize.utils.isKeydownButNotEnterEvent |
| | 748 | * |
| 746 | 749 | * @since 4.1.0 |
| 747 | 750 | * |
| 748 | 751 | * @param {jQuery.Event} event |
| … |
… |
|
| 755 | 758 | /** |
| 756 | 759 | * Return whether the two lists of elements are the same and are in the same order. |
| 757 | 760 | * |
| | 761 | * @alias wp.customize.utils.areElementListsEqual |
| | 762 | * |
| 758 | 763 | * @since 4.1.0 |
| 759 | 764 | * |
| 760 | 765 | * @param {Array|jQuery} listA |
| … |
… |
|
| 781 | 786 | * UI element, after an optional delay. If the user focuses the element |
| 782 | 787 | * before the delay passes, the reminder is canceled. |
| 783 | 788 | * |
| | 789 | * @alias wp.customize.utils.highlightButton |
| | 790 | * |
| 784 | 791 | * @since 4.9.0 |
| 785 | 792 | * |
| 786 | 793 | * @param {jQuery} button - The element to highlight. |
| … |
… |
|
| 834 | 841 | * |
| 835 | 842 | * Same functionality as the `current_time( 'mysql', false )` function in PHP. |
| 836 | 843 | * |
| | 844 | * @alias wp.customize.utils.getCurrentTimestamp |
| | 845 | * |
| 837 | 846 | * @since 4.9.0 |
| 838 | 847 | * |
| 839 | 848 | * @returns {int} Current timestamp. |
| … |
… |
|
| 851 | 860 | /** |
| 852 | 861 | * Get remaining time of when the date is set. |
| 853 | 862 | * |
| | 863 | * @alias wp.customize.utils.getRemainingTime |
| | 864 | * |
| 854 | 865 | * @since 4.9.0 |
| 855 | 866 | * |
| 856 | 867 | * @param {string|int|Date} datetime - Date time or timestamp of the future date. |
| … |
… |
|
| 876 | 887 | * |
| 877 | 888 | * @since 4.7.0 |
| 878 | 889 | * |
| | 890 | * @ignore |
| | 891 | * |
| 879 | 892 | * @returns {string|null} Normalized `transitionend` event name or null if CSS transitions are not supported. |
| 880 | 893 | */ |
| 881 | 894 | normalizedTransitionendEventName = (function () { |
| … |
… |
|
| 897 | 910 | } |
| 898 | 911 | })(); |
| 899 | 912 | |
| 900 | | /** |
| 901 | | * Base class for Panel and Section. |
| 902 | | * |
| 903 | | * @since 4.1.0 |
| 904 | | * |
| 905 | | * @class |
| 906 | | * @augments wp.customize.Class |
| 907 | | */ |
| 908 | | Container = api.Class.extend({ |
| | 913 | Container = api.Class.extend(/** @lends wp.customize~Container.prototype */{ |
| 909 | 914 | defaultActiveArguments: { duration: 'fast', completeCallback: $.noop }, |
| 910 | 915 | defaultExpandedArguments: { duration: 'fast', completeCallback: $.noop }, |
| 911 | 916 | containerType: 'container', |
| … |
… |
|
| 920 | 925 | }, |
| 921 | 926 | |
| 922 | 927 | /** |
| | 928 | * Base class for Panel and Section. |
| | 929 | * |
| | 930 | * @constructs wp.customize~Container |
| | 931 | * @augments wp.customize.Class |
| | 932 | * |
| 923 | 933 | * @since 4.1.0 |
| 924 | 934 | * |
| | 935 | * @borrows wp.customize~focus as focus |
| | 936 | * |
| 925 | 937 | * @param {string} id - The ID for the container. |
| 926 | 938 | * @param {object} options - Object containing one property: params. |
| 927 | 939 | * @param {string} options.title - Title shown when panel is collapsed and expanded. |
| … |
… |
|
| 999 | 1011 | * |
| 1000 | 1012 | * @since 4.9.0 |
| 1001 | 1013 | * @returns {jQuery} Notification container element. |
| 1002 | | * @this {wp.customize.Control} |
| 1003 | 1014 | */ |
| 1004 | 1015 | getNotificationsContainerElement: function() { |
| 1005 | 1016 | var container = this; |
| … |
… |
|
| 1305 | 1316 | } ); |
| 1306 | 1317 | }, |
| 1307 | 1318 | |
| 1308 | | /** |
| 1309 | | * Bring the container into view and then expand this and bring it into view |
| 1310 | | * @param {Object} [params] |
| | 1319 | /* |
| | 1320 | * is documented using @borrows in the constructor. |
| 1311 | 1321 | */ |
| 1312 | 1322 | focus: focus, |
| 1313 | 1323 | |
| … |
… |
|
| 1370 | 1380 | } |
| 1371 | 1381 | }); |
| 1372 | 1382 | |
| 1373 | | /** |
| 1374 | | * @since 4.1.0 |
| 1375 | | * |
| 1376 | | * @class |
| 1377 | | * @augments wp.customize.Class |
| 1378 | | */ |
| 1379 | | api.Section = Container.extend({ |
| | 1383 | api.Section = Container.extend(/** @lends wp.customize.Section.prototype */{ |
| 1380 | 1384 | containerType: 'section', |
| 1381 | 1385 | containerParent: '#customize-theme-controls', |
| 1382 | 1386 | containerPaneParent: '.customize-pane-parent', |
| … |
… |
|
| 1393 | 1397 | }, |
| 1394 | 1398 | |
| 1395 | 1399 | /** |
| | 1400 | * @constructs wp.customize.Section |
| | 1401 | * @augments wp.customize~Container |
| | 1402 | * |
| 1396 | 1403 | * @since 4.1.0 |
| 1397 | 1404 | * |
| 1398 | 1405 | * @param {string} id - The ID for the section. |
| … |
… |
|
| 1654 | 1661 | } |
| 1655 | 1662 | }); |
| 1656 | 1663 | |
| 1657 | | /** |
| 1658 | | * wp.customize.ThemesSection |
| 1659 | | * |
| 1660 | | * Custom section for themes that loads themes by category, and also |
| 1661 | | * handles the theme-details view rendering and navigation. |
| 1662 | | * |
| 1663 | | * @constructor |
| 1664 | | * @augments wp.customize.Section |
| 1665 | | * @augments wp.customize.Container |
| 1666 | | */ |
| 1667 | | api.ThemesSection = api.Section.extend({ |
| | 1664 | api.ThemesSection = api.Section.extend(/** @lends wp.customize.ThemesSection.prototype */{ |
| 1668 | 1665 | currentTheme: '', |
| 1669 | 1666 | overlay: '', |
| 1670 | 1667 | template: '', |
| … |
… |
|
| 1683 | 1680 | updateCountDebounced: null, |
| 1684 | 1681 | |
| 1685 | 1682 | /** |
| 1686 | | * Initialize. |
| | 1683 | * wp.customize.ThemesSection |
| | 1684 | * |
| | 1685 | * Custom section for themes that loads themes by category, and also |
| | 1686 | * handles the theme-details view rendering and navigation. |
| | 1687 | * |
| | 1688 | * @constructs wp.customize.ThemesSection |
| | 1689 | * @augments wp.customize.Section |
| 1687 | 1690 | * |
| 1688 | 1691 | * @since 4.9.0 |
| 1689 | 1692 | * |
| … |
… |
|
| 2627 | 2630 | } |
| 2628 | 2631 | }); |
| 2629 | 2632 | |
| 2630 | | /** |
| 2631 | | * Class wp.customize.OuterSection. |
| 2632 | | * |
| 2633 | | * Creates section outside of the sidebar, there is no ui to trigger collapse/expand so |
| 2634 | | * it would require custom handling. |
| 2635 | | * |
| 2636 | | * @since 4.9 |
| 2637 | | * |
| 2638 | | * @constructor |
| 2639 | | * @augments wp.customize.Section |
| 2640 | | * @augments wp.customize.Container |
| 2641 | | */ |
| 2642 | | api.OuterSection = api.Section.extend({ |
| | 2633 | api.OuterSection = api.Section.extend(/** @lends wp.customize.OuterSection.prototype */{ |
| 2643 | 2634 | |
| 2644 | 2635 | /** |
| 2645 | | * Initialize. |
| | 2636 | * Class wp.customize.OuterSection. |
| | 2637 | * |
| | 2638 | * Creates section outside of the sidebar, there is no ui to trigger collapse/expand so |
| | 2639 | * it would require custom handling. |
| | 2640 | * |
| | 2641 | * @constructs wp.customize.OuterSection |
| | 2642 | * @augments wp.customize.Section |
| 2646 | 2643 | * |
| 2647 | 2644 | * @since 4.9.0 |
| 2648 | 2645 | * |
| … |
… |
|
| 2746 | 2743 | } |
| 2747 | 2744 | }); |
| 2748 | 2745 | |
| 2749 | | /** |
| 2750 | | * @since 4.1.0 |
| 2751 | | * |
| 2752 | | * @class |
| 2753 | | * @augments wp.customize.Class |
| 2754 | | */ |
| 2755 | | api.Panel = Container.extend({ |
| | 2746 | api.Panel = Container.extend(/** @lends wp.customize.Panel.prototype */{ |
| 2756 | 2747 | containerType: 'panel', |
| 2757 | 2748 | |
| 2758 | 2749 | /** |
| | 2750 | * @constructs wp.customize.Panel |
| | 2751 | * @augments wp.customize~Container |
| | 2752 | * |
| 2759 | 2753 | * @since 4.1.0 |
| 2760 | 2754 | * |
| 2761 | 2755 | * @param {string} id - The ID for the panel. |
| … |
… |
|
| 3020 | 3014 | } |
| 3021 | 3015 | }); |
| 3022 | 3016 | |
| 3023 | | /** |
| 3024 | | * Class wp.customize.ThemesPanel. |
| 3025 | | * |
| 3026 | | * Custom section for themes that displays without the customize preview. |
| 3027 | | * |
| 3028 | | * @constructor |
| 3029 | | * @augments wp.customize.Panel |
| 3030 | | * @augments wp.customize.Container |
| 3031 | | */ |
| 3032 | | api.ThemesPanel = api.Panel.extend({ |
| | 3017 | api.ThemesPanel = api.Panel.extend(/** @lends wp.customize.ThemsPanel.prototype */{ |
| 3033 | 3018 | |
| 3034 | 3019 | /** |
| 3035 | | * Initialize. |
| | 3020 | * Class wp.customize.ThemesPanel. |
| | 3021 | * |
| | 3022 | * Custom section for themes that displays without the customize preview. |
| | 3023 | * |
| | 3024 | * @constructs wp.customize.ThemesPanel |
| | 3025 | * @augments wp.customize.Panel |
| 3036 | 3026 | * |
| 3037 | 3027 | * @since 4.9.0 |
| 3038 | 3028 | * |
| … |
… |
|
| 3451 | 3441 | } |
| 3452 | 3442 | }); |
| 3453 | 3443 | |
| 3454 | | /** |
| 3455 | | * A Customizer Control. |
| 3456 | | * |
| 3457 | | * A control provides a UI element that allows a user to modify a Customizer Setting. |
| 3458 | | * |
| 3459 | | * @see PHP class WP_Customize_Control. |
| 3460 | | * |
| 3461 | | * @class |
| 3462 | | * @augments wp.customize.Class |
| 3463 | | */ |
| 3464 | | api.Control = api.Class.extend({ |
| | 3444 | api.Control = api.Class.extend(/** @lends wp.customize.Control.prototype */{ |
| 3465 | 3445 | defaultActiveArguments: { duration: 'fast', completeCallback: $.noop }, |
| 3466 | 3446 | |
| 3467 | 3447 | /** |
| … |
… |
|
| 3478 | 3458 | }, |
| 3479 | 3459 | |
| 3480 | 3460 | /** |
| 3481 | | * Initialize. |
| | 3461 | * A Customizer Control. |
| | 3462 | * |
| | 3463 | * A control provides a UI element that allows a user to modify a Customizer Setting. |
| | 3464 | * |
| | 3465 | * @see PHP class WP_Customize_Control. |
| | 3466 | * |
| | 3467 | * @constructs wp.customize.Control |
| | 3468 | * @augments wp.customize.Class |
| | 3469 | * |
| | 3470 | * @borrows wp.customize~focus as focus |
| | 3471 | * @borrows wp.customize~Container.prototype.activate as activate |
| | 3472 | * @borrows wp.customize~Container.prototype.deactivate as deactivate |
| | 3473 | * @borrows wp.customize~Container.prototype._toggleActive as _toggleActive |
| 3482 | 3474 | * |
| 3483 | 3475 | * @param {string} id - Unique identifier for the control instance. |
| 3484 | 3476 | * @param {object} options - Options hash for the control instance. |
| … |
… |
|
| 3744 | 3736 | * |
| 3745 | 3737 | * @since 4.6.0 |
| 3746 | 3738 | * @returns {jQuery} Setting validation message element. |
| 3747 | | * @this {wp.customize.Control} |
| 3748 | 3739 | */ |
| 3749 | 3740 | getNotificationsContainerElement: function() { |
| 3750 | 3741 | var control = this, controlTitle, notificationsContainer; |
| … |
… |
|
| 3888 | 3879 | api.section( this.section() ).expand( params ); |
| 3889 | 3880 | }, |
| 3890 | 3881 | |
| 3891 | | /** |
| 3892 | | * Bring the containing section and panel into view and then |
| 3893 | | * this control into view, focusing on the first input. |
| | 3882 | /* |
| | 3883 | * Documented using @borrows in the constructor. |
| 3894 | 3884 | */ |
| 3895 | 3885 | focus: focus, |
| 3896 | 3886 | |
| … |
… |
|
| 3934 | 3924 | return this.onChangeActive( active, this.defaultActiveArguments ); |
| 3935 | 3925 | }, |
| 3936 | 3926 | |
| 3937 | | /** |
| 3938 | | * Shorthand way to enable the active state. |
| 3939 | | * |
| 3940 | | * @since 4.1.0 |
| 3941 | | * |
| 3942 | | * @param {Object} [params] |
| 3943 | | * @returns {Boolean} false if already active |
| | 3927 | /* |
| | 3928 | * Documented using @borrows in the constructor |
| 3944 | 3929 | */ |
| 3945 | 3930 | activate: Container.prototype.activate, |
| 3946 | 3931 | |
| 3947 | | /** |
| 3948 | | * Shorthand way to disable the active state. |
| 3949 | | * |
| 3950 | | * @since 4.1.0 |
| 3951 | | * |
| 3952 | | * @param {Object} [params] |
| 3953 | | * @returns {Boolean} false if already inactive |
| | 3932 | /* |
| | 3933 | * Documented using @borrows in the constructor |
| 3954 | 3934 | */ |
| 3955 | 3935 | deactivate: Container.prototype.deactivate, |
| 3956 | 3936 | |
| 3957 | | /** |
| 3958 | | * Re-use _toggleActive from Container class. |
| 3959 | | * |
| 3960 | | * @access private |
| | 3937 | /* |
| | 3938 | * Documented using @borrows in the constructor |
| 3961 | 3939 | */ |
| 3962 | 3940 | _toggleActive: Container.prototype._toggleActive, |
| 3963 | 3941 | |
| … |
… |
|
| 4131 | 4109 | /** |
| 4132 | 4110 | * A colorpicker control. |
| 4133 | 4111 | * |
| 4134 | | * @class |
| | 4112 | * @class wp.customize.ColorControl |
| 4135 | 4113 | * @augments wp.customize.Control |
| 4136 | | * @augments wp.customize.Class |
| 4137 | 4114 | */ |
| 4138 | | api.ColorControl = api.Control.extend({ |
| | 4115 | api.ColorControl = api.Control.extend(/** @lends wp.customize.ColorControl.prototype */{ |
| 4139 | 4116 | ready: function() { |
| 4140 | 4117 | var control = this, |
| 4141 | 4118 | isHueSlider = this.params.mode === 'hue', |
| … |
… |
|
| 4195 | 4172 | /** |
| 4196 | 4173 | * A control that implements the media modal. |
| 4197 | 4174 | * |
| 4198 | | * @class |
| | 4175 | * @class wp.customize.MediaControl |
| 4199 | 4176 | * @augments wp.customize.Control |
| 4200 | | * @augments wp.customize.Class |
| 4201 | 4177 | */ |
| 4202 | | api.MediaControl = api.Control.extend({ |
| | 4178 | api.MediaControl = api.Control.extend(/** @lends wp.customize.MediaControl.prototype */{ |
| 4203 | 4179 | |
| 4204 | 4180 | /** |
| 4205 | 4181 | * When the control's DOM structure is ready, |
| … |
… |
|
| 4384 | 4360 | /** |
| 4385 | 4361 | * An upload control, which utilizes the media modal. |
| 4386 | 4362 | * |
| 4387 | | * @class |
| | 4363 | * @class wp.customize.UploadControl |
| 4388 | 4364 | * @augments wp.customize.MediaControl |
| 4389 | | * @augments wp.customize.Control |
| 4390 | | * @augments wp.customize.Class |
| 4391 | 4365 | */ |
| 4392 | | api.UploadControl = api.MediaControl.extend({ |
| | 4366 | api.UploadControl = api.MediaControl.extend(/** @lends wp.customize.UploadControl.prototype */{ |
| 4393 | 4367 | |
| 4394 | 4368 | /** |
| 4395 | 4369 | * Callback handler for when an attachment is selected in the media modal. |
| … |
… |
|
| 4428 | 4402 | * This control no longer needs to do anything more |
| 4429 | 4403 | * than what the upload control does in JS. |
| 4430 | 4404 | * |
| 4431 | | * @class |
| | 4405 | * @class wp.customize.ImageControl |
| 4432 | 4406 | * @augments wp.customize.UploadControl |
| 4433 | | * @augments wp.customize.MediaControl |
| 4434 | | * @augments wp.customize.Control |
| 4435 | | * @augments wp.customize.Class |
| 4436 | 4407 | */ |
| 4437 | | api.ImageControl = api.UploadControl.extend({ |
| | 4408 | api.ImageControl = api.UploadControl.extend(/** @lends wp.customize.ImageControl.prototype */{ |
| 4438 | 4409 | // @deprecated |
| 4439 | 4410 | thumbnailSrc: function() {} |
| 4440 | 4411 | }); |
| … |
… |
|
| 4442 | 4413 | /** |
| 4443 | 4414 | * A control for uploading background images. |
| 4444 | 4415 | * |
| 4445 | | * @class |
| | 4416 | * @class wp.customize.BackgroundControl |
| 4446 | 4417 | * @augments wp.customize.UploadControl |
| 4447 | | * @augments wp.customize.MediaControl |
| 4448 | | * @augments wp.customize.Control |
| 4449 | | * @augments wp.customize.Class |
| 4450 | 4418 | */ |
| 4451 | | api.BackgroundControl = api.UploadControl.extend({ |
| | 4419 | api.BackgroundControl = api.UploadControl.extend(/** @lends wp.customize.BackgroundControl.prototype */{ |
| 4452 | 4420 | |
| 4453 | 4421 | /** |
| 4454 | 4422 | * When the control's DOM structure is ready, |
| … |
… |
|
| 4479 | 4447 | * |
| 4480 | 4448 | * @since 4.7.0 |
| 4481 | 4449 | * |
| 4482 | | * @class |
| | 4450 | * @class wp.customize.BackgroundPositionControl |
| 4483 | 4451 | * @augments wp.customize.Control |
| 4484 | | * @augments wp.customize.Class |
| 4485 | 4452 | */ |
| 4486 | | api.BackgroundPositionControl = api.Control.extend( { |
| | 4453 | api.BackgroundPositionControl = api.Control.extend(/** @lends wp.customize.BackgroundPositionControl.prototype */{ |
| 4487 | 4454 | |
| 4488 | 4455 | /** |
| 4489 | 4456 | * Set up control UI once embedded in DOM and settings are created. |
| … |
… |
|
| 4518 | 4485 | /** |
| 4519 | 4486 | * A control for selecting and cropping an image. |
| 4520 | 4487 | * |
| 4521 | | * @class |
| | 4488 | * @class wp.customize.CroppedImageControl |
| 4522 | 4489 | * @augments wp.customize.MediaControl |
| 4523 | | * @augments wp.customize.Control |
| 4524 | | * @augments wp.customize.Class |
| 4525 | 4490 | */ |
| 4526 | | api.CroppedImageControl = api.MediaControl.extend({ |
| | 4491 | api.CroppedImageControl = api.MediaControl.extend(/** @lends wp.customize.CroppedImageControl.prototype */{ |
| 4527 | 4492 | |
| 4528 | 4493 | /** |
| 4529 | 4494 | * Open the media modal to the library state. |
| … |
… |
|
| 4720 | 4685 | /** |
| 4721 | 4686 | * A control for selecting and cropping Site Icons. |
| 4722 | 4687 | * |
| 4723 | | * @class |
| | 4688 | * @class wp.customize.SiteIconControl |
| 4724 | 4689 | * @augments wp.customize.CroppedImageControl |
| 4725 | | * @augments wp.customize.MediaControl |
| 4726 | | * @augments wp.customize.Control |
| 4727 | | * @augments wp.customize.Class |
| 4728 | 4690 | */ |
| 4729 | | api.SiteIconControl = api.CroppedImageControl.extend({ |
| | 4691 | api.SiteIconControl = api.CroppedImageControl.extend(/** @lends wp.customize.SiteIconControl.prototype */{ |
| 4730 | 4692 | |
| 4731 | 4693 | /** |
| 4732 | 4694 | * Create a media modal select frame, and store it so the instance can be reused when needed. |
| … |
… |
|
| 4841 | 4803 | }); |
| 4842 | 4804 | |
| 4843 | 4805 | /** |
| 4844 | | * @class |
| | 4806 | * @class wp.customize.HeaderControl |
| 4845 | 4807 | * @augments wp.customize.Control |
| 4846 | | * @augments wp.customize.Class |
| 4847 | 4808 | */ |
| 4848 | | api.HeaderControl = api.Control.extend({ |
| | 4809 | api.HeaderControl = api.Control.extend(/** @lends wp.customize.HeaderControl.prototype */{ |
| 4849 | 4810 | ready: function() { |
| 4850 | 4811 | this.btnRemove = $('#customize-control-header_image .actions .remove'); |
| 4851 | 4812 | this.btnNew = $('#customize-control-header_image .actions .new'); |
| … |
… |
|
| 5111 | 5072 | /** |
| 5112 | 5073 | * wp.customize.ThemeControl |
| 5113 | 5074 | * |
| 5114 | | * @constructor |
| | 5075 | * @class wp.customize.ThemeControl |
| 5115 | 5076 | * @augments wp.customize.Control |
| 5116 | | * @augments wp.customize.Class |
| 5117 | 5077 | */ |
| 5118 | | api.ThemeControl = api.Control.extend({ |
| | 5078 | api.ThemeControl = api.Control.extend(/** @lends wp.customize.ThemeControl.prototype */{ |
| 5119 | 5079 | |
| 5120 | 5080 | touchDrag: false, |
| 5121 | 5081 | screenshotRendered: false, |
| … |
… |
|
| 5263 | 5223 | * |
| 5264 | 5224 | * @since 4.9.0 |
| 5265 | 5225 | * |
| 5266 | | * @constructor |
| | 5226 | * @class wp.customize.CodeEditorControl |
| 5267 | 5227 | * @augments wp.customize.Control |
| 5268 | | * @augments wp.customize.Class |
| 5269 | 5228 | */ |
| 5270 | | api.CodeEditorControl = api.Control.extend({ |
| | 5229 | api.CodeEditorControl = api.Control.extend(/** @lends wp.customize.CodeEditorControl.prototype */{ |
| 5271 | 5230 | |
| 5272 | 5231 | /** |
| 5273 | 5232 | * Initialize. |
| … |
… |
|
| 5584 | 5543 | * Class wp.customize.DateTimeControl. |
| 5585 | 5544 | * |
| 5586 | 5545 | * @since 4.9.0 |
| 5587 | | * @constructor |
| | 5546 | * @class wp.customize.DateTimeControl |
| 5588 | 5547 | * @augments wp.customize.Control |
| 5589 | | * @augments wp.customize.Class |
| 5590 | 5548 | */ |
| 5591 | | api.DateTimeControl = api.Control.extend({ |
| | 5549 | api.DateTimeControl = api.Control.extend(/** @lends wp.customize.DateTimeControl.prototype */{ |
| 5592 | 5550 | |
| 5593 | 5551 | /** |
| 5594 | 5552 | * Initialize behaviors. |
| … |
… |
|
| 5939 | 5897 | * Class PreviewLinkControl. |
| 5940 | 5898 | * |
| 5941 | 5899 | * @since 4.9.0 |
| 5942 | | * @constructor |
| | 5900 | * @class wp.customize.DateTimeControl |
| 5943 | 5901 | * @augments wp.customize.Control |
| 5944 | | * @augments wp.customize.Class |
| 5945 | 5902 | */ |
| 5946 | | api.PreviewLinkControl = api.Control.extend({ |
| | 5903 | api.PreviewLinkControl = api.Control.extend(/** @lends wp.customize.DateTimeControl.prototype */{ |
| 5947 | 5904 | |
| 5948 | 5905 | defaults: _.extend( {}, api.Control.prototype.defaults, { |
| 5949 | 5906 | templateId: 'customize-preview-link-control' |
| … |
… |
|
| 6057 | 6014 | } |
| 6058 | 6015 | }); |
| 6059 | 6016 | |
| 6060 | | // Change objects contained within the main customize object to Settings. |
| | 6017 | /** |
| | 6018 | * Change objects contained within the main customize object to Settings. |
| | 6019 | * |
| | 6020 | * @alias wp.customize.defaultConstructor |
| | 6021 | */ |
| 6061 | 6022 | api.defaultConstructor = api.Setting; |
| 6062 | 6023 | |
| 6063 | 6024 | /** |
| 6064 | 6025 | * Callback for resolved controls. |
| 6065 | 6026 | * |
| 6066 | | * @callback deferredControlsCallback |
| | 6027 | * @callback wp.customize.deferredControlsCallback |
| 6067 | 6028 | * @param {wp.customize.Control[]} Resolved controls. |
| 6068 | 6029 | */ |
| 6069 | 6030 | |
| 6070 | 6031 | /** |
| 6071 | 6032 | * Collection of all registered controls. |
| 6072 | 6033 | * |
| | 6034 | * @alias wp.customize.control |
| | 6035 | * |
| 6073 | 6036 | * @since 3.4.0 |
| 6074 | 6037 | * |
| 6075 | 6038 | * @type {Function} |
| … |
… |
|
| 6122 | 6085 | /** |
| 6123 | 6086 | * Callback for resolved sections. |
| 6124 | 6087 | * |
| 6125 | | * @callback deferredSectionsCallback |
| | 6088 | * @callback wp.customize.deferredSectionsCallback |
| 6126 | 6089 | * @param {wp.customize.Section[]} Resolved sections. |
| 6127 | 6090 | */ |
| 6128 | 6091 | |
| 6129 | 6092 | /** |
| 6130 | 6093 | * Collection of all registered sections. |
| 6131 | 6094 | * |
| | 6095 | * @alias wp.customize.section |
| | 6096 | * |
| 6132 | 6097 | * @since 3.4.0 |
| 6133 | 6098 | * |
| 6134 | 6099 | * @type {Function} |
| … |
… |
|
| 6154 | 6119 | /** |
| 6155 | 6120 | * Callback for resolved panels. |
| 6156 | 6121 | * |
| 6157 | | * @callback deferredPanelsCallback |
| | 6122 | * @callback wp.customize.deferredPanelsCallback |
| 6158 | 6123 | * @param {wp.customize.Panel[]} Resolved panels. |
| 6159 | 6124 | */ |
| 6160 | 6125 | |
| 6161 | 6126 | /** |
| 6162 | 6127 | * Collection of all registered panels. |
| 6163 | 6128 | * |
| | 6129 | * @alias wp.customize.panel |
| | 6130 | * |
| 6164 | 6131 | * @since 4.0.0 |
| 6165 | 6132 | * |
| 6166 | 6133 | * @type {Function} |
| … |
… |
|
| 6186 | 6153 | /** |
| 6187 | 6154 | * Callback for resolved notifications. |
| 6188 | 6155 | * |
| 6189 | | * @callback deferredNotificationsCallback |
| | 6156 | * @callback wp.customize.deferredNotificationsCallback |
| 6190 | 6157 | * @param {wp.customize.Notification[]} Resolved notifications. |
| 6191 | 6158 | */ |
| 6192 | 6159 | |
| 6193 | 6160 | /** |
| 6194 | 6161 | * Collection of all global notifications. |
| 6195 | 6162 | * |
| | 6163 | * @alias wp.customize.notifications |
| | 6164 | * |
| 6196 | 6165 | * @since 4.9.0 |
| 6197 | 6166 | * |
| 6198 | 6167 | * @type {Function} |
| … |
… |
|
| 6223 | 6192 | */ |
| 6224 | 6193 | api.notifications = new api.Notifications(); |
| 6225 | 6194 | |
| 6226 | | /** |
| 6227 | | * An object that fetches a preview in the background of the document, which |
| 6228 | | * allows for seamless replacement of an existing preview. |
| 6229 | | * |
| 6230 | | * @class |
| 6231 | | * @augments wp.customize.Messenger |
| 6232 | | * @augments wp.customize.Class |
| 6233 | | * @mixes wp.customize.Events |
| 6234 | | */ |
| 6235 | | api.PreviewFrame = api.Messenger.extend({ |
| | 6195 | api.PreviewFrame = api.Messenger.extend(/** @lends wp.customize.PreviewFrame.prototype */{ |
| 6236 | 6196 | sensitivity: null, // Will get set to api.settings.timeouts.previewFrameSensitivity. |
| 6237 | 6197 | |
| 6238 | 6198 | /** |
| 6239 | | * Initialize the PreviewFrame. |
| | 6199 | * An object that fetches a preview in the background of the document, which |
| | 6200 | * allows for seamless replacement of an existing preview. |
| | 6201 | * |
| | 6202 | * @constructs wp.customize.PreviewFrame |
| | 6203 | * @augments wp.customize.Messenger |
| 6240 | 6204 | * |
| 6241 | 6205 | * @param {object} params.container |
| 6242 | 6206 | * @param {object} params.previewUrl |
| … |
… |
|
| 6454 | 6418 | /** |
| 6455 | 6419 | * Set the document title of the customizer. |
| 6456 | 6420 | * |
| | 6421 | * @alias wp.customize.setDocumentTitle |
| | 6422 | * |
| 6457 | 6423 | * @since 4.1.0 |
| 6458 | 6424 | * |
| 6459 | 6425 | * @param {string} documentTitle |
| … |
… |
|
| 6466 | 6432 | api.trigger( 'title', title ); |
| 6467 | 6433 | }; |
| 6468 | 6434 | |
| 6469 | | /** |
| 6470 | | * @class |
| 6471 | | * @augments wp.customize.Messenger |
| 6472 | | * @augments wp.customize.Class |
| 6473 | | * @mixes wp.customize.Events |
| 6474 | | */ |
| 6475 | | api.Previewer = api.Messenger.extend({ |
| | 6435 | api.Previewer = api.Messenger.extend(/** @lends wp.customize.Previewer.prototype */{ |
| 6476 | 6436 | refreshBuffer: null, // Will get set to api.settings.timeouts.windowRefresh. |
| 6477 | 6437 | |
| 6478 | 6438 | /** |
| | 6439 | * @constructs wp.customize.Previewer |
| | 6440 | * @augments wp.customize.Messenger |
| | 6441 | * |
| 6479 | 6442 | * @param {array} params.allowedUrls |
| 6480 | 6443 | * @param {string} params.container A selector or jQuery element for the preview |
| 6481 | 6444 | * frame to be placed. |
| … |
… |
|
| 6929 | 6892 | * |
| 6930 | 6893 | * Add notifications to the settings and focus on the first control that has an invalid setting. |
| 6931 | 6894 | * |
| | 6895 | * @alias wp.customize._handleSettingValidities |
| | 6896 | * |
| 6932 | 6897 | * @since 4.6.0 |
| 6933 | 6898 | * @private |
| 6934 | 6899 | * |
| … |
… |
|
| 7004 | 6969 | /** |
| 7005 | 6970 | * Find all controls associated with the given settings. |
| 7006 | 6971 | * |
| | 6972 | * @alias wp.customize.findControlsForSettings |
| | 6973 | * |
| 7007 | 6974 | * @since 4.6.0 |
| 7008 | 6975 | * @param {string[]} settingIds Setting IDs. |
| 7009 | 6976 | * @returns {object<string, wp.customize.Control>} Mapping setting ids to arrays of controls. |
| … |
… |
|
| 7025 | 6992 | /** |
| 7026 | 6993 | * Sort panels, sections, controls by priorities. Hide empty sections and panels. |
| 7027 | 6994 | * |
| | 6995 | * @alias wp.customize.reflowPaneContents |
| | 6996 | * |
| 7028 | 6997 | * @since 4.1.0 |
| 7029 | 6998 | */ |
| 7030 | 6999 | api.reflowPaneContents = _.bind( function () { |
| … |
… |
|
| 7389 | 7358 | } |
| 7390 | 7359 | }); |
| 7391 | 7360 | |
| 7392 | | // Initialize Previewer |
| | 7361 | /** |
| | 7362 | * Initialize Previewer |
| | 7363 | * |
| | 7364 | * @alias wp.customize.previewer |
| | 7365 | */ |
| 7393 | 7366 | api.previewer = new api.Previewer({ |
| 7394 | 7367 | container: '#customize-preview', |
| 7395 | 7368 | form: '#customize-controls', |
| 7396 | 7369 | previewUrl: api.settings.url.preview, |
| 7397 | 7370 | allowedUrls: api.settings.url.allowed |
| 7398 | | }, { |
| | 7371 | },/** @lends wp.customize.previewer */{ |
| 7399 | 7372 | |
| 7400 | 7373 | nonce: api.settings.nonce, |
| 7401 | 7374 | |
| … |
… |
|
| 8098 | 8071 | */ |
| 8099 | 8072 | ( function checkAndDisplayLockNotice() { |
| 8100 | 8073 | |
| 8101 | | /** |
| 8102 | | * A notification that is displayed in a full-screen overlay with information about the locked changeset. |
| 8103 | | * |
| 8104 | | * @since 4.9.0 |
| 8105 | | * @class |
| 8106 | | * @augments wp.customize.Notification |
| 8107 | | * @augments wp.customize.OverlayNotification |
| 8108 | | */ |
| 8109 | | var LockedNotification = api.OverlayNotification.extend({ |
| | 8074 | var LockedNotification = api.OverlayNotification.extend(/** @lends wp.customize~LockedNotification.prototype */{ |
| 8110 | 8075 | |
| 8111 | 8076 | /** |
| 8112 | 8077 | * Template ID. |
| … |
… |
|
| 8123 | 8088 | lockUser: null, |
| 8124 | 8089 | |
| 8125 | 8090 | /** |
| 8126 | | * Initialize. |
| | 8091 | * A notification that is displayed in a full-screen overlay with information about the locked changeset. |
| | 8092 | * |
| | 8093 | * @constructs wp.customize~LockedNotification |
| | 8094 | * @augments wp.customize.Notification |
| 8127 | 8095 | * |
| 8128 | 8096 | * @since 4.9.0 |
| 8129 | 8097 | * |
-
diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
index 081807965..77fb6d60f 100644
|
|
|
|
| 13 | 13 | this.jQueryExtensions(); |
| 14 | 14 | }; |
| 15 | 15 | |
| | 16 | /** |
| | 17 | * @namespace wp.customize.Menus |
| | 18 | */ |
| 16 | 19 | api.Menus = api.Menus || {}; |
| 17 | 20 | |
| 18 | 21 | // Link settings. |
| … |
… |
|
| 35 | 38 | * Newly-created Nav Menus and Nav Menu Items have negative integer IDs which |
| 36 | 39 | * serve as placeholders until Save & Publish happens. |
| 37 | 40 | * |
| | 41 | * @alias wp.customize.Menus.generatePlaceholderAutoIncrementId |
| | 42 | * |
| 38 | 43 | * @return {number} |
| 39 | 44 | */ |
| 40 | 45 | api.Menus.generatePlaceholderAutoIncrementId = function() { |
| … |
… |
|
| 46 | 51 | * |
| 47 | 52 | * A single available menu item model. See PHP's WP_Customize_Nav_Menu_Item_Setting class. |
| 48 | 53 | * |
| 49 | | * @constructor |
| | 54 | * @class wp.customize.Menus.AvailableItemModel |
| 50 | 55 | * @augments Backbone.Model |
| 51 | 56 | */ |
| 52 | 57 | api.Menus.AvailableItemModel = Backbone.Model.extend( $.extend( |
| … |
… |
|
| 61 | 66 | * |
| 62 | 67 | * Collection for available menu item models. |
| 63 | 68 | * |
| 64 | | * @constructor |
| | 69 | * @class wp.customize.Menus.AvailableItemCollection |
| 65 | 70 | * @augments Backbone.Model |
| 66 | 71 | */ |
| 67 | | api.Menus.AvailableItemCollection = Backbone.Collection.extend({ |
| | 72 | api.Menus.AvailableItemCollection = Backbone.Collection.extend(/** @lends wp.customize.Menus.AvailableItemCollection.prototype */{ |
| 68 | 73 | model: api.Menus.AvailableItemModel, |
| 69 | 74 | |
| 70 | 75 | sort_key: 'order', |
| … |
… |
|
| 84 | 89 | * Insert a new `auto-draft` post. |
| 85 | 90 | * |
| 86 | 91 | * @since 4.7.0 |
| 87 | | * @access public |
| | 92 | * @alias wp.customize.Menus.insertAutoDraftPost |
| 88 | 93 | * |
| 89 | 94 | * @param {object} params - Parameters for the draft post to create. |
| 90 | 95 | * @param {string} params.post_type - Post type to add. |
| … |
… |
|
| 141 | 146 | return deferred.promise(); |
| 142 | 147 | }; |
| 143 | 148 | |
| 144 | | /** |
| 145 | | * wp.customize.Menus.AvailableMenuItemsPanelView |
| 146 | | * |
| 147 | | * View class for the available menu items panel. |
| 148 | | * |
| 149 | | * @constructor |
| 150 | | * @augments wp.Backbone.View |
| 151 | | * @augments Backbone.View |
| 152 | | */ |
| 153 | | api.Menus.AvailableMenuItemsPanelView = wp.Backbone.View.extend({ |
| | 149 | api.Menus.AvailableMenuItemsPanelView = wp.Backbone.View.extend(/** @lends wp.customize.Menus.AvailableMenuItemsPanelView.prototype */{ |
| 154 | 150 | |
| 155 | 151 | el: '#available-menu-items', |
| 156 | 152 | |
| … |
… |
|
| 181 | 177 | loading: false, |
| 182 | 178 | addingNew: false, |
| 183 | 179 | |
| | 180 | /** |
| | 181 | * wp.customize.Menus.AvailableMenuItemsPanelView |
| | 182 | * |
| | 183 | * View class for the available menu items panel. |
| | 184 | * |
| | 185 | * @constructs wp.customize.Menus.AvailableMenuItemsPanelView |
| | 186 | * @augments wp.Backbone.View |
| | 187 | */ |
| 184 | 188 | initialize: function() { |
| 185 | 189 | var self = this; |
| 186 | 190 | |
| … |
… |
|
| 753 | 757 | * Customizer panel for menus. This is used only for screen options management. |
| 754 | 758 | * Note that 'menus' must match the WP_Customize_Menu_Panel::$type. |
| 755 | 759 | * |
| 756 | | * @constructor |
| | 760 | * @class wp.customize.Menus.MenusPanel |
| 757 | 761 | * @augments wp.customize.Panel |
| 758 | 762 | */ |
| 759 | | api.Menus.MenusPanel = api.Panel.extend({ |
| | 763 | api.Menus.MenusPanel = api.Panel.extend(/** @lends wp.customize.Menus.MenusPanel.prototype */{ |
| 760 | 764 | |
| 761 | 765 | attachEvents: function() { |
| 762 | 766 | api.Panel.prototype.attachEvents.call( this ); |
| … |
… |
|
| 885 | 889 | * Customizer section for menus. This is used only for lazy-loading child controls. |
| 886 | 890 | * Note that 'nav_menu' must match the WP_Customize_Menu_Section::$type. |
| 887 | 891 | * |
| 888 | | * @constructor |
| | 892 | * @class wp.customize.Menus.MenuSection |
| 889 | 893 | * @augments wp.customize.Section |
| 890 | 894 | */ |
| 891 | | api.Menus.MenuSection = api.Section.extend({ |
| | 895 | api.Menus.MenuSection = api.Section.extend(/** @lends wp.customize.Menus.MenuSection.prototype */{ |
| 892 | 896 | |
| 893 | 897 | /** |
| 894 | 898 | * Initialize. |
| … |
… |
|
| 1212 | 1216 | * |
| 1213 | 1217 | * Customizer section for new menus. |
| 1214 | 1218 | * |
| 1215 | | * @constructor |
| | 1219 | * @class wp.customize.Menus.NewMenuSection |
| 1216 | 1220 | * @augments wp.customize.Section |
| 1217 | 1221 | */ |
| 1218 | | api.Menus.NewMenuSection = api.Section.extend({ |
| | 1222 | api.Menus.NewMenuSection = api.Section.extend(/** @lends wp.customize.Menus.NewMenuSection.prototype */{ |
| 1219 | 1223 | |
| 1220 | 1224 | /** |
| 1221 | 1225 | * Add behaviors for the accordion section. |
| … |
… |
|
| 1451 | 1455 | * Customizer control for menu locations (rendered as a <select>). |
| 1452 | 1456 | * Note that 'nav_menu_location' must match the WP_Customize_Nav_Menu_Location_Control::$type. |
| 1453 | 1457 | * |
| 1454 | | * @constructor |
| | 1458 | * @class wp.customize.Menus.MenuLocationControl |
| 1455 | 1459 | * @augments wp.customize.Control |
| 1456 | 1460 | */ |
| 1457 | | api.Menus.MenuLocationControl = api.Control.extend({ |
| | 1461 | api.Menus.MenuLocationControl = api.Control.extend(/** @lends wp.customize.Menus.MenuLocationControl.prototype */{ |
| 1458 | 1462 | initialize: function( id, options ) { |
| 1459 | 1463 | var control = this, |
| 1460 | 1464 | matches = id.match( /^nav_menu_locations\[(.+?)]/ ); |
| … |
… |
|
| 1529 | 1533 | } |
| 1530 | 1534 | }); |
| 1531 | 1535 | |
| 1532 | | /** |
| 1533 | | * wp.customize.Menus.MenuItemControl |
| 1534 | | * |
| 1535 | | * Customizer control for menu items. |
| 1536 | | * Note that 'menu_item' must match the WP_Customize_Menu_Item_Control::$type. |
| 1537 | | * |
| 1538 | | * @constructor |
| 1539 | | * @augments wp.customize.Control |
| 1540 | | */ |
| 1541 | | api.Menus.MenuItemControl = api.Control.extend({ |
| | 1536 | api.Menus.MenuItemControl = api.Control.extend(/** @lends wp.customize.Menus.MenuItemControl.prototype */{ |
| 1542 | 1537 | |
| 1543 | 1538 | /** |
| 1544 | | * @inheritdoc |
| | 1539 | * wp.customize.Menus.MenuItemControl |
| | 1540 | * |
| | 1541 | * Customizer control for menu items. |
| | 1542 | * Note that 'menu_item' must match the WP_Customize_Menu_Item_Control::$type. |
| | 1543 | * |
| | 1544 | * @constructs wp.customize.Menus.MenuItemControl |
| | 1545 | * @augments wp.customize.Control |
| | 1546 | * |
| | 1547 | * @inheritDoc |
| 1545 | 1548 | */ |
| 1546 | 1549 | initialize: function( id, options ) { |
| 1547 | 1550 | var control = this; |
| … |
… |
|
| 2324 | 2327 | * |
| 2325 | 2328 | * Customizer control for a nav menu's name. |
| 2326 | 2329 | * |
| 2327 | | * @constructor |
| | 2330 | * @class wp.customize.Menus.MenuNameControl |
| 2328 | 2331 | * @augments wp.customize.Control |
| 2329 | 2332 | */ |
| 2330 | | api.Menus.MenuNameControl = api.Control.extend({ |
| | 2333 | api.Menus.MenuNameControl = api.Control.extend(/** @lends wp.customize.Menus.MenuNameControl.prototype */{ |
| 2331 | 2334 | |
| 2332 | 2335 | ready: function() { |
| 2333 | 2336 | var control = this; |
| … |
… |
|
| 2364 | 2367 | * Customizer control for a nav menu's locations. |
| 2365 | 2368 | * |
| 2366 | 2369 | * @since 4.9.0 |
| 2367 | | * @constructor |
| | 2370 | * @class wp.customize.Menus.MenuLocationsControl |
| 2368 | 2371 | * @augments wp.customize.Control |
| 2369 | 2372 | */ |
| 2370 | | api.Menus.MenuLocationsControl = api.Control.extend({ |
| | 2373 | api.Menus.MenuLocationsControl = api.Control.extend(/** @lends wp.customize.Menus.MenuLocationsControl.prototype */{ |
| 2371 | 2374 | |
| 2372 | 2375 | /** |
| 2373 | 2376 | * Set up the control. |
| … |
… |
|
| 2437 | 2440 | * |
| 2438 | 2441 | * Customizer control for a nav menu's auto add. |
| 2439 | 2442 | * |
| 2440 | | * @constructor |
| | 2443 | * @class wp.customize.Menus.MenuAutoAddControl |
| 2441 | 2444 | * @augments wp.customize.Control |
| 2442 | 2445 | */ |
| 2443 | | api.Menus.MenuAutoAddControl = api.Control.extend({ |
| | 2446 | api.Menus.MenuAutoAddControl = api.Control.extend(/** @lends wp.customize.Menus.MenuAutoAddControl.prototype */{ |
| 2444 | 2447 | |
| 2445 | 2448 | ready: function() { |
| 2446 | 2449 | var control = this, |
| … |
… |
|
| 2490 | 2493 | * Customizer control for menus. |
| 2491 | 2494 | * Note that 'nav_menu' must match the WP_Menu_Customize_Control::$type |
| 2492 | 2495 | * |
| 2493 | | * @constructor |
| | 2496 | * @class wp.customize.Menus.MenuControl |
| 2494 | 2497 | * @augments wp.customize.Control |
| 2495 | 2498 | */ |
| 2496 | | api.Menus.MenuControl = api.Control.extend({ |
| | 2499 | api.Menus.MenuControl = api.Control.extend(/** @lends wp.customize.Menus.MenuControl.prototype */{ |
| 2497 | 2500 | /** |
| 2498 | 2501 | * Set up the control. |
| 2499 | 2502 | */ |
| … |
… |
|
| 3021 | 3024 | } |
| 3022 | 3025 | } ); |
| 3023 | 3026 | |
| 3024 | | /** |
| 3025 | | * wp.customize.Menus.NewMenuControl |
| 3026 | | * |
| 3027 | | * Customizer control for creating new menus and handling deletion of existing menus. |
| 3028 | | * Note that 'new_menu' must match the WP_Customize_New_Menu_Control::$type. |
| 3029 | | * |
| 3030 | | * @constructor |
| 3031 | | * @augments wp.customize.Control |
| 3032 | | * @deprecated 4.9.0 This class is no longer used due to new menu creation UX. |
| 3033 | | */ |
| 3034 | | api.Menus.NewMenuControl = api.Control.extend({ |
| | 3027 | api.Menus.NewMenuControl = api.Control.extend(/** @lends wp.customize.Menus.NewMenuControl.prototype */{ |
| 3035 | 3028 | |
| 3036 | 3029 | /** |
| 3037 | | * Initialize. |
| | 3030 | * wp.customize.Menus.NewMenuControl |
| 3038 | 3031 | * |
| 3039 | | * @deprecated 4.9.0 |
| | 3032 | * Customizer control for creating new menus and handling deletion of existing menus. |
| | 3033 | * Note that 'new_menu' must match the WP_Customize_New_Menu_Control::$type. |
| | 3034 | * |
| | 3035 | * @constructs wp.customize.Menus.NewMenuControl |
| | 3036 | * @augments wp.customize.Control |
| | 3037 | * |
| | 3038 | * @deprecated 4.9.0 This class is no longer used due to new menu creation UX. |
| 3040 | 3039 | */ |
| 3041 | 3040 | initialize: function() { |
| 3042 | 3041 | if ( 'undefined' !== typeof console && console.warn ) { |
| … |
… |
|
| 3166 | 3165 | * When customize_save comes back with a success, make sure any inserted |
| 3167 | 3166 | * nav menus and items are properly re-added with their newly-assigned IDs. |
| 3168 | 3167 | * |
| | 3168 | * @alias wp.customize.Menus.applySavedData |
| | 3169 | * |
| 3169 | 3170 | * @param {object} data |
| 3170 | 3171 | * @param {array} data.nav_menu_updates |
| 3171 | 3172 | * @param {array} data.nav_menu_item_updates |
| … |
… |
|
| 3396 | 3397 | /** |
| 3397 | 3398 | * Focus a menu item control. |
| 3398 | 3399 | * |
| | 3400 | * @alias wp.customize.Menus.focusMenuItemControl |
| | 3401 | * |
| 3399 | 3402 | * @param {string} menuItemId |
| 3400 | 3403 | */ |
| 3401 | 3404 | api.Menus.focusMenuItemControl = function( menuItemId ) { |
| … |
… |
|
| 3408 | 3411 | /** |
| 3409 | 3412 | * Get the control for a given menu. |
| 3410 | 3413 | * |
| | 3414 | * @alias wp.customize.Menus.getMenuControl |
| | 3415 | * |
| 3411 | 3416 | * @param menuId |
| 3412 | 3417 | * @return {wp.customize.controlConstructor.menus[]} |
| 3413 | 3418 | */ |
| … |
… |
|
| 3418 | 3423 | /** |
| 3419 | 3424 | * Given a menu item ID, get the control associated with it. |
| 3420 | 3425 | * |
| | 3426 | * @alias wp.customize.Menus.getMenuItemControl |
| | 3427 | * |
| 3421 | 3428 | * @param {string} menuItemId |
| 3422 | 3429 | * @return {object|null} |
| 3423 | 3430 | */ |
| … |
… |
|
| 3426 | 3433 | }; |
| 3427 | 3434 | |
| 3428 | 3435 | /** |
| | 3436 | * @alias wp.customize.Menus~menuItemIdToSettingId |
| | 3437 | * |
| 3429 | 3438 | * @param {String} menuItemId |
| 3430 | 3439 | */ |
| 3431 | 3440 | function menuItemIdToSettingId( menuItemId ) { |
| … |
… |
|
| 3436 | 3445 | * Apply sanitize_text_field()-like logic to the supplied name, returning a |
| 3437 | 3446 | * "unnammed" fallback string if the name is then empty. |
| 3438 | 3447 | * |
| | 3448 | * @alias wp.customize.Menus~displayNavMenuName |
| | 3449 | * |
| 3439 | 3450 | * @param {string} name |
| 3440 | 3451 | * @returns {string} |
| 3441 | 3452 | */ |
-
diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
index b2bd4ae6f..f2cf0d476 100644
|
|
|
|
| 7 | 7 | var api = wp.customize, |
| 8 | 8 | l10n; |
| 9 | 9 | |
| | 10 | /** |
| | 11 | * @namespace wp.customize.Widgets |
| | 12 | */ |
| 10 | 13 | api.Widgets = api.Widgets || {}; |
| 11 | 14 | api.Widgets.savedWidgetIds = {}; |
| 12 | 15 | |
| … |
… |
|
| 19 | 22 | * |
| 20 | 23 | * A single widget model. |
| 21 | 24 | * |
| 22 | | * @constructor |
| | 25 | * @class wp.customize.Widgets.WidgetModel |
| 23 | 26 | * @augments Backbone.Model |
| 24 | 27 | */ |
| 25 | | api.Widgets.WidgetModel = Backbone.Model.extend({ |
| | 28 | api.Widgets.WidgetModel = Backbone.Model.extend(/** @lends wp.customize.Widgets.WidgetModel.prototype */{ |
| 26 | 29 | id: null, |
| 27 | 30 | temp_id: null, |
| 28 | 31 | classname: null, |
| … |
… |
|
| 45 | 48 | * |
| 46 | 49 | * Collection for widget models. |
| 47 | 50 | * |
| 48 | | * @constructor |
| 49 | | * @augments Backbone.Model |
| | 51 | * @class wp.customize.Widgets.WidgetCollection |
| | 52 | * @augments Backbone.Collection |
| 50 | 53 | */ |
| 51 | | api.Widgets.WidgetCollection = Backbone.Collection.extend({ |
| | 54 | api.Widgets.WidgetCollection = Backbone.Collection.extend(/** @lends wp.customize.Widgets.WidgetCollection.prototype */{ |
| 52 | 55 | model: api.Widgets.WidgetModel, |
| 53 | 56 | |
| 54 | 57 | // Controls searching on the current widget collection |
| … |
… |
|
| 103 | 106 | * |
| 104 | 107 | * A single sidebar model. |
| 105 | 108 | * |
| 106 | | * @constructor |
| | 109 | * @class wp.customize.Widgets.SidebarModel |
| 107 | 110 | * @augments Backbone.Model |
| 108 | 111 | */ |
| 109 | | api.Widgets.SidebarModel = Backbone.Model.extend({ |
| | 112 | api.Widgets.SidebarModel = Backbone.Model.extend(/** @lends wp.customize.Widgets.SidebarModel.prototype */{ |
| 110 | 113 | after_title: null, |
| 111 | 114 | after_widget: null, |
| 112 | 115 | before_title: null, |
| … |
… |
|
| 123 | 126 | * |
| 124 | 127 | * Collection for sidebar models. |
| 125 | 128 | * |
| 126 | | * @constructor |
| | 129 | * @class wp.customize.Widgets.SidebarCollection |
| 127 | 130 | * @augments Backbone.Collection |
| 128 | 131 | */ |
| 129 | | api.Widgets.SidebarCollection = Backbone.Collection.extend({ |
| | 132 | api.Widgets.SidebarCollection = Backbone.Collection.extend(/** @lends wp.customize.Widgets.SidebarCollection.prototype */{ |
| 130 | 133 | model: api.Widgets.SidebarModel |
| 131 | 134 | }); |
| 132 | 135 | api.Widgets.registeredSidebars = new api.Widgets.SidebarCollection( api.Widgets.data.registeredSidebars ); |
| 133 | 136 | |
| 134 | | /** |
| 135 | | * wp.customize.Widgets.AvailableWidgetsPanelView |
| 136 | | * |
| 137 | | * View class for the available widgets panel. |
| 138 | | * |
| 139 | | * @constructor |
| 140 | | * @augments wp.Backbone.View |
| 141 | | * @augments Backbone.View |
| 142 | | */ |
| 143 | | api.Widgets.AvailableWidgetsPanelView = wp.Backbone.View.extend({ |
| | 137 | api.Widgets.AvailableWidgetsPanelView = wp.Backbone.View.extend(/** @lends wp.customize.Widgets.AvailableWidgetsPanelView.prototype */{ |
| 144 | 138 | |
| 145 | 139 | el: '#available-widgets', |
| 146 | 140 | |
| … |
… |
|
| 162 | 156 | $clearResults: null, |
| 163 | 157 | searchMatchesCount: null, |
| 164 | 158 | |
| | 159 | /** |
| | 160 | * @constructs wp.customize.Widgets.AvailableWidgetsPanelView |
| | 161 | * @augments wp.Backbone.View |
| | 162 | */ |
| 165 | 163 | initialize: function() { |
| 166 | 164 | var self = this; |
| 167 | 165 | |
| … |
… |
|
| 197 | 195 | api.previewer.bind( 'url', this.close ); |
| 198 | 196 | }, |
| 199 | 197 | |
| 200 | | // Performs a search and handles selected widget |
| | 198 | /** |
| | 199 | * Performs a search and handles selected widget. |
| | 200 | */ |
| 201 | 201 | search: function( event ) { |
| 202 | 202 | var firstVisible; |
| 203 | 203 | |
| … |
… |
|
| 242 | 242 | } |
| 243 | 243 | }, |
| 244 | 244 | |
| 245 | | // Update the count of the available widgets that have the `search_matched` attribute. |
| | 245 | /** |
| | 246 | * Update the count of the available widgets that have the `search_matched` attribute. |
| | 247 | */ |
| 246 | 248 | updateSearchMatchesCount: function() { |
| 247 | 249 | this.searchMatchesCount = this.collection.where({ search_matched: true }).length; |
| 248 | 250 | }, |
| 249 | 251 | |
| 250 | | // Send a message to the aria-live region to announce how many search results. |
| | 252 | /** |
| | 253 | * Send a message to the aria-live region to announce how many search results. |
| | 254 | */ |
| 251 | 255 | announceSearchMatches: _.debounce( function() { |
| 252 | 256 | var message = l10n.widgetsFound.replace( '%d', this.searchMatchesCount ) ; |
| 253 | 257 | |
| … |
… |
|
| 258 | 262 | wp.a11y.speak( message ); |
| 259 | 263 | }, 500 ), |
| 260 | 264 | |
| 261 | | // Changes visibility of available widgets |
| | 265 | /** |
| | 266 | * Changes visibility of available widgets. |
| | 267 | */ |
| 262 | 268 | updateList: function() { |
| 263 | 269 | this.collection.each( function( widget ) { |
| 264 | 270 | var widgetTpl = $( '#widget-tpl-' + widget.id ); |
| … |
… |
|
| 269 | 275 | } ); |
| 270 | 276 | }, |
| 271 | 277 | |
| 272 | | // Highlights a widget |
| | 278 | /** |
| | 279 | * Highlights a widget. |
| | 280 | */ |
| 273 | 281 | select: function( widgetTpl ) { |
| 274 | 282 | this.selected = $( widgetTpl ); |
| 275 | 283 | this.selected.siblings( '.widget-tpl' ).removeClass( 'selected' ); |
| 276 | 284 | this.selected.addClass( 'selected' ); |
| 277 | 285 | }, |
| 278 | 286 | |
| 279 | | // Highlights a widget on focus |
| | 287 | /** |
| | 288 | * Highlights a widget on focus. |
| | 289 | */ |
| 280 | 290 | focus: function( event ) { |
| 281 | 291 | this.select( $( event.currentTarget ) ); |
| 282 | 292 | }, |
| 283 | 293 | |
| 284 | | // Submit handler for keypress and click on widget |
| | 294 | /** |
| | 295 | * Submit handler for keypress and click on widget. |
| | 296 | */ |
| 285 | 297 | _submit: function( event ) { |
| 286 | 298 | // Only proceed with keypress if it is Enter or Spacebar |
| 287 | 299 | if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) { |
| … |
… |
|
| 291 | 303 | this.submit( $( event.currentTarget ) ); |
| 292 | 304 | }, |
| 293 | 305 | |
| 294 | | // Adds a selected widget to the sidebar |
| | 306 | /** |
| | 307 | * Adds a selected widget to the sidebar. |
| | 308 | */ |
| 295 | 309 | submit: function( widgetTpl ) { |
| 296 | 310 | var widgetId, widget, widgetFormControl; |
| 297 | 311 | |
| … |
… |
|
| 319 | 333 | this.close(); |
| 320 | 334 | }, |
| 321 | 335 | |
| 322 | | // Opens the panel |
| | 336 | /** |
| | 337 | * Opens the panel. |
| | 338 | */ |
| 323 | 339 | open: function( sidebarControl ) { |
| 324 | 340 | this.currentSidebarControl = sidebarControl; |
| 325 | 341 | |
| … |
… |
|
| 346 | 362 | } |
| 347 | 363 | }, |
| 348 | 364 | |
| 349 | | // Closes the panel |
| | 365 | /** |
| | 366 | * Closes the panel. |
| | 367 | */ |
| 350 | 368 | close: function( options ) { |
| 351 | 369 | options = options || {}; |
| 352 | 370 | |
| … |
… |
|
| 362 | 380 | this.$search.val( '' ); |
| 363 | 381 | }, |
| 364 | 382 | |
| 365 | | // Add keyboard accessiblity to the panel |
| | 383 | /** |
| | 384 | * Add keyboard accessiblity to the panel. |
| | 385 | */ |
| 366 | 386 | keyboardAccessible: function( event ) { |
| 367 | 387 | var isEnter = ( event.which === 13 ), |
| 368 | 388 | isEsc = ( event.which === 27 ), |
| … |
… |
|
| 424 | 444 | * Handlers for the widget-synced event, organized by widget ID base. |
| 425 | 445 | * Other widgets may provide their own update handlers by adding |
| 426 | 446 | * listeners for the widget-synced event. |
| | 447 | * |
| | 448 | * @alias wp.customize.Widgets.formSyncHandlers |
| 427 | 449 | */ |
| 428 | 450 | api.Widgets.formSyncHandlers = { |
| 429 | 451 | |
| … |
… |
|
| 446 | 468 | } |
| 447 | 469 | }; |
| 448 | 470 | |
| 449 | | /** |
| 450 | | * wp.customize.Widgets.WidgetControl |
| 451 | | * |
| 452 | | * Customizer control for widgets. |
| 453 | | * Note that 'widget_form' must match the WP_Widget_Form_Customize_Control::$type |
| 454 | | * |
| 455 | | * @constructor |
| 456 | | * @augments wp.customize.Control |
| 457 | | */ |
| 458 | | api.Widgets.WidgetControl = api.Control.extend({ |
| | 471 | api.Widgets.WidgetControl = api.Control.extend(/** @lends wp.customize.Widgets.WidgetControl.prototype */{ |
| 459 | 472 | defaultExpandedArguments: { |
| 460 | 473 | duration: 'fast', |
| 461 | 474 | completeCallback: $.noop |
| 462 | 475 | }, |
| 463 | 476 | |
| 464 | 477 | /** |
| | 478 | * wp.customize.Widgets.WidgetControl |
| | 479 | * |
| | 480 | * Customizer control for widgets. |
| | 481 | * Note that 'widget_form' must match the WP_Widget_Form_Customize_Control::$type |
| | 482 | * |
| 465 | 483 | * @since 4.1.0 |
| | 484 | * |
| | 485 | * @constructs wp.customize.Widgets.WidgetControl |
| | 486 | * @augments wp.customize.Control |
| 466 | 487 | */ |
| 467 | 488 | initialize: function( id, options ) { |
| 468 | 489 | var control = this; |
| … |
… |
|
| 943 | 964 | * |
| 944 | 965 | * @param {Boolean} active |
| 945 | 966 | * @param {Object} args |
| 946 | | * @param {Callback} args.completeCallback |
| | 967 | * @param {function} args.completeCallback |
| 947 | 968 | */ |
| 948 | 969 | onChangeActive: function ( active, args ) { |
| 949 | 970 | // Note: there is a second 'args' parameter being passed, merged on top of this.defaultActiveArguments |
| … |
… |
|
| 1574 | 1595 | * Customizer panel containing the widget area sections. |
| 1575 | 1596 | * |
| 1576 | 1597 | * @since 4.4.0 |
| | 1598 | * |
| | 1599 | * @class wp.customize.Widgets.WidgetsPanel |
| | 1600 | * @augments wp.customize.Panel |
| 1577 | 1601 | */ |
| 1578 | | api.Widgets.WidgetsPanel = api.Panel.extend({ |
| | 1602 | api.Widgets.WidgetsPanel = api.Panel.extend(/** @lends wp.customize.Widgets.WigetsPanel.prototype */{ |
| 1579 | 1603 | |
| 1580 | 1604 | /** |
| 1581 | 1605 | * Add and manage the display of the no-rendered-areas notice. |
| … |
… |
|
| 1695 | 1719 | * Customizer section representing a widget area widget |
| 1696 | 1720 | * |
| 1697 | 1721 | * @since 4.1.0 |
| | 1722 | * |
| | 1723 | * @class wp.customize.Widgets.SidebarSection |
| | 1724 | * @augments wp.customize.Section |
| 1698 | 1725 | */ |
| 1699 | | api.Widgets.SidebarSection = api.Section.extend({ |
| | 1726 | api.Widgets.SidebarSection = api.Section.extend(/** @lends wp.customize.Widgets.SidebarSection.prototype */{ |
| 1700 | 1727 | |
| 1701 | 1728 | /** |
| 1702 | 1729 | * Sync the section's active state back to the Backbone model's is_rendered attribute |
| … |
… |
|
| 1722 | 1749 | * |
| 1723 | 1750 | * @since 3.9.0 |
| 1724 | 1751 | * |
| 1725 | | * @constructor |
| | 1752 | * @class wp.customize.Widgets.SidebarControl |
| 1726 | 1753 | * @augments wp.customize.Control |
| 1727 | 1754 | */ |
| 1728 | | api.Widgets.SidebarControl = api.Control.extend({ |
| | 1755 | api.Widgets.SidebarControl = api.Control.extend(/** @lends wp.customize.Widgets.SidebarControl.prototype */{ |
| 1729 | 1756 | |
| 1730 | 1757 | /** |
| 1731 | 1758 | * Set up the control |
-
diff --git src/wp-admin/js/editor.js src/wp-admin/js/editor.js
index d52e6ba63..3d6b453ae 100644
|
|
|
window.wp = window.wp || {}; |
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | 1238 | /** |
| 1239 | | * @namespace {SwitchEditors} switchEditors |
| 1240 | 1239 | * Expose the switch editors to be used globally. |
| | 1240 | * |
| | 1241 | * @namespace switchEditors |
| 1241 | 1242 | */ |
| 1242 | 1243 | window.switchEditors = new SwitchEditors(); |
| 1243 | 1244 | |
-
diff --git src/wp-admin/js/image-edit.js src/wp-admin/js/image-edit.js
index 0d8eaf081..a570c5429 100644
|
|
|
|
| 614 | 614 | /** |
| 615 | 615 | * @summary Sets the CSS styles and binds events for locking the aspect ratio. |
| 616 | 616 | * |
| | 617 | * @ignore |
| | 618 | * |
| 617 | 619 | * @param {jQuery} img The preview image. |
| 618 | 620 | */ |
| 619 | 621 | onInit: function( img ) { |
| … |
… |
|
| 645 | 647 | /** |
| 646 | 648 | * @summary Event triggered when starting a selection. |
| 647 | 649 | * |
| | 650 | * @ignore |
| | 651 | * |
| 648 | 652 | * @returns {void} |
| 649 | 653 | */ |
| 650 | 654 | onSelectStart: function() { |
| … |
… |
|
| 653 | 657 | /** |
| 654 | 658 | * @summary Event triggered when the selection is ended. |
| 655 | 659 | * |
| | 660 | * @ignore |
| | 661 | * |
| 656 | 662 | * @param {object} img jQuery object representing the image. |
| 657 | 663 | * @param {object} c The selection. |
| 658 | 664 | * |
| … |
… |
|
| 665 | 671 | /** |
| 666 | 672 | * @summary Event triggered when the selection changes. |
| 667 | 673 | * |
| | 674 | * @ignore |
| | 675 | * |
| 668 | 676 | * @param {object} img jQuery object representing the image. |
| 669 | 677 | * @param {object} c The selection. |
| 670 | 678 | * |
-
diff --git src/wp-admin/js/inline-edit-post.js src/wp-admin/js/inline-edit-post.js
index 0b3d6a881..15ee5d85f 100644
|
|
|
window.wp = window.wp || {}; |
| 10 | 10 | /** |
| 11 | 11 | * Manages the quick edit and bulk edit windows for editing posts or pages. |
| 12 | 12 | * |
| 13 | | * @namespace |
| 14 | | * |
| 15 | 13 | * @since 2.7.0 |
| 16 | | * @access public |
| | 14 | * @ignore |
| 17 | 15 | * |
| 18 | 16 | * @type {Object} |
| 19 | 17 | * |
-
diff --git src/wp-admin/js/inline-edit-tax.js src/wp-admin/js/inline-edit-tax.js
index 797001780..040588bf1 100644
|
|
|
window.wp = window.wp || {}; |
| 8 | 8 | /** |
| 9 | 9 | * Consists of functions relevant to the inline taxonomy editor. |
| 10 | 10 | * |
| 11 | | * @namespace inlineEditTax |
| | 11 | * @ignore |
| 12 | 12 | * |
| 13 | 13 | * @property {string} type The type of inline edit we are currently on. |
| 14 | 14 | * @property {string} what The type property with a hash prefixed and a dash |
-
diff --git src/wp-admin/js/media.js src/wp-admin/js/media.js
index 4c1dc58fc..eecc382ef 100644
|
|
|
|
| 5 | 5 | * |
| 6 | 6 | * @since 2.7.0 |
| 7 | 7 | * |
| 8 | | * @global |
| 9 | | * @namespace |
| | 8 | * @ignore |
| 10 | 9 | * |
| 11 | 10 | * @requires jQuery |
| 12 | 11 | */ |
-
diff --git src/wp-admin/js/nav-menu.js src/wp-admin/js/nav-menu.js
index 79a8556db..3d9871baa 100644
|
|
|
var wpNavMenu; |
| 167 | 167 | /** |
| 168 | 168 | * Adds selected menu items to the menu. |
| 169 | 169 | * |
| | 170 | * @ignore |
| | 171 | * |
| 170 | 172 | * @param jQuery metabox The metabox jQuery object. |
| 171 | 173 | */ |
| 172 | 174 | addSelectedToMenu : function(processMethod) { |
-
diff --git src/wp-admin/js/plugin-install.js src/wp-admin/js/plugin-install.js
index 9fa218fe3..80e766b55 100644
|
|
|
|
| 1 | 1 | /* global plugininstallL10n, tb_click, tb_remove */ |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | | * Functionality for the plugin install screens. |
| | 4 | * @file Functionality for the plugin install screens. |
| 5 | 5 | */ |
| 6 | 6 | var tb_position; |
| 7 | 7 | jQuery( document ).ready( function( $ ) { |
-
diff --git src/wp-admin/js/post.js src/wp-admin/js/post.js
index 662c62bff..620d08982 100644
|
|
|
|
| 4 | 4 | /** |
| 5 | 5 | * Contains all dynamic functionality needed on post and term pages. |
| 6 | 6 | * |
| 7 | | * @summary Control page and term functionality. |
| | 7 | * @file Control page and term functionality. |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | var commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink; |
| … |
… |
window.wp = window.wp || {}; |
| 34 | 34 | * @param {int} total Total number of comments for this post. |
| 35 | 35 | * @param {int} num Optional. Number of comments to fetch, defaults to 20. |
| 36 | 36 | * @returns {boolean} Always returns false. |
| 37 | | * |
| 38 | | * @memberof commentsBox |
| 39 | 37 | */ |
| 40 | 38 | get : function(total, num) { |
| 41 | 39 | var st = this.st, data; |
| … |
… |
jQuery(document).ready( function($) { |
| 662 | 660 | /** |
| 663 | 661 | * Add current post_ID to request to fetch custom fields |
| 664 | 662 | * |
| | 663 | * @ignore |
| | 664 | * |
| 665 | 665 | * @param {Object} s Request object. |
| 666 | 666 | * |
| 667 | 667 | * @returns {Object} Data modified with post_ID attached. |
| … |
… |
jQuery(document).ready( function($) { |
| 672 | 672 | }, |
| 673 | 673 | /** |
| 674 | 674 | * Show the listing of custom fields after fetching. |
| | 675 | * |
| | 676 | * @ignore |
| 675 | 677 | */ |
| 676 | 678 | addAfter: function() { |
| 677 | 679 | $('table#list-table').show(); |
| … |
… |
jQuery(document).ready( function($) { |
| 689 | 691 | /** |
| 690 | 692 | * When the visibility of a post changes sub-options should be shown or hidden. |
| 691 | 693 | * |
| | 694 | * @ignore |
| | 695 | * |
| 692 | 696 | * @returns void |
| 693 | 697 | */ |
| 694 | 698 | updateVisibility = function() { |
| … |
… |
jQuery(document).ready( function($) { |
| 711 | 715 | /** |
| 712 | 716 | * Make sure all labels represent the current settings. |
| 713 | 717 | * |
| | 718 | * @ignore |
| | 719 | * |
| 714 | 720 | * @returns {boolean} False when an invalid timestamp has been selected, otherwise True. |
| 715 | 721 | */ |
| 716 | 722 | updateText = function() { |
| … |
… |
jQuery(document).ready( function($) { |
| 930 | 936 | * |
| 931 | 937 | * @summary Permalink aka slug aka post_name editing |
| 932 | 938 | * |
| 933 | | * @global |
| | 939 | * @ignore |
| 934 | 940 | * |
| 935 | 941 | * @returns void |
| 936 | 942 | */ |
-
diff --git src/wp-admin/js/postbox.js src/wp-admin/js/postbox.js
index bbc73b2a6..d713f333c 100644
|
|
|
|
| 16 | 16 | * |
| 17 | 17 | * @since 2.7.0 |
| 18 | 18 | * |
| 19 | | * @namespace postboxes |
| | 19 | * @ignore |
| 20 | 20 | * |
| 21 | 21 | * @type {Object} |
| 22 | 22 | */ |
| … |
… |
var postboxes; |
| 81 | 81 | * Contains a jQuery object with the relevant postbox element. |
| 82 | 82 | * |
| 83 | 83 | * @since 4.0.0 |
| | 84 | * @ignore |
| | 85 | * |
| 84 | 86 | * @event postboxes#postbox-toggled |
| 85 | 87 | * @type {Object} |
| 86 | 88 | */ |
| … |
… |
var postboxes; |
| 137 | 139 | * clicked this function will hide or show the relevant postboxes. |
| 138 | 140 | * |
| 139 | 141 | * @since 2.7.0 |
| | 142 | * @ignore |
| | 143 | * |
| 140 | 144 | * @fires postboxes#postbox-toggled |
| 141 | 145 | * |
| 142 | 146 | * @returns {void} |
| … |
… |
var postboxes; |
| 383 | 387 | * Fires when the amount of columns on the post edit page has been changed. |
| 384 | 388 | * |
| 385 | 389 | * @since 4.0.0 |
| | 390 | * @ignore |
| | 391 | * |
| 386 | 392 | * @event postboxes#postboxes-columnchange |
| 387 | 393 | */ |
| 388 | 394 | $( document ).trigger( 'postboxes-columnchange' ); |
-
diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js
index 2b5ba9291..0bf27d6bc 100644
|
|
|
|
| 2 | 2 | * Functions for ajaxified updates, deletions and installs inside the WordPress admin. |
| 3 | 3 | * |
| 4 | 4 | * @version 4.2.0 |
| 5 | | * |
| 6 | | * @package WordPress |
| 7 | | * @subpackage Administration |
| 8 | 5 | */ |
| 9 | 6 | |
| 10 | 7 | /* global pagenow */ |
| … |
… |
|
| 38 | 35 | * |
| 39 | 36 | * @since 4.2.0 |
| 40 | 37 | * |
| 41 | | * @type {object} |
| | 38 | * @namespace wp.updates |
| 42 | 39 | */ |
| 43 | 40 | wp.updates = {}; |
| 44 | 41 | |
| … |
… |
|
| 84 | 81 | * @since 4.2.0 |
| 85 | 82 | * @since 4.6.0 Added `available` property to indicate whether credentials have been provided. |
| 86 | 83 | * |
| 87 | | * @type {object} filesystemCredentials Holds filesystem credentials. |
| 88 | | * @type {object} filesystemCredentials.ftp Holds FTP credentials. |
| 89 | | * @type {string} filesystemCredentials.ftp.host FTP host. Default empty string. |
| 90 | | * @type {string} filesystemCredentials.ftp.username FTP user name. Default empty string. |
| 91 | | * @type {string} filesystemCredentials.ftp.password FTP password. Default empty string. |
| 92 | | * @type {string} filesystemCredentials.ftp.connectionType Type of FTP connection. 'ssh', 'ftp', or 'ftps'. |
| | 84 | * @type {object} |
| | 85 | * @property {object} filesystemCredentials.ftp Holds FTP credentials. |
| | 86 | * @property {string} filesystemCredentials.ftp.host FTP host. Default empty string. |
| | 87 | * @property {string} filesystemCredentials.ftp.username FTP user name. Default empty string. |
| | 88 | * @property {string} filesystemCredentials.ftp.password FTP password. Default empty string. |
| | 89 | * @property {string} filesystemCredentials.ftp.connectionType Type of FTP connection. 'ssh', 'ftp', or 'ftps'. |
| 93 | 90 | * Default empty string. |
| 94 | | * @type {object} filesystemCredentials.ssh Holds SSH credentials. |
| 95 | | * @type {string} filesystemCredentials.ssh.publicKey The public key. Default empty string. |
| 96 | | * @type {string} filesystemCredentials.ssh.privateKey The private key. Default empty string. |
| 97 | | * @type {string} filesystemCredentials.fsNonce Filesystem credentials form nonce. |
| 98 | | * @type {bool} filesystemCredentials.available Whether filesystem credentials have been provided. |
| | 91 | * @property {object} filesystemCredentials.ssh Holds SSH credentials. |
| | 92 | * @property {string} filesystemCredentials.ssh.publicKey The public key. Default empty string. |
| | 93 | * @property {string} filesystemCredentials.ssh.privateKey The private key. Default empty string. |
| | 94 | * @property {string} filesystemCredentials.fsNonce Filesystem credentials form nonce. |
| | 95 | * @property {bool} filesystemCredentials.available Whether filesystem credentials have been provided. |
| 99 | 96 | * Default 'false'. |
| 100 | 97 | */ |
| 101 | 98 | wp.updates.filesystemCredentials = { |
| … |
… |
|
| 128 | 125 | * |
| 129 | 126 | * @since 4.6.0 |
| 130 | 127 | * |
| 131 | | * @type {function} A function that lazily-compiles the template requested. |
| | 128 | * @type {function} |
| 132 | 129 | */ |
| 133 | 130 | wp.updates.adminNotice = wp.template( 'wp-updates-admin-notice' ); |
| 134 | 131 | |
| … |
… |
|
| 407 | 404 | * @since 4.2.0 |
| 408 | 405 | * @since 4.6.0 More accurately named `updatePluginSuccess`. |
| 409 | 406 | * |
| 410 | | * @typedef {object} updatePluginSuccess |
| 411 | 407 | * @param {object} response Response from the server. |
| 412 | 408 | * @param {string} response.slug Slug of the plugin to be updated. |
| 413 | 409 | * @param {string} response.plugin Basename of the plugin to be updated. |
| … |
… |
|
| 452 | 448 | * @since 4.2.0 |
| 453 | 449 | * @since 4.6.0 More accurately named `updatePluginError`. |
| 454 | 450 | * |
| 455 | | * @typedef {object} updatePluginError |
| 456 | 451 | * @param {object} response Response from the server. |
| 457 | 452 | * @param {string} response.slug Slug of the plugin to be updated. |
| 458 | 453 | * @param {string} response.plugin Basename of the plugin to be updated. |
| … |
… |
|
| 574 | 569 | * |
| 575 | 570 | * @since 4.6.0 |
| 576 | 571 | * |
| 577 | | * @typedef {object} installPluginSuccess |
| 578 | 572 | * @param {object} response Response from the server. |
| 579 | 573 | * @param {string} response.slug Slug of the installed plugin. |
| 580 | 574 | * @param {string} response.pluginName Name of the installed plugin. |
| … |
… |
|
| 610 | 604 | * |
| 611 | 605 | * @since 4.6.0 |
| 612 | 606 | * |
| 613 | | * @typedef {object} installPluginError |
| 614 | 607 | * @param {object} response Response from the server. |
| 615 | 608 | * @param {string} response.slug Slug of the plugin to be installed. |
| 616 | 609 | * @param {string=} response.pluginName Optional. Name of the plugin to be installed. |
| … |
… |
|
| 661 | 654 | * |
| 662 | 655 | * @since 4.6.0 |
| 663 | 656 | * |
| 664 | | * @typedef {object} installImporterSuccess |
| 665 | 657 | * @param {object} response Response from the server. |
| 666 | 658 | * @param {string} response.slug Slug of the installed plugin. |
| 667 | 659 | * @param {string} response.pluginName Name of the installed plugin. |
| … |
… |
|
| 693 | 685 | * |
| 694 | 686 | * @since 4.6.0 |
| 695 | 687 | * |
| 696 | | * @typedef {object} installImporterError |
| 697 | 688 | * @param {object} response Response from the server. |
| 698 | 689 | * @param {string} response.slug Slug of the plugin to be installed. |
| 699 | 690 | * @param {string=} response.pluginName Optional. Name of the plugin to be installed. |
| … |
… |
|
| 768 | 759 | * |
| 769 | 760 | * @since 4.6.0 |
| 770 | 761 | * |
| 771 | | * @typedef {object} deletePluginSuccess |
| 772 | 762 | * @param {object} response Response from the server. |
| 773 | 763 | * @param {string} response.slug Slug of the plugin that was deleted. |
| 774 | 764 | * @param {string} response.plugin Base name of the plugin that was deleted. |
| … |
… |
|
| 783 | 773 | $pluginRow = $( this ), |
| 784 | 774 | columnCount = $form.find( 'thead th:not(.hidden), thead td' ).length, |
| 785 | 775 | pluginDeletedRow = wp.template( 'item-deleted-row' ), |
| 786 | | /** @type {object} plugins Base names of plugins in their different states. */ |
| | 776 | /** |
| | 777 | * Plugins Base names of plugins in their different states. |
| | 778 | * |
| | 779 | * @type {object} |
| | 780 | */ |
| 787 | 781 | plugins = settings.plugins; |
| 788 | 782 | |
| 789 | 783 | // Add a success message after deleting a plugin. |
| … |
… |
|
| 858 | 852 | * |
| 859 | 853 | * @since 4.6.0 |
| 860 | 854 | * |
| 861 | | * @typedef {object} deletePluginError |
| 862 | 855 | * @param {object} response Response from the server. |
| 863 | 856 | * @param {string} response.slug Slug of the plugin to be deleted. |
| 864 | 857 | * @param {string} response.plugin Base name of the plugin to be deleted |
| … |
… |
|
| 971 | 964 | * |
| 972 | 965 | * @since 4.6.0 |
| 973 | 966 | * |
| 974 | | * @typedef {object} updateThemeSuccess |
| 975 | 967 | * @param {object} response |
| 976 | 968 | * @param {string} response.slug Slug of the theme to be updated. |
| 977 | 969 | * @param {object} response.theme Updated theme. |
| … |
… |
|
| 1033 | 1025 | * |
| 1034 | 1026 | * @since 4.6.0 |
| 1035 | 1027 | * |
| 1036 | | * @typedef {object} updateThemeError |
| 1037 | 1028 | * @param {object} response Response from the server. |
| 1038 | 1029 | * @param {string} response.slug Slug of the theme to be updated. |
| 1039 | 1030 | * @param {string} response.errorCode Error code for the error that occurred. |
| … |
… |
|
| 1119 | 1110 | * |
| 1120 | 1111 | * @since 4.6.0 |
| 1121 | 1112 | * |
| 1122 | | * @typedef {object} installThemeSuccess |
| 1123 | 1113 | * @param {object} response Response from the server. |
| 1124 | 1114 | * @param {string} response.slug Slug of the theme to be installed. |
| 1125 | 1115 | * @param {string} response.customizeUrl URL to the Customizer for the just installed theme. |
| … |
… |
|
| 1170 | 1160 | * |
| 1171 | 1161 | * @since 4.6.0 |
| 1172 | 1162 | * |
| 1173 | | * @typedef {object} installThemeError |
| 1174 | 1163 | * @param {object} response Response from the server. |
| 1175 | 1164 | * @param {string} response.slug Slug of the theme to be installed. |
| 1176 | 1165 | * @param {string} response.errorCode Error code for the error that occurred. |
| … |
… |
|
| 1268 | 1257 | * |
| 1269 | 1258 | * @since 4.6.0 |
| 1270 | 1259 | * |
| 1271 | | * @typedef {object} deleteThemeSuccess |
| 1272 | 1260 | * @param {object} response Response from the server. |
| 1273 | 1261 | * @param {string} response.slug Slug of the theme that was deleted. |
| 1274 | 1262 | */ |
| … |
… |
|
| 1327 | 1315 | * |
| 1328 | 1316 | * @since 4.6.0 |
| 1329 | 1317 | * |
| 1330 | | * @typedef {object} deleteThemeError |
| 1331 | 1318 | * @param {object} response Response from the server. |
| 1332 | 1319 | * @param {string} response.slug Slug of the theme to be deleted. |
| 1333 | 1320 | * @param {string} response.errorCode Error code for the error that occurred. |
| … |
… |
|
| 1601 | 1588 | * |
| 1602 | 1589 | * @since 4.6.0 |
| 1603 | 1590 | * |
| 1604 | | * @typedef {object} maybeHandleCredentialError |
| 1605 | 1591 | * @param {object} response Response from the server. |
| 1606 | 1592 | * @param {string} response.errorCode Error code for the error that occurred. |
| 1607 | 1593 | * @param {string} response.errorMessage The error that occurred. |
-
diff --git src/wp-admin/js/widgets.js src/wp-admin/js/widgets.js
index 1cb74a310..9268d0cbe 100644
|
|
|
wpWidgets = { |
| 245 | 245 | /** |
| 246 | 246 | * Open Sidebar when a Widget gets dragged over it. |
| 247 | 247 | * |
| | 248 | * @ignore |
| | 249 | * |
| 248 | 250 | * @param {object} event jQuery event object. |
| 249 | 251 | */ |
| 250 | 252 | over: function( event ) { |
| … |
… |
wpWidgets = { |
| 268 | 270 | /** |
| 269 | 271 | * Close Sidebar when the Widget gets dragged out of it. |
| 270 | 272 | * |
| | 273 | * @ignore |
| | 274 | * |
| 271 | 275 | * @param {object} event jQuery event object. |
| 272 | 276 | */ |
| 273 | 277 | out: function( event ) { |
-
diff --git src/wp-admin/js/widgets/custom-html-widgets.js src/wp-admin/js/widgets/custom-html-widgets.js
index 6fd642111..a9e405996 100644
|
|
|
|
| 1 | 1 | /* global wp */ |
| 2 | 2 | /* eslint consistent-this: [ "error", "control" ] */ |
| 3 | 3 | /* eslint no-magic-numbers: ["error", { "ignore": [0,1,-1] }] */ |
| | 4 | |
| | 5 | /** |
| | 6 | * @namespace wp.customHtmlWidget |
| | 7 | * @memberOf wp |
| | 8 | */ |
| 4 | 9 | wp.customHtmlWidgets = ( function( $ ) { |
| 5 | 10 | 'use strict'; |
| 6 | 11 | |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 15 | 20 | } |
| 16 | 21 | }; |
| 17 | 22 | |
| 18 | | /** |
| 19 | | * Text widget control. |
| 20 | | * |
| 21 | | * @class CustomHtmlWidgetControl |
| 22 | | * @constructor |
| 23 | | * @abstract |
| 24 | | */ |
| 25 | | component.CustomHtmlWidgetControl = Backbone.View.extend({ |
| | 23 | component.CustomHtmlWidgetControl = Backbone.View.extend(/** @lends wp.customHtmlWidget.CustomHtmlWidgetControl.prototype */{ |
| 26 | 24 | |
| 27 | 25 | /** |
| 28 | 26 | * View events. |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 32 | 30 | events: {}, |
| 33 | 31 | |
| 34 | 32 | /** |
| 35 | | * Initialize. |
| | 33 | * Text widget control. |
| | 34 | * |
| | 35 | * @constructs wp.customHtmlWidget.CustomHtmlWidgetControl |
| | 36 | * @abstract |
| 36 | 37 | * |
| 37 | 38 | * @param {Object} options - Options. |
| 38 | 39 | * @param {jQuery} options.el - Control field container element. |
| 39 | 40 | * @param {jQuery} options.syncContainer - Container element where fields are synced for the server. |
| | 41 | * |
| 40 | 42 | * @returns {void} |
| 41 | 43 | */ |
| 42 | 44 | initialize: function initialize( options ) { |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 171 | 173 | /** |
| 172 | 174 | * Handle tabbing to the field before the editor. |
| 173 | 175 | * |
| | 176 | * @ignore |
| | 177 | * |
| 174 | 178 | * @returns {void} |
| 175 | 179 | */ |
| 176 | 180 | onTabPrevious: function onTabPrevious() { |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 180 | 184 | /** |
| 181 | 185 | * Handle tabbing to the field after the editor. |
| 182 | 186 | * |
| | 187 | * @ignore |
| | 188 | * |
| 183 | 189 | * @returns {void} |
| 184 | 190 | */ |
| 185 | 191 | onTabNext: function onTabNext() { |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 190 | 196 | /** |
| 191 | 197 | * Disable save button and store linting errors for use in updateFields. |
| 192 | 198 | * |
| | 199 | * @ignore |
| | 200 | * |
| 193 | 201 | * @param {Array} errorAnnotations - Error notifications. |
| 194 | 202 | * @returns {void} |
| 195 | 203 | */ |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 200 | 208 | /** |
| 201 | 209 | * Update error notice. |
| 202 | 210 | * |
| | 211 | * @ignore |
| | 212 | * |
| 203 | 213 | * @param {Array} errorAnnotations - Error annotations. |
| 204 | 214 | * @returns {void} |
| 205 | 215 | */ |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 259 | 269 | /** |
| 260 | 270 | * Mapping of widget ID to instances of CustomHtmlWidgetControl subclasses. |
| 261 | 271 | * |
| | 272 | * @alias wp.customHtmlWidget.widgetControls |
| | 273 | * |
| 262 | 274 | * @type {Object.<string, wp.textWidgets.CustomHtmlWidgetControl>} |
| 263 | 275 | */ |
| 264 | 276 | component.widgetControls = {}; |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 266 | 278 | /** |
| 267 | 279 | * Handle widget being added or initialized for the first time at the widget-added event. |
| 268 | 280 | * |
| | 281 | * @alias wp.customHtmlWidget.handleWidgetAdded |
| | 282 | * |
| 269 | 283 | * @param {jQuery.Event} event - Event. |
| 270 | 284 | * @param {jQuery} widgetContainer - Widget container element. |
| | 285 | * |
| 271 | 286 | * @returns {void} |
| 272 | 287 | */ |
| 273 | 288 | component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) { |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 325 | 340 | /** |
| 326 | 341 | * Setup widget in accessibility mode. |
| 327 | 342 | * |
| | 343 | * @alias wp.customHtmlWidget.setupAccessibleMode |
| | 344 | * |
| 328 | 345 | * @returns {void} |
| 329 | 346 | */ |
| 330 | 347 | component.setupAccessibleMode = function setupAccessibleMode() { |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 358 | 375 | * the widgets admin screen and also via the 'widget-synced' event when making |
| 359 | 376 | * a change to a widget in the customizer. |
| 360 | 377 | * |
| | 378 | * @alias wp.customHtmlWidget.handleWidgetUpdated |
| | 379 | * |
| 361 | 380 | * @param {jQuery.Event} event - Event. |
| 362 | 381 | * @param {jQuery} widgetContainer - Widget container element. |
| 363 | 382 | * @returns {void} |
| … |
… |
wp.customHtmlWidgets = ( function( $ ) { |
| 387 | 406 | * When WordPress enqueues this script, it should have an inline script |
| 388 | 407 | * attached which calls wp.textWidgets.init(). |
| 389 | 408 | * |
| | 409 | * @alias wp.customHtmlWidget.init |
| | 410 | * |
| 390 | 411 | * @param {object} settings - Options for code editor, exported from PHP. |
| | 412 | * |
| 391 | 413 | * @returns {void} |
| 392 | 414 | */ |
| 393 | 415 | component.init = function init( settings ) { |
-
diff --git src/wp-admin/js/widgets/media-audio-widget.js src/wp-admin/js/widgets/media-audio-widget.js
index 1f98ef70c..e3e53c70f 100644
|
|
|
|
| 7 | 7 | /** |
| 8 | 8 | * Custom audio details frame that removes the replace-audio state. |
| 9 | 9 | * |
| 10 | | * @class AudioDetailsMediaFrame |
| 11 | | * @constructor |
| | 10 | * @class wp.mediaWidgets.controlConstructors~AudioDetailsMediaFrame |
| | 11 | * @augments wp.media.view.MediaFrame.AudioDetails |
| 12 | 12 | */ |
| 13 | | AudioDetailsMediaFrame = wp.media.view.MediaFrame.AudioDetails.extend({ |
| | 13 | AudioDetailsMediaFrame = wp.media.view.MediaFrame.AudioDetails.extend(/** @lends wp.mediaWidgets.controlConstructors~AudioDetailsMediaFrame.prototype */{ |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Create the default states. |
| … |
… |
|
| 40 | 40 | * |
| 41 | 41 | * See WP_Widget_Audio::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 42 | 42 | * |
| 43 | | * @class AudioWidgetModel |
| 44 | | * @constructor |
| | 43 | * @class wp.mediaWidgets.modelConstructors.media_audio |
| | 44 | * @augments wp.mediaWidgets.MediaWidgetModel |
| 45 | 45 | */ |
| 46 | 46 | AudioWidgetModel = component.MediaWidgetModel.extend({}); |
| 47 | 47 | |
| … |
… |
|
| 50 | 50 | * |
| 51 | 51 | * See WP_Widget_Audio::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 52 | 52 | * |
| 53 | | * @class AudioWidgetModel |
| 54 | | * @constructor |
| | 53 | * @class wp.mediaWidgets.controlConstructors.media_audio |
| | 54 | * @augments wp.mediaWidgets.MediaWidgetControl |
| 55 | 55 | */ |
| 56 | | AudioWidgetControl = component.MediaWidgetControl.extend({ |
| | 56 | AudioWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_audio.prototype */{ |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Show display settings. |
-
diff --git src/wp-admin/js/widgets/media-gallery-widget.js src/wp-admin/js/widgets/media-gallery-widget.js
index ebba81cf8..e9c5342e8 100644
|
|
|
|
| 8 | 8 | * Custom gallery details frame. |
| 9 | 9 | * |
| 10 | 10 | * @since 4.9.0 |
| 11 | | * @class GalleryDetailsMediaFrame |
| 12 | | * @constructor |
| | 11 | * @class wp.mediaWidgets~GalleryDetailsMediaFrame |
| | 12 | * @augments wp.media.view.MediaFrame.Post |
| 13 | 13 | */ |
| 14 | | GalleryDetailsMediaFrame = wp.media.view.MediaFrame.Post.extend( { |
| | 14 | GalleryDetailsMediaFrame = wp.media.view.MediaFrame.Post.extend(/** @lends wp.mediaWidgets~GalleryDetailsMediaFrame.prototype */{ |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Create the default states. |
| … |
… |
|
| 53 | 53 | * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 54 | 54 | * |
| 55 | 55 | * @since 4.9.0 |
| 56 | | * @class GalleryWidgetModel |
| 57 | | * @constructor |
| 58 | | */ |
| 59 | | GalleryWidgetModel = component.MediaWidgetModel.extend( {} ); |
| 60 | | |
| 61 | | /** |
| 62 | | * Gallery widget control. |
| 63 | | * |
| 64 | | * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 65 | 56 | * |
| 66 | | * @since 4.9.0 |
| 67 | | * @class GalleryWidgetControl |
| 68 | | * @constructor |
| | 57 | * @class wp.mediaWidgets.modelConstructors.media_gallery |
| | 58 | * @augments wp.mediaWidgets.MediaWidgetModel |
| 69 | 59 | */ |
| 70 | | GalleryWidgetControl = component.MediaWidgetControl.extend( { |
| | 60 | GalleryWidgetModel = component.MediaWidgetModel.extend(/** @lends wp.mediaWidgets.modelConstructors.media_gallery.prototype */{} ); |
| | 61 | |
| | 62 | GalleryWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_gallery.prototype */{ |
| 71 | 63 | |
| 72 | 64 | /** |
| 73 | 65 | * View events. |
| … |
… |
|
| 80 | 72 | } ), |
| 81 | 73 | |
| 82 | 74 | /** |
| 83 | | * Initialize. |
| | 75 | * Gallery widget control. |
| | 76 | * |
| | 77 | * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
| | 78 | * |
| | 79 | * @constructs wp.mediaWidgets.controlConstructors.media_gallery |
| | 80 | * @augments wp.mediaWidgets.MediaWidgetControl |
| 84 | 81 | * |
| 85 | 82 | * @since 4.9.0 |
| 86 | 83 | * @param {Object} options - Options. |
-
diff --git src/wp-admin/js/widgets/media-image-widget.js src/wp-admin/js/widgets/media-image-widget.js
index 78b257fea..eeebd174f 100644
|
|
|
|
| 9 | 9 | * |
| 10 | 10 | * See WP_Widget_Media_Image::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 11 | 11 | * |
| 12 | | * @class ImageWidgetModel |
| 13 | | * @constructor |
| | 12 | * @class wp.mediaWidgets.modelConstructors.media_image |
| | 13 | * @augments wp.mediaWidgets.MediaWidgetModel |
| 14 | 14 | */ |
| 15 | 15 | ImageWidgetModel = component.MediaWidgetModel.extend({}); |
| 16 | 16 | |
| … |
… |
|
| 19 | 19 | * |
| 20 | 20 | * See WP_Widget_Media_Image::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 21 | 21 | * |
| 22 | | * @class ImageWidgetModel |
| 23 | | * @constructor |
| | 22 | * @class wp.mediaWidgets.controlConstructors.media_audio |
| | 23 | * @augments wp.mediaWidgets.MediaWidgetControl |
| 24 | 24 | */ |
| 25 | | ImageWidgetControl = component.MediaWidgetControl.extend({ |
| | 25 | ImageWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_image.prototype */{ |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * View events. |
-
diff --git src/wp-admin/js/widgets/media-video-widget.js src/wp-admin/js/widgets/media-video-widget.js
index ddaaf5f3f..86ed42994 100644
|
|
|
|
| 7 | 7 | /** |
| 8 | 8 | * Custom video details frame that removes the replace-video state. |
| 9 | 9 | * |
| 10 | | * @class VideoDetailsMediaFrame |
| 11 | | * @constructor |
| | 10 | * @class wp.mediaWidgets.controlConstructors~VideoDetailsMediaFrame |
| | 11 | * @augments wp.media.view.MediaFrame.VideoDetails |
| | 12 | * |
| | 13 | * @private |
| 12 | 14 | */ |
| 13 | | VideoDetailsMediaFrame = wp.media.view.MediaFrame.VideoDetails.extend({ |
| | 15 | VideoDetailsMediaFrame = wp.media.view.MediaFrame.VideoDetails.extend(/** @lends wp.mediaWidgets.controlConstructors~VideoDetailsMediaFrame.prototype */{ |
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Create the default states. |
| … |
… |
|
| 49 | 51 | * |
| 50 | 52 | * See WP_Widget_Video::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 51 | 53 | * |
| 52 | | * @class VideoWidgetModel |
| 53 | | * @constructor |
| | 54 | * @class wp.mediaWidgets.modelConstructors.media_video |
| | 55 | * @augments wp.mediaWidgets.MediaWidgetModel |
| 54 | 56 | */ |
| 55 | 57 | VideoWidgetModel = component.MediaWidgetModel.extend({}); |
| 56 | 58 | |
| … |
… |
|
| 59 | 61 | * |
| 60 | 62 | * See WP_Widget_Video::enqueue_admin_scripts() for amending prototype from PHP exports. |
| 61 | 63 | * |
| 62 | | * @class VideoWidgetControl |
| 63 | | * @constructor |
| | 64 | * @class wp.mediaWidgets.controlConstructors.media_video |
| | 65 | * @augments wp.mediaWidgets.MediaWidgetControl |
| 64 | 66 | */ |
| 65 | | VideoWidgetControl = component.MediaWidgetControl.extend({ |
| | 67 | VideoWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_video.prototype */{ |
| 66 | 68 | |
| 67 | 69 | /** |
| 68 | 70 | * Show display settings. |
-
diff --git src/wp-admin/js/widgets/media-widgets.js src/wp-admin/js/widgets/media-widgets.js
index 6d994add2..07ea42aa3 100644
|
|
|
|
| 1 | 1 | /* eslint consistent-this: [ "error", "control" ] */ |
| | 2 | |
| | 3 | /** |
| | 4 | * @namespace wp.mediaWidgets |
| | 5 | * @memberOf wp |
| | 6 | */ |
| 2 | 7 | wp.mediaWidgets = ( function( $ ) { |
| 3 | 8 | 'use strict'; |
| 4 | 9 | |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 9 | 14 | * |
| 10 | 15 | * Media widgets register themselves by assigning subclasses of MediaWidgetControl onto this object by widget ID base. |
| 11 | 16 | * |
| | 17 | * @memberOf wp.mediaWidgets |
| | 18 | * |
| 12 | 19 | * @type {Object.<string, wp.mediaWidgets.MediaWidgetModel>} |
| 13 | 20 | */ |
| 14 | 21 | component.controlConstructors = {}; |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 18 | 25 | * |
| 19 | 26 | * Media widgets register themselves by assigning subclasses of MediaWidgetControl onto this object by widget ID base. |
| 20 | 27 | * |
| | 28 | * @memberOf wp.mediaWidgets |
| | 29 | * |
| 21 | 30 | * @type {Object.<string, wp.mediaWidgets.MediaWidgetModel>} |
| 22 | 31 | */ |
| 23 | 32 | component.modelConstructors = {}; |
| 24 | 33 | |
| 25 | | /** |
| 26 | | * Library which persists the customized display settings across selections. |
| 27 | | * |
| 28 | | * @class PersistentDisplaySettingsLibrary |
| 29 | | * @constructor |
| 30 | | */ |
| 31 | | component.PersistentDisplaySettingsLibrary = wp.media.controller.Library.extend({ |
| | 34 | component.PersistentDisplaySettingsLibrary = wp.media.controller.Library.extend(/** @lends wp.mediaWidgets.PersistentDisplaySettingsLibrary.prototype */{ |
| 32 | 35 | |
| 33 | 36 | /** |
| 34 | | * Initialize. |
| | 37 | * Library which persists the customized display settings across selections. |
| | 38 | * |
| | 39 | * @constructs wp.mediaWidgets.PersistentDisplaySettingsLibrary |
| | 40 | * @augments wp.media.controller.Library |
| 35 | 41 | * |
| 36 | 42 | * @param {Object} options - Options. |
| | 43 | * |
| 37 | 44 | * @returns {void} |
| 38 | 45 | */ |
| 39 | 46 | initialize: function initialize( options ) { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 79 | 86 | /** |
| 80 | 87 | * Extended view for managing the embed UI. |
| 81 | 88 | * |
| 82 | | * @class MediaEmbedView |
| 83 | | * @constructor |
| | 89 | * @class wp.mediaWidgets.MediaEmbedView |
| | 90 | * @augments wp.media.view.Embed |
| 84 | 91 | */ |
| 85 | | component.MediaEmbedView = wp.media.view.Embed.extend({ |
| | 92 | component.MediaEmbedView = wp.media.view.Embed.extend(/** @lends wp.mediaWidgets.MediaEmbedView.prototype */{ |
| 86 | 93 | |
| 87 | 94 | /** |
| 88 | 95 | * Initialize. |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 109 | 116 | * @returns {void} |
| 110 | 117 | */ |
| 111 | 118 | refresh: function refresh() { |
| | 119 | /** |
| | 120 | * @class wp.mediaWidgets~Constructor |
| | 121 | */ |
| 112 | 122 | var Constructor; |
| 113 | 123 | |
| 114 | 124 | if ( 'image' === this.controller.options.mimeType ) { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 116 | 126 | } else { |
| 117 | 127 | |
| 118 | 128 | // This should be eliminated once #40450 lands of when this is merged into core. |
| 119 | | Constructor = wp.media.view.EmbedLink.extend({ |
| | 129 | Constructor = wp.media.view.EmbedLink.extend(/** @lends wp.mediaWidgets~Constructor.prototype */{ |
| 120 | 130 | |
| 121 | 131 | /** |
| 122 | 132 | * Set the disabled state on the Add to Widget button. |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 284 | 294 | /** |
| 285 | 295 | * Custom media frame for selecting uploaded media or providing media by URL. |
| 286 | 296 | * |
| 287 | | * @class MediaFrameSelect |
| 288 | | * @constructor |
| | 297 | * @class wp.mediaWidgets.MediaFrameSelect |
| | 298 | * @augments wp.media.view.MediaFrame.Post |
| 289 | 299 | */ |
| 290 | | component.MediaFrameSelect = wp.media.view.MediaFrame.Post.extend({ |
| | 300 | component.MediaFrameSelect = wp.media.view.MediaFrame.Post.extend(/** @lends wp.mediaWidgets.MediaFrameSelect.prototype */{ |
| 291 | 301 | |
| 292 | 302 | /** |
| 293 | 303 | * Create the default states. |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 357 | 367 | /** |
| 358 | 368 | * Handle click. |
| 359 | 369 | * |
| | 370 | * @ignore |
| | 371 | * |
| 360 | 372 | * @fires wp.media.controller.State#insert() |
| 361 | 373 | * @returns {void} |
| 362 | 374 | */ |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 408 | 420 | } |
| 409 | 421 | }); |
| 410 | 422 | |
| 411 | | /** |
| 412 | | * Media widget control. |
| 413 | | * |
| 414 | | * @class MediaWidgetControl |
| 415 | | * @constructor |
| 416 | | * @abstract |
| 417 | | */ |
| 418 | | component.MediaWidgetControl = Backbone.View.extend({ |
| | 423 | component.MediaWidgetControl = Backbone.View.extend(/** @lends wp.mediaWidgets.MediaWidgetControl.prototype */{ |
| 419 | 424 | |
| 420 | 425 | /** |
| 421 | 426 | * Translation strings. |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 473 | 478 | showDisplaySettings: true, |
| 474 | 479 | |
| 475 | 480 | /** |
| 476 | | * Initialize. |
| | 481 | * Media Widget Control. |
| | 482 | * |
| | 483 | * @constructs wp.mediaWidgets.MediaWidgetControl |
| | 484 | * @augments Backbone.View |
| | 485 | * @abstract |
| 477 | 486 | * |
| 478 | 487 | * @param {Object} options - Options. |
| 479 | 488 | * @param {Backbone.Model} options.model - Model. |
| 480 | 489 | * @param {jQuery} options.el - Control field container element. |
| 481 | 490 | * @param {jQuery} options.syncContainer - Container element where fields are synced for the server. |
| | 491 | * |
| 482 | 492 | * @returns {void} |
| 483 | 493 | */ |
| 484 | 494 | initialize: function initialize( options ) { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 961 | 971 | /** |
| 962 | 972 | * Media widget model. |
| 963 | 973 | * |
| 964 | | * @class MediaWidgetModel |
| 965 | | * @constructor |
| | 974 | * @class wp.mediaWidgets.MediaWidgetModel |
| | 975 | * @augments Backbone.Model |
| 966 | 976 | */ |
| 967 | | component.MediaWidgetModel = Backbone.Model.extend({ |
| | 977 | component.MediaWidgetModel = Backbone.Model.extend(/** @lends wp.mediaWidgets.MediaWidgetModel.prototype */{ |
| 968 | 978 | |
| 969 | 979 | /** |
| 970 | 980 | * Id attribute. |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 1085 | 1095 | /** |
| 1086 | 1096 | * Collection of all widget model instances. |
| 1087 | 1097 | * |
| | 1098 | * @memberOf wp.mediaWidgets |
| | 1099 | * |
| 1088 | 1100 | * @type {Backbone.Collection} |
| 1089 | 1101 | */ |
| 1090 | | component.modelCollection = new ( Backbone.Collection.extend({ |
| | 1102 | component.modelCollection = new ( Backbone.Collection.extend( { |
| 1091 | 1103 | model: component.MediaWidgetModel |
| 1092 | 1104 | }) )(); |
| 1093 | 1105 | |
| 1094 | 1106 | /** |
| 1095 | 1107 | * Mapping of widget ID to instances of MediaWidgetControl subclasses. |
| 1096 | 1108 | * |
| | 1109 | * @memberOf wp.mediaWidgets |
| | 1110 | * |
| 1097 | 1111 | * @type {Object.<string, wp.mediaWidgets.MediaWidgetControl>} |
| 1098 | 1112 | */ |
| 1099 | 1113 | component.widgetControls = {}; |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 1101 | 1115 | /** |
| 1102 | 1116 | * Handle widget being added or initialized for the first time at the widget-added event. |
| 1103 | 1117 | * |
| | 1118 | * @memberOf wp.mediaWidgets |
| | 1119 | * |
| 1104 | 1120 | * @param {jQuery.Event} event - Event. |
| 1105 | 1121 | * @param {jQuery} widgetContainer - Widget container element. |
| | 1122 | * |
| 1106 | 1123 | * @returns {void} |
| 1107 | 1124 | */ |
| 1108 | 1125 | component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 1184 | 1201 | /** |
| 1185 | 1202 | * Setup widget in accessibility mode. |
| 1186 | 1203 | * |
| | 1204 | * @memberOf wp.mediaWidgets |
| | 1205 | * |
| 1187 | 1206 | * @returns {void} |
| 1188 | 1207 | */ |
| 1189 | 1208 | component.setupAccessibleMode = function setupAccessibleMode() { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 1233 | 1252 | * the widgets admin screen and also via the 'widget-synced' event when making |
| 1234 | 1253 | * a change to a widget in the customizer. |
| 1235 | 1254 | * |
| | 1255 | * @memberOf wp.mediaWidgets |
| | 1256 | * |
| 1236 | 1257 | * @param {jQuery.Event} event - Event. |
| 1237 | 1258 | * @param {jQuery} widgetContainer - Widget container element. |
| | 1259 | * |
| 1238 | 1260 | * @returns {void} |
| 1239 | 1261 | */ |
| 1240 | 1262 | component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 1267 | 1289 | * When WordPress enqueues this script, it should have an inline script |
| 1268 | 1290 | * attached which calls wp.mediaWidgets.init(). |
| 1269 | 1291 | * |
| | 1292 | * @memberOf wp.mediaWidgets |
| | 1293 | * |
| 1270 | 1294 | * @returns {void} |
| 1271 | 1295 | */ |
| 1272 | 1296 | component.init = function init() { |
-
diff --git src/wp-admin/js/widgets/text-widgets.js src/wp-admin/js/widgets/text-widgets.js
index e75256909..1c928956f 100644
|
|
|
|
| 1 | 1 | /* global tinymce, switchEditors */ |
| 2 | 2 | /* eslint consistent-this: [ "error", "control" ] */ |
| | 3 | |
| | 4 | /** |
| | 5 | * @namespace wp.textWidgets |
| | 6 | */ |
| 3 | 7 | wp.textWidgets = ( function( $ ) { |
| 4 | 8 | 'use strict'; |
| 5 | 9 | |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 8 | 12 | idBases: [ 'text' ] |
| 9 | 13 | }; |
| 10 | 14 | |
| 11 | | /** |
| 12 | | * Text widget control. |
| 13 | | * |
| 14 | | * @class TextWidgetControl |
| 15 | | * @constructor |
| 16 | | * @abstract |
| 17 | | */ |
| 18 | | component.TextWidgetControl = Backbone.View.extend({ |
| | 15 | component.TextWidgetControl = Backbone.View.extend(/** @lends wp.textWidgets.TextWidgetControl.prototype */{ |
| 19 | 16 | |
| 20 | 17 | /** |
| 21 | 18 | * View events. |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 25 | 22 | events: {}, |
| 26 | 23 | |
| 27 | 24 | /** |
| 28 | | * Initialize. |
| | 25 | * Text widget control. |
| | 26 | * |
| | 27 | * @constructs wp.textWidgets.TextWidgetControl |
| | 28 | * @augments Backbone.View |
| | 29 | * @abstract |
| 29 | 30 | * |
| 30 | 31 | * @param {Object} options - Options. |
| 31 | 32 | * @param {jQuery} options.el - Control field container element. |
| 32 | 33 | * @param {jQuery} options.syncContainer - Container element where fields are synced for the server. |
| | 34 | * |
| 33 | 35 | * @returns {void} |
| 34 | 36 | */ |
| 35 | 37 | initialize: function initialize( options ) { |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 357 | 359 | /** |
| 358 | 360 | * Mapping of widget ID to instances of TextWidgetControl subclasses. |
| 359 | 361 | * |
| | 362 | * @memberOf wp.textWidgets |
| | 363 | * |
| 360 | 364 | * @type {Object.<string, wp.textWidgets.TextWidgetControl>} |
| 361 | 365 | */ |
| 362 | 366 | component.widgetControls = {}; |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 364 | 368 | /** |
| 365 | 369 | * Handle widget being added or initialized for the first time at the widget-added event. |
| 366 | 370 | * |
| | 371 | * @memberOf wp.textWidgets |
| | 372 | * |
| 367 | 373 | * @param {jQuery.Event} event - Event. |
| 368 | 374 | * @param {jQuery} widgetContainer - Widget container element. |
| | 375 | * |
| 369 | 376 | * @returns {void} |
| 370 | 377 | */ |
| 371 | 378 | component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) { |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 429 | 436 | /** |
| 430 | 437 | * Setup widget in accessibility mode. |
| 431 | 438 | * |
| | 439 | * @memberOf wp.textWidgets |
| | 440 | * |
| 432 | 441 | * @returns {void} |
| 433 | 442 | */ |
| 434 | 443 | component.setupAccessibleMode = function setupAccessibleMode() { |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 467 | 476 | * the widgets admin screen and also via the 'widget-synced' event when making |
| 468 | 477 | * a change to a widget in the customizer. |
| 469 | 478 | * |
| | 479 | * @memberOf wp.textWidgets |
| | 480 | * |
| 470 | 481 | * @param {jQuery.Event} event - Event. |
| 471 | 482 | * @param {jQuery} widgetContainer - Widget container element. |
| 472 | 483 | * @returns {void} |
| … |
… |
wp.textWidgets = ( function( $ ) { |
| 496 | 507 | * When WordPress enqueues this script, it should have an inline script |
| 497 | 508 | * attached which calls wp.textWidgets.init(). |
| 498 | 509 | * |
| | 510 | * @memberOf wp.textWidgets |
| | 511 | * |
| 499 | 512 | * @returns {void} |
| 500 | 513 | */ |
| 501 | 514 | component.init = function init() { |
-
diff --git src/wp-includes/js/comment-reply.js src/wp-includes/js/comment-reply.js
index 55a4e9c9b..06d5f6240 100644
|
|
|
|
| 3 | 3 | * |
| 4 | 4 | * @since 2.7.0 |
| 5 | 5 | * |
| | 6 | * @ignore |
| | 7 | * |
| 6 | 8 | * @type {Object} |
| 7 | 9 | */ |
| 8 | 10 | var addComment; |
-
diff --git src/wp-includes/js/customize-base.js src/wp-includes/js/customize-base.js
index 628d26745..374f50300 100644
|
|
|
window.wp = window.wp || {}; |
| 908 | 908 | /** |
| 909 | 909 | * Get all customize settings. |
| 910 | 910 | * |
| 911 | | * @memberOf wp.customize |
| | 911 | * @alias wp.customize.get |
| 912 | 912 | * |
| 913 | 913 | * @return {object} |
| 914 | 914 | */ |
| … |
… |
window.wp = window.wp || {}; |
| 934 | 934 | * |
| 935 | 935 | * @since 4.7.0 |
| 936 | 936 | * @access public |
| 937 | | * @memberOf wp.customize.utils |
| | 937 | * |
| | 938 | * @alias wp.customize.utils.parseQueryString |
| 938 | 939 | * |
| 939 | 940 | * @param {string} queryString Query string. |
| 940 | 941 | * @returns {object} Parsed query string. |
-
diff --git src/wp-includes/js/media/views/frame/post.js src/wp-includes/js/media/views/frame/post.js
index 7ea2b8fd3..8c8906e26 100644
|
|
|
Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ |
| 445 | 445 | requires: { selection: true }, |
| 446 | 446 | |
| 447 | 447 | /** |
| 448 | | * @callback |
| | 448 | * @ignore |
| | 449 | * |
| 449 | 450 | * @fires wp.media.controller.State#insert |
| 450 | 451 | */ |
| 451 | 452 | click: function() { |
-
diff --git src/wp-includes/js/mediaelement/wp-mediaelement.js src/wp-includes/js/mediaelement/wp-mediaelement.js
index 058213065..f43c2b836 100644
|
|
|
|
| 12 | 12 | * Ensures media elements that have already been initialized won't be |
| 13 | 13 | * processed again. |
| 14 | 14 | * |
| | 15 | * @memberOf wp.mediaelement |
| | 16 | * |
| 15 | 17 | * @since 4.4.0 |
| 16 | 18 | * |
| 17 | 19 | * @returns {void} |
| … |
… |
|
| 56 | 58 | }; |
| 57 | 59 | } |
| 58 | 60 | |
| | 61 | /** |
| | 62 | * @namespace wp.mediaelement |
| | 63 | * @memberOf wp |
| | 64 | */ |
| 59 | 65 | window.wp.mediaelement = new wpMediaElement(); |
| 60 | 66 | |
| 61 | 67 | $( window.wp.mediaelement.initialize ); |
-
diff --git src/wp-includes/js/mediaelement/wp-playlist.js src/wp-includes/js/mediaelement/wp-playlist.js
index 590da2e74..ddbccc86f 100644
|
|
|
|
| 3 | 3 | (function ($, _, Backbone) { |
| 4 | 4 | 'use strict'; |
| 5 | 5 | |
| 6 | | var WPPlaylistView = Backbone.View.extend({ |
| | 6 | var WPPlaylistView = Backbone.View.extend(/** @lends WPPlaylistView.prototype */{ |
| | 7 | /** |
| | 8 | * @constructs |
| | 9 | * |
| | 10 | * @param {Object} options The options to create this playlist view with. |
| | 11 | * @param {Object} options.metadata The metadata |
| | 12 | */ |
| 7 | 13 | initialize : function (options) { |
| 8 | 14 | this.index = 0; |
| 9 | 15 | this.settings = {}; |
| … |
… |
|
| 59 | 65 | this.settings.success = this.bindResetPlayer; |
| 60 | 66 | } |
| 61 | 67 | |
| 62 | | /** |
| 63 | | * This is also our bridge to the outside world |
| 64 | | */ |
| | 68 | // This is also our bridge to the outside world |
| 65 | 69 | this.player = new MediaElementPlayer( this.playerNode.get(0), this.settings ); |
| 66 | 70 | }, |
| 67 | 71 | |
-
diff --git src/wp-includes/js/plupload/wp-plupload.js src/wp-includes/js/plupload/wp-plupload.js
index 39df22e0a..1e947b09a 100644
|
|
|
|
| 1 | 1 | /* global pluploadL10n, plupload, _wpPluploadSettings */ |
| 2 | 2 | |
| | 3 | /** |
| | 4 | * @namespace wp |
| | 5 | */ |
| 3 | 6 | window.wp = window.wp || {}; |
| 4 | 7 | |
| 5 | 8 | ( function( exports, $ ) { |
| … |
… |
window.wp = window.wp || {}; |
| 16 | 19 | * This object bridges the Plupload API to integrate uploads into the |
| 17 | 20 | * WordPress back end and the WordPress media experience. |
| 18 | 21 | * |
| | 22 | * @class |
| | 23 | * @memberOf wp |
| | 24 | * @alias wp.Uploader |
| | 25 | * |
| 19 | 26 | * @param {object} options The options passed to the new plupload instance. |
| 20 | 27 | * @param {object} options.container The id of uploader container. |
| 21 | 28 | * @param {object} options.browser The id of button to trigger the file select. |
-
diff --git src/wp-includes/js/wp-api.js src/wp-includes/js/wp-api.js
index 0f5135f3c..d796ddc47 100644
|
|
|
|
| 1161 | 1161 | * have to retrieve it again for this session. Then, construct the models and collections based |
| 1162 | 1162 | * on the schema model data. |
| 1163 | 1163 | * |
| 1164 | | * @callback |
| | 1164 | * @ignore |
| 1165 | 1165 | */ |
| 1166 | 1166 | success: function( newSchemaModel ) { |
| 1167 | 1167 | |