Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added twitter account and optional zooming out by clicking on aan ele…

…ment
  • Loading branch information...
commit 36435333a20517c37489b9090cacf13b9d9b696b 1 parent 1ea0291
@jaukia authored
View
31 index.html
@@ -45,16 +45,22 @@
<div class="social-buttons">
+ <iframe allowtransparency="true" frameborder="0" scrolling="no"
+ src="http://platform.twitter.com/widgets/tweet_button.html?related=jaukia&count=horizontal&counturl=http://janne.aukia.com/zoomooz&url=http://janne.aukia.com/zoomooz&text=@zoomoozjs%20is%20a%20jQuery%20plugin%20for%20making%20any%20web%20page%20zoom%20by%20@jaukia"
+ style="width:100px; height:20px;"></iframe>
+
+ <iframe allowtransparency="true" frameborder="0" scrolling="no"
+ src="http://platform.twitter.com/widgets/follow_button.html?screen_name=zoomoozjs&show_count=true&show_screen_name=true"
+ style="width:200px; height:20px;"></iframe>
+
+ <br/>
+
<iframe src="http://markdotto.github.com/github-buttons/github-btn.html?user=jaukia&repo=zoomooz&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
<iframe src="http://markdotto.github.com/github-buttons/github-btn.html?user=jaukia&repo=zoomooz&type=fork&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="85px" height="20px"></iframe>
- <iframe allowtransparency="true" frameborder="0" scrolling="no"
- src="http://platform.twitter.com/widgets/tweet_button.html?related=jaukia&count=horizontal&counturl=http://janne.aukia.com/zoomooz&url=http://janne.aukia.com/zoomooz&text=Zoomooz%20is%20a%20jQuery%20plugin%20for%20making%20any%20web%20page%20zoom%20by%20@jaukia"
- style="width:140px; height:20px;"></iframe>
-
</div>
<h2>Quirky transformations</h2>
@@ -126,6 +132,16 @@
<div class="clearer"></div>
</div>
+ <p>By adding a "data-closeclick" value to a zoom target, you can make the
+ image zoom out when the element is clicked for second time, see here:</p>
+
+ <div class="zoomingDemo">
+ <div class="zoomTarget" data-targetsize="0.6" data-closeclick="true">Target 1<br />(click twice)</div>
+ <div class="zoomTarget" data-targetsize="0.6" data-closeclick="true">Target 2<br />(click twice)</div>
+ <div class="zoomTarget" data-targetsize="0.6" data-closeclick="true">Target 3<br />(click twice)</div>
+ <div class="clearer"></div>
+ </div>
+
<a name="zoomcontainer"></a>
<h2>Zooming inside a container</h2>
@@ -232,7 +248,10 @@
debug: false,
// this function is called with the element that is zoomed to in this
// when animation ends
- animationendcallback: null
+ animationendcallback: null,
+ // this specifies, that clicking an element that is zoomed to zooms
+ // back out
+ closeclick: false
}
// settings can be set for both the zoomTo and zoomTarget calls:
$("#element").zoomTo(settings);</code></pre>
@@ -311,7 +330,7 @@
<p>Some people have been brave enough to try out zoomooz themselves. Have a look at the links below and let me know if you have used it!</p>
- <p>Very creative use of Zoomooz in <a href="http://www.parti-socialiste.fr/bilan-sarkozy/">this Frech presidential campaign web site</a>!</p>
+ <p>Very creative use of Zoomooz in <a href="http://www.parti-socialiste.fr/bilan-sarkozy/">this Frech presidential campaign web site</a></p>
<p>
<a href="http://www.azarask.in/blog/post/how-to-prototype-and-influence-people/">Aza Raskin prototyping with Zoomooz</a> and showing how to live code in front of seventy-five people.
View
144 jquery.zoomooz.js
@@ -662,23 +662,32 @@ if(!$.zoomooz) {
$.zoomooz = {};
}
- $.zoomooz.setup = function(settings) {
- $.zoomooz.defaultSettings = jQuery.extend(constructDefaultSettings(), settings);
- };
+ $.fn.zoomSettings = function(settings) {
+ var retValue;
+ this.each(function() {
+ var $elem = $(this);
+ retValue = setupElementSettings($elem, settings);
+ });
+ return retValue;
+ }
- $.fn.zoomTo = function(settings) {
+ $.fn.zoomTo = function(settings, skipElementSettings) {
this.each(function() {
var $this = $(this);
- var elemSettings = setupElementSettings($this, settings);
- zoomTo($this, elemSettings);
- if(elemSettings.debug) {
+ if(!skipElementSettings) {
+ settings = $this.zoomSettings(settings);
+ }
+
+ zoomTo($this, settings);
+
+ if(settings.debug) {
if($("#debug").length===0) {
- $(elemSettings.root).append('<div id="debug"><div>');
+ $(settings.root).append('<div id="debug"><div>');
} else {
$("#debug").html("");
}
- showDebug($this,elemSettings);
+ showDebug($this,settings);
} else {
if($("#debug").length!==0) {
$("#debug").html("");
@@ -693,9 +702,12 @@ if(!$.zoomooz) {
//*** Setup functions ***//
//**********************************//
- function setupElementSettings($elem, settings) {
+ function setupElementSettings($elem, baseSettings) {
+
+ var settings = jQuery.extend({}, baseSettings);
+
if(!$.zoomooz.defaultSettings) {
- $.zoomooz.setup();
+ $.zoomooz.defaultSettings = constructDefaultSettings();
}
var defaultSettings = $.zoomooz.defaultSettings;
@@ -706,6 +718,9 @@ if(!$.zoomooz) {
elementSettings[key] = $elem.data(key);
}
}
+
+ // FIXME: it would be better, that the animationSettings
+ // would come from the jquery.zoomooz-anim file somehow
for(var i=0;i<animationSettings.length;i++) {
var key = animationSettings[i];
if(!elementSettings[key]) {
@@ -743,7 +758,8 @@ if(!$.zoomooz) {
scalemode: "both",
root: $(document.body),
debug: false,
- animationendcallback: null
+ animationendcallback: null,
+ closeclick: false
};
}
@@ -1090,71 +1106,77 @@ if(!$.zoomooz) {
//**********************************//
var helpers = $.zoomooz.helpers;
-
//**********************************//
//*** jQuery functions ***//
//**********************************//
- $.fn.zoomTarget = function(settings) {
- if(!$.zoomooz.defaultSettings) {
- $.zoomooz.setup();
+ $.fn.zoomTarget = function(baseSettings) {
+ this.each(function() {
+ var settings = $(this).zoomSettings(baseSettings);
+ setupClickHandler($(this),$(this),settings);
+ });
+ }
+
+ //**********************************//
+ //*** Helper functions ***//
+ //**********************************//
+
+ function setupClickHandler(clickTarget, zoomTarget, settings) {
+ clickTarget.addClass("zoomTarget");
+
+ if(!settings.animationendcallback) {
+ if(!settings.closeclick) {
+ settings.animationendcallback = function() {
+ $(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable");
+ clickTarget.addClass("selectedZoomTarget zoomNotClickable");
+ };
+ } else {
+ settings.animationendcallback = function() {
+ $(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable");
+ clickTarget.addClass("selectedZoomTarget");
+ };
+ }
}
- if(!settings) {
- settings = {};
+ var zoomContainer = zoomTarget.closest(".zoomContainer");
+ if(zoomContainer.length!=0) {
+ settings.root = zoomContainer;
}
- settings.animationendcallback = function() {
- $(".selectedZoomTarget").removeClass("selectedZoomTarget");
- $(this).addClass("selectedZoomTarget");
- };
-
- var setupClickHandler = function(clickTarget,zoomTarget, settings) {
- clickTarget.addClass("zoomTarget");
+ var $root = settings.root;
+
+ if(!$root.hasClass("zoomTarget")) {
- var zoomContainer = zoomTarget.closest(".zoomContainer");
- if(zoomContainer.length!=0) {
- settings.root = zoomContainer;
- }
+ var rootSettings = $root.zoomSettings({});
- if(!settings.root) {
- settings.root = $.zoomooz.defaultSettings.root;
- }
+ rootSettings.animationendcallback = function() {
+ var $elem = $(this);
+ $(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable");
+ $elem.addClass("selectedZoomTarget zoomNotClickable");
+ $elem.parent().addClass("selectedZoomTarget zoomNotClickable");
+ };
- if(!settings.root.hasClass("zoomTarget")) {
+ setupClickHandler($root,$root,rootSettings);
+ setupClickHandler($root.parent(),$root,rootSettings);
- // fixme, if element has data fields for setting duration etc,
- // these will not be inherited by the root. which might or might not
- // make sense
-
- var rootSettings = {};
-
- rootSettings.animationendcallback = function() {
- var $elem = $(this);
- $(".selectedZoomTarget").removeClass("selectedZoomTarget");
- $elem.addClass("selectedZoomTarget");
- $elem.parent().addClass("selectedZoomTarget");
- };
-
- setupClickHandler(settings.root,settings.root,rootSettings);
- setupClickHandler(settings.root.parent(),settings.root,rootSettings);
-
- settings.root.click();
- }
-
- clickTarget.on("click", function(evt) {
- zoomTarget.zoomTo(settings);
- evt.stopPropagation();
- });
+ // FIXME: there could be many of these called simultaneously,
+ // don't know what would happen then
+ $root.click();
}
- this.each(function() {
- setupClickHandler($(this),$(this),jQuery.extend({}, settings));
+ clickTarget.on("click", function(evt) {
+
+ // closeclick not available here...
+ if(settings.closeclick && zoomTarget.hasClass("selectedZoomTarget")) {
+ settings.root.click();
+ } else {
+ zoomTarget.zoomTo(settings);
+ }
+ evt.stopPropagation();
});
}
-
//**********************************//
//*** Setup functions ***//
//**********************************//
@@ -1177,8 +1199,8 @@ if(!$.zoomooz) {
// FIXME: how to remove the transform origin?
style.innerHTML = ".zoomTarget{"+setupSelectionCss(false)+"}"+
".zoomTarget:hover{cursor:pointer!important;}"+
- ".selectedZoomTarget{"+setupSelectionCss(true)+"}"+
- ".selectedZoomTarget:hover{cursor:auto!important;}"+
+ ".zoomNotClickable{"+setupSelectionCss(true)+"}"+
+ ".zoomNotClickable:hover{cursor:auto!important;}"+
/* padding to fix margin collapse issues */
".zoomContainer{position:relative;padding:1px;margin:-1px;}";
View
2  jquery.zoomooz.min.js
@@ -1 +1 @@
-function Matrix(){}PureCSSMatrix=function(){function d(a){a&&a!==null&&a!="none"?a instanceof Matrix?this.setMatrix(a):this.setMatrixValue(a):this.m=Matrix.I(3)}function e(b){var c=parseFloat(f(b));return b.match(a)&&(c=2*Math.PI*c/360),c}function f(a){return a.match(b)}function g(a){return Number(a).toFixed(6)}"use strict";var a=/deg$/,b=/([0-9.\-e]+)/g,c=/([a-zA-Z]+)\(([^\)]+)\)/g;return d.prototype.setMatrix=function(a){this.m=a},d.prototype.setMatrixValue=function(a){var b=Matrix.I(3),d;while((d=c.exec(a))!==null){var g=d[1].toLowerCase(),h=d[2].split(","),i;if(g=="matrix")i=Matrix.create([[parseFloat(h[0]),parseFloat(h[2]),parseFloat(f(h[4]))],[parseFloat(h[1]),parseFloat(h[3]),parseFloat(f(h[5]))],[0,0,1]]);else if(g=="translate")i=Matrix.I(3),i.elements[0][2]=parseFloat(f(h[0])),i.elements[1][2]=parseFloat(f(h[1]));else if(g=="scale"){var j=parseFloat(h[0]),k;h.length>1?k=parseFloat(h[1]):k=j,i=Matrix.create([[j,0,0],[0,k,0],[0,0,1]])}else g=="rotate"?i=Matrix.RotationZ(e(h[0])):g=="skew"||g=="skewx"?(i=Matrix.I(3),i.elements[0][1]=Math.tan(e(h[0]))):g=="skewy"?(i=Matrix.I(3),i.elements[1][0]=Math.tan(e(h[0]))):console.log("Problem with setMatrixValue",g,h);b=b.multiply(i)}this.m=b},d.prototype.multiply=function(a){return new d(this.m.multiply(a.m))},d.prototype.inverse=function(){return Math.abs(this.m.elements[0][0])<1e-6&&(this.m.elements[0][0]=0),new d(this.m.inverse())},d.prototype.translate=function(a,b){var c=Matrix.I(3);return c.elements[0][2]=a,c.elements[1][2]=b,new d(this.m.multiply(c))},d.prototype.scale=function(a,b){var c=Matrix.create([[a,0,0],[0,b,0],[0,0,1]]);return new d(this.m.multiply(c))},d.prototype.rotate=function(a){var b=Matrix.RotationZ(a);return new d(this.m.multiply(b))},d.prototype.toString=function(){var a=this.m.elements,b="";if($.browser.mozilla||$.browser.opera)b="px";return"matrix("+g(a[0][0])+", "+g(a[1][0])+", "+g(a[0][1])+", "+g(a[1][1])+", "+g(a[0][2])+b+", "+g(a[1][2])+b+")"},d.prototype.elements=function(){var a=this.m.elements;return{a:a[0][0],b:a[1][0],c:a[0][1],d:a[1][1],e:a[0][2],f:a[1][2]}},d}(),$.zoomooz||($.zoomooz={}),$.zoomooz.helpers=function(a,b){"use strict";var c=["-moz-","-webkit-","-o-","-ms-"];return b.forEachPrefix=function(a,b){for(var d=0;d<c.length;d++)a(c[d]);b&&a("")},b.getElementTransform=function(c){var d;return b.forEachPrefix(function(b){d=d||a(c).css(b+"transform")},!0),d},b}(jQuery,{}),function(a){function j(a,b,c){var d={};g.forEachPrefix(function(b){d[b+"transform"]=a},!0);if(b){var e=w(b/1e3,6)+"s";d["-webkit-transition-duration"]=e,d["-o-transition-duration"]=e,d["-moz-transition-duration"]=e}if(c){var f=o(c);d["-webkit-transition-timing-function"]=f,d["-o-transition-timing-function"]=f,d["-moz-transition-timing-function"]=e}return d}function k(a,d,e,f,g){d||(d=m(new PureCSSMatrix)),b=(new Date).getTime(),c&&(clearInterval(c),c=null),f.easing&&(f.easingfunction=p(f.easing,f.duration)),c=setInterval(function(){l(a,d,e,f,g)},1)}function l(a,d,e,f,g){var h=(new Date).getTime()-b,i;f.easingfunction?i=f.easingfunction(h/f.duration):i=h/f.duration,a.css(j(n(v(d,e,i)))),h>f.duration&&(clearInterval(c),c=null,i=1,g&&g())}function m(a){var b=a.elements(),c=b.a,d=b.b,e=b.c,f=b.d,g=b.e,h=b.f;if(Math.abs(c*f-d*e)<.01){console.log("fail!");return}var i=g,j=h,k=Math.sqrt(c*c+d*d);c/=k,d/=k;var l=c*e+d*f;e-=c*l,f-=d*l;var m=Math.sqrt(e*e+f*f);e/=m,f/=m,l/=m,c*f-d*e<0&&(c=-c,d=-d,e=-e,f=-f,k=-k,m=-m);var n=Math.atan2(d,c);return{tx:i,ty:j,r:n,k:Math.atan(l),sx:k,sy:m}}function n(a){var b="";return b+="translate("+w(a.tx,6)+"px,"+w(a.ty,6)+"px) ",b+="rotate("+w(a.r,6)+"rad) skewX("+w(a.k,6)+"rad) ",b+="scale("+w(a.sx,6)+","+w(a.sy,6)+")",b}function o(a){return a instanceof Array?"cubic-bezier("+w(a[0],6)+","+w(a[1],6)+","+w(a[2],6)+","+w(a[3],6)+")":a}function p(a,b){var c=[];if(a instanceof Array)c=a;else switch(a){case"linear":c=[0,0,1,1];break;case"ease":c=[.25,.1,.25,1];break;case"ease-in":c=[.42,0,1,1];break;case"ease-out":c=[0,0,.58,1];break;case"ease-in-out":c=[.42,0,.58,1]}var d=function(a){return r(a,c[0],c[1],c[2],c[3],b)};return d}function q(a,b,c,d,e){var f,g,h=(1-a)*(1-a)*(1-a);return f=b*3*a*a*(1-a)+d*3*a*(1-a)*(1-a)+h,g=c*3*a*a*(1-a)+e*3*a*(1-a)*(1-a)+h,{x:Math.abs(f),y:Math.abs(g)}}function r(a,b,c,d,e,f){function m(a){return((g*a+h)*a+i)*a}function n(a){return((j*a+k)*a+l)*a}function o(a){return(3*g*a+2*h)*a+i}function p(a){return 1/(200*a)}function q(a,b){return n(r(a,b))}function r(a,b){function i(a){return a>=0?a:0-a}var c,d,e,f,g,h;for(e=a,h=0;h<8;h++){f=m(e)-a;if(i(f)<b)return e;g=o(e);if(i(g)<1e-6)break;e-=f/g}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(i(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)*.5+c}return e}var g=0,h=0,i=0,j=0,k=0,l=0;return i=3*b,h=3*(d-b)-i,g=1-i-h,l=3*c,k=3*(e-c)-l,j=1-l-k,q(a,p(f))}function s(a){var b=g.getElementTransform(a),c;b?c=new PureCSSMatrix(b):c=new PureCSSMatrix;var d=m(c);return d.r=t(b),d}function t(a){var b=0,c;while((c=e.exec(a))!==null){var d=c[1].toLowerCase(),g=c[2].split(",");if(d=="matrix"){var h=d+"("+c[2]+")";b+=m(new PureCSSMatrix(h)).r}else if(d=="rotate"){var i=g[0],j=parseFloat(x(i));i.match(f)&&(j=2*Math.PI*j/360),b+=j}}return b}function u(a,b){if(Math.abs(a.r-b.r)>Math.PI)if(b.r<a.r)while(Math.abs(a.r-b.r)>Math.PI)b.r+=2*Math.PI;else while(Math.abs(a.r-b.r)>Math.PI)b.r-=2*Math.PI;return b}function v(a,b,c){var d={};for(var e in a)a.hasOwnProperty(e)&&(d[e]=a[e]+(b[e]-a[e])*c);return d}function w(a,b){b=Math.abs(parseInt(b,10))||0;var c=Math.pow(10,b);return Math.round(a*c)/c}function x(a){return a.match(d)}"use strict";var b,c,d=/([0-9.\-e]+)/g,e=/([a-z]+)\(([^\)]+)\)/g,f=/deg$/,g=a.zoomooz.helpers,h={duration:450,easing:"ease",nativeanimation:!1},i;jQuery.cssHooks.MsTransform={set:function(a,b){a.style.msTransform=b}},jQuery.cssHooks.MsTransformOrigin={set:function(a,b){a.style.msTransformOrigin=b}},a.fn.animateTransformation=function(b,c,d){c=jQuery.extend({},h,c);var e=a.browser.webkit&&c.nativeanimation;i&&(clearTimeout(i),i=null),e&&d&&(i=setTimeout(d,c.duration)),this.each(function(){var f=a(this);b||(b=new PureCSSMatrix);var g=s(f),h=u(g,m(b));e?f.css(j(n(h),c.duration,c.easing)):k(f,g,h,c,d)})},a.fn.setTransformation=function(b){this.each(function(){var c=a(this),d=s(c),e=u(d,m(b));c.css(j(n(e)))})}}(jQuery),function(a){function d(b,d){a.zoomooz.defaultSettings||a.zoomooz.setup();var e=a.zoomooz.defaultSettings,f=jQuery.extend({},d);for(var g in e)e.hasOwnProperty(g)&&!f[g]&&(f[g]=b.data(g));for(var h=0;h<c.length;h++){var g=c[h];f[g]||(f[g]=b.data(g))}return jQuery.extend({},e,f)}function e(){var a=document.createElement("style");a.type="text/css";var c="";b.forEachPrefix(function(a){c+=a+"transform-origin: 0 0;"},!0),a.innerHTML="html {height:100%;}.noScroll{overflow:hidden !important;}body.noScroll,html.noScroll body{margin-right:15px;}* {"+c+"}",document.getElementsByTagName("head")[0].appendChild(a)}function f(){return{targetsize:.9,scalemode:"both",root:a(document.body),debug:!1,animationendcallback:null}}function g(b,c){var d=h(b,c),e,f=null;if(b[0]!==c.root[0]){var g=m(b,c.root).inverse();e=i(b,g,c),c.animationendcallback&&(f=function(){c.animationendcallback.call(b[0])})}else e=(new PureCSSMatrix).translate(-d.x,-d.y),f=function(){var e=a(c.root),f=d.elem;e.setTransformation(new PureCSSMatrix),e.data("original-scroll",null),f.removeClass("noScroll"),f.scrollLeft(d.x),f.scrollTop(d.y),c.animationendcallback&&c.animationendcallback.call(b[0])};a(c.root).animateTransformation(e,c,f)}function h(a,c){var d=c.root,e=d.parent();if(a[0]===d[0]){var f=d.data("original-scroll");return f?f:{elem:e,x:0,"y:":0}}if(!d.data("original-scroll")){var g=d.scrollTop(),h=d.scrollLeft(),a=d;g||(g=e.scrollTop(),h=e.scrollLeft(),a=e);var f={elem:a,x:h,y:g};d.data("original-scroll",f),a.addClass("noScroll"),a.scrollTop(0),a.scrollLeft(0);var i="translate(-"+h+"px,-"+g+"px)";return b.forEachPrefix(function(a){d.css(a+"transform",i)}),f}}function i(c,d,e){var f=e.targetsize,g=e.scalemode,h=e.root,i=a(h).parent(),j=i.width(),k=i.height(),l=j/c.outerWidth(),m=k/c.outerHeight(),o;if(g=="width")o=f*l;else if(g=="height")o=f*m;else if(g=="both")o=f*Math.min(l,m);else{if(g!="scale"){console.log("wrong zoommode");return}o=f}var p=(j-c.outerWidth()*o)/2,q=(k-c.outerHeight()*o)/2,r=j/2,s=k/2,t=-parseFloat(h.css("margin-left"))||0,u=-parseFloat(h.css("margin-top"))||0,v=n(r)+"px "+n(s)+"px";b.forEachPrefix(function(a){h.css(a+"transform-origin",v)});var w=(new PureCSSMatrix).translate(t,u).translate(-r,-s).translate(p,q).scale(o,o).multiply(d).translate(r,s);return w}function j(a,b,c){return[a.a*b+a.c*c+a.e,a.b*b+a.d*c+a.f]}function k(a,b){var c=m(a,b.root).elements();l(j(c,0,0)),l(j(c,0,a.outerHeight())),l(j(c,a.outerWidth(),a.outerHeight())),l(j(c,a.outerWidth(),0))}function l(b){var c="width:4px;height:4px;background-color:red;position:absolute;margin-left:-2px;margin-top:-2px;";c+="left:"+b[0]+"px;top:"+b[1]+"px;";var d='<div class="debuglabel" style="'+c+'"></div>';a("#debug").append(d)}function m(b,c){var d=b[0];if(!d||!d.ownerDocument)return null;var e=new PureCSSMatrix,f;if(d===d.ownerDocument.body){var g=jQuery.offset.bodyOffset(d);return f=new PureCSSMatrix,f=f.translate(g.left,g.top),e=e.multiply(f),e}var h;jQuery.offset.initialize?(jQuery.offset.initialize(),h={fixedPosition:jQuery.offset.supportsFixedPosition,doesNotAddBorder:jQuery.offset.doesNotAddBorder,doesAddBorderForTableAndCells:jQuery.support.doesAddBorderForTableAndCells,subtractsBorderForOverflowNotVisible:jQuery.offset.subtractsBorderForOverflowNotVisible}):h=jQuery.support;var i=d.offsetParent,j=d.ownerDocument,k,l=j.documentElement,m=j.body,n=c[0],p=j.defaultView,q;p?q=p.getComputedStyle(d,null):q=d.currentStyle;var r=d.offsetTop,s=d.offsetLeft,t=o().translate(s,r);t=t.multiply(o(d)),e=t.multiply(e);while((d=d.parentNode)&&d!==n){r=0,s=0;if(h.fixedPosition&&q.position==="fixed")break;k=p?p.getComputedStyle(d,null):d.currentStyle,r-=d.scrollTop,s-=d.scrollLeft,d===i&&(r+=d.offsetTop,s+=d.offsetLeft,h.doesNotAddBorder&&(!h.doesAddBorderForTableAndCells||!/^t(able|d|h)$/i.test(d.nodeName))&&(r+=parseFloat(k.borderTopWidth)||0,s+=parseFloat(k.borderLeftWidth)||0),i=d.offsetParent),h.subtractsBorderForOverflowNotVisible&&k.overflow!=="visible"&&(r+=parseFloat(k.borderTopWidth)||0,s+=parseFloat(k.borderLeftWidth)||0),q=k,d.offsetParent==n&&(r-=parseFloat(a(d.offsetParent).css("margin-top"))||0,s-=parseFloat(a(d.offsetParent).css("margin-left"))||0),t=o().translate(s,r),t=t.multiply(o(d)),e=t.multiply(e)}r=0,s=0;if(q.position==="relative"||q.position==="static")r+=m.offsetTop,s+=m.offsetLeft;h.fixedPosition&&q.position==="fixed"&&(r+=Math.max(l.scrollTop,m.scrollTop),s+=Math.max(l.scrollLeft,m.scrollLeft));var u=(new PureCSSMatrix).translate(s,r);return e=e.multiply(u),e}function n(a){return Number(a).toFixed(6)}function o(a){var c=b.getElementTransform(a);return c?new PureCSSMatrix(c):new PureCSSMatrix}"use strict";var b=a.zoomooz.helpers,c=["duration","easing","nativeanimation"];e(),a.zoomooz||(a.zoomooz={}),a.zoomooz.setup=function(b){a.zoomooz.defaultSettings=jQuery.extend(f(),b)},a.fn.zoomTo=function(b){return this.each(function(){var c=a(this),e=d(c,b);g(c,e),e.debug?(a("#debug").length===0?a(e.root).append('<div id="debug"><div>'):a("#debug").html(""),k(c,e)):a("#debug").length!==0&&a("#debug").html("")}),this}}(jQuery),function(a){function c(){function c(a){var c="-webkit-touch-callout: "+(a?"default":"none")+";";return b.forEachPrefix(function(b){c+=b+"user-select:"+(a?"text":"none")+";"},!0),c}var a=document.createElement("style");a.type="text/css",a.innerHTML=".zoomTarget{"+c(!1)+"}"+".zoomTarget:hover{cursor:pointer!important;}"+".selectedZoomTarget{"+c(!0)+"}"+".selectedZoomTarget:hover{cursor:auto!important;}"+".zoomContainer{position:relative;padding:1px;margin:-1px;}",document.getElementsByTagName("head")[0].appendChild(a)}"use strict",a.zoomooz||(a.zoomooz={});var b=a.zoomooz.helpers;a.fn.zoomTarget=function(b){a.zoomooz.defaultSettings||a.zoomooz.setup(),b||(b={}),b.animationendcallback=function(){a(".selectedZoomTarget").removeClass("selectedZoomTarget"),a(this).addClass("selectedZoomTarget")};var c=function(b,d,e){b.addClass("zoomTarget");var f=d.closest(".zoomContainer");f.length!=0&&(e.root=f),e.root||(e.root=a.zoomooz.defaultSettings.root);if(!e.root.hasClass("zoomTarget")){var g={};g.animationendcallback=function(){var b=a(this);a(".selectedZoomTarget").removeClass("selectedZoomTarget"),b.addClass("selectedZoomTarget"),b.parent().addClass("selectedZoomTarget")},c(e.root,e.root,g),c(e.root.parent(),e.root,g),e.root.click()}b.on("click",function(a){d.zoomTo(e),a.stopPropagation()})};this.each(function(){c(a(this),a(this),jQuery.extend({},b))})},c(),a(document).ready(function(){a(".zoomTarget").zoomTarget()})}(jQuery),function(a){"use strict",a.zoomooz||(a.zoomooz={}),a.fn.zoomContainer=function(a){},a(document).ready(function(){a(".zoomContainer").zoomContainer()})}(jQuery);var Sylvester={version:"0.1.3",precision:1e-6};Matrix.prototype={dup:function(){return Matrix.create(this.elements)},canMultiplyFromLeft:function(a){var b=a.elements||a;return typeof b[0][0]=="undefined"&&(b=Matrix.create(b).elements),this.elements[0].length==b.length},multiply:function(a){var b=a.modulus?!0:!1,c=a.elements||a;typeof c[0][0]=="undefined"&&(c=Matrix.create(c).elements);if(!this.canMultiplyFromLeft(c))return null;var d=this.elements.length,e=d,f,g,h=c[0].length,i,j=this.elements[0].length,k=[],l,m,n;do{f=e-d,k[f]=[],g=h;do{i=h-g,l=0,m=j;do n=j-m,l+=this.elements[f][n]*c[n][i];while(--m);k[f][i]=l}while(--g)}while(--d);var c=Matrix.create(k);return b?c.col(1):c},isSquare:function(){return this.elements.length==this.elements[0].length},toRightTriangular:function(){var a=this.dup(),b,c=this.elements.length,d=c,e,f,g=this.elements[0].length,h;do{e=d-c;if(a.elements[e][e]==0)for(j=e+1;j<d;j++)if(a.elements[j][e]!=0){b=[],f=g;do h=g-f,b.push(a.elements[e][h]+a.elements[j][h]);while(--f);a.elements[e]=b;break}if(a.elements[e][e]!=0)for(j=e+1;j<d;j++){var i=a.elements[j][e]/a.elements[e][e];b=[],f=g;do h=g-f,b.push(h<=e?0:a.elements[j][h]-a.elements[e][h]*i);while(--f);a.elements[j]=b}}while(--c);return a},determinant:function(){if(!this.isSquare())return null;var a=this.toRightTriangular(),b=a.elements[0][0],c=a.elements.length-1,d=c,e;do e=d-c+1,b*=a.elements[e][e];while(--c);return b},isSingular:function(){return this.isSquare()&&this.determinant()===0},augment:function(a){var b=a.elements||a;typeof b[0][0]=="undefined"&&(b=Matrix.create(b).elements);var c=this.dup(),d=c.elements[0].length,e=c.elements.length,f=e,g,h,i=b[0].length,j;if(e!=b.length)return null;do{g=f-e,h=i;do j=i-h,c.elements[g][d+j]=b[g][j];while(--h)}while(--e);return c},inverse:function(){if(!this.isSquare()||this.isSingular())return null;var a=this.elements.length,b=a,c,d,e=this.augment(Matrix.I(a)).toRightTriangular(),f,g=e.elements[0].length,h,i,j,k=[],l;do{c=a-1,i=[],f=g,k[c]=[],j=e.elements[c][c];do h=g-f,l=e.elements[c][h]/j,i.push(l),h>=b&&k[c].push(l);while(--f);e.elements[c]=i;for(d=0;d<c;d++){i=[],f=g;do h=g-f,i.push(e.elements[d][h]-e.elements[c][h]*e.elements[d][c]);while(--f);e.elements[d]=i}}while(--a);return Matrix.create(k)},setElements:function(a){var b,c=a.elements||a;if(typeof c[0][0]!="undefined"){var d=c.length,e=d,f,g,h;this.elements=[];do{b=e-d,f=c[b].length,g=f,this.elements[b]=[];do h=g-f,this.elements[b][h]=c[b][h];while(--f)}while(--d);return this}var i=c.length,j=i;this.elements=[];do b=j-i,this.elements.push([c[b]]);while(--i);return this}},Matrix.create=function(a){var b=new Matrix;return b.setElements(a)},Matrix.I=function(a){var b=[],c=a,d,e,f;do{d=c-a,b[d]=[],e=c;do f=c-e,b[d][f]=d==f?1:0;while(--e)}while(--a);return Matrix.create(b)}
+function Matrix(){}PureCSSMatrix=function(){function d(a){a&&a!==null&&a!="none"?a instanceof Matrix?this.setMatrix(a):this.setMatrixValue(a):this.m=Matrix.I(3)}function e(b){var c=parseFloat(f(b));return b.match(a)&&(c=2*Math.PI*c/360),c}function f(a){return a.match(b)}function g(a){return Number(a).toFixed(6)}"use strict";var a=/deg$/,b=/([0-9.\-e]+)/g,c=/([a-zA-Z]+)\(([^\)]+)\)/g;return d.prototype.setMatrix=function(a){this.m=a},d.prototype.setMatrixValue=function(a){var b=Matrix.I(3),d;while((d=c.exec(a))!==null){var g=d[1].toLowerCase(),h=d[2].split(","),i;if(g=="matrix")i=Matrix.create([[parseFloat(h[0]),parseFloat(h[2]),parseFloat(f(h[4]))],[parseFloat(h[1]),parseFloat(h[3]),parseFloat(f(h[5]))],[0,0,1]]);else if(g=="translate")i=Matrix.I(3),i.elements[0][2]=parseFloat(f(h[0])),i.elements[1][2]=parseFloat(f(h[1]));else if(g=="scale"){var j=parseFloat(h[0]),k;h.length>1?k=parseFloat(h[1]):k=j,i=Matrix.create([[j,0,0],[0,k,0],[0,0,1]])}else g=="rotate"?i=Matrix.RotationZ(e(h[0])):g=="skew"||g=="skewx"?(i=Matrix.I(3),i.elements[0][1]=Math.tan(e(h[0]))):g=="skewy"?(i=Matrix.I(3),i.elements[1][0]=Math.tan(e(h[0]))):console.log("Problem with setMatrixValue",g,h);b=b.multiply(i)}this.m=b},d.prototype.multiply=function(a){return new d(this.m.multiply(a.m))},d.prototype.inverse=function(){return Math.abs(this.m.elements[0][0])<1e-6&&(this.m.elements[0][0]=0),new d(this.m.inverse())},d.prototype.translate=function(a,b){var c=Matrix.I(3);return c.elements[0][2]=a,c.elements[1][2]=b,new d(this.m.multiply(c))},d.prototype.scale=function(a,b){var c=Matrix.create([[a,0,0],[0,b,0],[0,0,1]]);return new d(this.m.multiply(c))},d.prototype.rotate=function(a){var b=Matrix.RotationZ(a);return new d(this.m.multiply(b))},d.prototype.toString=function(){var a=this.m.elements,b="";if($.browser.mozilla||$.browser.opera)b="px";return"matrix("+g(a[0][0])+", "+g(a[1][0])+", "+g(a[0][1])+", "+g(a[1][1])+", "+g(a[0][2])+b+", "+g(a[1][2])+b+")"},d.prototype.elements=function(){var a=this.m.elements;return{a:a[0][0],b:a[1][0],c:a[0][1],d:a[1][1],e:a[0][2],f:a[1][2]}},d}(),$.zoomooz||($.zoomooz={}),$.zoomooz.helpers=function(a,b){"use strict";var c=["-moz-","-webkit-","-o-","-ms-"];return b.forEachPrefix=function(a,b){for(var d=0;d<c.length;d++)a(c[d]);b&&a("")},b.getElementTransform=function(c){var d;return b.forEachPrefix(function(b){d=d||a(c).css(b+"transform")},!0),d},b}(jQuery,{}),function(a){function j(a,b,c){var d={};g.forEachPrefix(function(b){d[b+"transform"]=a},!0);if(b){var e=w(b/1e3,6)+"s";d["-webkit-transition-duration"]=e,d["-o-transition-duration"]=e,d["-moz-transition-duration"]=e}if(c){var f=o(c);d["-webkit-transition-timing-function"]=f,d["-o-transition-timing-function"]=f,d["-moz-transition-timing-function"]=e}return d}function k(a,d,e,f,g){d||(d=m(new PureCSSMatrix)),b=(new Date).getTime(),c&&(clearInterval(c),c=null),f.easing&&(f.easingfunction=p(f.easing,f.duration)),c=setInterval(function(){l(a,d,e,f,g)},1)}function l(a,d,e,f,g){var h=(new Date).getTime()-b,i;f.easingfunction?i=f.easingfunction(h/f.duration):i=h/f.duration,a.css(j(n(v(d,e,i)))),h>f.duration&&(clearInterval(c),c=null,i=1,g&&g())}function m(a){var b=a.elements(),c=b.a,d=b.b,e=b.c,f=b.d,g=b.e,h=b.f;if(Math.abs(c*f-d*e)<.01){console.log("fail!");return}var i=g,j=h,k=Math.sqrt(c*c+d*d);c/=k,d/=k;var l=c*e+d*f;e-=c*l,f-=d*l;var m=Math.sqrt(e*e+f*f);e/=m,f/=m,l/=m,c*f-d*e<0&&(c=-c,d=-d,e=-e,f=-f,k=-k,m=-m);var n=Math.atan2(d,c);return{tx:i,ty:j,r:n,k:Math.atan(l),sx:k,sy:m}}function n(a){var b="";return b+="translate("+w(a.tx,6)+"px,"+w(a.ty,6)+"px) ",b+="rotate("+w(a.r,6)+"rad) skewX("+w(a.k,6)+"rad) ",b+="scale("+w(a.sx,6)+","+w(a.sy,6)+")",b}function o(a){return a instanceof Array?"cubic-bezier("+w(a[0],6)+","+w(a[1],6)+","+w(a[2],6)+","+w(a[3],6)+")":a}function p(a,b){var c=[];if(a instanceof Array)c=a;else switch(a){case"linear":c=[0,0,1,1];break;case"ease":c=[.25,.1,.25,1];break;case"ease-in":c=[.42,0,1,1];break;case"ease-out":c=[0,0,.58,1];break;case"ease-in-out":c=[.42,0,.58,1]}var d=function(a){return r(a,c[0],c[1],c[2],c[3],b)};return d}function q(a,b,c,d,e){var f,g,h=(1-a)*(1-a)*(1-a);return f=b*3*a*a*(1-a)+d*3*a*(1-a)*(1-a)+h,g=c*3*a*a*(1-a)+e*3*a*(1-a)*(1-a)+h,{x:Math.abs(f),y:Math.abs(g)}}function r(a,b,c,d,e,f){function m(a){return((g*a+h)*a+i)*a}function n(a){return((j*a+k)*a+l)*a}function o(a){return(3*g*a+2*h)*a+i}function p(a){return 1/(200*a)}function q(a,b){return n(r(a,b))}function r(a,b){function i(a){return a>=0?a:0-a}var c,d,e,f,g,h;for(e=a,h=0;h<8;h++){f=m(e)-a;if(i(f)<b)return e;g=o(e);if(i(g)<1e-6)break;e-=f/g}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(i(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)*.5+c}return e}var g=0,h=0,i=0,j=0,k=0,l=0;return i=3*b,h=3*(d-b)-i,g=1-i-h,l=3*c,k=3*(e-c)-l,j=1-l-k,q(a,p(f))}function s(a){var b=g.getElementTransform(a),c;b?c=new PureCSSMatrix(b):c=new PureCSSMatrix;var d=m(c);return d.r=t(b),d}function t(a){var b=0,c;while((c=e.exec(a))!==null){var d=c[1].toLowerCase(),g=c[2].split(",");if(d=="matrix"){var h=d+"("+c[2]+")";b+=m(new PureCSSMatrix(h)).r}else if(d=="rotate"){var i=g[0],j=parseFloat(x(i));i.match(f)&&(j=2*Math.PI*j/360),b+=j}}return b}function u(a,b){if(Math.abs(a.r-b.r)>Math.PI)if(b.r<a.r)while(Math.abs(a.r-b.r)>Math.PI)b.r+=2*Math.PI;else while(Math.abs(a.r-b.r)>Math.PI)b.r-=2*Math.PI;return b}function v(a,b,c){var d={};for(var e in a)a.hasOwnProperty(e)&&(d[e]=a[e]+(b[e]-a[e])*c);return d}function w(a,b){b=Math.abs(parseInt(b,10))||0;var c=Math.pow(10,b);return Math.round(a*c)/c}function x(a){return a.match(d)}"use strict";var b,c,d=/([0-9.\-e]+)/g,e=/([a-z]+)\(([^\)]+)\)/g,f=/deg$/,g=a.zoomooz.helpers,h={duration:450,easing:"ease",nativeanimation:!1},i;jQuery.cssHooks.MsTransform={set:function(a,b){a.style.msTransform=b}},jQuery.cssHooks.MsTransformOrigin={set:function(a,b){a.style.msTransformOrigin=b}},a.fn.animateTransformation=function(b,c,d){c=jQuery.extend({},h,c);var e=a.browser.webkit&&c.nativeanimation;i&&(clearTimeout(i),i=null),e&&d&&(i=setTimeout(d,c.duration)),this.each(function(){var f=a(this);b||(b=new PureCSSMatrix);var g=s(f),h=u(g,m(b));e?f.css(j(n(h),c.duration,c.easing)):k(f,g,h,c,d)})},a.fn.setTransformation=function(b){this.each(function(){var c=a(this),d=s(c),e=u(d,m(b));c.css(j(n(e)))})}}(jQuery),function(a){function d(b,d){var e=jQuery.extend({},d);a.zoomooz.defaultSettings||(a.zoomooz.defaultSettings=f());var g=a.zoomooz.defaultSettings,h=jQuery.extend({},e);for(var i in g)g.hasOwnProperty(i)&&!h[i]&&(h[i]=b.data(i));for(var j=0;j<c.length;j++){var i=c[j];h[i]||(h[i]=b.data(i))}return jQuery.extend({},g,h)}function e(){var a=document.createElement("style");a.type="text/css";var c="";b.forEachPrefix(function(a){c+=a+"transform-origin: 0 0;"},!0),a.innerHTML="html {height:100%;}.noScroll{overflow:hidden !important;}body.noScroll,html.noScroll body{margin-right:15px;}* {"+c+"}",document.getElementsByTagName("head")[0].appendChild(a)}function f(){return{targetsize:.9,scalemode:"both",root:a(document.body),debug:!1,animationendcallback:null,closeclick:!1}}function g(b,c){var d=h(b,c),e,f=null;if(b[0]!==c.root[0]){var g=m(b,c.root).inverse();e=i(b,g,c),c.animationendcallback&&(f=function(){c.animationendcallback.call(b[0])})}else e=(new PureCSSMatrix).translate(-d.x,-d.y),f=function(){var e=a(c.root),f=d.elem;e.setTransformation(new PureCSSMatrix),e.data("original-scroll",null),f.removeClass("noScroll"),f.scrollLeft(d.x),f.scrollTop(d.y),c.animationendcallback&&c.animationendcallback.call(b[0])};a(c.root).animateTransformation(e,c,f)}function h(a,c){var d=c.root,e=d.parent();if(a[0]===d[0]){var f=d.data("original-scroll");return f?f:{elem:e,x:0,"y:":0}}if(!d.data("original-scroll")){var g=d.scrollTop(),h=d.scrollLeft(),a=d;g||(g=e.scrollTop(),h=e.scrollLeft(),a=e);var f={elem:a,x:h,y:g};d.data("original-scroll",f),a.addClass("noScroll"),a.scrollTop(0),a.scrollLeft(0);var i="translate(-"+h+"px,-"+g+"px)";return b.forEachPrefix(function(a){d.css(a+"transform",i)}),f}}function i(c,d,e){var f=e.targetsize,g=e.scalemode,h=e.root,i=a(h).parent(),j=i.width(),k=i.height(),l=j/c.outerWidth(),m=k/c.outerHeight(),o;if(g=="width")o=f*l;else if(g=="height")o=f*m;else if(g=="both")o=f*Math.min(l,m);else{if(g!="scale"){console.log("wrong zoommode");return}o=f}var p=(j-c.outerWidth()*o)/2,q=(k-c.outerHeight()*o)/2,r=j/2,s=k/2,t=-parseFloat(h.css("margin-left"))||0,u=-parseFloat(h.css("margin-top"))||0,v=n(r)+"px "+n(s)+"px";b.forEachPrefix(function(a){h.css(a+"transform-origin",v)});var w=(new PureCSSMatrix).translate(t,u).translate(-r,-s).translate(p,q).scale(o,o).multiply(d).translate(r,s);return w}function j(a,b,c){return[a.a*b+a.c*c+a.e,a.b*b+a.d*c+a.f]}function k(a,b){var c=m(a,b.root).elements();l(j(c,0,0)),l(j(c,0,a.outerHeight())),l(j(c,a.outerWidth(),a.outerHeight())),l(j(c,a.outerWidth(),0))}function l(b){var c="width:4px;height:4px;background-color:red;position:absolute;margin-left:-2px;margin-top:-2px;";c+="left:"+b[0]+"px;top:"+b[1]+"px;";var d='<div class="debuglabel" style="'+c+'"></div>';a("#debug").append(d)}function m(b,c){var d=b[0];if(!d||!d.ownerDocument)return null;var e=new PureCSSMatrix,f;if(d===d.ownerDocument.body){var g=jQuery.offset.bodyOffset(d);return f=new PureCSSMatrix,f=f.translate(g.left,g.top),e=e.multiply(f),e}var h;jQuery.offset.initialize?(jQuery.offset.initialize(),h={fixedPosition:jQuery.offset.supportsFixedPosition,doesNotAddBorder:jQuery.offset.doesNotAddBorder,doesAddBorderForTableAndCells:jQuery.support.doesAddBorderForTableAndCells,subtractsBorderForOverflowNotVisible:jQuery.offset.subtractsBorderForOverflowNotVisible}):h=jQuery.support;var i=d.offsetParent,j=d.ownerDocument,k,l=j.documentElement,m=j.body,n=c[0],p=j.defaultView,q;p?q=p.getComputedStyle(d,null):q=d.currentStyle;var r=d.offsetTop,s=d.offsetLeft,t=o().translate(s,r);t=t.multiply(o(d)),e=t.multiply(e);while((d=d.parentNode)&&d!==n){r=0,s=0;if(h.fixedPosition&&q.position==="fixed")break;k=p?p.getComputedStyle(d,null):d.currentStyle,r-=d.scrollTop,s-=d.scrollLeft,d===i&&(r+=d.offsetTop,s+=d.offsetLeft,h.doesNotAddBorder&&(!h.doesAddBorderForTableAndCells||!/^t(able|d|h)$/i.test(d.nodeName))&&(r+=parseFloat(k.borderTopWidth)||0,s+=parseFloat(k.borderLeftWidth)||0),i=d.offsetParent),h.subtractsBorderForOverflowNotVisible&&k.overflow!=="visible"&&(r+=parseFloat(k.borderTopWidth)||0,s+=parseFloat(k.borderLeftWidth)||0),q=k,d.offsetParent==n&&(r-=parseFloat(a(d.offsetParent).css("margin-top"))||0,s-=parseFloat(a(d.offsetParent).css("margin-left"))||0),t=o().translate(s,r),t=t.multiply(o(d)),e=t.multiply(e)}r=0,s=0;if(q.position==="relative"||q.position==="static")r+=m.offsetTop,s+=m.offsetLeft;h.fixedPosition&&q.position==="fixed"&&(r+=Math.max(l.scrollTop,m.scrollTop),s+=Math.max(l.scrollLeft,m.scrollLeft));var u=(new PureCSSMatrix).translate(s,r);return e=e.multiply(u),e}function n(a){return Number(a).toFixed(6)}function o(a){var c=b.getElementTransform(a);return c?new PureCSSMatrix(c):new PureCSSMatrix}"use strict";var b=a.zoomooz.helpers,c=["duration","easing","nativeanimation"];e(),a.zoomooz||(a.zoomooz={}),a.fn.zoomSettings=function(b){var c;return this.each(function(){var e=a(this);c=d(e,b)}),c},a.fn.zoomTo=function(b,c){return this.each(function(){var d=a(this);c||(b=d.zoomSettings(b)),g(d,b),b.debug?(a("#debug").length===0?a(b.root).append('<div id="debug"><div>'):a("#debug").html(""),k(d,b)):a("#debug").length!==0&&a("#debug").html("")}),this}}(jQuery),function(a){function c(b,d,e){b.addClass("zoomTarget"),e.animationendcallback||(e.closeclick?e.animationendcallback=function(){a(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable"),b.addClass("selectedZoomTarget")}:e.animationendcallback=function(){a(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable"),b.addClass("selectedZoomTarget zoomNotClickable")});var f=d.closest(".zoomContainer");f.length!=0&&(e.root=f);var g=e.root;if(!g.hasClass("zoomTarget")){var h=g.zoomSettings({});h.animationendcallback=function(){var b=a(this);a(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable"),b.addClass("selectedZoomTarget zoomNotClickable"),b.parent().addClass("selectedZoomTarget zoomNotClickable")},c(g,g,h),c(g.parent(),g,h),g.click()}b.on("click",function(a){e.closeclick&&d.hasClass("selectedZoomTarget")?e.root.click():d.zoomTo(e),a.stopPropagation()})}function d(){function c(a){var c="-webkit-touch-callout: "+(a?"default":"none")+";";return b.forEachPrefix(function(b){c+=b+"user-select:"+(a?"text":"none")+";"},!0),c}var a=document.createElement("style");a.type="text/css",a.innerHTML=".zoomTarget{"+c(!1)+"}"+".zoomTarget:hover{cursor:pointer!important;}"+".zoomNotClickable{"+c(!0)+"}"+".zoomNotClickable:hover{cursor:auto!important;}"+".zoomContainer{position:relative;padding:1px;margin:-1px;}",document.getElementsByTagName("head")[0].appendChild(a)}"use strict",a.zoomooz||(a.zoomooz={});var b=a.zoomooz.helpers;a.fn.zoomTarget=function(b){this.each(function(){var d=a(this).zoomSettings(b);c(a(this),a(this),d)})},d(),a(document).ready(function(){a(".zoomTarget").zoomTarget()})}(jQuery),function(a){"use strict",a.zoomooz||(a.zoomooz={}),a.fn.zoomContainer=function(a){},a(document).ready(function(){a(".zoomContainer").zoomContainer()})}(jQuery);var Sylvester={version:"0.1.3",precision:1e-6};Matrix.prototype={dup:function(){return Matrix.create(this.elements)},canMultiplyFromLeft:function(a){var b=a.elements||a;return typeof b[0][0]=="undefined"&&(b=Matrix.create(b).elements),this.elements[0].length==b.length},multiply:function(a){var b=a.modulus?!0:!1,c=a.elements||a;typeof c[0][0]=="undefined"&&(c=Matrix.create(c).elements);if(!this.canMultiplyFromLeft(c))return null;var d=this.elements.length,e=d,f,g,h=c[0].length,i,j=this.elements[0].length,k=[],l,m,n;do{f=e-d,k[f]=[],g=h;do{i=h-g,l=0,m=j;do n=j-m,l+=this.elements[f][n]*c[n][i];while(--m);k[f][i]=l}while(--g)}while(--d);var c=Matrix.create(k);return b?c.col(1):c},isSquare:function(){return this.elements.length==this.elements[0].length},toRightTriangular:function(){var a=this.dup(),b,c=this.elements.length,d=c,e,f,g=this.elements[0].length,h;do{e=d-c;if(a.elements[e][e]==0)for(j=e+1;j<d;j++)if(a.elements[j][e]!=0){b=[],f=g;do h=g-f,b.push(a.elements[e][h]+a.elements[j][h]);while(--f);a.elements[e]=b;break}if(a.elements[e][e]!=0)for(j=e+1;j<d;j++){var i=a.elements[j][e]/a.elements[e][e];b=[],f=g;do h=g-f,b.push(h<=e?0:a.elements[j][h]-a.elements[e][h]*i);while(--f);a.elements[j]=b}}while(--c);return a},determinant:function(){if(!this.isSquare())return null;var a=this.toRightTriangular(),b=a.elements[0][0],c=a.elements.length-1,d=c,e;do e=d-c+1,b*=a.elements[e][e];while(--c);return b},isSingular:function(){return this.isSquare()&&this.determinant()===0},augment:function(a){var b=a.elements||a;typeof b[0][0]=="undefined"&&(b=Matrix.create(b).elements);var c=this.dup(),d=c.elements[0].length,e=c.elements.length,f=e,g,h,i=b[0].length,j;if(e!=b.length)return null;do{g=f-e,h=i;do j=i-h,c.elements[g][d+j]=b[g][j];while(--h)}while(--e);return c},inverse:function(){if(!this.isSquare()||this.isSingular())return null;var a=this.elements.length,b=a,c,d,e=this.augment(Matrix.I(a)).toRightTriangular(),f,g=e.elements[0].length,h,i,j,k=[],l;do{c=a-1,i=[],f=g,k[c]=[],j=e.elements[c][c];do h=g-f,l=e.elements[c][h]/j,i.push(l),h>=b&&k[c].push(l);while(--f);e.elements[c]=i;for(d=0;d<c;d++){i=[],f=g;do h=g-f,i.push(e.elements[d][h]-e.elements[c][h]*e.elements[d][c]);while(--f);e.elements[d]=i}}while(--a);return Matrix.create(k)},setElements:function(a){var b,c=a.elements||a;if(typeof c[0][0]!="undefined"){var d=c.length,e=d,f,g,h;this.elements=[];do{b=e-d,f=c[b].length,g=f,this.elements[b]=[];do h=g-f,this.elements[b][h]=c[b][h];while(--f)}while(--d);return this}var i=c.length,j=i;this.elements=[];do b=j-i,this.elements.push([c[b]]);while(--i);return this}},Matrix.create=function(a){var b=new Matrix;return b.setElements(a)},Matrix.I=function(a){var b=[],c=a,d,e,f;do{d=c-a,b[d]=[],e=c;do f=c-e,b[d][f]=d==f?1:0;while(--e)}while(--a);return Matrix.create(b)}
View
40 src/js/jquery.zoomooz-core.js
@@ -67,23 +67,32 @@
$.zoomooz = {};
}
- $.zoomooz.setup = function(settings) {
- $.zoomooz.defaultSettings = jQuery.extend(constructDefaultSettings(), settings);
- };
+ $.fn.zoomSettings = function(settings) {
+ var retValue;
+ this.each(function() {
+ var $elem = $(this);
+ retValue = setupElementSettings($elem, settings);
+ });
+ return retValue;
+ }
- $.fn.zoomTo = function(settings) {
+ $.fn.zoomTo = function(settings, skipElementSettings) {
this.each(function() {
var $this = $(this);
- var elemSettings = setupElementSettings($this, settings);
- zoomTo($this, elemSettings);
- if(elemSettings.debug) {
+ if(!skipElementSettings) {
+ settings = $this.zoomSettings(settings);
+ }
+
+ zoomTo($this, settings);
+
+ if(settings.debug) {
if($("#debug").length===0) {
- $(elemSettings.root).append('<div id="debug"><div>');
+ $(settings.root).append('<div id="debug"><div>');
} else {
$("#debug").html("");
}
- showDebug($this,elemSettings);
+ showDebug($this,settings);
} else {
if($("#debug").length!==0) {
$("#debug").html("");
@@ -98,9 +107,12 @@
//*** Setup functions ***//
//**********************************//
- function setupElementSettings($elem, settings) {
+ function setupElementSettings($elem, baseSettings) {
+
+ var settings = jQuery.extend({}, baseSettings);
+
if(!$.zoomooz.defaultSettings) {
- $.zoomooz.setup();
+ $.zoomooz.defaultSettings = constructDefaultSettings();
}
var defaultSettings = $.zoomooz.defaultSettings;
@@ -111,6 +123,9 @@
elementSettings[key] = $elem.data(key);
}
}
+
+ // FIXME: it would be better, that the animationSettings
+ // would come from the jquery.zoomooz-anim file somehow
for(var i=0;i<animationSettings.length;i++) {
var key = animationSettings[i];
if(!elementSettings[key]) {
@@ -148,7 +163,8 @@
scalemode: "both",
root: $(document.body),
debug: false,
- animationendcallback: null
+ animationendcallback: null,
+ closeclick: false
};
}
View
104 src/js/jquery.zoomooz-zoomTarget.js
@@ -24,71 +24,77 @@
//**********************************//
var helpers = $.zoomooz.helpers;
-
//**********************************//
//*** jQuery functions ***//
//**********************************//
- $.fn.zoomTarget = function(settings) {
- if(!$.zoomooz.defaultSettings) {
- $.zoomooz.setup();
+ $.fn.zoomTarget = function(baseSettings) {
+ this.each(function() {
+ var settings = $(this).zoomSettings(baseSettings);
+ setupClickHandler($(this),$(this),settings);
+ });
+ }
+
+ //**********************************//
+ //*** Helper functions ***//
+ //**********************************//
+
+ function setupClickHandler(clickTarget, zoomTarget, settings) {
+ clickTarget.addClass("zoomTarget");
+
+ if(!settings.animationendcallback) {
+ if(!settings.closeclick) {
+ settings.animationendcallback = function() {
+ $(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable");
+ clickTarget.addClass("selectedZoomTarget zoomNotClickable");
+ };
+ } else {
+ settings.animationendcallback = function() {
+ $(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable");
+ clickTarget.addClass("selectedZoomTarget");
+ };
+ }
}
- if(!settings) {
- settings = {};
+ var zoomContainer = zoomTarget.closest(".zoomContainer");
+ if(zoomContainer.length!=0) {
+ settings.root = zoomContainer;
}
- settings.animationendcallback = function() {
- $(".selectedZoomTarget").removeClass("selectedZoomTarget");
- $(this).addClass("selectedZoomTarget");
- };
-
- var setupClickHandler = function(clickTarget,zoomTarget, settings) {
- clickTarget.addClass("zoomTarget");
-
- var zoomContainer = zoomTarget.closest(".zoomContainer");
- if(zoomContainer.length!=0) {
- settings.root = zoomContainer;
- }
+ var $root = settings.root;
- if(!settings.root) {
- settings.root = $.zoomooz.defaultSettings.root;
- }
+ if(!$root.hasClass("zoomTarget")) {
+
+ var rootSettings = $root.zoomSettings({});
- if(!settings.root.hasClass("zoomTarget")) {
+ rootSettings.animationendcallback = function() {
+ var $elem = $(this);
+ $(".selectedZoomTarget").removeClass("selectedZoomTarget zoomNotClickable");
+ $elem.addClass("selectedZoomTarget zoomNotClickable");
+ $elem.parent().addClass("selectedZoomTarget zoomNotClickable");
+ };
- // fixme, if element has data fields for setting duration etc,
- // these will not be inherited by the root. which might or might not
- // make sense
-
- var rootSettings = {};
-
- rootSettings.animationendcallback = function() {
- var $elem = $(this);
- $(".selectedZoomTarget").removeClass("selectedZoomTarget");
- $elem.addClass("selectedZoomTarget");
- $elem.parent().addClass("selectedZoomTarget");
- };
-
- setupClickHandler(settings.root,settings.root,rootSettings);
- setupClickHandler(settings.root.parent(),settings.root,rootSettings);
-
- settings.root.click();
- }
+ setupClickHandler($root,$root,rootSettings);
+ setupClickHandler($root.parent(),$root,rootSettings);
- clickTarget.on("click", function(evt) {
- zoomTarget.zoomTo(settings);
- evt.stopPropagation();
- });
+ // FIXME: there could be many of these called simultaneously,
+ // don't know what would happen then
+ $root.click();
}
- this.each(function() {
- setupClickHandler($(this),$(this),jQuery.extend({}, settings));
+ clickTarget.on("click", function(evt) {
+
+ // closeclick not available here...
+ if(settings.closeclick && zoomTarget.hasClass("selectedZoomTarget")) {
+ settings.root.click();
+ } else {
+ zoomTarget.zoomTo(settings);
+ }
+ evt.stopPropagation();
});
}
-
//**********************************//
//*** Setup functions ***//
//**********************************//
@@ -111,8 +117,8 @@
// FIXME: how to remove the transform origin?
style.innerHTML = ".zoomTarget{"+setupSelectionCss(false)+"}"+
".zoomTarget:hover{cursor:pointer!important;}"+
- ".selectedZoomTarget{"+setupSelectionCss(true)+"}"+
- ".selectedZoomTarget:hover{cursor:auto!important;}"+
+ ".zoomNotClickable{"+setupSelectionCss(true)+"}"+
+ ".zoomNotClickable:hover{cursor:auto!important;}"+
/* padding to fix margin collapse issues */
".zoomContainer{position:relative;padding:1px;margin:-1px;}";
Please sign in to comment.
Something went wrong with that request. Please try again.