Changeset 39345
- Timestamp:
- 11/23/2016 06:04:23 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r39271 r39345 46 46 * 47 47 * @since 3.4.0 48 * @access public 49 * 50 * @returns {void} 48 51 */ 49 52 preview: function() { … … 56 59 57 60 if ( 'postMessage' === transport ) { 58 returnsetting.previewer.send( 'setting', [ setting.id, setting() ] );61 setting.previewer.send( 'setting', [ setting.id, setting() ] ); 59 62 } else if ( 'refresh' === transport ) { 60 returnsetting.previewer.refresh();63 setting.previewer.refresh(); 61 64 } 62 65 }, … … 131 134 * Get the dirty setting values. 132 135 * 136 * @since 4.7.0 137 * @access public 138 * 133 139 * @param {object} [options] Options. 134 140 * @param {boolean} [options.unsaved=false] Whether only values not saved yet into a changeset will be returned (differential changes). … … 159 165 * Request updates to the changeset. 160 166 * 167 * @since 4.7.0 168 * @access public 169 * 161 170 * @param {object} [changes] Mapping of setting IDs to setting params each normally including a value property, or mapping to null. 162 171 * If not provided, then the changes will still be obtained from unsaved dirty settings. 163 * @returns {jQuery.Promise} 172 * @returns {jQuery.Promise} Promise resolving with the response data. 164 173 */ 165 174 api.requestChangesetUpdate = function requestChangesetUpdate( changes ) { … … 685 694 * 686 695 * @since 4.7.0 696 * @private 687 697 * 688 698 * @param {function} completeCallback Function to be called after transition is completed. 689 699 * @returns {void} 690 * @private691 700 */ 692 701 _animateChangeExpanded: function( completeCallback ) { … … 779 788 * 780 789 * @since 4.7.0 790 * @access public 781 791 * 782 792 * @returns {jQuery} Detached content element. … … 936 946 content.slideToggle(); 937 947 content.attr( 'aria-expanded', function ( i, attr ) { 938 return attr === 'true'? 'false' : 'true';948 return 'true' === attr ? 'false' : 'true'; 939 949 }); 940 950 }); … … 1420 1430 * 1421 1431 * @since 4.7.0 1432 * @access public 1422 1433 * 1423 1434 * @param {string} themeId Theme ID. … … 1452 1463 $( window ).off( 'beforeunload.customize-confirm' ); 1453 1464 top.location.href = urlParser.href; 1465 deferred.resolve(); 1454 1466 } ); 1455 1467 request.fail( function() { 1456 1468 overlay.removeClass( 'customize-loading' ); 1469 deferred.reject(); 1457 1470 } ); 1458 1471 }; … … 2274 2287 container.slideUp( 180 ); 2275 2288 toggle.slideDown( 180 ); 2276 } ) 2277 .always( function() {2289 } ); 2290 promise.always( function() { 2278 2291 input.val( '' ).removeAttr( 'disabled' ); 2279 2292 } ); … … 2321 2334 2322 2335 control.setting.bind( function ( value ) { 2323 // bail if the update came from the control itself2336 // Bail if the update came from the control itself. 2324 2337 if ( updating ) { 2325 2338 return; … … 2642 2655 * 2643 2656 * @since 4.7.0 2657 * @access public 2644 2658 */ 2645 2659 ready: function() { … … 3714 3728 } 3715 3729 3716 // Attempt to match the URL to the control frame's scheme 3717 // and check if it's allowed. If not, try the original URL. 3730 // Attempt to match the URL to the control frame's scheme and check if it's allowed. If not, try the original URL. 3718 3731 parsedAllowedUrl = document.createElement( 'a' ); 3719 3732 _.find( parsedCandidateUrls, function( parsedCandidateUrl ) { … … 3772 3785 * 3773 3786 * @since 4.7.0 3787 * @access public 3774 3788 * 3775 3789 * @param {object} data - Data from preview. … … 3846 3860 * 3847 3861 * @since 4.7.0 3862 * @access public 3848 3863 * 3849 3864 * @returns {void} … … 3905 3920 /** 3906 3921 * Refresh the preview seamlessly. 3922 * 3923 * @since 3.4.0 3924 * @access public 3925 * @returns {void} 3907 3926 */ 3908 3927 refresh: function() { … … 4300 4319 * Build the query to send along with the Preview request. 4301 4320 * 4321 * @since 3.4.0 4302 4322 * @since 4.7.0 Added options param. 4323 * @access public 4303 4324 * 4304 4325 * @param {object} [options] Options. … … 4334 4355 * has been added to the post type. 4335 4356 * 4357 * @since 3.4.0 4358 * @since 4.7.0 Added args param and return value. 4359 * 4336 4360 * @param {object} [args] Args. 4337 4361 * @param {string} [args.status=publish] Status. 4338 4362 * @param {string} [args.date] Date, in local time in MySQL format. 4339 4363 * @param {string} [args.title] Title 4340 * 4341 * @returns {jQuery.promise} 4364 * @returns {jQuery.promise} Promise. 4342 4365 */ 4343 4366 save: function( args ) { … … 4694 4717 }); 4695 4718 4719 /** 4720 * Populate URL with UUID via `history.replaceState()`. 4721 * 4722 * @since 4.7.0 4723 * @access private 4724 * 4725 * @param {boolean} isIncluded Is UUID included. 4726 * @returns {void} 4727 */ 4696 4728 populateChangesetUuidParam = function( isIncluded ) { 4697 4729 var urlParser, queryParams; … … 4830 4862 activeHeader, lastScrollTop; 4831 4863 4832 // Determine which panel or section is currently expanded. 4864 /** 4865 * Determine which panel or section is currently expanded. 4866 * 4867 * @since 4.7.0 4868 * @access private 4869 * 4870 * @param {wp.customize.Panel|wp.customize.Section} container Construct. 4871 * @returns {void} 4872 */ 4833 4873 changeContainer = function( container ) { 4834 4874 var newInstance = container, … … 4906 4946 }; 4907 4947 4908 // Get header height. 4948 /** 4949 * Get header height. 4950 * 4951 * @since 4.7.0 4952 * @access private 4953 * 4954 * @param {jQuery} headerElement Header element. 4955 * @returns {number} Height. 4956 */ 4909 4957 getHeaderHeight = function( headerElement ) { 4910 4958 var height = headerElement.data( 'height' ); … … 4916 4964 }; 4917 4965 4918 // Reposition header on throttled `scroll` event. 4966 /** 4967 * Reposition header on throttled `scroll` event. 4968 * 4969 * @since 4.7.0 4970 * @access private 4971 * 4972 * @param {object} header Header. 4973 * @param {number} scrollTop Scroll top. 4974 * @param {boolean} isScrollingUp Is scrolling up? 4975 * @returns {void} 4976 */ 4919 4977 positionStickyHeader = function( header, scrollTop, isScrollingUp ) { 4920 4978 var headerElement = header.element, … … 5363 5421 * Request changeset update and then re-schedule the next changeset update time. 5364 5422 * 5423 * @since 4.7.0 5365 5424 * @private 5366 5425 */ … … 5378 5437 * Schedule changeset update. 5379 5438 * 5439 * @since 4.7.0 5380 5440 * @private 5381 5441 */ -
trunk/src/wp-admin/js/customize-nav-menus.js
r39138 r39345 85 85 /** 86 86 * Insert a new `auto-draft` post. 87 * 88 * @since 4.7.0 89 * @access public 87 90 * 88 91 * @param {object} params - Parameters for the draft post to create. … … 563 566 }, 564 567 565 // Submit handler for keypress (enter) on field and click on button. 568 /** 569 * Submit handler for keypress (enter) on field and click on button. 570 * 571 * @since 4.7.0 572 * @private 573 * 574 * @param {jQuery.Event} event Event. 575 * @returns {void} 576 */ 566 577 _submitNew: function( event ) { 567 578 var container; … … 581 592 }, 582 593 583 // Creates a new object and adds an associated menu item to the menu. 594 /** 595 * Creates a new object and adds an associated menu item to the menu. 596 * 597 * @since 4.7.0 598 * @private 599 * 600 * @param {jQuery} container 601 * @returns {void} 602 */ 584 603 submitNew: function( container ) { 585 604 var panel = this, -
trunk/src/wp-includes/class-wp-customize-control.php
r39194 r39345 120 120 * @since 4.7.0 121 121 * @access public 122 * @var array122 * @var bool 123 123 */ 124 124 public $allow_addition = false; -
trunk/src/wp-includes/class-wp-customize-manager.php
r39332 r39345 3968 3968 return new WP_Error( 'invalid_value', __( 'Invalid value for background repeat.' ) ); 3969 3969 } 3970 } else 3970 } elseif ( 'background_attachment' === $setting->id ) { 3971 3971 if ( ! in_array( $value, array( 'fixed', 'scroll' ) ) ) { 3972 3972 return new WP_Error( 'invalid_value', __( 'Invalid value for background attachment.' ) ); 3973 3973 } 3974 } else 3974 } elseif ( 'background_position_x' === $setting->id ) { 3975 3975 if ( ! in_array( $value, array( 'left', 'center', 'right' ), true ) ) { 3976 3976 return new WP_Error( 'invalid_value', __( 'Invalid value for background position X.' ) ); 3977 3977 } 3978 } else 3978 } elseif ( 'background_position_y' === $setting->id ) { 3979 3979 if ( ! in_array( $value, array( 'top', 'center', 'bottom' ), true ) ) { 3980 3980 return new WP_Error( 'invalid_value', __( 'Invalid value for background position Y.' ) ); 3981 3981 } 3982 } else 3982 } elseif ( 'background_size' === $setting->id ) { 3983 3983 if ( ! in_array( $value, array( 'auto', 'contain', 'cover' ), true ) ) { 3984 3984 return new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) ); 3985 3985 } 3986 } else 3986 } elseif ( 'background_preset' === $setting->id ) { 3987 3987 if ( ! in_array( $value, array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) { 3988 3988 return new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) ); 3989 3989 } 3990 } else 3990 } elseif ( 'background_image' === $setting->id || 'background_image_thumb' === $setting->id ) { 3991 3991 $value = empty( $value ) ? '' : esc_url_raw( $value ); 3992 3992 } else { -
trunk/src/wp-includes/customize/class-wp-customize-color-control.php
r38931 r39345 17 17 class WP_Customize_Color_Control extends WP_Customize_Control { 18 18 /** 19 * Type. 20 * 19 21 * @access public 20 22 * @var string … … 23 25 24 26 /** 27 * Statuses. 28 * 25 29 * @access public 26 30 * @var array … … 29 33 30 34 /** 31 * @access public 32 * @var string 33 */ 35 * Mode. 36 * 37 * @since 4.7.0 38 * @access public 39 * @var string 40 */ 34 41 public $mode = 'full'; 35 42 -
trunk/src/wp-includes/customize/class-wp-customize-custom-css-setting.php
r39318 r39345 22 22 * The setting type. 23 23 * 24 * @since 4.7.0 25 * @access public 24 26 * @var string 25 *26 * @since 4.7.027 * @access public28 27 */ 29 28 public $type = 'custom_css'; … … 34 33 * @since 4.7.0 35 34 * @access public 36 *37 35 * @var string 38 36 */ … … 44 42 * @since 4.7.0 45 43 * @access public 46 *47 44 * @var string 48 45 */ … … 54 51 * @since 4.7.0 55 52 * @access public 56 *57 53 * @var string 58 54 */ -
trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
r38991 r39345 268 268 * 269 269 * @since 4.7.0 270 * @access protected 270 271 * 271 272 * @param object $item Nav menu item. -
trunk/src/wp-includes/js/customize-preview.js
r39332 r39345 133 133 * 134 134 * @since 4.7.0 135 * @access public 135 136 * 136 137 * @param {jQuery.Event} event Event. … … 179 180 * 180 181 * @since 4.7.0 182 * @access public 181 183 * 182 184 * @param {jQuery.Event} event Event. -
trunk/src/wp-includes/js/customize-selective-refresh.js
r39281 r39345 105 105 * 106 106 * @since 4.7.0 107 * @access public 107 108 * 108 109 * @param {Placement} placement The placement container element. … … 133 134 * 134 135 * @since 4.7.0 136 * @access public 135 137 * 136 138 * @param {Placement} placement The placement for the partial. … … 150 152 * 151 153 * @since 4.7.0 154 * @access public 152 155 * 153 156 * @return {string} Partial ID converted into a class name for use in shortcut. … … 163 166 * 164 167 * @since 4.7.0 168 * @access public 165 169 * 166 170 * @return {string} Tooltip for edit shortcut. … … 188 192 * 189 193 * @since 4.7.0 194 * @access public 190 195 * 191 196 * @return {string} Type of partial derived from type param or the related setting ID. … … 210 215 * 211 216 * @since 4.7.0 217 * @access public 212 218 * 213 219 * @return {jQuery} The edit shortcut button element.
Note: See TracChangeset
for help on using the changeset viewer.