Team:Shenzhen BGIC 0101/humaan

From 2013.igem.org

Revision as of 03:16, 13 September 2013 by Czh (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=0.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});

/**

  • hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
  • <http://cherne.net/brian/resources/jquery.hoverIntent.html>
  • @param f onMouseOver function || An object with configuration options
  • @param g onMouseOut function || Nothing (use configuration options object)
  • @author Brian Cherne <brian@cherne.net>
  • /

(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/*

* In-Field Label jQuery Plugin
* http://fuelyourcoding.com/scripts/infield.html
*
* Copyright (c) 2009 Doug Neiner
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
* @version 0.1
*/

(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);

(function(c,n){var k="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";c.fn.imagesLoaded=function(l){function m(){var b=c(h),a=c(g);d&&(g.length?d.reject(e,b,a):d.resolve(e));c.isFunction(l)&&l.call(f,e,b,a)}function i(b,a){b.src===k||-1!==c.inArray(b,j)||(j.push(b),a?g.push(b):h.push(b),c.data(b,"imagesLoaded",{isBroken:a,src:b.src}),o&&d.notifyWith(c(b),[a,e,c(h),c(g)]),e.length===j.length&&(setTimeout(m),e.unbind(".imagesLoaded")))}var f=this,d=c.isFunction(c.Deferred)?c.Deferred(): 0,o=c.isFunction(d.notify),e=f.find("img").add(f.filter("img")),j=[],h=[],g=[];e.length?e.bind("load.imagesLoaded error.imagesLoaded",function(b){i(b.target,"error"===b.type)}).each(function(b,a){var e=a.src,d=c.data(a,"imagesLoaded");if(d&&d.src===e)i(a,d.isBroken);else if(a.complete&&a.naturalWidth!==n)i(a,0===a.naturalWidth||0===a.naturalHeight);else if(a.readyState||a.complete)a.src=k,a.src=e}):m();return d?d.promise(f):f}})(jQuery);

function checkEmail(b){var c=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;var a=$("#"+b).val();return c.test(a)}$(function(){$("#newsletter button").click(function(){$("form#newsletter").submit(function(){return false});var a=$("form#newsletter").attr("action");var e="xtluyy";var b="emailsub";if(!checkEmail(b)){$("#footer-newsletter .error").remove();$("#footer-newsletter").append('Please enter a valid email address');return}var d=$("form#newsletter").serialize();var c=d+"&action="+a;$.ajax({url:"/wp-content/themes/humaan/js/proxy.php",type:"POST",data:c,dataType:"html",success:function(f){$("#footer-newsletter form").remove();$("#footer-newsletter .fail").remove();$("#footer-newsletter").append('Thanks - we\'ll be in touch soon!')}})})});

