-
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 5ff47c499..fe10d0b24 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 | * |
| … |
… |
|
| 2624 | 2627 | } |
| 2625 | 2628 | }); |
| 2626 | 2629 | |
| 2627 | | /** |
| 2628 | | * Class wp.customize.OuterSection. |
| 2629 | | * |
| 2630 | | * Creates section outside of the sidebar, there is no ui to trigger collapse/expand so |
| 2631 | | * it would require custom handling. |
| 2632 | | * |
| 2633 | | * @since 4.9 |
| 2634 | | * |
| 2635 | | * @constructor |
| 2636 | | * @augments wp.customize.Section |
| 2637 | | * @augments wp.customize.Container |
| 2638 | | */ |
| 2639 | | api.OuterSection = api.Section.extend({ |
| | 2630 | api.OuterSection = api.Section.extend(/** @lends wp.customize.OuterSection.prototype */{ |
| 2640 | 2631 | |
| 2641 | 2632 | /** |
| 2642 | | * Initialize. |
| | 2633 | * Class wp.customize.OuterSection. |
| | 2634 | * |
| | 2635 | * Creates section outside of the sidebar, there is no ui to trigger collapse/expand so |
| | 2636 | * it would require custom handling. |
| | 2637 | * |
| | 2638 | * @constructs wp.customize.OuterSection |
| | 2639 | * @augments wp.customize.Section |
| 2643 | 2640 | * |
| 2644 | 2641 | * @since 4.9.0 |
| 2645 | 2642 | * |
| … |
… |
|
| 2743 | 2740 | } |
| 2744 | 2741 | }); |
| 2745 | 2742 | |
| 2746 | | /** |
| 2747 | | * @since 4.1.0 |
| 2748 | | * |
| 2749 | | * @class |
| 2750 | | * @augments wp.customize.Class |
| 2751 | | */ |
| 2752 | | api.Panel = Container.extend({ |
| | 2743 | api.Panel = Container.extend(/** @lends wp.customize.Panel.prototype */{ |
| 2753 | 2744 | containerType: 'panel', |
| 2754 | 2745 | |
| 2755 | 2746 | /** |
| | 2747 | * @constructs wp.customize.Panel |
| | 2748 | * @augments wp.customize~Container |
| | 2749 | * |
| 2756 | 2750 | * @since 4.1.0 |
| 2757 | 2751 | * |
| 2758 | 2752 | * @param {string} id - The ID for the panel. |
| … |
… |
|
| 3017 | 3011 | } |
| 3018 | 3012 | }); |
| 3019 | 3013 | |
| 3020 | | /** |
| 3021 | | * Class wp.customize.ThemesPanel. |
| 3022 | | * |
| 3023 | | * Custom section for themes that displays without the customize preview. |
| 3024 | | * |
| 3025 | | * @constructor |
| 3026 | | * @augments wp.customize.Panel |
| 3027 | | * @augments wp.customize.Container |
| 3028 | | */ |
| 3029 | | api.ThemesPanel = api.Panel.extend({ |
| | 3014 | api.ThemesPanel = api.Panel.extend(/** @lends wp.customize.ThemsPanel.prototype */{ |
| 3030 | 3015 | |
| 3031 | 3016 | /** |
| 3032 | | * Initialize. |
| | 3017 | * Class wp.customize.ThemesPanel. |
| | 3018 | * |
| | 3019 | * Custom section for themes that displays without the customize preview. |
| | 3020 | * |
| | 3021 | * @constructs wp.customize.ThemesPanel |
| | 3022 | * @augments wp.customize.Panel |
| 3033 | 3023 | * |
| 3034 | 3024 | * @since 4.9.0 |
| 3035 | 3025 | * |
| … |
… |
|
| 3448 | 3438 | } |
| 3449 | 3439 | }); |
| 3450 | 3440 | |
| 3451 | | /** |
| 3452 | | * A Customizer Control. |
| 3453 | | * |
| 3454 | | * A control provides a UI element that allows a user to modify a Customizer Setting. |
| 3455 | | * |
| 3456 | | * @see PHP class WP_Customize_Control. |
| 3457 | | * |
| 3458 | | * @class |
| 3459 | | * @augments wp.customize.Class |
| 3460 | | */ |
| 3461 | | api.Control = api.Class.extend({ |
| | 3441 | api.Control = api.Class.extend(/** @lends wp.customize.Control.prototype */{ |
| 3462 | 3442 | defaultActiveArguments: { duration: 'fast', completeCallback: $.noop }, |
| 3463 | 3443 | |
| 3464 | 3444 | /** |
| … |
… |
|
| 3475 | 3455 | }, |
| 3476 | 3456 | |
| 3477 | 3457 | /** |
| 3478 | | * Initialize. |
| | 3458 | * A Customizer Control. |
| | 3459 | * |
| | 3460 | * A control provides a UI element that allows a user to modify a Customizer Setting. |
| | 3461 | * |
| | 3462 | * @see PHP class WP_Customize_Control. |
| | 3463 | * |
| | 3464 | * @constructs wp.customize.Control |
| | 3465 | * @augments wp.customize.Class |
| | 3466 | * |
| | 3467 | * @borrows wp.customize~focus as focus |
| | 3468 | * @borrows wp.customize~Container.prototype.activate as activate |
| | 3469 | * @borrows wp.customize~Container.prototype.deactivate as deactivate |
| | 3470 | * @borrows wp.customize~Container.prototype._toggleActive as _toggleActive |
| 3479 | 3471 | * |
| 3480 | 3472 | * @param {string} id - Unique identifier for the control instance. |
| 3481 | 3473 | * @param {object} options - Options hash for the control instance. |
| … |
… |
|
| 3741 | 3733 | * |
| 3742 | 3734 | * @since 4.6.0 |
| 3743 | 3735 | * @returns {jQuery} Setting validation message element. |
| 3744 | | * @this {wp.customize.Control} |
| 3745 | 3736 | */ |
| 3746 | 3737 | getNotificationsContainerElement: function() { |
| 3747 | 3738 | var control = this, controlTitle, notificationsContainer; |
| … |
… |
|
| 3885 | 3876 | api.section( this.section() ).expand( params ); |
| 3886 | 3877 | }, |
| 3887 | 3878 | |
| 3888 | | /** |
| 3889 | | * Bring the containing section and panel into view and then |
| 3890 | | * this control into view, focusing on the first input. |
| | 3879 | /* |
| | 3880 | * Documented using @borrows in the constructor. |
| 3891 | 3881 | */ |
| 3892 | 3882 | focus: focus, |
| 3893 | 3883 | |
| … |
… |
|
| 3931 | 3921 | return this.onChangeActive( active, this.defaultActiveArguments ); |
| 3932 | 3922 | }, |
| 3933 | 3923 | |
| 3934 | | /** |
| 3935 | | * Shorthand way to enable the active state. |
| 3936 | | * |
| 3937 | | * @since 4.1.0 |
| 3938 | | * |
| 3939 | | * @param {Object} [params] |
| 3940 | | * @returns {Boolean} false if already active |
| | 3924 | /* |
| | 3925 | * Documented using @borrows in the constructor |
| 3941 | 3926 | */ |
| 3942 | 3927 | activate: Container.prototype.activate, |
| 3943 | 3928 | |
| 3944 | | /** |
| 3945 | | * Shorthand way to disable the active state. |
| 3946 | | * |
| 3947 | | * @since 4.1.0 |
| 3948 | | * |
| 3949 | | * @param {Object} [params] |
| 3950 | | * @returns {Boolean} false if already inactive |
| | 3929 | /* |
| | 3930 | * Documented using @borrows in the constructor |
| 3951 | 3931 | */ |
| 3952 | 3932 | deactivate: Container.prototype.deactivate, |
| 3953 | 3933 | |
| 3954 | | /** |
| 3955 | | * Re-use _toggleActive from Container class. |
| 3956 | | * |
| 3957 | | * @access private |
| | 3934 | /* |
| | 3935 | * Documented using @borrows in the constructor |
| 3958 | 3936 | */ |
| 3959 | 3937 | _toggleActive: Container.prototype._toggleActive, |
| 3960 | 3938 | |
| … |
… |
|
| 4128 | 4106 | /** |
| 4129 | 4107 | * A colorpicker control. |
| 4130 | 4108 | * |
| 4131 | | * @class |
| | 4109 | * @class wp.customize.ColorControl |
| 4132 | 4110 | * @augments wp.customize.Control |
| 4133 | | * @augments wp.customize.Class |
| 4134 | 4111 | */ |
| 4135 | | api.ColorControl = api.Control.extend({ |
| | 4112 | api.ColorControl = api.Control.extend(/** @lends wp.customize.ColorControl.prototype */{ |
| 4136 | 4113 | ready: function() { |
| 4137 | 4114 | var control = this, |
| 4138 | 4115 | isHueSlider = this.params.mode === 'hue', |
| … |
… |
|
| 4192 | 4169 | /** |
| 4193 | 4170 | * A control that implements the media modal. |
| 4194 | 4171 | * |
| 4195 | | * @class |
| | 4172 | * @class wp.customize.MediaControl |
| 4196 | 4173 | * @augments wp.customize.Control |
| 4197 | | * @augments wp.customize.Class |
| 4198 | 4174 | */ |
| 4199 | | api.MediaControl = api.Control.extend({ |
| | 4175 | api.MediaControl = api.Control.extend(/** @lends wp.customize.MediaControl.prototype */{ |
| 4200 | 4176 | |
| 4201 | 4177 | /** |
| 4202 | 4178 | * When the control's DOM structure is ready, |
| … |
… |
|
| 4381 | 4357 | /** |
| 4382 | 4358 | * An upload control, which utilizes the media modal. |
| 4383 | 4359 | * |
| 4384 | | * @class |
| | 4360 | * @class wp.customize.UploadControl |
| 4385 | 4361 | * @augments wp.customize.MediaControl |
| 4386 | | * @augments wp.customize.Control |
| 4387 | | * @augments wp.customize.Class |
| 4388 | 4362 | */ |
| 4389 | | api.UploadControl = api.MediaControl.extend({ |
| | 4363 | api.UploadControl = api.MediaControl.extend(/** @lends wp.customize.UploadControl.prototype */{ |
| 4390 | 4364 | |
| 4391 | 4365 | /** |
| 4392 | 4366 | * Callback handler for when an attachment is selected in the media modal. |
| … |
… |
|
| 4425 | 4399 | * This control no longer needs to do anything more |
| 4426 | 4400 | * than what the upload control does in JS. |
| 4427 | 4401 | * |
| 4428 | | * @class |
| | 4402 | * @class wp.customize.ImageControl |
| 4429 | 4403 | * @augments wp.customize.UploadControl |
| 4430 | | * @augments wp.customize.MediaControl |
| 4431 | | * @augments wp.customize.Control |
| 4432 | | * @augments wp.customize.Class |
| 4433 | 4404 | */ |
| 4434 | | api.ImageControl = api.UploadControl.extend({ |
| | 4405 | api.ImageControl = api.UploadControl.extend(/** @lends wp.customize.ImageControl.prototype */{ |
| 4435 | 4406 | // @deprecated |
| 4436 | 4407 | thumbnailSrc: function() {} |
| 4437 | 4408 | }); |
| … |
… |
|
| 4439 | 4410 | /** |
| 4440 | 4411 | * A control for uploading background images. |
| 4441 | 4412 | * |
| 4442 | | * @class |
| | 4413 | * @class wp.customize.BackgroundControl |
| 4443 | 4414 | * @augments wp.customize.UploadControl |
| 4444 | | * @augments wp.customize.MediaControl |
| 4445 | | * @augments wp.customize.Control |
| 4446 | | * @augments wp.customize.Class |
| 4447 | 4415 | */ |
| 4448 | | api.BackgroundControl = api.UploadControl.extend({ |
| | 4416 | api.BackgroundControl = api.UploadControl.extend(/** @lends wp.customize.BackgroundControl.prototype */{ |
| 4449 | 4417 | |
| 4450 | 4418 | /** |
| 4451 | 4419 | * When the control's DOM structure is ready, |
| … |
… |
|
| 4476 | 4444 | * |
| 4477 | 4445 | * @since 4.7.0 |
| 4478 | 4446 | * |
| 4479 | | * @class |
| | 4447 | * @class wp.customize.BackgroundPositionControl |
| 4480 | 4448 | * @augments wp.customize.Control |
| 4481 | | * @augments wp.customize.Class |
| 4482 | 4449 | */ |
| 4483 | | api.BackgroundPositionControl = api.Control.extend( { |
| | 4450 | api.BackgroundPositionControl = api.Control.extend(/** @lends wp.customize.BackgroundPositionControl.prototype */{ |
| 4484 | 4451 | |
| 4485 | 4452 | /** |
| 4486 | 4453 | * Set up control UI once embedded in DOM and settings are created. |
| … |
… |
|
| 4515 | 4482 | /** |
| 4516 | 4483 | * A control for selecting and cropping an image. |
| 4517 | 4484 | * |
| 4518 | | * @class |
| | 4485 | * @class wp.customize.CroppedImageControl |
| 4519 | 4486 | * @augments wp.customize.MediaControl |
| 4520 | | * @augments wp.customize.Control |
| 4521 | | * @augments wp.customize.Class |
| 4522 | 4487 | */ |
| 4523 | | api.CroppedImageControl = api.MediaControl.extend({ |
| | 4488 | api.CroppedImageControl = api.MediaControl.extend(/** @lends wp.customize.CroppedImageControl.prototype */{ |
| 4524 | 4489 | |
| 4525 | 4490 | /** |
| 4526 | 4491 | * Open the media modal to the library state. |
| … |
… |
|
| 4717 | 4682 | /** |
| 4718 | 4683 | * A control for selecting and cropping Site Icons. |
| 4719 | 4684 | * |
| 4720 | | * @class |
| | 4685 | * @class wp.customize.SiteIconControl |
| 4721 | 4686 | * @augments wp.customize.CroppedImageControl |
| 4722 | | * @augments wp.customize.MediaControl |
| 4723 | | * @augments wp.customize.Control |
| 4724 | | * @augments wp.customize.Class |
| 4725 | 4687 | */ |
| 4726 | | api.SiteIconControl = api.CroppedImageControl.extend({ |
| | 4688 | api.SiteIconControl = api.CroppedImageControl.extend(/** @lends wp.customize.SiteIconControl.prototype */{ |
| 4727 | 4689 | |
| 4728 | 4690 | /** |
| 4729 | 4691 | * Create a media modal select frame, and store it so the instance can be reused when needed. |
| … |
… |
|
| 4838 | 4800 | }); |
| 4839 | 4801 | |
| 4840 | 4802 | /** |
| 4841 | | * @class |
| | 4803 | * @class wp.customize.HeaderControl |
| 4842 | 4804 | * @augments wp.customize.Control |
| 4843 | | * @augments wp.customize.Class |
| 4844 | 4805 | */ |
| 4845 | | api.HeaderControl = api.Control.extend({ |
| | 4806 | api.HeaderControl = api.Control.extend(/** @lends wp.customize.HeaderControl.prototype */{ |
| 4846 | 4807 | ready: function() { |
| 4847 | 4808 | this.btnRemove = $('#customize-control-header_image .actions .remove'); |
| 4848 | 4809 | this.btnNew = $('#customize-control-header_image .actions .new'); |
| … |
… |
|
| 5108 | 5069 | /** |
| 5109 | 5070 | * wp.customize.ThemeControl |
| 5110 | 5071 | * |
| 5111 | | * @constructor |
| | 5072 | * @class wp.customize.ThemeControl |
| 5112 | 5073 | * @augments wp.customize.Control |
| 5113 | | * @augments wp.customize.Class |
| 5114 | 5074 | */ |
| 5115 | | api.ThemeControl = api.Control.extend({ |
| | 5075 | api.ThemeControl = api.Control.extend(/** @lends wp.customize.ThemeControl.prototype */{ |
| 5116 | 5076 | |
| 5117 | 5077 | touchDrag: false, |
| 5118 | 5078 | screenshotRendered: false, |
| … |
… |
|
| 5260 | 5220 | * |
| 5261 | 5221 | * @since 4.9.0 |
| 5262 | 5222 | * |
| 5263 | | * @constructor |
| | 5223 | * @class wp.customize.CodeEditorControl |
| 5264 | 5224 | * @augments wp.customize.Control |
| 5265 | | * @augments wp.customize.Class |
| 5266 | 5225 | */ |
| 5267 | | api.CodeEditorControl = api.Control.extend({ |
| | 5226 | api.CodeEditorControl = api.Control.extend(/** @lends wp.customize.CodeEditorControl.prototype */{ |
| 5268 | 5227 | |
| 5269 | 5228 | /** |
| 5270 | 5229 | * Initialize. |
| … |
… |
|
| 5560 | 5519 | * Class wp.customize.DateTimeControl. |
| 5561 | 5520 | * |
| 5562 | 5521 | * @since 4.9.0 |
| 5563 | | * @constructor |
| | 5522 | * @class wp.customize.DateTimeControl |
| 5564 | 5523 | * @augments wp.customize.Control |
| 5565 | | * @augments wp.customize.Class |
| 5566 | 5524 | */ |
| 5567 | | api.DateTimeControl = api.Control.extend({ |
| | 5525 | api.DateTimeControl = api.Control.extend(/** @lends wp.customize.DateTimeControl.prototype */{ |
| 5568 | 5526 | |
| 5569 | 5527 | /** |
| 5570 | 5528 | * Initialize behaviors. |
| … |
… |
|
| 5915 | 5873 | * Class PreviewLinkControl. |
| 5916 | 5874 | * |
| 5917 | 5875 | * @since 4.9.0 |
| 5918 | | * @constructor |
| | 5876 | * @class wp.customize.DateTimeControl |
| 5919 | 5877 | * @augments wp.customize.Control |
| 5920 | | * @augments wp.customize.Class |
| 5921 | 5878 | */ |
| 5922 | | api.PreviewLinkControl = api.Control.extend({ |
| | 5879 | api.PreviewLinkControl = api.Control.extend(/** @lends wp.customize.DateTimeControl.prototype */{ |
| 5923 | 5880 | |
| 5924 | 5881 | defaults: _.extend( {}, api.Control.prototype.defaults, { |
| 5925 | 5882 | templateId: 'customize-preview-link-control' |
| … |
… |
|
| 6033 | 5990 | } |
| 6034 | 5991 | }); |
| 6035 | 5992 | |
| 6036 | | // Change objects contained within the main customize object to Settings. |
| | 5993 | /** |
| | 5994 | * Change objects contained within the main customize object to Settings. |
| | 5995 | * |
| | 5996 | * @alias wp.customize.defaultConstructor |
| | 5997 | */ |
| 6037 | 5998 | api.defaultConstructor = api.Setting; |
| 6038 | 5999 | |
| 6039 | 6000 | /** |
| 6040 | 6001 | * Callback for resolved controls. |
| 6041 | 6002 | * |
| 6042 | | * @callback deferredControlsCallback |
| | 6003 | * @callback wp.customize.deferredControlsCallback |
| 6043 | 6004 | * @param {wp.customize.Control[]} Resolved controls. |
| 6044 | 6005 | */ |
| 6045 | 6006 | |
| 6046 | 6007 | /** |
| 6047 | 6008 | * Collection of all registered controls. |
| 6048 | 6009 | * |
| | 6010 | * @alias wp.customize.control |
| | 6011 | * |
| 6049 | 6012 | * @since 3.4.0 |
| 6050 | 6013 | * |
| 6051 | 6014 | * @type {Function} |
| … |
… |
|
| 6098 | 6061 | /** |
| 6099 | 6062 | * Callback for resolved sections. |
| 6100 | 6063 | * |
| 6101 | | * @callback deferredSectionsCallback |
| | 6064 | * @callback wp.customize.deferredSectionsCallback |
| 6102 | 6065 | * @param {wp.customize.Section[]} Resolved sections. |
| 6103 | 6066 | */ |
| 6104 | 6067 | |
| 6105 | 6068 | /** |
| 6106 | 6069 | * Collection of all registered sections. |
| 6107 | 6070 | * |
| | 6071 | * @alias wp.customize.section |
| | 6072 | * |
| 6108 | 6073 | * @since 3.4.0 |
| 6109 | 6074 | * |
| 6110 | 6075 | * @type {Function} |
| … |
… |
|
| 6130 | 6095 | /** |
| 6131 | 6096 | * Callback for resolved panels. |
| 6132 | 6097 | * |
| 6133 | | * @callback deferredPanelsCallback |
| | 6098 | * @callback wp.customize.deferredPanelsCallback |
| 6134 | 6099 | * @param {wp.customize.Panel[]} Resolved panels. |
| 6135 | 6100 | */ |
| 6136 | 6101 | |
| 6137 | 6102 | /** |
| 6138 | 6103 | * Collection of all registered panels. |
| 6139 | 6104 | * |
| | 6105 | * @alias wp.customize.panel |
| | 6106 | * |
| 6140 | 6107 | * @since 4.0.0 |
| 6141 | 6108 | * |
| 6142 | 6109 | * @type {Function} |
| … |
… |
|
| 6162 | 6129 | /** |
| 6163 | 6130 | * Callback for resolved notifications. |
| 6164 | 6131 | * |
| 6165 | | * @callback deferredNotificationsCallback |
| | 6132 | * @callback wp.customize.deferredNotificationsCallback |
| 6166 | 6133 | * @param {wp.customize.Notification[]} Resolved notifications. |
| 6167 | 6134 | */ |
| 6168 | 6135 | |
| 6169 | 6136 | /** |
| 6170 | 6137 | * Collection of all global notifications. |
| 6171 | 6138 | * |
| | 6139 | * @alias wp.customize.notifications |
| | 6140 | * |
| 6172 | 6141 | * @since 4.9.0 |
| 6173 | 6142 | * |
| 6174 | 6143 | * @type {Function} |
| … |
… |
|
| 6199 | 6168 | */ |
| 6200 | 6169 | api.notifications = new api.Notifications(); |
| 6201 | 6170 | |
| 6202 | | /** |
| 6203 | | * An object that fetches a preview in the background of the document, which |
| 6204 | | * allows for seamless replacement of an existing preview. |
| 6205 | | * |
| 6206 | | * @class |
| 6207 | | * @augments wp.customize.Messenger |
| 6208 | | * @augments wp.customize.Class |
| 6209 | | * @mixes wp.customize.Events |
| 6210 | | */ |
| 6211 | | api.PreviewFrame = api.Messenger.extend({ |
| | 6171 | api.PreviewFrame = api.Messenger.extend(/** @lends wp.customize.PreviewFrame.prototype */{ |
| 6212 | 6172 | sensitivity: null, // Will get set to api.settings.timeouts.previewFrameSensitivity. |
| 6213 | 6173 | |
| 6214 | 6174 | /** |
| 6215 | | * Initialize the PreviewFrame. |
| | 6175 | * An object that fetches a preview in the background of the document, which |
| | 6176 | * allows for seamless replacement of an existing preview. |
| | 6177 | * |
| | 6178 | * @constructs wp.customize.PreviewFrame |
| | 6179 | * @augments wp.customize.Messenger |
| 6216 | 6180 | * |
| 6217 | 6181 | * @param {object} params.container |
| 6218 | 6182 | * @param {object} params.previewUrl |
| … |
… |
|
| 6430 | 6394 | /** |
| 6431 | 6395 | * Set the document title of the customizer. |
| 6432 | 6396 | * |
| | 6397 | * @alias wp.customize.setDocumentTitle |
| | 6398 | * |
| 6433 | 6399 | * @since 4.1.0 |
| 6434 | 6400 | * |
| 6435 | 6401 | * @param {string} documentTitle |
| … |
… |
|
| 6442 | 6408 | api.trigger( 'title', title ); |
| 6443 | 6409 | }; |
| 6444 | 6410 | |
| 6445 | | /** |
| 6446 | | * @class |
| 6447 | | * @augments wp.customize.Messenger |
| 6448 | | * @augments wp.customize.Class |
| 6449 | | * @mixes wp.customize.Events |
| 6450 | | */ |
| 6451 | | api.Previewer = api.Messenger.extend({ |
| | 6411 | api.Previewer = api.Messenger.extend(/** @lends wp.customize.Previewer.prototype */{ |
| 6452 | 6412 | refreshBuffer: null, // Will get set to api.settings.timeouts.windowRefresh. |
| 6453 | 6413 | |
| 6454 | 6414 | /** |
| | 6415 | * @constructs wp.customize.Previewer |
| | 6416 | * @augments wp.customize.Messenger |
| | 6417 | * |
| 6455 | 6418 | * @param {array} params.allowedUrls |
| 6456 | 6419 | * @param {string} params.container A selector or jQuery element for the preview |
| 6457 | 6420 | * frame to be placed. |
| … |
… |
|
| 6905 | 6868 | * |
| 6906 | 6869 | * Add notifications to the settings and focus on the first control that has an invalid setting. |
| 6907 | 6870 | * |
| | 6871 | * @alias wp.customize._handleSettingValidities |
| | 6872 | * |
| 6908 | 6873 | * @since 4.6.0 |
| 6909 | 6874 | * @private |
| 6910 | 6875 | * |
| … |
… |
|
| 6980 | 6945 | /** |
| 6981 | 6946 | * Find all controls associated with the given settings. |
| 6982 | 6947 | * |
| | 6948 | * @alias wp.customize.findControlsForSettings |
| | 6949 | * |
| 6983 | 6950 | * @since 4.6.0 |
| 6984 | 6951 | * @param {string[]} settingIds Setting IDs. |
| 6985 | 6952 | * @returns {object<string, wp.customize.Control>} Mapping setting ids to arrays of controls. |
| … |
… |
|
| 7001 | 6968 | /** |
| 7002 | 6969 | * Sort panels, sections, controls by priorities. Hide empty sections and panels. |
| 7003 | 6970 | * |
| | 6971 | * @alias wp.customize.reflowPaneContents |
| | 6972 | * |
| 7004 | 6973 | * @since 4.1.0 |
| 7005 | 6974 | */ |
| 7006 | 6975 | api.reflowPaneContents = _.bind( function () { |
| … |
… |
|
| 7365 | 7334 | } |
| 7366 | 7335 | }); |
| 7367 | 7336 | |
| 7368 | | // Initialize Previewer |
| | 7337 | /** |
| | 7338 | * Initialize Previewer |
| | 7339 | * |
| | 7340 | * @alias wp.customize.previewer |
| | 7341 | */ |
| 7369 | 7342 | api.previewer = new api.Previewer({ |
| 7370 | 7343 | container: '#customize-preview', |
| 7371 | 7344 | form: '#customize-controls', |
| 7372 | 7345 | previewUrl: api.settings.url.preview, |
| 7373 | 7346 | allowedUrls: api.settings.url.allowed |
| 7374 | | }, { |
| | 7347 | },/** @lends wp.customize.previewer */{ |
| 7375 | 7348 | |
| 7376 | 7349 | nonce: api.settings.nonce, |
| 7377 | 7350 | |
| … |
… |
|
| 8074 | 8047 | */ |
| 8075 | 8048 | ( function checkAndDisplayLockNotice() { |
| 8076 | 8049 | |
| 8077 | | /** |
| 8078 | | * A notification that is displayed in a full-screen overlay with information about the locked changeset. |
| 8079 | | * |
| 8080 | | * @since 4.9.0 |
| 8081 | | * @class |
| 8082 | | * @augments wp.customize.Notification |
| 8083 | | * @augments wp.customize.OverlayNotification |
| 8084 | | */ |
| 8085 | | var LockedNotification = api.OverlayNotification.extend({ |
| | 8050 | var LockedNotification = api.OverlayNotification.extend(/** @lends wp.customize~LockedNotification.prototype */{ |
| 8086 | 8051 | |
| 8087 | 8052 | /** |
| 8088 | 8053 | * Template ID. |
| … |
… |
|
| 8099 | 8064 | lockUser: null, |
| 8100 | 8065 | |
| 8101 | 8066 | /** |
| 8102 | | * Initialize. |
| | 8067 | * A notification that is displayed in a full-screen overlay with information about the locked changeset. |
| | 8068 | * |
| | 8069 | * @constructs wp.customize~LockedNotification |
| | 8070 | * @augments wp.customize.Notification |
| 8103 | 8071 | * |
| 8104 | 8072 | * @since 4.9.0 |
| 8105 | 8073 | * |
-
diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
index 3e223825c..a50966efa 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 | |
| … |
… |
|
| 749 | 753 | * Customizer panel for menus. This is used only for screen options management. |
| 750 | 754 | * Note that 'menus' must match the WP_Customize_Menu_Panel::$type. |
| 751 | 755 | * |
| 752 | | * @constructor |
| | 756 | * @class wp.customize.Menus.MenusPanel |
| 753 | 757 | * @augments wp.customize.Panel |
| 754 | 758 | */ |
| 755 | | api.Menus.MenusPanel = api.Panel.extend({ |
| | 759 | api.Menus.MenusPanel = api.Panel.extend(/** @lends wp.customize.Menus.MenusPanel.prototype */{ |
| 756 | 760 | |
| 757 | 761 | attachEvents: function() { |
| 758 | 762 | api.Panel.prototype.attachEvents.call( this ); |
| … |
… |
|
| 881 | 885 | * Customizer section for menus. This is used only for lazy-loading child controls. |
| 882 | 886 | * Note that 'nav_menu' must match the WP_Customize_Menu_Section::$type. |
| 883 | 887 | * |
| 884 | | * @constructor |
| | 888 | * @class wp.customize.Menus.MenuSection |
| 885 | 889 | * @augments wp.customize.Section |
| 886 | 890 | */ |
| 887 | | api.Menus.MenuSection = api.Section.extend({ |
| | 891 | api.Menus.MenuSection = api.Section.extend(/** @lends wp.customize.Menus.MenuSection.prototype */{ |
| 888 | 892 | |
| 889 | 893 | /** |
| 890 | 894 | * Initialize. |
| … |
… |
|
| 1208 | 1212 | * |
| 1209 | 1213 | * Customizer section for new menus. |
| 1210 | 1214 | * |
| 1211 | | * @constructor |
| | 1215 | * @class wp.customize.Menus.NewMenuSection |
| 1212 | 1216 | * @augments wp.customize.Section |
| 1213 | 1217 | */ |
| 1214 | | api.Menus.NewMenuSection = api.Section.extend({ |
| | 1218 | api.Menus.NewMenuSection = api.Section.extend(/** @lends wp.customize.Menus.NewMenuSection.prototype */{ |
| 1215 | 1219 | |
| 1216 | 1220 | /** |
| 1217 | 1221 | * Add behaviors for the accordion section. |
| … |
… |
|
| 1447 | 1451 | * Customizer control for menu locations (rendered as a <select>). |
| 1448 | 1452 | * Note that 'nav_menu_location' must match the WP_Customize_Nav_Menu_Location_Control::$type. |
| 1449 | 1453 | * |
| 1450 | | * @constructor |
| | 1454 | * @class wp.customize.Menus.MenuLocationControl |
| 1451 | 1455 | * @augments wp.customize.Control |
| 1452 | 1456 | */ |
| 1453 | | api.Menus.MenuLocationControl = api.Control.extend({ |
| | 1457 | api.Menus.MenuLocationControl = api.Control.extend(/** @lends wp.customize.Menus.MenuLocationControl.prototype */{ |
| 1454 | 1458 | initialize: function( id, options ) { |
| 1455 | 1459 | var control = this, |
| 1456 | 1460 | matches = id.match( /^nav_menu_locations\[(.+?)]/ ); |
| … |
… |
|
| 1525 | 1529 | } |
| 1526 | 1530 | }); |
| 1527 | 1531 | |
| 1528 | | /** |
| 1529 | | * wp.customize.Menus.MenuItemControl |
| 1530 | | * |
| 1531 | | * Customizer control for menu items. |
| 1532 | | * Note that 'menu_item' must match the WP_Customize_Menu_Item_Control::$type. |
| 1533 | | * |
| 1534 | | * @constructor |
| 1535 | | * @augments wp.customize.Control |
| 1536 | | */ |
| 1537 | | api.Menus.MenuItemControl = api.Control.extend({ |
| | 1532 | api.Menus.MenuItemControl = api.Control.extend(/** @lends wp.customize.Menus.MenuItemControl.prototype */{ |
| 1538 | 1533 | |
| 1539 | 1534 | /** |
| 1540 | | * @inheritdoc |
| | 1535 | * wp.customize.Menus.MenuItemControl |
| | 1536 | * |
| | 1537 | * Customizer control for menu items. |
| | 1538 | * Note that 'menu_item' must match the WP_Customize_Menu_Item_Control::$type. |
| | 1539 | * |
| | 1540 | * @constructs wp.customize.Menus.MenuItemControl |
| | 1541 | * @augments wp.customize.Control |
| | 1542 | * |
| | 1543 | * @inheritDoc |
| 1541 | 1544 | */ |
| 1542 | 1545 | initialize: function( id, options ) { |
| 1543 | 1546 | var control = this; |
| … |
… |
|
| 2320 | 2323 | * |
| 2321 | 2324 | * Customizer control for a nav menu's name. |
| 2322 | 2325 | * |
| 2323 | | * @constructor |
| | 2326 | * @class wp.customize.Menus.MenuNameControl |
| 2324 | 2327 | * @augments wp.customize.Control |
| 2325 | 2328 | */ |
| 2326 | | api.Menus.MenuNameControl = api.Control.extend({ |
| | 2329 | api.Menus.MenuNameControl = api.Control.extend(/** @lends wp.customize.Menus.MenuNameControl.prototype */{ |
| 2327 | 2330 | |
| 2328 | 2331 | ready: function() { |
| 2329 | 2332 | var control = this; |
| … |
… |
|
| 2360 | 2363 | * Customizer control for a nav menu's locations. |
| 2361 | 2364 | * |
| 2362 | 2365 | * @since 4.9.0 |
| 2363 | | * @constructor |
| | 2366 | * @class wp.customize.Menus.MenuLocationsControl |
| 2364 | 2367 | * @augments wp.customize.Control |
| 2365 | 2368 | */ |
| 2366 | | api.Menus.MenuLocationsControl = api.Control.extend({ |
| | 2369 | api.Menus.MenuLocationsControl = api.Control.extend(/** @lends wp.customize.Menus.MenuLocationsControl.prototype */{ |
| 2367 | 2370 | |
| 2368 | 2371 | /** |
| 2369 | 2372 | * Set up the control. |
| … |
… |
|
| 2433 | 2436 | * |
| 2434 | 2437 | * Customizer control for a nav menu's auto add. |
| 2435 | 2438 | * |
| 2436 | | * @constructor |
| | 2439 | * @class wp.customize.Menus.MenuAutoAddControl |
| 2437 | 2440 | * @augments wp.customize.Control |
| 2438 | 2441 | */ |
| 2439 | | api.Menus.MenuAutoAddControl = api.Control.extend({ |
| | 2442 | api.Menus.MenuAutoAddControl = api.Control.extend(/** @lends wp.customize.Menus.MenuAutoAddControl.prototype */{ |
| 2440 | 2443 | |
| 2441 | 2444 | ready: function() { |
| 2442 | 2445 | var control = this, |
| … |
… |
|
| 2486 | 2489 | * Customizer control for menus. |
| 2487 | 2490 | * Note that 'nav_menu' must match the WP_Menu_Customize_Control::$type |
| 2488 | 2491 | * |
| 2489 | | * @constructor |
| | 2492 | * @class wp.customize.Menus.MenuControl |
| 2490 | 2493 | * @augments wp.customize.Control |
| 2491 | 2494 | */ |
| 2492 | | api.Menus.MenuControl = api.Control.extend({ |
| | 2495 | api.Menus.MenuControl = api.Control.extend(/** @lends wp.customize.Menus.MenuControl.prototype */{ |
| 2493 | 2496 | /** |
| 2494 | 2497 | * Set up the control. |
| 2495 | 2498 | */ |
| … |
… |
|
| 3017 | 3020 | } |
| 3018 | 3021 | } ); |
| 3019 | 3022 | |
| 3020 | | /** |
| 3021 | | * wp.customize.Menus.NewMenuControl |
| 3022 | | * |
| 3023 | | * Customizer control for creating new menus and handling deletion of existing menus. |
| 3024 | | * Note that 'new_menu' must match the WP_Customize_New_Menu_Control::$type. |
| 3025 | | * |
| 3026 | | * @constructor |
| 3027 | | * @augments wp.customize.Control |
| 3028 | | * @deprecated 4.9.0 This class is no longer used due to new menu creation UX. |
| 3029 | | */ |
| 3030 | | api.Menus.NewMenuControl = api.Control.extend({ |
| | 3023 | api.Menus.NewMenuControl = api.Control.extend(/** @lends wp.customize.Menus.NewMenuControl.prototype */{ |
| 3031 | 3024 | |
| 3032 | 3025 | /** |
| 3033 | | * Initialize. |
| | 3026 | * wp.customize.Menus.NewMenuControl |
| 3034 | 3027 | * |
| 3035 | | * @deprecated 4.9.0 |
| | 3028 | * Customizer control for creating new menus and handling deletion of existing menus. |
| | 3029 | * Note that 'new_menu' must match the WP_Customize_New_Menu_Control::$type. |
| | 3030 | * |
| | 3031 | * @constructs wp.customize.Menus.NewMenuControl |
| | 3032 | * @augments wp.customize.Control |
| | 3033 | * |
| | 3034 | * @deprecated 4.9.0 This class is no longer used due to new menu creation UX. |
| 3036 | 3035 | */ |
| 3037 | 3036 | initialize: function() { |
| 3038 | 3037 | if ( 'undefined' !== typeof console && console.warn ) { |
| … |
… |
|
| 3162 | 3161 | * When customize_save comes back with a success, make sure any inserted |
| 3163 | 3162 | * nav menus and items are properly re-added with their newly-assigned IDs. |
| 3164 | 3163 | * |
| | 3164 | * @alias wp.customize.Menus.applySavedData |
| | 3165 | * |
| 3165 | 3166 | * @param {object} data |
| 3166 | 3167 | * @param {array} data.nav_menu_updates |
| 3167 | 3168 | * @param {array} data.nav_menu_item_updates |
| … |
… |
|
| 3392 | 3393 | /** |
| 3393 | 3394 | * Focus a menu item control. |
| 3394 | 3395 | * |
| | 3396 | * @alias wp.customize.Menus.focusMenuItemControl |
| | 3397 | * |
| 3395 | 3398 | * @param {string} menuItemId |
| 3396 | 3399 | */ |
| 3397 | 3400 | api.Menus.focusMenuItemControl = function( menuItemId ) { |
| … |
… |
|
| 3404 | 3407 | /** |
| 3405 | 3408 | * Get the control for a given menu. |
| 3406 | 3409 | * |
| | 3410 | * @alias wp.customize.Menus.getMenuControl |
| | 3411 | * |
| 3407 | 3412 | * @param menuId |
| 3408 | 3413 | * @return {wp.customize.controlConstructor.menus[]} |
| 3409 | 3414 | */ |
| … |
… |
|
| 3414 | 3419 | /** |
| 3415 | 3420 | * Given a menu item ID, get the control associated with it. |
| 3416 | 3421 | * |
| | 3422 | * @alias wp.customize.Menus.getMenuItemControl |
| | 3423 | * |
| 3417 | 3424 | * @param {string} menuItemId |
| 3418 | 3425 | * @return {object|null} |
| 3419 | 3426 | */ |
| … |
… |
|
| 3422 | 3429 | }; |
| 3423 | 3430 | |
| 3424 | 3431 | /** |
| | 3432 | * @alias wp.customize.Menus~menuItemIdToSettingId |
| | 3433 | * |
| 3425 | 3434 | * @param {String} menuItemId |
| 3426 | 3435 | */ |
| 3427 | 3436 | function menuItemIdToSettingId( menuItemId ) { |
| … |
… |
|
| 3432 | 3441 | * Apply sanitize_text_field()-like logic to the supplied name, returning a |
| 3433 | 3442 | * "unnammed" fallback string if the name is then empty. |
| 3434 | 3443 | * |
| | 3444 | * @alias wp.customize.Menus~displayNavMenuName |
| | 3445 | * |
| 3435 | 3446 | * @param {string} name |
| 3436 | 3447 | * @returns {string} |
| 3437 | 3448 | */ |
-
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/dashboard.js src/wp-admin/js/dashboard.js
index a6b56c37e..ab0741c8c 100644
|
|
|
jQuery( function( $ ) { |
| 195 | 195 | var communityEventsData = window.communityEventsData || {}, |
| 196 | 196 | app; |
| 197 | 197 | |
| 198 | | app = window.wp.communityEvents = { |
| | 198 | /** |
| | 199 | * @namespace wp.communityEvents |
| | 200 | */ |
| | 201 | app = window.wp.communityEvents = /** @lends wp.communityEvents */{ |
| 199 | 202 | initialized: false, |
| 200 | 203 | model: null, |
| 201 | 204 | |
-
diff --git src/wp-admin/js/editor.js src/wp-admin/js/editor.js
index ed77d3c75..bbe2f9c81 100644
|
|
|
window.wp = window.wp || {}; |
| 1227 | 1227 | } |
| 1228 | 1228 | |
| 1229 | 1229 | /** |
| 1230 | | * @namespace {SwitchEditors} switchEditors |
| 1231 | 1230 | * Expose the switch editors to be used globally. |
| | 1231 | * |
| | 1232 | * @namespace switchEditors |
| 1232 | 1233 | */ |
| 1233 | 1234 | window.switchEditors = new SwitchEditors(); |
| 1234 | 1235 | |
-
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/class-wp-admin-bar.php src/wp-includes/class-wp-admin-bar.php
index 734a04827..3568be078 100644
|
|
|
class WP_Admin_Bar { |
| 434 | 434 | if ( $node->type != 'container' || empty( $node->children ) ) |
| 435 | 435 | return; |
| 436 | 436 | |
| 437 | | ?><div id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>" class="ab-group-container"><?php |
| 438 | | foreach ( $node->children as $group ) { |
| 439 | | $this->_render_group( $group ); |
| 440 | | } |
| 441 | | ?></div><?php |
| | 437 | echo '<div id="' . esc_attr( 'wp-admin-bar-' . $node->id ) . '" class="ab-group-container">'; |
| | 438 | foreach ( $node->children as $group ) { |
| | 439 | $this->_render_group( $group ); |
| | 440 | } |
| | 441 | echo '</div>'; |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | /** |
| … |
… |
class WP_Admin_Bar { |
| 457 | 457 | else |
| 458 | 458 | $class = ''; |
| 459 | 459 | |
| 460 | | ?><ul id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $class; ?>><?php |
| 461 | | foreach ( $node->children as $item ) { |
| 462 | | $this->_render_item( $item ); |
| 463 | | } |
| 464 | | ?></ul><?php |
| | 460 | echo "<ul id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$class>"; |
| | 461 | foreach ( $node->children as $item ) { |
| | 462 | $this->_render_item( $item ); |
| | 463 | } |
| | 464 | echo '</ul>'; |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
| … |
… |
class WP_Admin_Bar { |
| 491 | 491 | if ( $menuclass ) |
| 492 | 492 | $menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"'; |
| 493 | 493 | |
| 494 | | ?> |
| | 494 | echo "<li id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$menuclass>"; |
| 495 | 495 | |
| 496 | | <li id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $menuclass; ?>><?php |
| 497 | | if ( $has_link ): |
| 498 | | ?><a class="ab-item"<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php |
| 499 | | if ( ! empty( $node->meta['onclick'] ) ) : |
| 500 | | ?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php |
| 501 | | endif; |
| 502 | | if ( ! empty( $node->meta['target'] ) ) : |
| 503 | | ?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php |
| 504 | | endif; |
| 505 | | if ( ! empty( $node->meta['title'] ) ) : |
| 506 | | ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php |
| 507 | | endif; |
| 508 | | if ( ! empty( $node->meta['rel'] ) ) : |
| 509 | | ?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php |
| 510 | | endif; |
| 511 | | if ( ! empty( $node->meta['lang'] ) ) : |
| 512 | | ?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php |
| 513 | | endif; |
| 514 | | if ( ! empty( $node->meta['dir'] ) ) : |
| 515 | | ?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php |
| 516 | | endif; |
| 517 | | ?>><?php |
| 518 | | else: |
| 519 | | ?><div class="ab-item ab-empty-item"<?php echo $aria_attributes; |
| 520 | | if ( ! empty( $node->meta['title'] ) ) : |
| 521 | | ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php |
| 522 | | endif; |
| 523 | | if ( ! empty( $node->meta['lang'] ) ) : |
| 524 | | ?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php |
| 525 | | endif; |
| 526 | | if ( ! empty( $node->meta['dir'] ) ) : |
| 527 | | ?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php |
| 528 | | endif; |
| 529 | | ?>><?php |
| 530 | | endif; |
| 531 | | |
| 532 | | echo $node->title; |
| 533 | | |
| 534 | | if ( $has_link ) : |
| 535 | | ?></a><?php |
| 536 | | else: |
| 537 | | ?></div><?php |
| 538 | | endif; |
| 539 | | |
| 540 | | if ( $is_parent ) : |
| 541 | | ?><div class="ab-sub-wrapper"><?php |
| 542 | | foreach ( $node->children as $group ) { |
| 543 | | $this->_render_group( $group ); |
| 544 | | } |
| 545 | | ?></div><?php |
| 546 | | endif; |
| | 496 | if ( $has_link ) { |
| | 497 | $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); |
| | 498 | echo "<a class='ab-item'$aria_attributes href='" . esc_url( $node->href ) . "'"; |
| | 499 | if ( ! empty( $node->meta['onclick'] ) ) { |
| | 500 | echo ' onclick="' . esc_js( $node->meta['onclick'] ) . '"'; |
| | 501 | } |
| | 502 | } else { |
| | 503 | $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); |
| | 504 | echo '<div class="ab-item ab-empty-item"' . $aria_attributes; |
| | 505 | } |
| 547 | 506 | |
| 548 | | if ( ! empty( $node->meta['html'] ) ) |
| 549 | | echo $node->meta['html']; |
| | 507 | foreach ( $attributes as $attribute ) { |
| | 508 | if ( ! empty( $node->meta[ $attribute ] ) ) { |
| | 509 | echo " $attribute='" . esc_attr( $node->meta[ $attribute ] ) . '"'; |
| | 510 | } |
| | 511 | } |
| | 512 | |
| | 513 | echo ">{$node->title}"; |
| | 514 | |
| | 515 | if ( $has_link ) { |
| | 516 | echo '</a>'; |
| | 517 | } else { |
| | 518 | echo '</div>'; |
| | 519 | } |
| | 520 | |
| | 521 | if ( $is_parent ) { |
| | 522 | echo '<div class="ab-sub-wrapper">'; |
| | 523 | foreach ( $node->children as $group ) { |
| | 524 | $this->_render_group( $group ); |
| | 525 | } |
| | 526 | echo '</div>'; |
| | 527 | } |
| | 528 | |
| | 529 | if ( ! empty( $node->meta['html'] ) ) { |
| | 530 | echo $node->meta['html']; |
| | 531 | } |
| 550 | 532 | |
| 551 | | ?> |
| 552 | | </li><?php |
| | 533 | echo '</li>'; |
| 553 | 534 | } |
| 554 | 535 | |
| 555 | 536 | /** |
-
diff --git src/wp-includes/js/comment-reply.js src/wp-includes/js/comment-reply.js
index 3ddf7744c..27b13cea7 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 | |