Changeset 59016
- Timestamp:
- 09/11/2024 11:07:26 PM (4 weeks ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/inline-edit-post.js
r58894 r59016 251 251 // Get the term label text. 252 252 var label = $( this ).parent().text(); 253 // Set indeterminate states for the backend. Add accessible text for indeterminate inputs. 253 // Set indeterminate states for the backend. Add accessible text for indeterminate inputs. 254 254 $( this ).after( '<input type="hidden" name="indeterminate_post_category[]" value="' + $( this ).val() + '">' ).attr( 'aria-label', label.trim() + ': ' + wp.i18n.__( 'Some selected posts have this category' ) ); 255 255 } … … 604 604 $( function() { 605 605 606 // Set the heartbeat interval to 1 5seconds.606 // Set the heartbeat interval to 10 seconds. 607 607 if ( typeof wp !== 'undefined' && wp.heartbeat ) { 608 wp.heartbeat.interval( 1 5);608 wp.heartbeat.interval( 10 ); 609 609 } 610 610 }).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) { -
trunk/src/js/_enqueues/admin/post.js
r57584 r59016 344 344 }).filter(':visible').find('.wp-tab-first').trigger( 'focus' ); 345 345 346 // Set the heartbeat interval to 1 5seconds if post lock dialogs are enabled.346 // Set the heartbeat interval to 10 seconds if post lock dialogs are enabled. 347 347 if ( wp.heartbeat && $('#post-lock-dialog').length ) { 348 wp.heartbeat.interval( 1 5);348 wp.heartbeat.interval( 10 ); 349 349 } 350 350 -
trunk/src/js/_enqueues/wp/heartbeat.js
r56809 r59016 133 133 134 134 /* 135 * The interval can be from 15 to 120 seconds and can be set temporarily to 5 seconds. 136 * It can be set in the initial options or changed later through JS and/or through PHP. 135 * Logic check: the interval can be from 1 to 3600 seconds and can be set temporarily 136 * to 5 seconds. It can be set in the initial options or changed later from JS 137 * or from PHP through the AJAX responses. 137 138 */ 138 139 if ( options.interval ) { 139 140 settings.mainInterval = options.interval; 140 141 141 if ( settings.mainInterval < 1 5) {142 settings.mainInterval = 1 5;143 } else if ( settings.mainInterval > 120 ) {144 settings.mainInterval = 120;142 if ( settings.mainInterval < 1 ) { 143 settings.mainInterval = 1; 144 } else if ( settings.mainInterval > 3600 ) { 145 settings.mainInterval = 3600; 145 146 } 146 147 } … … 722 723 * @memberOf wp.heartbeat.prototype 723 724 * 724 * @param {string|number} speed Interval: 'fast' or 5, 15, 30, 60, 120.725 * @param {string|number} speed Interval: 'fast' or integer between 1 and 3600 (seconds). 725 726 * Fast equals 5. 726 * @param { string} ticks Tells how many ticks before the interval reverts727 * back. Used with speed = 'fast' or 5.727 * @param {number} ticks Tells how many ticks before the interval reverts back. 728 * Value must be between 1 and 30. Used with speed = 'fast' or 5. 728 729 * 729 730 * @return {number} Current interval in seconds. … … 734 735 735 736 if ( speed ) { 736 switch ( speed ) { 737 case 'fast': 738 case 5: 739 newInterval = 5000; 740 break; 741 case 15: 742 newInterval = 15000; 743 break; 744 case 30: 745 newInterval = 30000; 746 break; 747 case 60: 748 newInterval = 60000; 749 break; 750 case 120: 751 newInterval = 120000; 752 break; 753 case 'long-polling': 754 // Allow long polling (experimental). 755 settings.mainInterval = 0; 756 return 0; 757 default: 737 if ( 'fast' === speed ) { 738 // Special case, see below. 739 newInterval = 5000; 740 } else if ( 'long-polling' === speed ) { 741 // Allow long polling (experimental). 742 settings.mainInterval = 0; 743 return 0; 744 } else { 745 speed = parseInt( speed, 10 ); 746 747 if ( speed >= 1 && speed <= 3600 ) { 748 newInterval = speed * 1000; 749 } else { 758 750 newInterval = settings.originalInterval; 751 } 759 752 } 760 753 … … 763 756 } 764 757 758 // Special case, runs for a number of ticks then reverts to the previous interval. 765 759 if ( 5000 === newInterval ) { 766 760 ticks = parseInt( ticks, 10 ) || 30; -
trunk/src/wp-admin/edit-form-blocks.php
r58904 r59016 122 122 sprintf( 'var _wpMetaBoxUrl = %s;', wp_json_encode( $meta_box_url ) ), 123 123 'before' 124 ); 125 126 // Set Heartbeat interval to 10 seconds, used to refresh post locks. 127 wp_add_inline_script( 128 'heartbeat', 129 'if ( window.wp && window.wp.heartbeat ) { 130 window.wp.heartbeat.interval( 10 ); 131 }' 124 132 ); 125 133
Note: See TracChangeset
for help on using the changeset viewer.