![JAR search and dependency download from the Maven repository](/logo.png)
jquery-fracs-0.15.0.jquery.outline-0.15.0.min.js Maven / Gradle / Ivy
/* jQuery.fracs 0.15.0 - http://larsjung.de/jquery-fracs/ */
!function(){"use strict";function t(t,o,l){function c(t,e,i,n,o){t&&(i||n)&&(n&&(m.beginPath(),o?(m.rect(0,0,b.width,t.top),m.rect(0,t.top,t.left,t.height),m.rect(t.right,t.top,b.width-t.right,t.height),m.rect(0,t.bottom,b.width,b.height-t.bottom)):m.rect(t.left,t.top,t.width,t.height),m.fillStyle=n,m.fill()),i&&(m.beginPath(),m.rect(t.left,t.top,t.width,t.height),m.lineWidth=T?Math.max(e,.2/T):e,m.strokeStyle=i,m.stroke()))}function u(t,i,n,o){var s=e(t),h=r.ofElement(t);!h||h.width<=0||h.height<=0||"hidden"===s.css("visibility")||(h=h.relativeTo(b),i="auto"===i?parseInt(s.css("border-top-width"),10):i,n="auto"===n?s.css("border-top-color"):n,o="auto"===o?s.css("background-color"):o,c(h,i,n,o))}function a(){e.each(V.styles,function(t,e){L(e.selector).each(function(){u(this,e.strokeWidth,e.strokeStyle,e.fillStyle)})})}function f(){var t=M&&V.viewportDragStyle?V.viewportDragStyle:V.viewportStyle;c(y,t.strokeWidth,t.strokeStyle,t.fillStyle,V.invertViewport)}function d(){b=r.ofContent(l),y=r.ofViewport(l,!0),T=Math.min(x/b.width,C/b.height),V.crop&&E.attr("width",b.width*T).attr("height",b.height*T),m.setTransform(1,0,0,1,0,0),m.clearRect(0,0,E.width(),E.height()),m.scale(T,T),a(),f()}function p(e){var i=r.ofElement(t),n=(e.pageX-i.left)/T-y.width*k,o=(e.pageY-i.top)/T-y.height*S;W.scrollTo(n,o,V.duration)}function w(t){M=!1,t.preventDefault(),E.css("cursor","pointer").removeClass("dragOn"),e("body").css("cursor","auto"),i.off("mousemove",p),d()}function v(n){var o;V.autoFocus&&(o=r.ofElement(t),k=((n.pageX-o.left)/T-y.left)/y.width,S=((n.pageY-o.top)/T-y.top)/y.height),(!V.autoFocus||0>k||k>1||0>S||S>1)&&(k=V.focusWidth,S=V.focusHeight),M=!0,n.preventDefault(),E.css("cursor","crosshair").addClass("dragOn"),e("body").css("cursor","crosshair"),i.on("mousemove",p).one("mouseup",w),p(n)}function g(){E.css("cursor","pointer").mousedown(v),q.on("load resize scroll",d),d()}if(!t||!e.isFunction(t.getContext))return null;var m=t.getContext("2d");if(!m)return null;l=l||window;var b,y,T,k,S,V=n({},h,o),E=e(t),x=E.attr("width"),C=E.attr("height"),q=e(l),W=new s(l),L=l===window?function(t){return e(t)}:function(t){return q.find(t)},M=!1;g(),this.redraw=d}var e=jQuery,i=e(window),n=e.extend,o=e.fracs,r=o.Rect,s=o.Viewport,h={crop:!1,duration:0,focusWidth:.5,focusHeight:.5,autoFocus:!0,styles:[{selector:"header,footer,section,article",fillStyle:"rgb(230,230,230)"},{selector:"h1,h2,h3,h4",fillStyle:"rgb(255,144,55)"}],viewportStyle:{fillStyle:"rgba(255,144,55,0.3)"},viewportDragStyle:{fillStyle:"rgba(255,144,55,0.5)"},invertViewport:!1},l="fracs.outline";o.modplug({statics:{Outline:t},methods:{outline:function(i,n,o){return"string"!=typeof i&&(o=n,n=i,i=null),o instanceof e&&(o=o[0]),this.each("redraw"===i?function(){var t=e(this).data(l);t&&t.redraw()}:function(){var i=e(this).data(l);i||(i=new t(this,n,o),i&&e(this).data(l,i))})}}})}();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy