Update deprecated jQuery functions for jquery.blockui.js

This commit is contained in:
roykho 2021-02-04 08:04:38 -08:00 committed by Jonathan Sadowski
parent 3d1391f6bd
commit 08aa9e32eb
2 changed files with 24 additions and 24 deletions

View File

@ -25,7 +25,7 @@
var msie = /MSIE/.test(navigator.userAgent);
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
var mode = document.documentMode || 0;
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
var setExpr = 'function' === typeof document.createElement('div').style.setExpression ? document.createElement('div').style.setExpression : false;
// global $ methods for blocking/unblocking the entire page
$.blockUI = function(opts) { install(window, opts); };
@ -56,7 +56,7 @@
callBlock();
var nonmousedOpacity = $m.css('opacity');
$m.mouseover(function() {
$m.on( 'mouseover', function() {
callBlock({
fadeIn: 0,
timeout: 30000
@ -65,7 +65,7 @@
var displayBlock = $('.blockMsg');
displayBlock.stop(); // cancel fadeout if it has started
displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
}).mouseout(function() {
}).on( 'mouseout', function() {
$('.blockMsg').fadeOut(1000);
});
// End konapun additions
@ -550,9 +550,9 @@
// bind anchors and inputs for mouse and key events
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
if (b)
$(document).bind(events, opts, handler);
$(document).on(events, opts, handler);
else
$(document).unbind(events, handler);
$(document).off(events, handler);
// former impl...
// var $e = $('a,:input');
@ -591,7 +591,7 @@
return;
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
if (e)
e.focus();
e.trigger( 'focus' );
}
function center(el, x, y) {
@ -616,4 +616,4 @@
setup(jQuery);
}
})();
})();

View File

@ -108,10 +108,10 @@
doresize = true, scroll_pos = _get_scroll();
// Window/Keyboard events
$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); });
$(window).off('resize.prettyphoto').on('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); });
if(pp_settings.keyboard_shortcuts) {
$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){
$(document).off('keydown.prettyphoto').on('keydown.prettyphoto',function(e){
if(typeof $pp_pic_holder != 'undefined'){
if($pp_pic_holder.is(':visible')){
switch(e.keyCode){
@ -162,7 +162,7 @@
_build_overlay(this); // Build the overlay {this} being the caller
if(settings.allow_resize)
$(window).bind('scroll.prettyphoto',function(){ _center_overlay(); });
$(window).on('scroll.prettyphoto',function(){ _center_overlay(); });
$.prettyPhoto.open();
@ -431,7 +431,7 @@
*/
$.prettyPhoto.startSlideshow = function(){
if(typeof pp_slideshow == 'undefined'){
$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){
$pp_pic_holder.find('.pp_play').off('click').removeClass('pp_play').addClass('pp_pause').on( 'click', function(){
$.prettyPhoto.stopSlideshow();
return false;
});
@ -446,7 +446,7 @@
* Stop the slideshow...
*/
$.prettyPhoto.stopSlideshow = function(){
$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){
$pp_pic_holder.find('.pp_pause').off('click').removeClass('pp_pause').addClass('pp_play').on( 'click', function(){
$.prettyPhoto.startSlideshow();
return false;
});
@ -473,7 +473,7 @@
$(this).remove(); // No more need for the prettyPhoto markup
$(window).unbind('scroll.prettyphoto');
$(window).off('scroll.prettyphoto');
clearHashtag();
@ -739,7 +739,7 @@
$pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');
}else{
$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');
$pp_pic_holder.find('.pp_content').off('mouseenter mouseleave');
// $pp_gallery.hide();
}
}
@ -776,13 +776,13 @@
$pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); // Set the gallery selectors
$pp_gallery.find('.pp_arrow_next').click(function(){
$pp_gallery.find('.pp_arrow_next').on( 'click', function(){
$.prettyPhoto.changeGalleryPage('next');
$.prettyPhoto.stopSlideshow();
return false;
});
$pp_gallery.find('.pp_arrow_previous').click(function(){
$pp_gallery.find('.pp_arrow_previous').on( 'click', function(){
$.prettyPhoto.changeGalleryPage('previous');
$.prettyPhoto.stopSlideshow();
return false;
@ -800,7 +800,7 @@
$pp_gallery_li.each(function(i){
$(this)
.find('a')
.click(function(){
.on( 'click', function(){
$.prettyPhoto.changePage(i);
$.prettyPhoto.stopSlideshow();
return false;
@ -812,7 +812,7 @@
// Inject the play/pause if it's a slideshow
if(settings.slideshow){
$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){
$pp_pic_holder.find('.pp_nav .pp_play').on( 'click', function(){
$.prettyPhoto.startSlideshow();
return false;
});
@ -826,15 +826,15 @@
'height':$(document).height(),
'width':$(window).width()
})
.bind('click',function(){
.on('click',function(){
if(!settings.modal) $.prettyPhoto.close();
});
$('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });
$('a.pp_close').on('click',function(){ $.prettyPhoto.close(); return false; });
if(settings.allow_expand) {
$('a.pp_expand').bind('click',function(e){
$('a.pp_expand').on('click',function(e){
// Expand the image
if($(this).hasClass('pp_expand')){
$(this).removeClass('pp_expand').addClass('pp_contract');
@ -850,13 +850,13 @@
});
}
$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){
$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').on('click',function(){
$.prettyPhoto.changePage('previous');
$.prettyPhoto.stopSlideshow();
return false;
});
$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){
$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').on('click',function(){
$.prettyPhoto.changePage('next');
$.prettyPhoto.stopSlideshow();
return false;
@ -879,7 +879,7 @@
setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50);
}
return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
return this.off('click.prettyphoto').on('click.prettyphoto',$.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
};
function getHashtag(){