PageSourceSearch

https://classic.infrastructureinvestor.com/wp-content/plugins/wp-s…/js/jquery.wp-smartcrop.min.js?ver=2.0.10

js infrastructureinvestor.com collected 2026-09-24 18:14:18 UTC 3,402 bytes, 6 lines download raw bytes

1/**
2 * jQuery WP-SmartCrop v2.0.6
3 * Copyright (c) 2017 Greg Schoppe
4 * License: http://www.opensource.org/licenses/mit-license.php
5 **/
6!function(t){t.fn.extend({wpsmartcrop:function(e){e=t.extend({focal_point:null,compatibility:null,focus_mode:"power-lines"},e);for(var o=0,i=["webkit","moz"],n=window.requestAnimationFrame,a=window.cancelAnimationFrame,r=0;r<i.length&&!n;++r)n=window[i[r]+"RequestAnimationFrame"],a=window[i[r]+"CancelAnimationFrame"]||window[i[r]+"CancelRequestAnimationFrame"];n||(n=function(t,e){var i=(new Date).getTime(),n=Math.max(0,16-(i-o)),a=window.setTimeout(function(){t(i+n)},n);return o=i+n,a}),a||(a=function(t){clearTimeout(t)});var s,c="objectFit"in(s=document.createElement("div")).style&&"objectPosition"in s.style||"OobjectFit"in s.style&&"OobjectPosition"in s.style;function p(t){var o=function(t,e,o,i){i||(i="power-lines");var n,a=o/=100,r=e-t;return"power-lines"==i&&(a=function(t,e){for(var o=e[0],i=Math.abs(t-o),n=0;n<e.length;n++){var a=Math.abs(t-e[n]);a<i&&(i=a,o=e[n])}return o}(o,[.33333,.5,.66667])),(n=Math.round(o*e-a*t))>r&&(n=r),n<0&&(n=0),-1*n},i=t.data("smartcrop-focus"),n=t.data("smartcrop-mode"),a=[t[0].naturalWidth?t[0].naturalWidth:t[0].getAttribute("width"),t[0].naturalHeight?t[0].naturalHeight:t[0].getAttribute("height")],r=[t.width(),t.height()],s=function(t,e){var o=t[0]/t[1];return o>e[0]/e[1]?[Math.round(e[1]*o),e[1]]:[e[0],Math.round(e[0]/o)]}(a,r),c=[0,0];return i||(i=e.focal_point),!(!i||i.length<2||!a[0]||!a[1]||!r[0]||!r[1])&&(n||(n=void 0!==window.wpsmartcrop_focus_mode?e.focus_mode:"power-lines"),r[0]/r[1]<s[0]/s[1]?c[0]=o(r[0],s[0],i[0],n):c[1]=o(r[1],s[1],i[1],n),{final_width:s[0],final_height:s[1],offset_x:c[0],offset_y:c[1]})}function d(t,e){var o=p(t);if(e){var i=o.offset_x+"px "+o.offset_y+"px";t.css({"-o-object-position":i,"object-position":i}),t.addClass("wpsmartcrop-rendered")}else{var n=t.position(),a=t.next(".wpsmartcrop-overlay"),r=a.find("img");a.css({width:t.width()+"px",height:t.height()+"px",top:n.top+"px",left:n.left+"px"}),r.css({width:o.final_width+"px",height:o.final_height+"px",top:o.offset_y+"px",left:o.offset_x+"px"}),a.addClass("wpsmartcrop-overlay-rendered")}}return this.each(function(){var o=t(this);if(o.is("img")){var i=[o[0].naturalWidth?o[0].naturalWidth:o[0].getAttribute("width"),o[0].naturalHeight?o[0].naturalHeight:o[0].getAttribute("height")];if(0!=i[0]&&0!=i[1]){o.data("wpsmartcrop-natural-dims",i),o.next("wpsmartcrop-overlay").remove(),e.focal_point?o.data("smartcrop-focus",e.focal_point):o.data("smartcrop-focus")||o.data("smartcrop-focus",[50,50]);var r=!0;if("new"!=e.compatibility&&("old"==e.compatibility||!c)){r=!1;var s=o.clone().removeClass("wpsmartcrop-image").removeAttr("data-smartcrop-focus");t("<div></div>").addClass("wpsmartcrop-overlay").append(s).insertAfter(o)}d(o,r);var p=!1;t(window).resize(function(){a(p),p=n(function(){d(o,r)})}),t(window).on("load",function(){d(o,r)}),o.on("wpsmartcrop-redraw",function(){d(o,r)})}}})}})}(jQuery),jQuery(document).ready(function(t){"undefined"==typeof wpsmartcrop_options&&(wpsmartcrop_options={});var e=function(){t("img.wpsmartcrop-image").wpsmartcrop(wpsmartcrop_options)};e();var o=o||navigator.userAgent,i=-1!==o.indexOf("Trident/7");"MutationObserver"in window&&!i&&new MutationObserver(function(t){e()}).observe(document.documentElement,{attributes:!1,characterData:!1,childList:!0,subtree:!0})});

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.