PageSourceSearch

https://dismagazine.com/wp-content/plugins/really-simple-popup/js/hs_rsp_popup.min.js?ver=6.7.9

js dismagazine.com collected 2026-10-02 04:48:33 UTC 17,202 bytes, 1 lines download raw bytes

1var hsRspOrigImgWidth=null;var hsRspOrigImgHeight=null;var hsRspDefaultAnimation="fade";var hsRspMinImgWidth=150;var hsRspMinImgHeight=150;var hsRspIframeWidth=-1;var hsRspIframeHeight=-1;var hsRspDivWidth=-1;var hsRspDivHeight=-1;var hsRspModalMarginTop=90;var hsRspMaxModalWidth=90;var hsRspMaxModalHeight=90;var hsRspSetWidth=null;var hsRspSetHeight=null;var hsRspResizeTimer;var hsRspCurrentType=null;var hsRspImgGallery=[];var hsRspIsPopupOpen=false;var hsRspDisableResizeOnWindowChange=false;jQuery(document).ready(function(){if(jQuery("#hs-rsp-popup-bg").length==0){_hsRspSetupThumbnails();_hsRspSetupGallery();_hsRspSetupEventHandlers();}});function hsRspShowLoader(){_hsRspSetupPopup();jQuery("#hs-rsp-image-wrap").css("visibility","hidden");if(jQuery("#hs-rsp-image-wrap p").length==1){jQuery("#hs-rsp-image-wrap p").remove();}if(jQuery("#hs-rsp-image-loader").length==0){jQuery("#hs-rsp-popup-bg").append('<div id="hs-rsp-image-loader"></div>');}jQuery("#hs-rsp-image-loader").css({left:_hsRspCalcLeftMargin(32),top:_hsRspCalcTopMargin(32)});}
1function hsRspCloseLoader(){if(jQuery("#hs-rsp-image-loader").length==1){jQuery("#hs-rsp-image-loader").remove();}}function hsRspLoadImage(imgurl,title){hsRspDisableResizeOnWindowChange=false;if(jQuery("#hs-rs-big-img").length==1){jQuery("#hs-rs-big-img").remove();}if(title!==undefined&&title!==""&&jQuery("#hs-rsp-image-wrap .popup-title").length==0){jQuery("#hs-rsp-image-wrap").append('<img id="hs-rs-big-img" src="'+imgurl+'" alt="'+imgurl+'"/>');jQuery("#hs-rsp-image-wrap img").load(function(){jQuery(this).after('<p class="popup-title pimage">'+title+"</p>");});}else{jQuery("#hs-rsp-image-wrap").append('<img id="hs-rs-big-img" src="'+imgurl+'" alt="'+imgurl+'"/>');}jQuery("#hs-rs-big-img").load(function(){hsRspOrigImgWidth=jQuery("#hs-rs-big-img").width();hsRspOrigImgHeight=jQuery("#hs-rs-big-img").height();var img={};img=_hsRspScalePopup(jQuery("#hs-rs-big-img"),hsRspMinImgWidth,hsRspMinImgHeight,hsRspOrigImgWidth,hsRspOrigImgHeight);if(hsRspImgGallery.length>1){if(jQuery("#hsrsp-leftarrow").length==0){jQuery("#hs-rsp-image-wrap").append('<a id="hsrsp-leftarrow" href="#hsrsp-left">Previous</a>');jQuery("#hsrsp-leftarrow").click(function(event){event.preventDefault();_hsRspPreviousImg();});}if(jQuery("#hsrsp-rightarrow").length==0){jQuery("#hs-rsp-image-wrap").append('<a id="hsrsp-rightarrow" href="#hsrsp-right">Next</a>');jQuery("#hsrsp-rightarrow").click(function(event){event.preventDefault();_hsRspNextImg();});}jQuery("#hsrsp-leftarrow").css({top:parseInt((img.iheight/2)-((64-10)/2)),left:10});jQuery("#hsrsp-rightarrow").css({top:parseInt((img.iheight/2)-((64-10)/2)),left:parseInt((img.iwidth)-54)});}_hsRspShowPopup(img.iwidth,img.iheight);});}function hsRspLoadFixedImage(imgurl,title,height,width){hsRspDisableResizeOnWindowChange=true;hsRspSetWidth=width;hsRspSetHeight=height;if(jQuery("#hs-rs-big-img").length==1){jQuery("#hs-rs-big-img").remove();}if(title!==undefined&&title!==""&&jQuery("#hs-rsp-image-wrap .popup-title").length==0){jQuery("#hs-rsp-image-wrap").append('<img id="hs-rs-big-img" src="'+imgurl+'" alt="'+imgurl+'"/>');jQuery("#hs-rsp-image-wrap img").load(function(){jQuery(this).after('<p class="popup-title pimagef">'+title+"</p>");});}else{jQuery("#hs-rsp-image-wrap").append('<img id="hs-rs-big-img" src="'+imgurl+'" alt="'+imgurl+'"/>');}jQuery("#hs-rs-big-img").load(function(){hsRspOrigImgWidth=jQuery("#hs-rs-big-img").width();hsRspOrigImgHeight=jQuery("#hs-rs-big-img").height();var img={};if(hsRspImgGallery.length>1){if(jQuery("#hsrsp-leftarrow").length==0){jQuery("#hs-rsp-image-wrap").append('<a id="hsrsp-leftarrow" href="#hsrsp-left">Previous</a>');jQuery("#hsrsp-leftarrow").click(function(event){event.preventDefault();_hsRspPreviousImg();});}if(jQuery("#hsrsp-rightarrow").length==0){jQuery("#hs-rsp-image-wrap").append('<a id="hsrsp-rightarrow" href="#hsrsp-right">Next</a>');jQuery("#hsrsp-rightarrow").click(function(event){event.preventDefault();_hsRspNextImg();});}jQuery("#hsrsp-leftarrow").css({top:parseInt((height/2)-((64-10)/2)),left:10});jQuery("#hsrsp-rightarrow").css({top:parseInt((height/2)-((64-10)/2)),left:parseInt((width)-54)});}_hsRspShowPopup(width,height);});}function hsRspLoadIframe(iframurl,title){hsRspDisableResizeOnWindowChange=false;jQuery("#hs-rsp-image-wrap").append('<iframe frameborder="0" id="hs-rsp-iframe" src="'+iframurl+'" name="hs-rsp-iframe" vspace="0" hspace="0" allowtransparency="true"></iframe>');if(title!==undefined&&title!==""&&jQuery("#hs-rsp-image-wrap .popup-title").length==0){jQuery("#hs-rsp-image-wrap").append('<p class="popup-title">'+title+"</p>");}var ifr={};ifr=_hsRspScalePopup(jQuery("#hs-rsp-iframe"),hsRspMinImgWidth,hsRspMinImgHeight,hsRspIframeWidth,hsRspIframeHeight);jQuery("#hs-rsp-iframe").attr({width:ifr.iwidth,height:ifr.iheight});jQuery("#hs-rsp-iframe").load(iframurl,function(){_hsRspShowPopup(ifr.iwidth,ifr.iheight);});}function hsRspLoadIframeFixedWidth(iframurl,title,height,width){hsRspDisableResizeOnWindowChange=true;hsRspSetWidth=width;hsRspSetHeight=height;jQuery("#hs-rsp-image-wrap").append('<iframe frameborder="0" id="hs-rsp-iframe" src="'+iframurl+'" name="hs-rsp-iframe" vspace
1="0" hspace="0" allowtransparency="true"></iframe>');if(title!==undefined&&title!==""&&jQuery("#hs-rsp-image-wrap .popup-title").length==0){jQuery("#hs-rsp-image-wrap").append('<p class="popup-title">'+title+"</p>");}jQuery("#hs-rsp-iframe").attr({width:width,height:height});jQuery("#hs-rsp-iframe").load(iframurl,function(){_hsRspShowPopup(width,height);});}function hsRspLoadDiv(linktarget,title){hsRspDisableResizeOnWindowChange=false;if(/\#.*/.test(linktarget)){jQuery("#hs-rsp-image-wrap").append('<div id="hs-rsp-div">'+jQuery(linktarget).html()+"</div>");if(title!==undefined&&title!==""&&jQuery("#hs-rsp-image-wrap .popup-title").length==0){jQuery("#hs-rsp-image-wrap").append('<p class="popup-title">'+title+"</p>");}var div={};div=_hsRspScalePopup(jQuery("#hs-rsp-div"),hsRspMinImgWidth,hsRspMinImgHeight,hsRspDivWidth,hsRspDivHeight);jQuery("#hs-rsp-div").css({width:div.iwidth,height:div.iheight});_hsRspShowPopup(div.iwidth,div.iheight);}else{this.hsRspCurrentType="iframe";hsRspLoadIframe(linktarget,title);}}function hsRspLoadFixedWidthDiv(linktarget,title,height,width){hsRspDisableResizeOnWindowChange=true;hsRspSetWidth=width;hsRspSetHeight=height;if(/\#.*/.test(linktarget)){jQuery("#hs-rsp-image-wrap").append('<div id="hs-rsp-div">'+jQuery(linktarget).html()+"</div>");if(title!==undefined&&title!==""&&jQuery("#hs-rsp-image-wrap .popup-title").length==0){jQuery("#hs-rsp-image-wrap").append('<p class="popup-title">'+title+"</p>");}_hsRspShowPopup(width,height);}else{this.hsRspCurrentType="iframe";hsRspLoadIframeFixedWidth(linktarget,title,height,width);}}function hsRspClosePopup(){if(jQuery("#hs-rsp-popup-bg").length==1){jQuery("#hs-rsp-popup-bg").fadeOut("fast",function(){jQuery(this).remove();});hsRspCurrentType=null;hsRspOrigImgWidth=null;hsRspOrigImgHeight=null;hsRspIsPopupOpen=false;}}function _hsRspSetupPopup(){if(jQuery("#hs-rsp-popup-bg").length==0){jQuery("body").append('<div id="hs-rsp-popup-bg"></div>');}if(jQuery("#hs-rsp-image-wrap").length==0){jQuery("#hs-rsp-popup-bg").append('<div id="hs-rsp-image-wrap"></div>');}if(jQuery("#hs-rsp-close").length==0){jQuery("#hs-rsp-image-wrap").append('<a id="hs-rsp-close" href="#hs-rsp-close" title="click to close">Close</a>');}}function _hsRspShowPopup(imgWidth,imgHeight){if(jQuery("#hs-rsp-image-wrap").length==1){jQuery("#hs-rsp-image-wrap").css({left:_hsRspCalcLeftMargin(imgWidth)+"px"});jQuery("#hs-rsp-image-wrap img").prop({width:imgWidth,height:imgHeight});if(hsRspIsPopupOpen){jQuery("#hs-rsp-image-wrap").css({marginTop:hsRspModalMarginTop});}else{jQuery("#hs-rsp-image-wrap").css({marginTop:((imgHeight+60)*-1)});}hsRspCloseLoader();if(hsRspDefaultAnimation=="slide-down"){jQuery("#hs-rsp-image-wrap").fadeIn(100,function(){jQuery("#hs-rsp-image-wrap").css("visibility","visible");if(!hsRspIsPopupOpen){jQuery("#hs-rsp-image-wrap").animate({marginTop:hsRspModalMarginTop},200);}hsRspIsPopupOpen=true;});}else{jQuery("#hs-rsp-image-wrap").css({"display":"none","visibility":"visible","marginTop":hsRspModalMarginTop}).fadeIn(200,function(){hsRspIsPopupOpen=true;});}}}function _hsRspSetupThumbnails(){var thumbnails=jQuery("a:has(img)").not(".no-hsrsp-popup").filter(function(){if(jQuery(this).find("img.no-hsrsp-popup").length==1){return false;}else{return/\.(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr("href"));}});thumbnails.addClass("hs-rsp-popup");}function _hsRspSetupGallery(){hsRspImgGallery=jQuery(".hs-rsp-popup").not(".iframe, .hiddendiv, .hs-rsp-nogallery");if(jQuery(".hs-rsp-nogallery").length>=1){hsRspImgGallery=[];}}function _hsRspSetupEventHandlers(){jQuery(window).resize(function(){if(jQuery("#hs-rsp-image-wrap").length==1){clearTimeout(hsRspResizeTimer);hsRspResizeTimer=setTimeout(_hsRspAnimateResize,100);}});jQuery(".hs-rsp-popup").click(function(event){event.preventDefault();if(jQuery(this).hasClass("iframe")){hsRspCurrentType="iframe";hsRspShowLoader();var iframeTitle=jQuery(this).attr("title");if(jQuery(this).attr("data-popupheight")!==undefined&&jQuery(this).attr("data-popupheight")!==undefined){hsRspLoadIframeFixedWidth(jQuery(this).attr("href"),iframeTitle,jQuery(this).attr("data-popupheight"),jQuery(this).attr("data-popupwidth"));}else{hsRspLoadIframe(jQuery(this).attr("href"),iframeTitle);}}else{if(jQuery(this).hasClass("hiddendiv")){hsRspCurrentType="div";hsRspShowLoader();var divTitle=jQuery(this).attr("title");if(jQuery(this).attr("data-popupheight")!==undefined&&jQuery(this).attr("data-popupheight")!==undefined){hsRspLoadFixedWidthDiv(jQuery(this).attr("href"),divTitle,jQuery(this).attr("data-popupheight"),jQuery(this).attr("data-popupwidth"));}else{hsRspLoadDiv(jQuery(this).attr("href"),divTitle);}}else{hsRspCurrentType="image";hsRspShowLoader();var imgTitle=jQuery(this).find("img").attr("alt");hsRspLoadImage(jQuery(this).attr("href"),imgTitle);if(jQuery(this).attr("data-popupheight")!==undefined&&jQuery(this).attr("data-popupheight")!==undefined){hsRspLoadFixedImage(jQuery(this).attr("href"),imgTitle,jQuery(this).attr("data-popupheight"),jQuery(this).attr("data-popupwidth"));}else{hsRspLoadImage(jQuery(this).attr("href"),imgTitle);}}}});jQuery("body").on("click","#hs-rsp-popup-bg, #hs-rsp-image-wrap",function(event){if(event.srcElement==event.currentTarget){event.preventDefault();
1hsRspClosePopup();}});jQuery("body").on("click","#hs-rsp-close",function(event){event.preventDefault();hsRspClosePopup();});jQuery(document).keyup(function(e){if(e.which==37||e.which==39){var img=jQuery("#hs-rs-big-img");if(hsRspImgGallery.length>1&&e.which==37&&img.length==1){_hsRspPreviousImg();}if(hsRspImgGallery.length>1&&e.which==39&&img.length==1){_hsRspNextImg();}}if(e.which==27){hsRspClosePopup();}});}function _hsRspPreviousImg(){var img=jQuery("#hs-rs-big-img");var curIndex=-1;var newImgIndex=-1;var newImg=null;var prevImageLink=null;for(var i=0;i<hsRspImgGallery.length;i++){if(jQuery(hsRspImgGallery[i]).attr("href")==img.attr("src")){curIndex=i;}}if(curIndex==0){newImgIndex=hsRspImgGallery.length-1;}else{if(curIndex>0){newImgIndex=--curIndex;}}newImg=jQuery(hsRspImgGallery[newImgIndex]).attr("href");jQuery("#hs-rsp-image-wrap").fadeOut("fast",function(){jQuery(this).css({visibility:"hidden",display:"block"});hsRspShowLoader();prevImageLink=jQuery('a[href="'+newImg+'"]');if(jQuery(prevImageLink).attr("data-popupheight")!==undefined&&jQuery(prevImageLink).attr("data-popupheight")!==undefined){hsRspLoadFixedImage(newImg,jQuery(prevImageLink).find("img").attr("alt"),jQuery(prevImageLink).attr("data-popupheight"),jQuery(prevImageLink).attr("data-popupwidth"));}else{hsRspLoadImage(newImg,jQuery(prevImageLink).find("img").attr("alt"));}});}function _hsRspNextImg(){var img=jQuery("#hs-rs-big-img");var curIndex=-1;var newImgIndex=-1;var newImg=null;var nextImgLink=null;for(var i=0;i<hsRspImgGallery.length;i++){if(jQuery(hsRspImgGallery[i]).attr("href")==img.attr("src")){curIndex=i;}}if(curIndex==hsRspImgGallery.length-1){newImgIndex=0;}else{if(curIndex<hsRspImgGallery.length-1){newImgIndex=++curIndex;}}newImg=jQuery(hsRspImgGallery[newImgIndex]).attr("href");jQuery("#hs-rsp-image-wrap").fadeOut("fast",function(){jQuery(this).css({visibility:"hidden",display:"block"});hsRspShowLoader();nextImgLink=jQuery('a[href="'+newImg+'"]');if(jQuery(nextImgLink).attr("data-popupheight")!==undefined&&jQuery(nextImgLink).attr("data-popupheight")!==undefined){hsRspLoadFixedImage(newImg,jQuery(nextImgLink).find("img").attr("alt"),jQuery(nextImgLink).attr("data-popupheight"),jQuery(nextImgLink).attr("data-popupwidth"));}else{hsRspLoadImage(newImg,jQuery(nextImgLink).find("img").attr("alt"));}});}function _hsRspAnimateResize(){switch(hsRspCurrentType){case"image":if(hsRspDisableResizeOnWindowChange){var img={"iwidth":hsRspSetWidth,"iheight":hsRspSetHeight};}else{var img=_hsRspScalePopup(jQuery("#hs-rs-big-img"),hsRspMinImgWidth,hsRspMinImgHeight,hsRspOrigImgWidth,hsRspOrigImgHeight);}jQuery("#hs-rs-big-img").animate({width:img.iwidth,height:img.iheight},100,function(){jQuery("#hs-rsp-image-wrap").animate({left:_hsRspCalcLeftMargin(jQuery(this).width())},50,function(){if(jQuery("#hsrsp-leftarrow").length==1){jQuery("#hsrsp-leftarrow").css({top:parseInt((img.iheight/2)-((64-10)/2)),left:10});}if(jQuery("#hsrsp-rightarrow").length==1){jQuery("#hsrsp-rightarrow").css({top:parseInt((img.iheight/2)-((64-10)/2)),left:parseInt((img.iwidth)-54)});}});});break;case"iframe":if(hsRspDisableResizeOnWindowChange){var img={"iwidth":hsRspSetWidth,"iheight":hsRspSetHeight};}else{var img=_hsRspScalePopup(jQuery("#hs-rsp-iframe"),hsRspMinImgWidth,hsRspMinImgHeight,hsRspIframeWidth,hsRspIframeHeight);}jQuery("#hs-rsp-iframe").animate({width:img.iwidth,height:img.iheight},100,function(){jQuery("#hs-rsp-image-wrap").animate({left:_hsRspCalcLeftMargin(jQuery(this).width())},50,function(){});});break;case"div":if(hsRspDisableResizeOnWindowChange){var div={"iwidth":hsRspSetWidth,"iheight":hsRspSetHeight};}else{var div=_hsRspScalePopup(jQuery("#hs-rsp-div"),hsRspMinImgWidth,hsRspMinImgHeight,hsRspDivWidth,hsRspDivHeight);}jQuery("#hs-rsp-div").animate({width:div.iwidth,height:div.iheight},100,function(){jQuery("#hs-rsp-image-wrap").animate({left:_hsRspCalcLeftMargin(jQuery(this).width())},50,function(){});});break;}}function _hsRspCalcLeftMargin(imgWidth){var halfScreenPoint=parseInt(parseInt(jQuery(window).width())/2);var leftStartPoint=parseInt(halfScreenPoint-(imgWidth/2));return leftStartPoint;}function _hsRspCalcTopMargin(imgHeight){var halfScreenPoint=parseInt(parseInt(j
1Query(window).height())/2);var topStartPoint=parseInt(halfScreenPoint-(imgHeight/2));return topStartPoint;}function _hsRspScalePopup(elem,minWidth,minHeight,defaultWidth,defaultHeight){var popupWidth,popupWidth=0;var maxPopupWidth,maxPopupHeight=0;var pageWidth,pageHeight=0;var newWidth,newHeight=0;var resizeFactor=0;pageWidth=jQuery(window).width();pageHeight=jQuery(window).height();popupWidth=elem.width();popupHeight=elem.height();maxPopupWidth=parseInt(pageWidth*(hsRspMaxModalWidth/100));maxPopupHeight=parseInt((pageHeight-hsRspModalMarginTop)*(hsRspMaxModalHeight/100));if(defaultWidth==-1&&defaultHeight==-1){newHeight=maxPopupHeight;newWidth=maxPopupWidth;}else{if(popupWidth>maxPopupWidth||popupHeight>maxPopupHeight){if(popupHeight>popupWidth||popupHeight>maxPopupHeight){newHeight=maxPopupHeight;if(newHeight<hsRspMinImgHeight){newHeight=hsRspMinImgHeight;}resizeFactor=parseFloat(newHeight/popupHeight);newWidth=parseFloat(resizeFactor*popupWidth);newWidth=parseInt(Math.ceil(newWidth));}else{newWidth=maxPopupWidth;if(newHeight<hsRspMinImgWidth){newHeight=hsRspMinImgWidth;}resizeFactor=parseFloat(newWidth/popupWidth);newHeight=parseFloat(resizeFactor*popupHeight);newHeight=parseInt(Math.ceil(newHeight));}}else{if(defaultHeight!=null||defaultWidth!=null){if(popupHeight>popupWidth&&popupHeight<maxPopupHeight){newHeight=maxPopupHeight;if(newHeight>defaultHeight){newHeight=defaultHeight;}resizeFactor=parseFloat(newHeight/popupHeight);newWidth=parseFloat(resizeFactor*popupWidth);newWidth=parseInt(Math.ceil(newWidth));}else{newWidth=maxPopupWidth;if(newWidth>defaultWidth){newWidth=defaultWidth;}resizeFactor=parseFloat(newWidth/popupWidth);newHeight=parseFloat(resizeFactor*popupHeight);newHeight=parseInt(Math.ceil(newHeight));}}else{newWidth=popupWidth;newHeight=popupHeight;}}}if(jQuery(elem).attr("id")=="hs-rsp-div"){newWidth=elem.width();newHeight=elem.height();if(popupWidth>maxPopupWidth||popupHeight>maxPopupHeight){if(popupHeight>popupWidth||popupHeight>maxPopupHeight){newHeight=maxPopupHeight;if(newHeight<maxPopupHeight){newHeight=maxPopupHeight;}resizeFactor=parseFloat(newHeight/popupHeight);newWidth=parseFloat(resizeFactor*popupWidth);newWidth=parseInt(Math.ceil(newWidth));}else{newWidth=maxPopupWidth;if(elem.height()<maxPopupHeight){newHeight=maxPopupHeight;}else{resizeFactor=parseFloat(newWidth/popupWidth);newHeight=parseFloat(resizeFactor*popupHeight);newHeight=parseInt(Math.ceil(newHeight));}elem.css("overflow","scroll");}}}var popup={};popup.iwidth=newWidth;popup.iheight=newHeight;return popup;}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.