Template:Team:Harvard BioDesign/JS

From 2014.igem.org

Revision as of 20:15, 17 October 2014 by Nlarusstone (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

").appendTo("head"),f=b('

').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&clearTimeout(u),u=setTimeout(function(){s[t].apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=v.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;fg?1:f0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),w.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;id&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;id&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var x=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){x("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){x("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery); /*parsed HTML*/ $(function(){ $(".maxheight").each(function(){ $(this).contents().wrapAll("
"); }) $(".maxheight2").each(function(){ $(this).contents().wrapAll("
"); }) $(".maxheight3").each(function(){ $(this).contents().wrapAll("
"); }) }) /*add event*/ $(window).bind("resize", height_handler).bind("load", height_handler) function height_handler(){ if($(window).width()>465){ $(".maxheight").equalHeights(); }else{ $(".maxheight").equalHeights(); } if($(window).width()>740){ $(".maxheight2").equalHeights(); }else{ $(".maxheight2").equalHeights(); } if($(window).width()>740){ $(".maxheight3").equalHeights(); }else{ $(".maxheight3").equalHeights(); } } /*glob function*/ (function($){ $.fn.equalHeights=function(minHeight,maxHeight){ tallest=(minHeight)?minHeight:0; this.each(function(){ if($(">.box_inner", this).outerHeight()>tallest){ tallest=$(">.box_inner", this).outerHeight() } }); if((maxHeight)&&tallest>maxHeight) tallest=maxHeight; return this.each(function(){$(this).height(tallest)}) } })(jQuery); /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d' ).wrapInner( '
' ); var fakeHover = $('.camera_fakehover',wrap); fakeHover.append( '
' ); if(opts.overlayer == true){ fakeHover.append( '
' ) } fakeHover.append( '
' ); var loader; if(opts.loader=='pie' && $.browser.msie && $.browser.version < 9){ loader = 'bar'; } else { loader = opts.loader; } if(loader == 'pie'){ fakeHover.append( '
' ) } else if (loader == 'bar') { fakeHover.append( '
' ) } else { fakeHover.append( '' ) } if(opts.playPause==true){ fakeHover.append( '
' ) } if(opts.navigation==true){ fakeHover.append( '
' ).append( '
' ); } if(opts.thumbnails==true){ wrap.append( '
' ); } if(opts.thumbnails==true && opts.pagination!=true){ $('.camera_thumbs_cont',wrap).wrap( '
' ).wrap( '
' ).wrap( '
' ).wrap( '
' ); } if(opts.pagination==true){ wrap.append( '
' ); } wrap.append( '
' ); $('.camera_caption',wrap).each(function(){ $(this).wrapInner('
'); }); var pieID = 'pie_'+wrap.index(), elem = $('.camera_src',wrap), target = $('.camera_target',wrap), content = $('.camera_target_content',wrap), pieContainer = $('.camera_pie',wrap), barContainer = $('.camera_bar',wrap), prevNav = $('.camera_prev',wrap), nextNav = $('.camera_next',wrap), commands = $('.camera_commands',wrap), pagination = $('.camera_pag',wrap), thumbs = $('.camera_thumbs_cont',wrap); var w, h; var allImg = new Array(); $('> div', elem).each( function() { allImg.push($(this).attr('data-src')); }); var allLinks = new Array(); $('> div', elem).each( function() { if($(this).attr('data-link')){ allLinks.push($(this).attr('data-link')); } else { allLinks.push(''); } }); var allTargets = new Array(); $('> div', elem).each( function() { if($(this).attr('data-target')){ allTargets.push($(this).attr('data-target')); } else { allTargets.push(''); } }); var allPor = new Array(); $('> div', elem).each( function() { if($(this).attr('data-portrait')){ allPor.push($(this).attr('data-portrait')); } else { allPor.push(''); } }); var allAlign= new Array(); $('> div', elem).each( function() { if($(this).attr('data-alignment')){ allAlign.push($(this).attr('data-alignment')); } else { allAlign.push(''); } }); var allThumbs = new Array(); $('> div', elem).each( function() { if($(this).attr('data-thumb')){ allThumbs.push($(this).attr('data-thumb')); } else { allThumbs.push(''); } }); var amountSlide = allImg.length; $(content).append('
'); var loopMove; for (loopMove=0;loopMove'); if(allLinks[loopMove]!=''){ //only for Wordpress plugin var dataBox = $('> div ',elem).eq(loopMove).attr('data-box'); if(typeof dataBox !== 'undefined' && dataBox !== false && dataBox != '') { dataBox = 'data-box="'+$('> div ',elem).eq(loopMove).attr('data-box')+'"'; } else { dataBox = ''; } // $('.camera_target_content .cameraContent:eq('+loopMove+')',wrap).append(''); } } $('.camera_caption',wrap).each(function(){ var ind = $(this).parent().index(), cont = wrap.find('.cameraContent').eq(ind); $(this).appendTo(cont); }); target.append('
'); var cameraCont = $('.cameraCont',wrap); var loop; for (loop=0;loop'); var div = $('> div:eq('+loop+')',elem); target.find('.cameraSlide_'+loop).clone(div); } function thumbnailVisible() { var wTh = $(thumbs).width(); $('li', thumbs).removeClass('camera_visThumb'); $('li', thumbs).each(function(){ var pos = $(this).position(), ulW = $('ul', thumbs).outerWidth(), offUl = $('ul', thumbs).offset().left, offDiv = $('> div',thumbs).offset().left, ulLeft = offDiv-offUl; if(ulLeft>0){ $('.camera_prevThumbs',camera_thumbs_wrap).removeClass('hideNav'); } else { $('.camera_prevThumbs',camera_thumbs_wrap).addClass('hideNav'); } if((ulW-ulLeft)>wTh){ $('.camera_nextThumbs',camera_thumbs_wrap).removeClass('hideNav'); } else { $('.camera_nextThumbs',camera_thumbs_wrap).addClass('hideNav'); } var left = pos.left, right = pos.left+($(this).width()); if(right-ulLeft<=wTh && left-ulLeft>=0){ $(this).addClass('camera_visThumb'); } }); } $(window).bind('load resize pageshow',function(){ thumbnailPos(); thumbnailVisible(); }); cameraCont.append('
'); var started; wrap.show(); var w = target.width(); var h = target.height(); var setPause; $(window).bind('resize pageshow',function(){ if(started == true) { resizeImage(); } $('ul', thumbs).animate({'margin-top':0},0,thumbnailPos); if(!elem.hasClass('paused')){ elem.addClass('paused'); if($('.camera_stop',camera_thumbs_wrap).length){ $('.camera_stop',camera_thumbs_wrap).hide() $('.camera_play',camera_thumbs_wrap).show(); if(loader!='none'){ $('#'+pieID).hide(); } } else { if(loader!='none'){ $('#'+pieID).hide(); } } clearTimeout(setPause); setPause = setTimeout(function(){ elem.removeClass('paused'); if($('.camera_play',camera_thumbs_wrap).length){ $('.camera_play',camera_thumbs_wrap).hide(); $('.camera_stop',camera_thumbs_wrap).show(); if(loader!='none'){ $('#'+pieID).fadeIn(); } } else { if(loader!='none'){ $('#'+pieID).fadeIn(); } } },1500); } }); function resizeImage(){ var res; function resizeImageWork(){ w = wrap.width(); if(opts.height.indexOf('%')!=-1) { var startH = Math.round(w / (100/parseFloat(opts.height))); if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){ h = parseFloat(opts.minHeight); } else { h = startH; } wrap.css({height:h}); } else if (opts.height=='auto') { h = wrap.height(); } else { h = parseFloat(opts.height); wrap.css({height:h}); } $('.camerarelative',target).css({'width':w,'height':h}); $('.imgLoaded',target).each(function(){ var t = $(this), wT = t.attr('width'), hT = t.attr('height'), imgLoadIn = t.index(), mTop, mLeft, alignment = t.attr('data-alignment'), portrait = t.attr('data-portrait'); if(typeof alignment === 'undefined' || alignment === false || alignment === ''){ alignment = opts.alignment; } if(typeof portrait === 'undefined' || portrait === false || portrait === ''){ portrait = opts.portrait; } if(portrait==false||portrait=='false'){ if((wT/hT)<(w/h)) { var r = w / wT; var d = (Math.abs(h - (hT*r)))*0.5; switch(alignment){ case 'topLeft': mTop = 0; break; case 'topCenter': mTop = 0; break; case 'topRight': mTop = 0; break; case 'centerLeft': mTop = '-'+d+'px'; break; case 'center': mTop = '-'+d+'px'; break; case 'centerRight': mTop = '-'+d+'px'; break; case 'bottomLeft': mTop = '-'+d*2+'px'; break; case 'bottomCenter': mTop = '-'+d*2+'px'; break; case 'bottomRight': mTop = '-'+d*2+'px'; break; } t.css({ 'height' : hT*r, 'margin-left' : 0, 'margin-top' : mTop, 'position' : 'absolute', 'visibility' : 'visible', 'width' : w }); } else { var r = h / hT; var d = (Math.abs(w - (wT*r)))*0.5; switch(alignment){ case 'topLeft': mLeft = 0; break; case 'topCenter': mLeft = '-'+d+'px'; break; case 'topRight': mLeft = '-'+d*2+'px'; break; case 'centerLeft': mLeft = 0; break; case 'center': mLeft = '-'+d+'px'; break; case 'centerRight': mLeft = '-'+d*2+'px'; break; case 'bottomLeft': mLeft = 0; break; case 'bottomCenter': mLeft = '-'+d+'px'; break; case 'bottomRight': mLeft = '-'+d*2+'px'; break; } t.css({ 'height' : h, 'margin-left' : mLeft, 'margin-top' : 0, 'position' : 'absolute', 'visibility' : 'visible', 'width' : wT*r }); } } else { if((wT/hT)<(w/h)) { var r = h / hT; var d = (Math.abs(w - (wT*r)))*0.5; switch(alignment){ case 'topLeft': mLeft = 0; break; case 'topCenter': mLeft = d+'px'; break; case 'topRight': mLeft = d*2+'px'; break; case 'centerLeft': mLeft = 0; break; case 'center': mLeft = d+'px'; break; case 'centerRight': mLeft = d*2+'px'; break; case 'bottomLeft': mLeft = 0; break; case 'bottomCenter': mLeft = d+'px'; break; case 'bottomRight': mLeft = d*2+'px'; break; } t.css({ 'height' : h, 'margin-left' : mLeft, 'margin-top' : 0, 'position' : 'absolute', 'visibility' : 'visible', 'width' : wT*r }); } else { var r = w / wT; var d = (Math.abs(h - (hT*r)))*0.5; switch(alignment){ case 'topLeft': mTop = 0; break; case 'topCenter': mTop = 0; break; case 'topRight': mTop = 0; break; case 'centerLeft': mTop = d+'px'; break; case 'center': mTop = d+'px'; break; case 'centerRight': mTop = d+'px'; break; case 'bottomLeft': mTop = d*2+'px'; break; case 'bottomCenter': mTop = d*2+'px'; break; case 'bottomRight': mTop = d*2+'px'; break; } t.css({ 'height' : hT*r, 'margin-left' : 0, 'margin-top' : mTop, 'position' : 'absolute', 'visibility' : 'visible', 'width' : w }); } } }); } if (started == true) { clearTimeout(res); res = setTimeout(resizeImageWork,200); } else { resizeImageWork(); } started = true; } var u, setT; var clickEv, autoAdv, navHover, commands, pagination; var videoHover, videoPresent; if(isMobile() && opts.mobileAutoAdvance!=''){ autoAdv = opts.mobileAutoAdvance; } else { autoAdv = opts.autoAdvance; } if(autoAdv==false){ elem.addClass('paused'); } if(isMobile() && opts.mobileNavHover!=''){ navHover = opts.mobileNavHover; } else { navHover = opts.navigationHover; } if(elem.length!=0){ var selector = $('.cameraSlide',target); selector.wrapInner('
'); var navSlide; var barDirection = opts.barDirection; var camera_thumbs_wrap = wrap; $('iframe',fakeHover).each(function(){ var t = $(this); var src = t.attr('src'); t.attr('data-src',src); var divInd = t.parent().index('.camera_src > div'); $('.camera_target_content .cameraContent:eq('+divInd+')',wrap).append(t); }); function imgFake() { $('iframe',fakeHover).each(function(){ $('.camera_caption',fakeHover).show(); var t = $(this); var cloneSrc = t.attr('data-src'); t.attr('src',cloneSrc); var imgFakeUrl = opts.imagePath+'blank.gif'; var imgFake = new Image(); imgFake.src = imgFakeUrl; if(opts.height.indexOf('%')!=-1) { var startH = Math.round(w / (100/parseFloat(opts.height))); if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){ h = parseFloat(opts.minHeight); } else { h = startH; } } else if (opts.height=='auto') { h = wrap.height(); } else { h = parseFloat(opts.height); } t.after($(imgFake).attr({'class':'imgFake','width':w,'height':h})); var clone = t.clone(); t.remove(); $(imgFake).bind('click',function(){ if($(this).css('position')=='absolute') { $(this).remove(); if(cloneSrc.indexOf('vimeo') != -1 || cloneSrc.indexOf('youtube') != -1) { if(cloneSrc.indexOf('?') != -1){ autoplay = '&autoplay=1'; } else { autoplay = '?autoplay=1'; } } else if(cloneSrc.indexOf('dailymotion') != -1) { if(cloneSrc.indexOf('?') != -1){ autoplay = '&autoPlay=1'; } else { autoplay = '?autoPlay=1'; } } clone.attr('src',cloneSrc+autoplay); videoPresent = true; } else { $(this).css({position:'absolute',top:0,left:0,zIndex:10}).after(clone); clone.css({position:'absolute',top:0,left:0,zIndex:9}); } }); }); } imgFake(); if(opts.hover==true){ if(!isMobile()){ fakeHover.hover(function(){ elem.addClass('hovered'); },function(){ elem.removeClass('hovered'); }); } } if(navHover==true){ $(prevNav,wrap).animate({opacity:0},0); $(nextNav,wrap).animate({opacity:0},0); $(commands,wrap).animate({opacity:0},0); if(isMobile()){ fakeHover.live('vmouseover',function(){ $(prevNav,wrap).animate({opacity:1},200); $(nextNav,wrap).animate({opacity:1},200); $(commands,wrap).animate({opacity:1},200); }); fakeHover.live('vmouseout',function(){ $(prevNav,wrap).delay(500).animate({opacity:0},200); $(nextNav,wrap).delay(500).animate({opacity:0},200); $(commands,wrap).delay(500).animate({opacity:0},200); }); } else { fakeHover.hover(function(){ $(prevNav,wrap).animate({opacity:1},200); $(nextNav,wrap).animate({opacity:1},200); $(commands,wrap).animate({opacity:1},200); },function(){ $(prevNav,wrap).animate({opacity:0},200); $(nextNav,wrap).animate({opacity:0},200); $(commands,wrap).animate({opacity:0},200); }); } } $('.camera_stop',camera_thumbs_wrap).live('click',function(){ autoAdv = false; elem.addClass('paused'); if($('.camera_stop',camera_thumbs_wrap).length){ $('.camera_stop',camera_thumbs_wrap).hide() $('.camera_play',camera_thumbs_wrap).show(); if(loader!='none'){ $('#'+pieID).hide(); } } else { if(loader!='none'){ $('#'+pieID).hide(); } } }); $('.camera_play',camera_thumbs_wrap).live('click',function(){ autoAdv = true; elem.removeClass('paused'); if($('.camera_play',camera_thumbs_wrap).length){ $('.camera_play',camera_thumbs_wrap).hide(); $('.camera_stop',camera_thumbs_wrap).show(); if(loader!='none'){ $('#'+pieID).show(); } } else { if(loader!='none'){ $('#'+pieID).show(); } } }); if(opts.pauseOnClick==true){ $('.camera_target_content',fakeHover).mouseup(function(){ autoAdv = false; elem.addClass('paused'); $('.camera_stop',camera_thumbs_wrap).hide() $('.camera_play',camera_thumbs_wrap).show(); $('#'+pieID).hide(); }); } $('.cameraContent, .imgFake',fakeHover).hover(function(){ videoHover = true; },function(){ videoHover = false; }); $('.cameraContent, .imgFake',fakeHover).bind('click',function(){ if(videoPresent == true && videoHover == true) { autoAdv = false; $('.camera_caption',fakeHover).hide(); elem.addClass('paused'); $('.camera_stop',camera_thumbs_wrap).hide() $('.camera_play',camera_thumbs_wrap).show(); $('#'+pieID).hide(); } }); } function shuffle(arr) { for( var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x ); return arr; } function isInteger(s) { return Math.ceil(s) == Math.floor(s); } if (loader != 'pie') { barContainer.append(''); $('.camera_bar_cont',barContainer) .animate({opacity:opts.loaderOpacity},0) .css({'position':'absolute', 'left':0, 'right':0, 'top':0, 'bottom':0, 'background-color':opts.loaderBgColor}) .append(''); $('#'+pieID).animate({opacity:0},0); var canvas = $('#'+pieID); canvas.css({'position':'absolute', 'background-color':opts.loaderColor}); switch(opts.barPosition){ case 'left': barContainer.css({right:'auto',width:opts.loaderStroke}); break; case 'right': barContainer.css({left:'auto',width:opts.loaderStroke}); break; case 'top': barContainer.css({bottom:'auto',height:opts.loaderStroke}); break; case 'bottom': barContainer.css({top:'auto',height:opts.loaderStroke}); break; } switch(barDirection){ case 'leftToRight': canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding}); break; case 'rightToLeft': canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding}); break; case 'topToBottom': canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0}); break; case 'bottomToTop': canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0}); break; } } else { pieContainer.append(''); var G_vmlCanvasManager; var canvas = document.getElementById(pieID); canvas.setAttribute("width", opts.pieDiameter); canvas.setAttribute("height", opts.pieDiameter); var piePosition; switch(opts.piePosition){ case 'leftTop' : piePosition = 'left:0; top:0;'; break; case 'rightTop' : piePosition = 'right:0; top:0;'; break; case 'leftBottom' : piePosition = 'left:0; bottom:0;'; break; case 'rightBottom' : piePosition = 'right:0; bottom:0;'; break; } canvas.setAttribute("style", "position:absolute; z-index:1002; "+piePosition); var rad; var radNew; if (canvas && canvas.getContext) { var ctx = canvas.getContext("2d"); ctx.rotate(Math.PI*(3/2)); ctx.translate(-opts.pieDiameter,0); } } if(loader=='none' || autoAdv==false) { $('#'+pieID).hide(); $('.camera_canvas_wrap',camera_thumbs_wrap).hide(); } if($(pagination).length) { $(pagination).append('