Changeset 50367
- Timestamp:
- 02/16/2021 08:23:19 PM (4 years ago)
- Location:
- trunk/src/js
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/application-passwords.js
r50030 r50367 26 26 27 27 if ( 0 === name.length ) { 28 $newAppPassField. focus();28 $newAppPassField.trigger( 'focus' ); 29 29 return; 30 30 } … … 61 61 password: response.password 62 62 } ) ); 63 $( '.new-application-password-notice' ). focus();63 $( '.new-application-password-notice' ).trigger( 'focus' ); 64 64 65 65 $appPassTbody.prepend( tmplAppPassRow( response ) ); … … 106 106 $tr.remove(); 107 107 108 addNotice( wp.i18n.__( 'Application password revoked.' ), 'success' ). focus();108 addNotice( wp.i18n.__( 'Application password revoked.' ), 'success' ).trigger( 'focus' ); 109 109 } 110 110 } ).fail( handleErrorResponse ); … … 134 134 $appPassTwrapper.hide(); 135 135 136 addNotice( wp.i18n.__( 'All application passwords revoked.' ), 'success' ). focus();136 addNotice( wp.i18n.__( 'All application passwords revoked.' ), 'success' ).trigger( 'focus' ); 137 137 } 138 138 } ).fail( handleErrorResponse ); … … 146 146 $el.slideUp( 100, function () { 147 147 $el.remove(); 148 $newAppPassField. focus();148 $newAppPassField.trigger( 'focus' ); 149 149 } ); 150 150 } ); -
trunk/src/js/_enqueues/admin/privacy-tools.js
r50161 r50367 73 73 $rowActions.addClass( 'processing' ); 74 74 75 $action. blur();75 $action.trigger( 'blur' ); 76 76 clearResultsAfterRow( $requestRow ); 77 77 setExportProgress( 0 ); … … 178 178 $rowActions.addClass( 'processing' ); 179 179 180 $action. blur();180 $action.trigger( 'blur' ); 181 181 clearResultsAfterRow( $requestRow ); 182 182 setErasureProgress( 0 ); -
trunk/src/js/_enqueues/admin/site-health.js
r50001 r50367 25 25 e.clearSelection(); 26 26 // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 27 triggerElement. focus();27 triggerElement.trigger( 'focus' ); 28 28 29 29 // Show success visual feedback. -
trunk/src/js/_enqueues/admin/xfn.js
r45448 r50367 7 7 jQuery( document ).ready(function( $ ) { 8 8 $( '#link_rel' ).prop( 'readonly', true ); 9 $( '#linkxfndiv input' ). bind( 'click keyup', function() {9 $( '#linkxfndiv input' ).on( 'click keyup', function() { 10 10 var isMe = $( '#me' ).is( ':checked' ), inputs = ''; 11 11 $( 'input.valinp' ).each( function() { -
trunk/src/js/_enqueues/lib/pointer.js
r48266 r50367 20 20 var button = $('<a class="close" href="#"></a>').text( wp.i18n.__( 'Dismiss' ) ); 21 21 22 return button. bind( 'click.pointer', function(e) {22 return button.on( 'click.pointer', function(e) { 23 23 e.preventDefault(); 24 24 t.element.pointer('close'); -
trunk/src/js/_enqueues/vendor/thickbox/thickbox.js
r43309 r50367 36 36 var g = this.rel || false; 37 37 tb_show(t,a,g); 38 this. blur();38 this.trigger( 'blur' ); 39 39 return false; 40 40 } … … 50 50 if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 51 51 jQuery("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>"); 52 jQuery("#TB_overlay"). click(tb_remove);52 jQuery("#TB_overlay").trigger( 'click', tb_remove ); 53 53 } 54 54 }else{//all others 55 55 if(document.getElementById("TB_overlay") === null){ 56 56 jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>"); 57 jQuery("#TB_overlay"). click(tb_remove);57 jQuery("#TB_overlay").trigger( 'click', tb_remove ); 58 58 jQuery( 'body' ).addClass( 'modal-open' ); 59 59 } … … 142 142 jQuery("#TB_window").append("<a href='' id='TB_ImageOff'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div>"); 143 143 144 jQuery("#TB_closeWindowButton"). click(tb_remove);144 jQuery("#TB_closeWindowButton").trigger( 'click', tb_remove ); 145 145 146 146 if (!(TB_PrevHTML === "")) { 147 147 function goPrev(){ 148 if(jQuery(document). unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}148 if(jQuery(document).off("click",goPrev)){jQuery(document).off("click",goPrev);} 149 149 jQuery("#TB_window").remove(); 150 150 jQuery("body").append("<div id='TB_window'></div>"); … … 152 152 return false; 153 153 } 154 jQuery("#TB_prev"). click(goPrev);154 jQuery("#TB_prev").trigger( 'click', goPrev ); 155 155 } 156 156 … … 162 162 return false; 163 163 } 164 jQuery("#TB_next"). click(goNext);165 166 } 167 168 jQuery(document). bind('keydown.thickbox', function(e){164 jQuery("#TB_next").trigger( 'click', goNext ); 165 166 } 167 168 jQuery(document).on('keydown.thickbox', function(e){ 169 169 if ( e.which == 27 ){ // close 170 170 tb_remove(); … … 172 172 } else if ( e.which == 190 ){ // display previous image 173 173 if(!(TB_NextHTML == "")){ 174 jQuery(document). unbind('thickbox');174 jQuery(document).off('thickbox'); 175 175 goNext(); 176 176 } 177 177 } else if ( e.which == 188 ){ // display next image 178 178 if(!(TB_PrevHTML == "")){ 179 jQuery(document). unbind('thickbox');179 jQuery(document).off('thickbox'); 180 180 goPrev(); 181 181 } … … 186 186 tb_position(); 187 187 jQuery("#TB_load").remove(); 188 jQuery("#TB_ImageOff"). click(tb_remove);188 jQuery("#TB_ImageOff").trigger( 'click', tb_remove ); 189 189 jQuery("#TB_window").css({'visibility':'visible'}); //for safari using css instead of show 190 190 }; … … 207 207 jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>"); 208 208 }else{//iframe modal 209 jQuery("#TB_overlay"). unbind();209 jQuery("#TB_overlay").off(); 210 210 jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>"); 211 211 } … … 215 215 jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>"); 216 216 }else{//ajax modal 217 jQuery("#TB_overlay"). unbind();217 jQuery("#TB_overlay").off(); 218 218 jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>"); 219 219 } … … 226 226 } 227 227 228 jQuery("#TB_closeWindowButton"). click(tb_remove);228 jQuery("#TB_closeWindowButton").trigger( 'click', tb_remove ); 229 229 230 230 if(url.indexOf('TB_inline') != -1){ 231 231 jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children()); 232 jQuery("#TB_window"). bind('tb_unload', function () {232 jQuery("#TB_window").on('tb_unload', function () { 233 233 jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished 234 234 }); … … 254 254 255 255 if(!params['modal']){ 256 jQuery(document). bind('keydown.thickbox', function(e){256 jQuery(document).on('keydown.thickbox', function(e){ 257 257 if ( e.which == 27 ){ // close 258 258 tb_remove(); … … 269 269 */ 270 270 if ( $closeBtn.find( '.tb-close-icon' ).is( ':visible' ) ) { 271 $closeBtn. focus();271 $closeBtn.trigger( 'focus' ); 272 272 } 273 273 … … 284 284 285 285 function tb_remove() { 286 jQuery("#TB_imageOff"). unbind("click");287 jQuery("#TB_closeWindowButton"). unbind("click");286 jQuery("#TB_imageOff").off("click"); 287 jQuery("#TB_closeWindowButton").off("click"); 288 288 jQuery( '#TB_window' ).fadeOut( 'fast', function() { 289 jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ). unbind().remove();289 jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ).off().remove(); 290 290 jQuery( 'body' ).trigger( 'thickbox:removed' ); 291 291 }); … … 296 296 jQuery("html").css("overflow",""); 297 297 } 298 jQuery(document). unbind('.thickbox');298 jQuery(document).off('.thickbox'); 299 299 return false; 300 300 } -
trunk/src/js/media/views/attachment/details.js
r49195 r50367 49 49 event.clearSelection(); 50 50 // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 51 triggerElement. focus();51 triggerElement.trigger( 'focus' ); 52 52 53 53 // Show success visual feedback. … … 106 106 moveFocus: function() { 107 107 if ( this.previousAttachment.length ) { 108 this.previousAttachment. focus();108 this.previousAttachment.trigger( 'focus' ); 109 109 return; 110 110 } 111 111 112 112 if ( this.nextAttachment.length ) { 113 this.nextAttachment. focus();113 this.nextAttachment.trigger( 'focus' ); 114 114 return; 115 115 } … … 117 117 // Fallback: move focus to the "Select Files" button in the media modal. 118 118 if ( this.controller.uploader && this.controller.uploader.$browser ) { 119 this.controller.uploader.$browser. focus();119 this.controller.uploader.$browser.trigger( 'focus' ); 120 120 return; 121 121 } … … 134 134 $( '.media-frame' ) 135 135 .attr( 'tabindex', '-1' ) 136 . focus();136 .trigger( 'focus' ); 137 137 }, 138 138
Note: See TracChangeset
for help on using the changeset viewer.