Changeset 52228
- Timestamp:
- 11/20/2021 02:48:08 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/post.js
r52225 r52228 136 136 */ 137 137 window.WPRemoveThumbnail = function(nonce){ 138 $.post(ajaxurl, { 139 action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) 140 }, 138 $.post( 139 ajaxurl, { 140 action: 'set-post-thumbnail', 141 post_id: $( '#post_ID' ).val(), 142 thumbnail_id: -1, 143 _ajax_nonce: nonce, 144 cookie: encodeURIComponent( document.cookie ) 145 }, 141 146 /** 142 147 * Handle server response … … 145 150 */ 146 151 function(str){ 147 if ( str == '0' ) {148 alert( __( 'Could not set that as the thumbnail image. Try a different attachment.' ) );149 } else {150 WPSetThumbnailHTML(str);151 }152 }152 if ( str == '0' ) { 153 alert( __( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 154 } else { 155 WPSetThumbnailHTML(str); 156 } 157 } 153 158 ); 154 159 }; … … 208 213 alt: '', 209 214 src: received.lock_error.avatar_src, 210 srcset: received.lock_error.avatar_src_2x ? received.lock_error.avatar_src_2x + ' 2x' : undefined 215 srcset: received.lock_error.avatar_src_2x ? 216 received.lock_error.avatar_src_2x + ' 2x' : 217 undefined 211 218 } ); 212 219 wrap.find('div.post-locked-avatar').empty().append( avatar ); … … 667 674 668 675 // Sync checked items between "All {taxonomy}" and "Most used" lists. 669 $('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 'click', 'li.popular-category > label input[type="checkbox"]', function() { 670 var t = $(this), c = t.is(':checked'), id = t.val(); 671 if ( id && t.parents('#taxonomy-'+taxonomy).length ) 672 $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c ); 673 }); 676 $('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 677 'click', 678 'li.popular-category > label input[type="checkbox"]', 679 function() { 680 var t = $(this), c = t.is(':checked'), id = t.val(); 681 if ( id && t.parents('#taxonomy-'+taxonomy).length ) 682 $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c ); 683 } 684 ); 674 685 675 686 }); // End cats. … … 750 761 751 762 attemptedDate = new Date( aa, mm - 1, jj, hh, mn ); 752 originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() ); 753 currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); 763 originalDate = new Date( 764 $('#hidden_aa').val(), 765 $('#hidden_mm').val() -1, 766 $('#hidden_jj').val(), 767 $('#hidden_hh').val(), 768 $('#hidden_mn').val() 769 ); 770 currentDate = new Date( 771 $('#cur_aa').val(), 772 $('#cur_mm').val() -1, 773 $('#cur_jj').val(), 774 $('#cur_hh').val(), 775 $('#cur_mn').val() 776 ); 754 777 755 778 // Catch unexpected date problems. 756 if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) { 779 if ( 780 attemptedDate.getFullYear() != aa || 781 (1 + attemptedDate.getMonth()) != mm || 782 attemptedDate.getDate() != jj || 783 attemptedDate.getMinutes() != mn 784 ) { 757 785 $timestampdiv.find('.timestamp-wrap').addClass('form-invalid'); 758 786 return false; … … 821 849 822 850 // Show or hide the "Save Draft" button. 823 if ( $('option:selected', postStatus).val() == 'private' || $('option:selected', postStatus).val() == 'publish' ) { 851 if ( 852 $('option:selected', postStatus).val() == 'private' || 853 $('option:selected', postStatus).val() == 'publish' 854 ) { 824 855 $('#save-post').hide(); 825 856 } else { … … 995 1026 revert_e = $el.html(); 996 1027 997 buttons.html( '<button type="button" class="save button button-small">' + __( 'OK' ) + '</button> <button type="button" class="cancel button-link">' + __( 'Cancel' ) + '</button>' ); 1028 buttons.html( 1029 '<button type="button" class="save button button-small">' + __( 'OK' ) + '</button> ' + 1030 '<button type="button" class="cancel button-link">' + __( 'Cancel' ) + '</button>' 1031 ); 998 1032 999 1033 // Save permalink changes. … … 1051 1085 slug_label = __( 'URL Slug' ); 1052 1086 1053 $el.html( '<label for="new-post-slug" class="screen-reader-text">' + slug_label + '</label><input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" spellcheck="false" />' ).children( 'input' ).on( 'keydown', function( e ) { 1087 $el.html( 1088 '<label for="new-post-slug" class="screen-reader-text">' + slug_label + '</label>' + 1089 '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" spellcheck="false" />' 1090 ).children( 'input' ).on( 'keydown', function( e ) { 1054 1091 var key = e.which; 1055 1092 // On [Enter], just save the new slug, don't save the post. … … 1225 1262 // Key [S] has code 83. 1226 1263 if ( event.which === 83 ) { 1227 if ( event.shiftKey || event.altKey || ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! isMac && ! event.ctrlKey ) ) { 1264 if ( 1265 event.shiftKey || 1266 event.altKey || 1267 ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || 1268 ( ! isMac && ! event.ctrlKey ) 1269 ) { 1228 1270 return; 1229 1271 }
Note: See TracChangeset
for help on using the changeset viewer.