var center=$(window).width()/2;$(document).ready(function(){function d(){$(".slide.active img").each(function(){var g=parseInt($(this).attr("class").split(" ")[1].replace("left",""));var i=g+center;var h=parseInt($(this).attr("class").split(" ")[4].replace("t",""));var f=parseInt($(this).attr("class").split(" ")[5].replace("z",""));if($(this).hasClass("fade")){$(this).css({left:i,top:h,"z-index":f})}else{$(this).css({left:i,top:h,"z-index":f}).show()}});setTimeout(function(){$(".slide.active img.fade,.slide.active .info").fadeIn(600,"easeInOutQuad",function(){$("#feature").removeClass()})},800)}function c(){$("#feature").addClass("disabled").append('<ul id="pagination" /><a href="" id="slide-left" /><a href="" id="slide-right" />');$("#feature article").each(function(){$("#pagination").append('
  • <a href="#'+$(this).attr("id")+'">'+$(this).index()+"</a></li>")});$("#pagination li:first").addClass("active");$("#pagination").css({left:($(window).width()-$("#pagination li").length*14)/2});var h=0;function j(){$(".slide.active img").each(function(){var l=parseInt($(this).attr("class").split(" ")[1].replace("left",""));var q=l+center;var p=parseInt($(this).attr("class").split(" ")[2].replace("st",""));var n=parseInt($(this).attr("class").split(" ")[3].replace("sp",""));var o=parseInt($(this).attr("class").split(" ")[4].replace("t",""));var k=parseInt($(this).attr("class").split(" ")[5].replace("z",""));if($(this).hasClass("fade")){$(this).css({left:q,top:o,"z-index":k})}else{if($("#feature").hasClass("scrollLeft")){var m=-$(this).width()-p}else{var m=$(window).width()+p}$(this).css({left:m,top:o,"z-index":k}).show();$(this).animate({left:q},n,"easeOutQuad")}});setTimeout(function(){$(".slide.active img.fade,.slide.active .info").fadeIn(600,"easeInOutQuad",function(){$("#feature").removeClass()})},1000)}function g(){$(".slide.active").removeClass("active").addClass("previous");$(".slide.previous img").not(".fade").each(function(){var l=parseInt($(this).attr("class").split(" ")[2].replace("st",""));var k=parseInt($(this).attr("class").split(" ")[3].replace("sp",""));if($("#feature").hasClass("scrollLeft")){$(this).animate({left:$(window).width()+l},k,"easeInQuad")}else{$(this).animate({left:-$(this).width()-l},k,"easeInQuad")}});$(".slide.previous img.fade,.slide.previous .info").fadeOut(600,"easeInQuad",function(){$(".slide.next").removeClass("next").addClass("active").fadeIn(1000,"easeInOutQuad",function(){$(".slide.previous").removeClass("previous").fadeOut(1000,"easeInOutQuad");j()})})}$(".slide:first").addClass("active").fadeIn(1000,"easeInOutQuad",function(){$("#slide-left, #slide-right, #pagination").fadeIn(300,"easeInOutQuad",function(){j()})});$("#pagination li").not("active").click(function(){clearInterval(f);if($(this).index()<$("#pagination li.active").index()){$("#feature").addClass("scrollLeft")}if(!$("#feature").hasClass("disabled")){$("#feature").addClass("disabled");$("#pagination li.active").removeClass();$(this).addClass("active");$($(this).find("a").attr("href")).addClass("next");g()}return false});$("#slide-left").click(function(){clearInterval(f);if(!$("#feature").hasClass("disabled")){$("#feature").addClass("disabled");if($("#pagination li:first").hasClass("active")){$("#pagination li.active").removeClass();$("#pagination li:last").addClass("active");$("#feature article:last").addClass("next")}else{$("#pagination li.active").removeClass().prev().addClass("active");$("#feature article.active").prev().addClass("next")}$("#feature").addClass("scrollLeft");g()}return false});function i(){if(!$("#feature").hasClass("disabled")){$("#feature").addClass("disabled");if($("#pagination li:last").hasClass("active")){$("#pagination li.active").removeClass();$("#pagination li:first").addClass("active");$("#feature article:first").addClass("next")}else{$("#pagination li.active").removeClass().next().addClass("active");$("#feature article.active").next().addClass("next")}g()}}$("#slide-right").click(function(){clearInterval(f);i();return false});var f=setInterval(function(){i()},10000)}$(window).load(function(){if($(window).width()>767){$.ajax({url:"/wp-content/themes/humaan/element-banner.php",type:"POST",dataType:"html",success:function(f){$("#feature h1").after(f);$("#feature img").imagesLoaded(function(g,h,i){setTimeout(function(){c()},1000)})}})}});$(window).resize(function(){$("#pagination").css({left:($(window).width()-$("#pagination li").length*14)/2});center=$(window).width()/2;d()});$(window).scroll(function(){if($("header").offset().top>0){$("header").addClass("sticky")}else{$("header").removeClass("sticky")}});$(".mini-post").hoverIntent(function(){$(".mini-post").not(this).animate({opacity:0.75},200)},function(){$(".mini-post").not(this).animate({opacity:1},200)});$(".mini-post").click(function(){window.location=$(this).find("a.image").attr("href");return false});$("#work article").hoverIntent(function(){$("#work article").not(this).animate({opacity:0.75},200)},function(){$("#work article").not(this).animate({opacity:1},200)});$("#footer-newsletter label, #blog-top label, #message label").inFieldLabels();$("html").click(function(){$("#categories ul").slideUp(200,"easeInOutQuad")});$("#categories div").click(function(f){f.stopPropagation();$("#categories ul").slideDown(200,"easeInOutQuad")});$("#categories ul").click(function(f){f.stopPropagation()});$(".share").click(function(){if($(this).parent().find(".addthis_toolbox").is(":hidden")){$(this).parent().find(".addthis_toolbox").slideDown(200,"easeInOutQuad");$(this).animate({opacity:".5"},200,"easeInOutQuad")}else{$(this).parent().find(".addthis_toolbox").slideUp(200,"easeInOutQuad");$(this).animate({opacity:"1"},200,"easeInOutQuad")}return false});function a(){var h;var j=new google.maps.LatLng(-31.939,115.875);var f={zoom:16,center:j,scrollwheel:false,scaleControl:false,mapTypeControl:false,mapTypeId:google.maps.MapTypeId.ROADMAP};h=new google.maps.Map(document.getElementById("location-map"),f);var g=new google.maps.MarkerImage("/wp-content/themes/humaan/art/pin.png",new google.maps.Size(93,100),new google.maps.Point(0,0),new google.maps.Point(47,100));var i=new google.maps.Marker({position:new google.maps.LatLng(-31.93625,115.879),map:h,icon:g})}if($(window).width()>767){if($("#location-map").length>0){a()}}$("#message").validate({errorElement:"span",errorPlacement:function(f,g){f.appendTo(g.parent("div:first"))}});$("#team-bios a").click(function(){if(!$(this).hasClass("open")){$(".profile .bio").slideDown(600,"easeInOutQuad");$(this).addClass("open").text("Hide Bios");$("html, body").animate({scrollTop:$(this).offset().top-100},600,"easeInOutQuad")}else{$(".profile .bio").slideUp(600,"easeInOutQuad");$(this).removeClass("open").text("View Bios")}return false});function e(){return($.browser.msie&&parseInt($.browser.version)<=8)}if(e()){$("body").prepend('
    You are using an outdated, unsupported browser. Upgrade to a modern browser such as <a target="_blank" href="https://www.google.com/chrome/">Chrome</a>, <a target="_blank" href="http://www.mozilla.org/en-US/firefox/new/">FireFox</a>, <a target="_blank" href="http://www.apple.com/safari/">Safari</a> or <a target="_blank" href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home">Internet Explorer 9+</a> for a more complete experience.
    ')}/mobile/i.test(navigator.userAgent)&&!location.hash&&setTimeout(function(){window.scrollTo(0,1)},1000)});

    $(document).ready(function(){

    // set your twitter id

       var user = 'wearehumaan';
    

    $.getJSON("/wp-content/themes/humaan/functions/tweetproxy.php", function(data) { var tweet = data[0].text; tweet = tweet.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, function(url) { return '<a href="'+url+'">'+url+'</a>'; }).replace(/B@([_a-z0-9]+)/ig, function(reply) { return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>'; }); $("#tweet .text p:first").html(tweet); });

    mini_post_h = 0;

    $('body.home .mini-post').each(function(){ if ( $(this).height() > mini_post_h ) { mini_post_h = $(this).height(); } });

    $('body.home .mini-post').animate({ height: mini_post_h }, 1000);

    });