diff -r 34716fd837a4 -r be944660c56a wp/wp-includes/js/thickbox/thickbox.js --- a/wp/wp-includes/js/thickbox/thickbox.js Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-includes/js/thickbox/thickbox.js Wed Sep 21 18:19:35 2022 +0200 @@ -49,12 +49,12 @@ jQuery("html").css("overflow","hidden"); if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 jQuery("body").append("
"); - jQuery("#TB_overlay").click(tb_remove); + jQuery("#TB_overlay").on( 'click', tb_remove ); } }else{//all others if(document.getElementById("TB_overlay") === null){ jQuery("body").append("
"); - jQuery("#TB_overlay").click(tb_remove); + jQuery("#TB_overlay").on( 'click', tb_remove ); jQuery( 'body' ).addClass( 'modal-open' ); } } @@ -141,17 +141,17 @@ TB_HEIGHT = imageHeight + 60; jQuery("#TB_window").append(""+thickboxL10n.close+""+caption+"" + "
"+caption+"
" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
"); - jQuery("#TB_closeWindowButton").click(tb_remove); + jQuery("#TB_closeWindowButton").on( 'click', tb_remove ); if (!(TB_PrevHTML === "")) { function goPrev(){ - if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);} + if(jQuery(document).off("click",goPrev)){jQuery(document).off("click",goPrev);} jQuery("#TB_window").remove(); jQuery("body").append("
"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } - jQuery("#TB_prev").click(goPrev); + jQuery("#TB_prev").on( 'click', goPrev ); } if (!(TB_NextHTML === "")) { @@ -161,22 +161,22 @@ tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } - jQuery("#TB_next").click(goNext); + jQuery("#TB_next").on( 'click', goNext ); } - jQuery(document).bind('keydown.thickbox', function(e){ + jQuery(document).on('keydown.thickbox', function(e){ if ( e.which == 27 ){ // close tb_remove(); } else if ( e.which == 190 ){ // display previous image if(!(TB_NextHTML == "")){ - jQuery(document).unbind('thickbox'); + jQuery(document).off('thickbox'); goNext(); } } else if ( e.which == 188 ){ // display next image if(!(TB_PrevHTML == "")){ - jQuery(document).unbind('thickbox'); + jQuery(document).off('thickbox'); goPrev(); } } @@ -185,7 +185,7 @@ tb_position(); jQuery("#TB_load").remove(); - jQuery("#TB_ImageOff").click(tb_remove); + jQuery("#TB_ImageOff").on( 'click', tb_remove ); jQuery("#TB_window").css({'visibility':'visible'}); //for safari using css instead of show }; @@ -206,7 +206,7 @@ if(params['modal'] != "true"){//iframe no modal jQuery("#TB_window").append("
"+caption+"
"); }else{//iframe modal - jQuery("#TB_overlay").unbind(); + jQuery("#TB_overlay").off(); jQuery("#TB_window").append(""); } }else{// not an iframe, ajax @@ -214,7 +214,7 @@ if(params['modal'] != "true"){//ajax no modal jQuery("#TB_window").append("
"+caption+"
"); }else{//ajax modal - jQuery("#TB_overlay").unbind(); + jQuery("#TB_overlay").off(); jQuery("#TB_window").append("
"); } }else{//this means the window is already up, we are just loading new content via ajax @@ -225,11 +225,11 @@ } } - jQuery("#TB_closeWindowButton").click(tb_remove); + jQuery("#TB_closeWindowButton").on( 'click', tb_remove ); if(url.indexOf('TB_inline') != -1){ jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children()); - jQuery("#TB_window").bind('tb_unload', function () { + jQuery("#TB_window").on('tb_unload', function () { jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); @@ -253,7 +253,7 @@ } if(!params['modal']){ - jQuery(document).bind('keydown.thickbox', function(e){ + jQuery(document).on('keydown.thickbox', function(e){ if ( e.which == 27 ){ // close tb_remove(); return false; @@ -268,7 +268,7 @@ * In other admin screens is hidden and replaced by a different icon. */ if ( $closeBtn.find( '.tb-close-icon' ).is( ':visible' ) ) { - $closeBtn.focus(); + $closeBtn.trigger( 'focus' ); } } catch(e) { @@ -283,10 +283,10 @@ } function tb_remove() { - jQuery("#TB_imageOff").unbind("click"); - jQuery("#TB_closeWindowButton").unbind("click"); + jQuery("#TB_imageOff").off("click"); + jQuery("#TB_closeWindowButton").off("click"); jQuery( '#TB_window' ).fadeOut( 'fast', function() { - jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ).unbind().remove(); + jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ).off().remove(); jQuery( 'body' ).trigger( 'thickbox:removed' ); }); jQuery( 'body' ).removeClass( 'modal-open' ); @@ -295,7 +295,7 @@ jQuery("body","html").css({height: "auto", width: "auto"}); jQuery("html").css("overflow",""); } - jQuery(document).unbind('.thickbox'); + jQuery(document).off('.thickbox'); return false; }