JeffHusdsz (Talk | contribs) |
JeffHusdsz (Talk | contribs) |
||
Line 284: | Line 284: | ||
} | } | ||
})( jQuery );</script> | })( jQuery );</script> | ||
− | <script src=" | + | <script> |
− | + | /* | |
− | <script src=" | + | * jQuery FlexSlider v1.8 |
− | + | * http://flex.madebymufffin.com | |
+ | * Copyright 2011, Tyler Smith | ||
+ | */ | ||
+ | (function(a){a.flexslider=function(c,b){var d=c;d.init=function(){d.vars=a.extend({},a.flexslider.defaults,b);d.data("flexslider",true);d.container=a(".slides",d);d.slides=a(".slides > li",d);d.count=d.slides.length;d.animating=false;d.currentSlide=d.vars.slideToStart;d.animatingTo=d.currentSlide;d.atEnd=(d.currentSlide==0)?true:false;d.eventType=("ontouchstart" in document.documentElement)?"touchstart":"click";d.cloneCount=0;d.cloneOffset=0;d.manualPause=false;d.vertical=(d.vars.slideDirection=="vertical");d.prop=(d.vertical)?"top":"marginLeft";d.args={};d.transitions="webkitTransition" in document.body.style;if(d.transitions){d.prop="-webkit-transform"}if(d.vars.controlsContainer!=""){d.controlsContainer=a(d.vars.controlsContainer).eq(a(".slides").index(d.container));d.containerExists=d.controlsContainer.length>0}if(d.vars.manualControls!=""){d.manualControls=a(d.vars.manualControls,((d.containerExists)?d.controlsContainer:d));d.manualExists=d.manualControls.length>0}if(d.vars.randomize){d.slides.sort(function(){return(Math.round(Math.random())-0.5)});d.container.empty().append(d.slides)}if(d.vars.animation.toLowerCase()=="slide"){if(d.transitions){d.setTransition(0)}d.css({overflow:"hidden"});if(d.vars.animationLoop){d.cloneCount=2;d.cloneOffset=1;d.container.append(d.slides.filter(":first").clone().addClass("clone")).prepend(d.slides.filter(":last").clone().addClass("clone"))}d.newSlides=a(".slides > li",d);var m=(-1*(d.currentSlide+d.cloneOffset));if(d.vertical){d.newSlides.css({display:"block",width:"100%","float":"left"});d.container.height((d.count+d.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){d.css({position:"relative"}).height(d.slides.filter(":first").height());d.args[d.prop]=(d.transitions)?"translate3d(0,"+m*d.height()+"px,0)":m*d.height()+"px";d.container.css(d.args)},100)}else{d.args[d.prop]=(d.transitions)?"translate3d("+m*d.width()+"px,0,0)":m*d.width()+"px";d.container.width((d.count+d.cloneCount)*200+"%").css(d.args);setTimeout(function(){d.newSlides.width(d.width()).css({"float":"left",display:"block"})},100)}}else{d.transitions=false;d.slides.css({width:"100%","float":"left",marginRight:"-100%"}).eq(d.currentSlide).fadeIn(d.vars.animationDuration)}if(d.vars.controlNav){if(d.manualExists){d.controlNav=d.manualControls}else{var e=a('<ol class="flex-control-nav"></ol>');var s=1;for(var t=0;t<d.count;t++){e.append("<li><a>"+s+"</a></li>");s++}if(d.containerExists){a(d.controlsContainer).append(e);d.controlNav=a(".flex-control-nav li a",d.controlsContainer)}else{d.append(e);d.controlNav=a(".flex-control-nav li a",d)}}d.controlNav.eq(d.currentSlide).addClass("active");d.controlNav.bind(d.eventType,function(i){i.preventDefault();if(!a(this).hasClass("active")){(d.controlNav.index(a(this))>d.currentSlide)?d.direction="next":d.direction="prev";d.flexAnimate(d.controlNav.index(a(this)),d.vars.pauseOnAction)}})}if(d.vars.directionNav){var v=a('<ul class="flex-direction-nav"><li><a class="prev" href="#">'+d.vars.prevText+'</a></li><li><a class="next" href="#">'+d.vars.nextText+"</a></li></ul>");if(d.containerExists){a(d.controlsContainer).append(v);d.directionNav=a(".flex-direction-nav li a",d.controlsContainer)}else{d.append(v);d.directionNav=a(".flex-direction-nav li a",d)}if(!d.vars.animationLoop){if(d.currentSlide==0){d.directionNav.filter(".prev").addClass("disabled")}else{if(d.currentSlide==d.count-1){d.directionNav.filter(".next").addClass("disabled")}}}d.directionNav.bind(d.eventType,function(i){i.preventDefault();var j=(a(this).hasClass("next"))?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}})}if(d.vars.keyboardNav&&a("ul.slides").length==1){function h(i){if(d.animating){return}else{if(i.keyCode!=39&&i.keyCode!=37){return}else{if(i.keyCode==39){var j=d.getTarget("next")}else{if(i.keyCode==37){var j=d.getTarget("prev")}}if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}}}}a(document).bind("keyup",h)}if(d.vars.mousewheel){d.mousewheelEvent=(/Firefox/i.test(navigator.userAgent))?"DOMMouseScroll":"mousewheel";d.bind(d.mousewheelEvent,function(y){y.preventDefault();y=y?y:window.event;var i=y.detail?y.detail*-1:y.wheelDelta/40,j=(i<0)?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}})}if(d.vars.slideshow){if(d.vars.pauseOnHover&&d.vars.slideshow){d.hover(function(){d.pause()},function(){if(!d.manualPause){d.resume()}})}d.animatedSlides=setInterval(d.animateSlides,d.vars.slideshowSpeed)}if(d.vars.pausePlay){var q=a('<div class="flex-pauseplay"><span></span></div>');if(d.containerExists){d.controlsContainer.append(q);d.pausePlay=a(".flex-pauseplay span",d.controlsContainer)}else{d.append(q);d.pausePlay=a(".flex-pauseplay span",d)}var n=(d.vars.slideshow)?"pause":"play";d.pausePlay.addClass(n).text((n=="pause")?d.vars.pauseText:d.vars.playText);d.pausePlay.bind(d.eventType,function(i){i.preventDefault();if(a(this).hasClass("pause")){d.pause();d.manualPause=true}else{d.resume();d.manualPause=false}})}if("ontouchstart" in document.documentElement){var w,u,l,r,o,x,p=false;d.each(function(){if("ontouchstart" in document.documentElement){this.addEventListener("touchstart",g,false)}});function g(i){if(d.animating){i.preventDefault()}else{if(i.touches.length==1){d.pause();r=(d.vertical)?d.height():d.width();x=Number(new Date());l=(d.vertical)?(d.currentSlide+d.cloneOffset)*d.height():(d.currentSlide+d.cloneOffset)*d.width();w=(d.vertical)?i.touches[0].pageY:i.touches[0].pageX;u=(d.vertical)?i.touches[0].pageX:i.touches[0].pageY;d.setTransition(0);this.addEventListener("touchmove",k,false);this.addEventListener("touchend",f,false)}}}function k(i){o=(d.vertical)?w-i.touches[0].pageY:w-i.touches[0].pageX;p=(d.vertical)?(Math.abs(o)<Math.abs(i.touches[0].pageX-u)):(Math.abs(o)<Math.abs(i.touches[0].pageY-u));if(!p){i.preventDefault();if(d.vars.animation=="slide"&&d.transitions){if(!d.vars.animationLoop){o=o/((d.currentSlide==0&&o<0||d.currentSlide==d.count-1&&o>0)?(Math.abs(o)/r+2):1)}d.args[d.prop]=(d.vertical)?"translate3d(0,"+(-l-o)+"px,0)":"translate3d("+(-l-o)+"px,0,0)";d.container.css(d.args)}}}function f(j){d.animating=false;if(d.animatingTo==d.currentSlide&&!p&&!(o==null)){var i=(o>0)?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(i)&&Number(new Date())-x<550&&Math.abs(o)>20||Math.abs(o)>r/2){d.flexAnimate(i,d.vars.pauseOnAction)}else{d.flexAnimate(d.currentSlide,d.vars.pauseOnAction)}}this.removeEventListener("touchmove",k,false);this.removeEventListener("touchend",f,false);w=null;u=null;o=null;l=null}}if(d.vars.animation.toLowerCase()=="slide"){a(window).resize(function(){if(!d.animating){if(d.vertical){d.height(d.slides.filter(":first").height());d.args[d.prop]=(-1*(d.currentSlide+d.cloneOffset))*d.slides.filter(":first").height()+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}else{d.newSlides.width(d.width());d.args[d.prop]=(-1*(d.currentSlide+d.cloneOffset))*d.width()+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}}})}d.vars.start(d)};d.flexAnimate=function(g,f){if(!d.animating){d.animating=true;d.animatingTo=g;d.vars.before(d);if(f){d.pause()}if(d.vars.controlNav){d.controlNav.removeClass("active").eq(g).addClass("active")}d.atEnd=(g==0||g==d.count-1)?true:false;if(!d.vars.animationLoop&&d.vars.directionNav){if(g==0){d.directionNav.removeClass("disabled").filter(".prev").addClass("disabled")}else{if(g==d.count-1){d.directionNav.removeClass("disabled").filter(".next").addClass("disabled")}else{d.directionNav.removeClass("disabled")}}}if(!d.vars.animationLoop&&g==d.count-1){d.pause();d.vars.end(d)}if(d.vars.animation.toLowerCase()=="slide"){var e=(d.vertical)?d.slides.filter(":first").height():d.slides.filter(":first").width();if(d.currentSlide==0&&g==d.count-1&&d.vars.animationLoop&&d.direction!="next"){d.slideString="0px"}else{if(d.currentSlide==d.count-1&&g==0&&d.vars.animationLoop&&d.direction!="prev"){d.slideString=(-1*(d.count+1))*e+"px"}else{d.slideString=(-1*(g+d.cloneOffset))*e+"px"}}d.args[d.prop]=d.slideString;if(d.transitions){d.setTransition(d.vars.animationDuration);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.slideString+",0)":"translate3d("+d.slideString+",0,0)";d.container.css(d.args).one("webkitTransitionEnd transitionend",function(){d.wrapup(e)})}else{d.container.animate(d.args,d.vars.animationDuration,function(){d.wrapup(e)})}}else{d.slides.eq(d.currentSlide).fadeOut(d.vars.animationDuration);d.slides.eq(g).fadeIn(d.vars.animationDuration,function(){d.wrapup()})}}};d.wrapup=function(e){if(d.vars.animation=="slide"){if(d.currentSlide==0&&d.animatingTo==d.count-1&&d.vars.animationLoop){d.args[d.prop]=(-1*d.count)*e+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}else{if(d.currentSlide==d.count-1&&d.animatingTo==0&&d.vars.animationLoop){d.args[d.prop]=-1*e+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}}}d.animating=false;d.currentSlide=d.animatingTo;d.vars.after(d)};d.animateSlides=function(){if(!d.animating){d.flexAnimate(d.getTarget("next"))}};d.pause=function(){clearInterval(d.animatedSlides);if(d.vars.pausePlay){d.pausePlay.removeClass("pause").addClass("play").text(d.vars.playText)}};d.resume=function(){d.animatedSlides=setInterval(d.animateSlides,d.vars.slideshowSpeed);if(d.vars.pausePlay){d.pausePlay.removeClass("play").addClass("pause").text(d.vars.pauseText)}};d.canAdvance=function(e){if(!d.vars.animationLoop&&d.atEnd){if(d.currentSlide==0&&e==d.count-1&&d.direction!="next"){return false}else{if(d.currentSlide==d.count-1&&e==0&&d.direction=="next"){return false}else{return true}}}else{return true}};d.getTarget=function(e){d.direction=e;if(e=="next"){return(d.currentSlide==d.count-1)?0:d.currentSlide+1}else{return(d.currentSlide==0)?d.count-1:d.currentSlide-1}};d.setTransition=function(e){d.container.css({"-webkit-transition-duration":(e/1000)+"s"})};d.init()};a.flexslider.defaults={animation:"fade",slideDirection:"horizontal",slideshow:true,slideshowSpeed:7000,animationDuration:600,directionNav:true,controlNav:true,keyboardNav:true,mousewheel:false,prevText:"Previous",nextText:"Next",pausePlay:false,pauseText:"Pause",playText:"Play",randomize:false,slideToStart:0,animationLoop:true,pauseOnAction:true,pauseOnHover:false,controlsContainer:"",manualControls:"",start:function(){},before:function(){},after:function(){},end:function(){}};a.fn.flexslider=function(b){return this.each(function(){if(a(this).find(".slides li").length==1){a(this).find(".slides li").fadeIn(400)}else{if(a(this).data("flexslider")!=true){new a.flexslider(a(this),b)}}})}})(jQuery);</script> | ||
+ | <scrip> | ||
+ | /* ------------------------------------------------------------------------ | ||
+ | Class: prettyPhoto | ||
+ | Use: Lightbox clone for jQuery | ||
+ | Author: Stephane Caron (http://www.no-margin-for-errors.com) | ||
+ | Version: 3.1.3 | ||
+ | ------------------------------------------------------------------------- */ | ||
+ | |||
+ | (function($){$.prettyPhoto={version:'3.1.3'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',slideshow:5000,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'pp_default',horizontal_padding:20,hideflash:false,wmode:'opaque',autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> \ | ||
+ | <div class="ppt"> </div> \ | ||
+ | <div class="pp_top"> \ | ||
+ | <div class="pp_left"></div> \ | ||
+ | <div class="pp_middle"></div> \ | ||
+ | <div class="pp_right"></div> \ | ||
+ | </div> \ | ||
+ | <div class="pp_content_container"> \ | ||
+ | <div class="pp_left"> \ | ||
+ | <div class="pp_right"> \ | ||
+ | <div class="pp_content"> \ | ||
+ | <div class="pp_loaderIcon"></div> \ | ||
+ | <div class="pp_fade"> \ | ||
+ | <a href="#" class="pp_expand" title="Expand the image">Expand</a> \ | ||
+ | <div class="pp_hoverContainer"> \ | ||
+ | <a class="pp_next" href="#">next</a> \ | ||
+ | <a class="pp_previous" href="#">previous</a> \ | ||
+ | </div> \ | ||
+ | <div id="pp_full_res"></div> \ | ||
+ | <div class="pp_details"> \ | ||
+ | <div class="pp_nav"> \ | ||
+ | <a href="#" class="pp_arrow_previous">Previous</a> \ | ||
+ | <p class="currentTextHolder">0/0</p> \ | ||
+ | <a href="#" class="pp_arrow_next">Next</a> \ | ||
+ | </div> \ | ||
+ | <p class="pp_description"></p> \ | ||
+ | <div class="pp_social">{pp_social}</div> \ | ||
+ | <a class="pp_close" href="#">Close</a> \ | ||
+ | </div> \ | ||
+ | </div> \ | ||
+ | </div> \ | ||
+ | </div> \ | ||
+ | </div> \ | ||
+ | </div> \ | ||
+ | <div class="pp_bottom"> \ | ||
+ | <div class="pp_left"></div> \ | ||
+ | <div class="pp_middle"></div> \ | ||
+ | <div class="pp_right"></div> \ | ||
+ | </div> \ | ||
+ | </div> \ | ||
+ | <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \ | ||
+ | <a href="#" class="pp_arrow_previous">Previous</a> \ | ||
+ | <div> \ | ||
+ | <ul> \ | ||
+ | {gallery} \ | ||
+ | </ul> \ | ||
+ | </div> \ | ||
+ | <a href="#" class="pp_arrow_next">Next</a> \ | ||
+ | </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:'',social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="#plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal) | ||
+ | $.prettyPhoto.close();e.preventDefault();break;};};};});};$.prettyPhoto.initialize=function(){settings=pp_settings;if(settings.theme=='pp_default')settings.horizontal_padding=16;if(settings.ie6_fallback&&$.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));if(pp_images.length>30)settings.overlay_gallery=false;set_position=jQuery.inArray($(this).attr('href'),pp_images);rel_index=(isSet)?set_position:$("a[rel^='"+theRel+"']").index($(this));_build_overlay(this);if(settings.allow_resize) | ||
+ | $(window).bind('scroll.prettyphoto',function(){_center_overlay();});$.prettyPhoto.open();return false;} | ||
+ | $.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;_build_overlay(event.target);} | ||
+ | if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if(settings.deeplinking) | ||
+ | setHashtag();if(settings.social_tools){facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));$pp_pic_holder.find('.pp_social').html(facebook_like_link);} | ||
+ | if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());if(pp_descriptions[set_position]!=""){$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));}else{$pp_pic_holder.find('.pp_description').hide();} | ||
+ | movie_width=(parseFloat(getParam('width',pp_images[set_position])))?getParam('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(getParam('height',pp_images[set_position])))?getParam('height',pp_images[set_position]):settings.default_height.toString();percentBased=false;if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;} | ||
+ | if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;} | ||
+ | $pp_pic_holder.fadeIn(function(){(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(' ');imgPreloader="";skipInjection=false;switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=getParam('v',pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split('youtu.be/');movie_id=movie_id[1];if(movie_id.indexOf('?')>0) | ||
+ | movie_id=movie_id.substr(0,movie_id.indexOf('?'));if(movie_id.indexOf('&')>0) | ||
+ | movie_id=movie_id.substr(0,movie_id.indexOf('&'));} | ||
+ | movie='#embed/'+movie_id;(getParam('rel',pp_images[set_position]))?movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='#video/'+match[2]+'?title=0&byline=0&portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'ajax':doresize=false;pp_dimensions=_fitToViewport(movie_width,movie_height);doresize=true;skipInjection=true;$.get(pp_images[set_position],function(responseHTML){toInject=settings.inline_markup.replace(/{content}/g,responseHTML);$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();});break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader&&!skipInjection){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0)set_position=$(pp_images).size()-1;}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1)set_position=0;}else{set_position=direction;};rel_index=set_position;if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0;}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage;}else{currentGalleryPage=direction;};slide_speed=(direction=='next'||direction=='previous')?settings.animation_speed:0;slide_to=currentGalleryPage*(itemsPerPage*itemWidth);$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};} | ||
+ | $.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;} | ||
+ | $.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');$(this).remove();$(window).unbind('scroll.prettyphoto');clearHashtag();settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();} | ||
+ | if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand').hide();} | ||
+ | if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);if((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight)){_fitToViewport(pp_containerWidth,pp_containerHeight)};};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+(settings.horizontal_padding*2),contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;} | ||
+ | function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bajax=true\b/i)){return'ajax';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;if(contentHeight>windowHeight) | ||
+ | return;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"&&(settings.ie6_fallback&&!($.browser.msie&&parseInt($.browser.version)==6))){itemWidth=52+5;navWidth=(settings.theme=="facebook"||settings.theme=="pp_default")?50:30;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();}else{$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css('margin-left',-((galleryWidth/2)+(navWidth/2))).find('div:first').width(galleryWidth+5).find('ul').width(fullGalleryWidth).find('li.selected').removeClass('selected');goToPage=(Math.floor(set_position/itemsPerPage)<totalPage)?Math.floor(set_position/itemsPerPage):totalPage;$.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');}} | ||
+ | function _build_overlay(caller){if(settings.social_tools) | ||
+ | facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));settings.markup=settings.markup.replace('{pp_social}',(settings.social_tools)?facebook_like_link:'');$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname='default';img_src='';}else{classname='';img_src=pp_images[i];} | ||
+ | toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_gallery=$('.pp_pic_holder .pp_gallery'),$pp_gallery_li=$pp_gallery.find('li');$pp_gallery.find('.pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_gallery.find('.pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_gallery_li.each(function(i){$(this).find('a').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>') | ||
+ | $pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});} | ||
+ | $pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};if(!pp_alreadyInitialized&&getHashtag()){pp_alreadyInitialized=true;hashIndex=getHashtag();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf('/'));setTimeout(function(){$("a[rel^='"+hashRel+"']:eq("+hashIndex+")").trigger('click');},50);} | ||
+ | return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function getHashtag(){url=location.href;hashtag=(url.indexOf('#!')!=-1)?decodeURI(url.substring(url.indexOf('#!')+2,url.length)):false;return hashtag;};function setHashtag(){if(typeof theRel=='undefined')return;location.hash='!'+theRel+'/'+rel_index+'/';};function clearHashtag(){url=location.href;hashtag=(url.indexOf('#!prettyPhoto'))?true:false;if(hashtag)location.hash="!prettyPhoto";} | ||
+ | function getParam(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);var pp_alreadyInitialized=false;</script> | ||
+ | <script> | ||
+ | /*! | ||
+ | * MediaElement.js | ||
+ | * HTML5 <video> and <audio> shim and player | ||
+ | * http://mediaelementjs.com/ | ||
+ | * | ||
+ | * Creates a JavaScript object that mimics HTML5 MediaElement API | ||
+ | * for browsers that don't understand HTML5 or can't play the provided codec | ||
+ | * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 | ||
+ | * | ||
+ | * Copyright 2010-2012, John Dyer (http://j.hn) | ||
+ | * Dual licensed under the MIT or GPL Version 2 licenses. | ||
+ | * | ||
+ | */var mejs=mejs||{};mejs.version="2.6.5";mejs.meIndex=0;mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg"]}],youtube:[{version:null,types:["video/youtube"]}],vimeo:[{version:null,types:["video/vimeo"]}]}; | ||
+ | mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script"),j=f.length,h=a.length;b<j;b++){g=f[b].src;for(c=0;c<h;c++){e=a[c];if(g.indexOf(e)> | ||
+ | -1){d=g.substring(0,g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0], | ||
+ | 10);var e=parseInt(a[1],10),g=parseInt(a[2],10),f=0,j=0;if(c)f=parseInt(a[3])/d;return j=b*3600+e*60+g+f},removeSwf:function(a){var b=document.getElementById(a);if(b&&b.nodeName=="OBJECT")if(mejs.MediaFeatures.isIE){b.style.display="none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}}; | ||
+ | mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&& | ||
+ | !(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}}; | ||
+ | mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b}); | ||
+ | mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b}); | ||
+ | mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!== | ||
+ | null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.isOpera=d.match(/opera/gi)!==null;a.hasTouch="ontouchstart"in window;for(c=0;c<g.length;c++)e=document.createElement(g[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined";a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen|| | ||
+ | a.hasMozNativeFullScreen;a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen;if(a.hasMozNativeFullScreen)a.nativeFullScreenEnabled=e.mozFullScreenEnabled;if(this.isChrome)a.hasSemiNativeFullScreen=false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen;else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(f){if(a.hasWebkitNativeFullScreen)f.webkitRequestFullScreen(); | ||
+ | else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init(); | ||
+ | mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}}; | ||
+ | mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}}; | ||
+ | mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.playVideo():this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginType!="youtube"&&this.pluginApi.loadMedia();this.paused=false}}, | ||
+ | pause:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia();this.paused=true}},stop:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.stopVideo():this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return true}return false}, | ||
+ | positionFullscreenButton:function(a,b,c){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(a,b,c)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src)); | ||
+ | this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a); | ||
+ | this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&& | ||
+ | this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}}; | ||
+ | mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];if(b){switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id);b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b, | ||
+ | c)}},fireEvent:function(a,b,c){var d,e;a=this.pluginMediaElements[a];a.ended=false;a.paused=true;b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}}; | ||
+ | mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:0.8,success:function(){}, | ||
+ | error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)}; | ||
+ | mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var j=d.getAttribute("autoplay"),h=d.getAttribute("preload"),l=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;h=typeof h=="undefined"||h===null||h==="false"? | ||
+ | "none":h;j=!(typeof j=="undefined"||j===null||j==="false");l=!(typeof l=="undefined"||l===null||l==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,j,h)}else if(k.method!=="")return this.createPlugin(k,c,e,j,h,l);else{this.createErrorMessage(k,c,e);return this}}, | ||
+ | determinePlayback:function(a,b,c,d,e){var g=[],f,j,h={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},l,k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){j=this.formatType(e,a.getAttribute("type"));g.push({type:j,url:e})}else for(f=0;f<a.childNodes.length;f++){j=a.childNodes[f];if(j.nodeType==1&&j.tagName.toLowerCase()=="source"){e=j.getAttribute("src"); | ||
+ | j=this.formatType(e,j.getAttribute("type"));g.push({type:j,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/, | ||
+ | "")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){h.method="native";h.url=g[f].url;break}if(h.method==="native"){if(h.url!==null)a.src=h.url;return h}}if(b.mode==="auto"||b.mode==="shim")for(f=0;f<g.length;f++){j=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];l=mejs.plugins[e];for(c=0;c<l.length;c++){k=l[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(j==k.types[d]){h.method=e;h.url=g[f].url;return h}}}}if(h.method=== | ||
+ | ""&&g.length>0)h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+a},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!== | ||
+ | ""?'<a href="'+a.url+'"><img src="'+c+'" /></a>':'<a href="'+a.url+'"><span>Download File</span></a>';d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,j=1,h="me_"+a.method+"_"+mejs.meIndex++,l=new mejs.PluginMediaElement(h,a.method,a.url),k=document.createElement("div"),m;for(m=c.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode); | ||
+ | break}m=m.parentNode}if(a.isVideo){f=b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;j=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);j=mejs.Utility.encodeUrl(j)}else if(b.enablePluginDebug){f=320;j=240}l.success=b.success;mejs.MediaPluginBridge.registerPluginElement(h,l,c);k.className="me-plugin";k.id=h+"_container";a.isVideo?c.parentNode.insertBefore(k, | ||
+ | c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+h,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+j];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML= | ||
+ | '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+h+'" name="'+h+'" width="'+f+'" height="'+j+'"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div"); | ||
+ | k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+h+'" width="'+f+'" height="'+j+'"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML= | ||
+ | '<embed id="'+h+'" name="'+h+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+j+'"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:l,pluginId:h,videoId:b, | ||
+ | height:j,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":console.log("vimeoid");l.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<object width="'+f+'" height="'+j+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="api=1" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+ | ||
+ | l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="//vimeo.com/moogaloop.swf?api=1&clip_id='+l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+f+'" height="'+j+'"></embed></object>'}c.style.display= | ||
+ | "none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}}; | ||
+ | mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="#player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId, | ||
+ | {height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused; | ||
+ | c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b, | ||
+ | c="#apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");a.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'"><param name="movie" value="'+c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else a.container.innerHTML= | ||
+ | '<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; "><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e, | ||
+ | c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b, | ||
+ | c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement; | ||
+ | |||
+ | /*! | ||
+ | * MediaElementPlayer | ||
+ | * http://mediaelementjs.com/ | ||
+ | * | ||
+ | * Creates a controller bar for HTML5 <video> add <audio> tags | ||
+ | * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) | ||
+ | * | ||
+ | * Copyright 2010-2012, John Dyer (http://j.hn/) | ||
+ | * Dual licensed under the MIT or GPL Version 2 licenses. | ||
+ | * | ||
+ | */if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender; | ||
+ | (function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks", | ||
+ | "volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,c){c.paused||c.ended?c.play():c.pause()}},{keys:[38],action:function(a,c){c.setVolume(Math.min(c.volume+0.1,1))}},{keys:[40],action:function(a,c){c.setVolume(Math.max(c.volume-0.1,0))}},{keys:[37,227],action:function(a,c){if(!isNaN(c.duration)&&c.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}c.setCurrentTime(Math.min(c.currentTime-c.duration*0.05,c.duration))}}}, | ||
+ | {keys:[39,228],action:function(a,c){if(!isNaN(c.duration)&&c.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}c.setCurrentTime(Math.max(c.currentTime+c.duration*0.05,0))}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!="undefined")a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players=[];mejs.MediaElementPlayer=function(a,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,c);this.$media=this.$node=f(a); | ||
+ | this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof c=="undefined")c=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,c);mejs.players.push(this);this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,c=mejs.MediaFeatures,b=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}), | ||
+ | d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(c.isiPad&&a.options.iPadUseNativeControls||c.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls","controls");if(c.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(c.isAndroid&&a.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=f('<div id="'+a.id+'" class="mejs-container"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media); | ||
+ | a.container.addClass((c.isAndroid?"mejs-android ":"")+(c.isiOS?"mejs-ios ":"")+(c.isiPad?"mejs-ipad ":"")+(c.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(c.isiOS){c=a.$media.clone();a.container.find(".mejs-mediaelement").append(c);a.$media.remove();a.$node=a.$media=c;a.node=a.media=c[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");c=d.substring(0,1).toUpperCase()+d.substring(1); | ||
+ | a.width=a.options[d+"Width"]>0||a.options[d+"Width"].toString().indexOf("%")>-1?a.options[d+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+c+"Width"];a.height=a.options[d+"Height"]>0||a.options[d+"Height"].toString().indexOf("%")>-1?a.options[d+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"): | ||
+ | a.options["default"+c+"Height"];a.setPlayerSize(a.width,a.height);b.pluginWidth=a.height;b.pluginHeight=a.width}mejs.MediaElement(a.$media[0],b)},showControls:function(a){var c=this;a=typeof a=="undefined"||a;if(!c.controlsAreVisible){if(a){c.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){c.controlsAreVisible=true});c.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){c.controlsAreVisible=true})}else{c.controls.css("visibility", | ||
+ | "visible").css("display","block");c.container.find(".mejs-control").css("visibility","visible").css("display","block");c.controlsAreVisible=true}c.setControlsSize()}},hideControls:function(a){var c=this;a=typeof a=="undefined"||a;if(c.controlsAreVisible)if(a){c.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");c.controlsAreVisible=false});c.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display", | ||
+ | "block")})}else{c.controls.css("visibility","hidden").css("display","block");c.container.find(".mejs-control").css("visibility","hidden").css("display","block");c.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(a){var c=this;a=typeof a!="undefined"?a:1500;c.killControlsTimer("start");c.controlsTimer=setTimeout(function(){c.hideControls();c.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer; | ||
+ | this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,c){var b=this,d=mejs.MediaFeatures,e=c.getAttribute("autoplay");e=!(typeof e=="undefined"||e===null||e==="false");var g;if(!b.created){b.created=true;b.media=a;b.domNode=c;if(!(d.isAndroid&&b.options.AndroidUseNativeControls)&&!(d.isiPad&&b.options.iPadUseNativeControls)&& | ||
+ | !(d.isiPhone&&b.options.iPhoneUseNativeControls)){b.buildposter(b,b.controls,b.layers,b.media);b.buildkeyboard(b,b.controls,b.layers,b.media);b.buildoverlays(b,b.controls,b.layers,b.media);b.findTracks();for(g in b.options.features){d=b.options.features[g];if(b["build"+d])try{b["build"+d](b,b.controls,b.layers,b.media)}catch(k){}}b.container.trigger("controlsready");b.setPlayerSize(b.width,b.height);b.setControlsSize();if(b.isVideo){if(mejs.MediaFeatures.hasTouch)b.$media.bind("touchstart",function(){if(b.controlsAreVisible)b.hideControls(false); | ||
+ | else b.controlsEnabled&&b.showControls(false)});else{(b.media.pluginType=="native"?b.$media:f(b.media.pluginElement)).click(function(){a.paused?a.play():a.pause()});b.container.bind("mouseenter mouseover",function(){if(b.controlsEnabled)if(!b.options.alwaysShowControls){b.killControlsTimer("enter");b.showControls();b.startControlsTimer(2500)}}).bind("mousemove",function(){if(b.controlsEnabled){b.controlsAreVisible||b.showControls();b.options.alwaysShowControls||b.startControlsTimer(2500)}}).bind("mouseleave", | ||
+ | function(){b.controlsEnabled&&!b.media.paused&&!b.options.alwaysShowControls&&b.startControlsTimer(1E3)})}e&&!b.options.alwaysShowControls&&b.hideControls();b.options.enableAutosize&&b.media.addEventListener("loadedmetadata",function(i){if(b.options.videoHeight<=0&&b.domNode.getAttribute("height")===null&&!isNaN(i.target.videoHeight)){b.setPlayerSize(i.target.videoWidth,i.target.videoHeight);b.setControlsSize();b.media.setVideoSize(i.target.videoWidth,i.target.videoHeight)}},false)}a.addEventListener("play", | ||
+ | function(){for(var i=0,m=mejs.players.length;i<m;i++){var l=mejs.players[i];l.id!=b.id&&b.options.pauseOtherPlayers&&!l.paused&&!l.ended&&l.pause();l.hasFocus=false}b.hasFocus=true},false);b.media.addEventListener("ended",function(){try{b.media.setCurrentTime(0)}catch(i){}b.media.pause();b.setProgressRail&&b.setProgressRail();b.setCurrentRail&&b.setCurrentRail();if(b.options.loop)b.media.play();else!b.options.alwaysShowControls&&b.controlsEnabled&&b.showControls()},false);b.media.addEventListener("loadedmetadata", | ||
+ | function(){b.updateDuration&&b.updateDuration();b.updateCurrent&&b.updateCurrent();if(!b.isFullScreen){b.setPlayerSize(b.width,b.height);b.setControlsSize()}},false);setTimeout(function(){b.setPlayerSize(b.width,b.height);b.setControlsSize()},50);f(window).resize(function(){b.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||b.setPlayerSize(b.width,b.height);b.setControlsSize()});b.media.pluginType=="youtube"&&b.container.find(".mejs-overlay-play").hide()}if(e&& | ||
+ | a.pluginType=="native"){a.load();a.play()}if(b.options.success)typeof b.options.success=="string"?window[b.options.success](b.media,b.domNode,b):b.options.success(b.media,b.domNode,b)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},setPlayerSize:function(){if(this.height.toString().indexOf("%")>0){var a=this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth,c=this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight: | ||
+ | this.options.defaultVideoHeight,b=this.container.parent().width();a=parseInt(b*c/a,10);if(this.container.parent()[0].tagName.toLowerCase()==="body"){b=f(window).width();a=f(window).height()}this.container.width(b).height(a);this.$media.width("100%").height("100%");this.container.find("object, embed, iframe").width("100%").height("100%");this.media.setVideoSize&&this.media.setVideoSize(b,a);this.layers.children(".mejs-layer").width("100%").height("100%")}else{this.container.width(this.width).height(this.height); | ||
+ | this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,c=0,b=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");others=b.siblings();if(this.options&&!this.options.autosizeProgress)c=parseInt(b.css("width"));if(c===0||!c){others.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});c=this.controls.width()- | ||
+ | a-(b.outerWidth(true)-b.outerWidth(false))}b.width(c);d.width(c-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,c,b,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(b);c=a.$media.attr("poster");if(a.options.poster!=="")c=a.options.poster;c!==""&&c!=null?this.setPoster(c):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var c=this.container.find(".mejs-poster"), | ||
+ | b=c.find("img");if(b.length==0)b=f('<img width="100%" height="100%" />').appendTo(c);b.attr("src",a)},buildoverlays:function(a,c,b,d){if(a.isVideo){var e=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(b),g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(b),k=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(b).click(function(){d.paused? | ||
+ | d.play():d.pause()});d.addEventListener("play",function(){k.hide();e.hide();g.hide()},false);d.addEventListener("playing",function(){k.hide();e.hide();g.hide()},false);d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||k.show()},false);d.addEventListener("waiting",function(){e.show()},false);d.addEventListener("loadeddata",function(){e.show()},false);d.addEventListener("canplay",function(){e.hide()},false);d.addEventListener("error",function(){e.hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")}, | ||
+ | false)}},buildkeyboard:function(a,c,b,d){f(document).keydown(function(e){if(a.hasFocus&&a.options.enableKeyboard)for(var g=0,k=a.options.keyActions.length;g<k;g++)for(var i=a.options.keyActions[g],m=0,l=i.keys.length;m<l;m++)if(e.keyCode==i.keys[m]){e.preventDefault();i.action(a,d);return false}return true});f(document).click(function(e){if(f(e.target).closest(".mejs-container").length==0)a.hasFocus=false})},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[];c.each(function(b,d){d= | ||
+ | f(d);a.tracks.push({srclang:d.attr("srclang").toLowerCase(),src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize();this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime}, | ||
+ | setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){if(this.media.pluginType=="flash")this.media.remove();else this.media.pluginTyp=="native"&&this.media.prop("controls",true);this.isDynamic||this.$node.insertBefore(this.container);this.container.remove()}};if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(this,a)})};f(document).ready(function(){f(".mejs-player").mediaelementplayer()}); | ||
+ | window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,c,b,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'"></button></div>').appendTo(c).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false); | ||
+ | d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,c,b,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+"></button></div>").appendTo(c).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);c.find(".mejs-time-current").width("0px");c.find(".mejs-time-handle").css("left","0px");c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0)); | ||
+ | c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));b.find(".mejs-poster").show()}})}})})(mejs.$); | ||
+ | (function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,c,b,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(c);var e=c.find(".mejs-time-total");b=c.find(".mejs-time-loaded");var g=c.find(".mejs-time-current"), | ||
+ | k=c.find(".mejs-time-handle"),i=c.find(".mejs-time-float"),m=c.find(".mejs-time-float-current"),l=function(j){j=j.pageX;var h=e.offset(),n=e.outerWidth(),p=0;p=0;var s=j-h.left;if(j>h.left&&j<=n+h.left&&d.duration){p=(j-h.left)/n;p=p<=0.02?0:p*d.duration;o&&d.setCurrentTime(p);if(!mejs.MediaFeatures.hasTouch){i.css("left",s);m.html(mejs.Utility.secondsToTimeCode(p));i.show()}}},o=false,q=false;e.bind("mousedown",function(j){if(j.which===1){o=true;l(j);return false}});c.find(".mejs-time-total").bind("mouseenter", | ||
+ | function(){q=true;mejs.MediaFeatures.hasTouch||i.show()}).bind("mouseleave",function(){q=false;i.hide()});f(document).bind("mouseup",function(){o=false;i.hide()}).bind("mousemove",function(j){if(o||q)l(j)});d.addEventListener("progress",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false);d.addEventListener("timeupdate",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false);this.loaded=b;this.total=e;this.current=g;this.handle=k},setProgressRail:function(a){var c=a!=undefined?a.target: | ||
+ | this.media,b=null;if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=c.buffered.end(0)/c.duration;else if(c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined)b=c.bufferedBytes/c.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)b=a.loaded/a.total;if(b!==null){b=Math.min(1,Math.max(0,b));this.loaded&&this.total&&this.loaded.width(this.total.width()*b)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a= | ||
+ | this.total.width()*this.media.currentTime/this.media.duration,c=a-this.handle.outerWidth(true)/2;this.current.width(a);this.handle.css("left",c)}}})})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" <span> | </span> "});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,c,b,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a, | ||
+ | c,b,d){if(c.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"); | ||
+ | f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()}, | ||
+ | false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,c,b,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+this.id+'" title="'+this.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(c), | ||
+ | g=e.find(".mejs-volume-slider"),k=e.find(".mejs-volume-total"),i=e.find(".mejs-volume-current"),m=e.find(".mejs-volume-handle"),l=function(h){if(g.is(":visible")){var n=k.height(),p=k.position();h=n-n*h;m.css("top",p.top+h-m.height()/2);i.height(n-h);i.css("top",p.top+h)}else{g.show();l(h);g.hide()}},o=function(h){var n=k.height(),p=k.offset(),s=parseInt(k.css("top").replace(/px/,""),10);h=h.pageY-p.top;var r=(n-h)/n;if(!(p.top==0||p.left==0)){r=Math.max(0,r);r=Math.min(r,1);if(h<0)h=0;else if(h> | ||
+ | n)h=n;m.css("top",h-m.height()/2+s);i.height(n-h);i.css("top",h+s);if(r==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}r=Math.max(0,r);r=Math.min(r,1);d.setVolume(r)}},q=false,j=false;e.hover(function(){g.show();j=true},function(){j=false;q||g.hide()});g.bind("mouseover",function(){j=true}).bind("mousedown",function(h){o(h);q=true;return false});f(document).bind("mouseup",function(){q=false;j||g.hide()}).bind("mousemove", | ||
+ | function(h){q&&o(h)});e.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(){if(!q)if(d.muted){l(0);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{l(d.volume);e.removeClass("mejs-unmute").addClass("mejs-mute")}},false);if(this.container.is(":visible")){l(a.options.startVolume);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}}}})})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:"Fullscreen"});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(a,c,b,d){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;mejs.MediaFeatures.hasTrueNativeFullScreen&&a.container.bind(mejs.MediaFeatures.fullScreenEventName,function(){if(mejs.MediaFeatures.isFullScreen()){a.isNativeFullScreen= | ||
+ | true;a.setControlsSize()}else{a.isNativeFullScreen=false;a.exitFullScreen()}});var e=this,g=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.fullscreenText+'"></button></div>').appendTo(c);if(e.media.pluginType==="native"||!e.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}); | ||
+ | else{var k=null;if(document.documentElement.style.pointerEvents===""&&!mejs.MediaFeatures.isOpera){var i=false,m=function(){if(i){l.hide();o.hide();q.hide();g.css("pointer-events","");e.controls.css("pointer-events","");i=false}},l=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(m),o=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(m),q=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(m),j=function(){var h={position:"absolute", | ||
+ | top:0,left:0};l.css(h);o.css(h);q.css(h);l.width(e.container.width()).height(e.container.height()-e.controls.height());h=g.offset().left-e.container.offset().left;fullScreenBtnWidth=g.outerWidth(true);o.width(h).height(e.controls.height()).css({top:e.container.height()-e.controls.height()});q.width(e.container.width()-h-fullScreenBtnWidth).height(e.controls.height()).css({top:e.container.height()-e.controls.height(),left:h+fullScreenBtnWidth})};f(document).resize(function(){j()});g.mouseover(function(){if(!e.isFullScreen){var h= | ||
+ | g.offset(),n=a.container.offset();d.positionFullscreenButton(h.left-n.left,h.top-n.top,false);g.css("pointer-events","none");e.controls.css("pointer-events","none");l.show();q.show();o.show();j();i=true}});d.addEventListener("fullscreenchange",function(){m()})}else g.mouseover(function(){if(k!==null){clearTimeout(k);delete k}var h=g.offset(),n=a.container.offset();d.positionFullscreenButton(h.left-n.left,h.top-n.top,true)}).mouseout(function(){if(k!==null){clearTimeout(k);delete k}k=setTimeout(function(){d.hideFullscreenButton()}, | ||
+ | 1500)})}a.fullscreenBtn=g;f(document).bind("keydown",function(h){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||e.isFullScreen)&&h.keyCode==27)a.exitFullScreen()})}},enterFullScreen:function(){var a=this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width(); | ||
+ | if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(a.container[0]);a.isInIframe&&setTimeout(function b(){if(a.isNativeFullScreen)f(window).width()!==screen.width?a.exitFullScreen():setTimeout(b,500)},500)}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var c=a.options.newWindowCallback(this);if(c!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause(); | ||
+ | window.open(c,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},250);else{a.pause();window.open(c,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.pluginType=== | ||
+ | "native")a.$media.width("100%").height("100%");else{a.container.find("object, embed, iframe").width("100%").height("100%");a.media.setVideoSize(f(window).width(),f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&& | ||
+ | (mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow=docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight); | ||
+ | this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=false}}})})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles"});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,c,b,d){if(a.isVideo)if(a.tracks.length!=0){var e;a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(b).hide();a.captions=f('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>').prependTo(b).hide();a.captionsText=a.captions.find(".mejs-captions-text"); | ||
+ | a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(c).hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},function(){f(this).find(".mejs-captions-selector").css("visibility", | ||
+ | "hidden")}).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(e=0;e<a.tracks.length;e++)if(a.tracks[e].srclang==lang){a.selectedTrack=a.tracks[e];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("mouseenter",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave", | ||
+ | function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(e=0;e<a.tracks.length;e++)a.tracks[e].kind=="subtitles"&&a.addTrackButton(a.tracks[e].srclang,a.tracks[e].label);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},false);d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility", | ||
+ | "visible");a.chapters.fadeIn(200)}},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")}},loadNextTrack:function(){this.trackToLoad++;if(this.trackToLoad<this.tracks.length){this.isLoadingTrack=true;this.loadTrack(this.trackToLoad)}else this.isLoadingTrack=false},loadTrack:function(a){var c=this,b=c.tracks[a],d=function(){b.isLoaded= | ||
+ | true;c.enableTrackButton(b.srclang,b.label);c.loadNextTrack()};b.isTranslation?mejs.TrackFormatParser.translateTrackText(c.tracks[0].entries,c.tracks[0].srclang,b.srclang,c.options.googleApiKey,function(e){b.entries=e;d()}):f.ajax({url:b.src,success:function(e){b.entries=mejs.TrackFormatParser.parse(e);d();b.kind=="chapters"&&c.media.duration>0&&c.drawChapters(b)},error:function(){c.loadNextTrack()}})},enableTrackButton:function(a,c){if(c==="")c=mejs.language.codes[a]||a;this.captionsButton.find("input[value="+ | ||
+ | a+"]").prop("disabled",false).siblings("label").html(c);this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,c){if(c==="")c=mejs.language.codes[a]||a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+c+" (loading)</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+ | ||
+ | a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,c=this.selectedTrack;if(c!=null&&c.isLoaded)for(a=0;a<c.entries.times.length;a++)if(this.media.currentTime>=c.entries.times[a].start&&this.media.currentTime<=c.entries.times[a].stop){this.captionsText.html(c.entries.text[a]); | ||
+ | this.captions.show();return}this.captions.hide()}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var c=this,b,d,e=d=0;c.chapters.empty();for(b=0;b<a.entries.times.length;b++){d=a.entries.times[b].stop-a.entries.times[b].start;d=Math.floor(d/c.media.duration*100);if(d+e>100||b==a.entries.times.length-1&&d+e<100)d=100-e;c.chapters.append(f('<div class="mejs-chapter" rel="'+ | ||
+ | a.entries.times[b].start+'" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+(b==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[b]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[b].start)+"–"+mejs.Utility.secondsToTimeCode(a.entries.times[b].stop)+"</span></div></div>"));e+=d}c.chapters.find("div.mejs-chapter").click(function(){c.media.setCurrentTime(parseFloat(f(this).attr("rel"))); | ||
+ | c.media.paused&&c.media.play()});c.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese", | ||
+ | ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/, | ||
+ | split2:function(a,c){return a.split(c)},parse:function(a){var c=0;a=this.split2(a,/\r?\n/);for(var b={text:[],times:[]},d,e;c<a.length;c++)if(this.pattern_identifier.exec(a[c])){c++;if((d=this.pattern_timecode.exec(a[c]))&&c<a.length){c++;e=a[c];for(c++;a[c]!==""&&c<a.length;){e=e+"\n"+a[c];c++}b.text.push(e);b.times.push({start:mejs.Utility.timeCodeToSeconds(d[1]),stop:mejs.Utility.timeCodeToSeconds(d[3]),settings:d[5]})}}return b}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2= | ||
+ | function(a,c){var b=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(c.test(d)){b.push(d.replace(c,""));d=""}}b.push(d);return b}})(mejs.$); | ||
+ | (function(f){f.extend(mejs.MepDefaults,contextMenuItems=[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]); | ||
+ | f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(c){if(a.isContextMenuEnabled){c.preventDefault();a.renderContextMenu(c.clientX-1,c.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled= | ||
+ | true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,c){for(var b=this,d="",e=b.options.contextMenuItems,g=0,k=e.length;g< | ||
+ | k;g++)if(e[g].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var i=e[g].render(b);if(i!=null)d+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+Math.random()*1E6+'">'+i+"</div>"}b.contextMenu.empty().append(f(d)).css({top:c,left:a}).show();b.contextMenu.find(".mejs-contextmenu-item").each(function(){var m=f(this),l=parseInt(m.data("itemindex"),10),o=b.options.contextMenuItems[l];typeof o.show!="undefined"&&o.show(m,b);m.click(function(){typeof o.click!= | ||
+ | "undefined"&&o.click(b);b.contextMenu.hide()})});setTimeout(function(){b.killControlsTimer("rev3")},100)}})})(mejs.$); | ||
+ | |||
+ | </script> | ||
+ | <script> | ||
+ | jQuery.noConflict(); | ||
+ | |||
+ | $apex_highlightcolor = "#34b489"; | ||
+ | |||
+ | |||
+ | /* #On Document Ready | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | jQuery(document).ready(function() { | ||
+ | |||
+ | |||
+ | |||
+ | /* Menu */ | ||
+ | ddsmoothmenu.init({ | ||
+ | mainmenuid: "mainmenu", //menu DIV id | ||
+ | orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" | ||
+ | classname: 'ddsmoothmenu', //class added to menu's outer DIV | ||
+ | contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"] | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | /* Responsive Menu Generation */ | ||
+ | menuHandler(); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | /* Responsive Select Menu */ | ||
+ | jQuery("#responsive-menu select").change(function() { | ||
+ | window.location = jQuery(this).find("option:selected").val(); | ||
+ | }); | ||
+ | |||
+ | |||
+ | /* Footer Close */ | ||
+ | jQuery('.footerclose').click(function() { | ||
+ | jQuery('.footer').animate({height:'hide'},{duration:500,queue:false}, 'easeInOutExpo') | ||
+ | jQuery('.footerclose').animate({opacity:'hide'},{duration:300,queue:false}, 'easeOutSine') | ||
+ | jQuery('.footeropen').animate({opacity:'show'},{duration:300,queue:false}, 'easeOutSine') | ||
+ | }); | ||
+ | |||
+ | |||
+ | /* Footer Open */ | ||
+ | jQuery('.footeropen').click(function() { | ||
+ | jQuery('.footer').animate({height:'show'},{duration:500,queue:false}, 'easeInOutExpo') | ||
+ | jQuery('.footerclose').animate({opacity:'show'},{duration:300,queue:false}, 'easeOutSine') | ||
+ | jQuery('.footeropen').animate({opacity:'hide'},{duration:300,queue:false}, 'easeOutSine') | ||
+ | jQuery('html, body').animate({ scrollTop: jQuery(document).height()},{duration:300,queue:false}, 'easeOutSine'); | ||
+ | |||
+ | setTimeout(function() { | ||
+ | jQuery('html, body').animate({ scrollTop: jQuery(document).height()},{duration:300,queue:false}, 'easeOutSine'); | ||
+ | },290); | ||
+ | }); | ||
+ | |||
+ | |||
+ | /* Init FlexSlider Home */ | ||
+ | jQuery('.flexslider').not(".postslider").flexslider({ | ||
+ | touchSwipe: true, | ||
+ | controlNav: false, | ||
+ | directionNav: true, | ||
+ | slideshow: true, | ||
+ | slideshowSpeed: 7000, | ||
+ | animationDuration: 600, | ||
+ | randomize: false, | ||
+ | pauseOnAction: false, | ||
+ | pauseOnHover: true | ||
+ | }); | ||
+ | |||
+ | |||
+ | /* Init FlexSlider Post */ | ||
+ | jQuery('.postslider').flexslider({ | ||
+ | touchSwipe: true, | ||
+ | controlNav: false, | ||
+ | directionNav: true, | ||
+ | slideshow: false, | ||
+ | slideshowSpeed: 7000, | ||
+ | animationDuration: 600, | ||
+ | randomize: false, | ||
+ | pauseOnAction: false, | ||
+ | pauseOnHover: true | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | /* FlexSlider Button Hover */ | ||
+ | jQuery(".flex-direction-nav li a.next, .flex-direction-nav li a.prev").css({ opacity: 0.2 }); | ||
+ | jQuery(".flex-direction-nav li a.next, .flex-direction-nav li a.prev").hover(function() { | ||
+ | jQuery(this).animate({ opacity: 1 },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ opacity: 0.2 },{duration:300,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | /* FlexSlider Button FadeIn */ | ||
+ | jQuery("ul.flex-direction-nav").css("opacity", "0"); | ||
+ | jQuery("ul.flex-direction-nav").css("display", "block"); | ||
+ | jQuery(".flexslider").hover(function() { | ||
+ | jQuery("ul.flex-direction-nav").animate({ opacity: 1 },{duration:200,queue:false}); | ||
+ | },function() { | ||
+ | jQuery("ul.flex-direction-nav").animate({ opacity: 0 },{duration:200,queue:false}); | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | /* List Fades */ | ||
+ | listfades(".clients"); | ||
+ | |||
+ | |||
+ | |||
+ | /* Accordion Init */ | ||
+ | initAccordion(); | ||
+ | |||
+ | |||
+ | |||
+ | /* Hover Effects */ | ||
+ | hoverEffects(); | ||
+ | |||
+ | |||
+ | |||
+ | /* MediaElement Init */ | ||
+ | jQuery('audio,video').mediaelementplayer(); | ||
+ | |||
+ | |||
+ | |||
+ | /* Tabs */ | ||
+ | tabsInit(); | ||
+ | |||
+ | |||
+ | |||
+ | /* Fit Videos */ | ||
+ | jQuery(".scalevid").fitVids(); | ||
+ | |||
+ | |||
+ | |||
+ | /* Portfolio 4 Column */ | ||
+ | jQuery('.portfolio4column').tpportfolio({ | ||
+ | speed:500, | ||
+ | row:4, | ||
+ | nonSelectedAlpha:0, | ||
+ | portfolioContainer:'.portfolio' | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | /* Contact Form */ | ||
+ | if(jQuery('#contactform').length != 0){ | ||
+ | addForm('#contactform'); | ||
+ | } | ||
+ | |||
+ | |||
+ | /* Quick Contact */ | ||
+ | if(jQuery('#quickcontact').length != 0){ | ||
+ | addForm('#quickcontact'); | ||
+ | } | ||
+ | |||
+ | |||
+ | /* Blog Comments */ | ||
+ | if(jQuery('#replyform').length != 0){ | ||
+ | addForm('#replyform'); | ||
+ | } | ||
+ | |||
+ | |||
+ | /* Footer Position Calculator */ | ||
+ | footerHandler(); | ||
+ | |||
+ | /* Twitter Customization */ | ||
+ | twitterTimelineCustomize(); | ||
+ | |||
+ | |||
+ | /* PrettyPhoto */ | ||
+ | addPrettyPhoto(); | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | /* #On Window Load | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | jQuery(window).load(function() { | ||
+ | |||
+ | jQuery("#background").fullBg(); | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | /* #Twitter Customizer | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | function twitterTimelineCustomize() { | ||
+ | |||
+ | |||
+ | // Customize twitter feed | ||
+ | var changeTwitterAttempts = 0; | ||
+ | function changeTwitterBoxElements() { | ||
+ | setTimeout( function() { | ||
+ | if ( jQuery('[id*=twitter]').length ) { | ||
+ | jQuery('[id*=twitter]').each( function(){ | ||
+ | var ibody = jQuery(this).contents().find( 'body' ); | ||
+ | if ( ibody.find( '.timeline .stream .h-feed li.tweet' ).length ) { | ||
+ | ibody.find( '.timeline .stream .h-feed li.tweet' ).slice(2, ibody.find( '.timeline .stream .h-feed li.tweet' ).length).remove(); | ||
+ | |||
+ | ibody.find( '.timeline .stream').css('height',(ibody.find( '.timeline .stream ol').outerHeight()+10)+"px"); | ||
+ | jQuery( '.twitter-timeline').css('height',(ibody.find( '.timeline .stream ol').outerHeight()+10)+"px"); | ||
+ | |||
+ | ibody.find( '.timeline' ).css( 'border', '0px solid #000' ); | ||
+ | ibody.find( '.timeline' ).css( 'background-color', 'transparent' ); | ||
+ | ibody.find( '.tweet' ).css( 'border', "0px solid #000" ); | ||
+ | ibody.find( '.timeline .stream' ).css( 'overflow-x', 'hidden' ); | ||
+ | ibody.find( '.timeline .stream' ).css( 'overflow-y', 'hidden' ); | ||
+ | ibody.find( '.timeline-header').hide(); | ||
+ | ibody.find( '.timeline-footer').hide(); | ||
+ | ibody.find( '.timeline .load-more').hide(); | ||
+ | jQuery( '.twitter-timeline').show(); | ||
+ | ibody.find( '.timeline .stream').click(function(){ | ||
+ | clickEvent(); | ||
+ | }); | ||
+ | } | ||
+ | else { | ||
+ | jQuery(this).hide(); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | changeTwitterAttempts++; | ||
+ | if ( changeTwitterAttempts < 3 ) { | ||
+ | changeTwitterBoxElements(); | ||
+ | } | ||
+ | }, 1500); | ||
+ | } | ||
+ | |||
+ | changeTwitterBoxElements(); | ||
+ | |||
+ | var timeouts; | ||
+ | jQuery(window).resize(function() { | ||
+ | clearTimeout(timeouts); | ||
+ | timeouts= setTimeout(function() { | ||
+ | changeTwitterBoxElements(); | ||
+ | },150); | ||
+ | }); | ||
+ | |||
+ | function clickEvent(){ | ||
+ | changeTwitterBoxElements(); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Menu Handler | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | function menuHandler() { | ||
+ | |||
+ | var defpar = jQuery('#mainmenu').parents().length; | ||
+ | |||
+ | jQuery('#mainmenu li >a').each(function() { | ||
+ | var a=jQuery(this); | ||
+ | var par= a.parents().length-defpar -3; | ||
+ | |||
+ | var atext = a.html().split('<')[0]; | ||
+ | atext = atext.toLowerCase(); | ||
+ | atext = atext.substr(0,1).toUpperCase() + atext.substr(1,atext.length); | ||
+ | |||
+ | if (par==0) | ||
+ | var newtxt=jQuery("<div>"+atext+"</div>").text(); | ||
+ | else | ||
+ | if (par==2) | ||
+ | var newtxt=jQuery("<div> "+atext+"</div>").text(); | ||
+ | else | ||
+ | if (par==4) | ||
+ | var newtxt=jQuery("<div> "+atext+"</div>").text(); | ||
+ | |||
+ | jQuery('#responsive-menu select').append(new Option(newtxt,a.attr('href')) ); | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | //var aktmenu=jQuery('.current_page_item a:first').text(); | ||
+ | //jQuery('#responsive-menu-button').html(aktmenu); | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Footer Handler | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function footerHandler() { | ||
+ | |||
+ | var main_cont = jQuery('body').find('.main:first'); | ||
+ | var footer_wrap = jQuery('body').find('.footerwrap'); | ||
+ | var subfooter_wrap = jQuery('body').find('.subfooterwrap'); | ||
+ | setInterval(function() { | ||
+ | |||
+ | |||
+ | var mainh = main_cont.outerHeight(); | ||
+ | var footerh = footer_wrap.outerHeight() + subfooter_wrap.outerHeight(); | ||
+ | var windowh = jQuery(window).height(); | ||
+ | |||
+ | var dif = windowh - (mainh+footerh); | ||
+ | |||
+ | if (dif>0) { | ||
+ | footer_wrap.stop(); | ||
+ | footer_wrap.animate({'marginTop':dif+"px"},{duration:300,queue:false}); | ||
+ | } | ||
+ | |||
+ | if (dif<0) { | ||
+ | footer_wrap.stop(); | ||
+ | footer_wrap.animate({'marginTop':"0px"},{duration:300,queue:false}); | ||
+ | |||
+ | } | ||
+ | |||
+ | // DEBUG jQuery('body').find('.khinfo').html('main:'+mainh+" footer:"+footerh+" Window:"+windowh+" dif:"+dif); | ||
+ | |||
+ | },100); | ||
+ | |||
+ | setInterval(function() { | ||
+ | |||
+ | jQuery('.tiledbackground').height(jQuery(document).height()); | ||
+ | jQuery('.whitebackground').height(jQuery(document).height()); | ||
+ | |||
+ | },500); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Accordion | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function initAccordion() { | ||
+ | jQuery('.accordion-item').each(function(i) { | ||
+ | var item=jQuery(this); | ||
+ | item.find('.togglecontent').slideUp(0); | ||
+ | item.find('.toggleswitch').click(function() { | ||
+ | var displ = item.find('.togglecontent').css('display'); | ||
+ | item.closest('ul').find('.toggleswitch').each(function() { | ||
+ | var li = jQuery(this).closest('li'); | ||
+ | li.find('.togglecontent').slideUp(300); | ||
+ | jQuery(this).parent().removeClass("selected"); | ||
+ | }); | ||
+ | if (displ=="block") { | ||
+ | item.find('.togglecontent').slideUp(300) | ||
+ | item.removeClass("selected"); | ||
+ | } else { | ||
+ | item.find('.togglecontent').slideDown(300) | ||
+ | item.addClass("selected"); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #List Fade | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function listfades(container) { | ||
+ | jQuery(container).find('>li').each(function() { | ||
+ | var li=jQuery(this); | ||
+ | li.hover( | ||
+ | function() { | ||
+ | var li=jQuery(this); | ||
+ | li.addClass('listover'); | ||
+ | li.find('img:first').addClass('listovereffect'); | ||
+ | |||
+ | |||
+ | jQuery(container).find('>li').each(function(i) { | ||
+ | var lis = jQuery(this); | ||
+ | lis.stop(); | ||
+ | if (!lis.hasClass('listover')) | ||
+ | lis.find('img:first').animate({opacity:0.3},{duration:300,queue:false}); | ||
+ | else | ||
+ | lis.find('img:first').animate({opacity:1},{duration:300,queue:false}); | ||
+ | }); | ||
+ | }, | ||
+ | function() { | ||
+ | var li=jQuery(this); | ||
+ | li.removeClass('listover'); | ||
+ | li.find('img:first').removeClass('listovereffect'); | ||
+ | li.siblings().each(function() { | ||
+ | var lis = jQuery(this); | ||
+ | lis.stop(); | ||
+ | lis.find('img:first').animate({opacity:1},{duration:300,queue:false}); | ||
+ | }); | ||
+ | |||
+ | li.stop(); | ||
+ | li.find('img:first').animate({opacity:1},{duration:300,queue:false}); | ||
+ | }); | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Pretty Photo | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function addPrettyPhoto() { | ||
+ | /* PrettyPhoto init */ | ||
+ | jQuery("a[data-rel^='prettyPhoto']").prettyPhoto({ | ||
+ | theme: 'pp_default', | ||
+ | overlay_gallery: false, | ||
+ | show_title: false, | ||
+ | social_tools: false, | ||
+ | hideflash: true | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Site Tabs | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function tabsInit() { | ||
+ | |||
+ | /* | ||
+ | * Skeleton V1.1 | ||
+ | * Copyright 2011, Dave Gamache | ||
+ | * www.getskeleton.com | ||
+ | * Free to use under the MIT license. | ||
+ | * http://www.opensource.org/licenses/mit-license.php | ||
+ | * 8/17/2011 | ||
+ | */ | ||
+ | |||
+ | /* Tabs Activiation | ||
+ | ================================================== */ | ||
+ | |||
+ | var tabs = jQuery('ul.tabs'); | ||
+ | |||
+ | tabs.each(function(i) { | ||
+ | |||
+ | //Get all tabs | ||
+ | var tab = jQuery(this).find('> li > a'); | ||
+ | tab.click(function(e) { | ||
+ | |||
+ | //Get Location of tab's content | ||
+ | var contentLocation = jQuery(this).attr('href'); | ||
+ | |||
+ | //Let go if not a hashed one | ||
+ | if(contentLocation.charAt(0)=="#") { | ||
+ | |||
+ | e.preventDefault(); | ||
+ | |||
+ | //Make Tab Active | ||
+ | tab.removeClass('active'); | ||
+ | jQuery(this).addClass('active'); | ||
+ | |||
+ | //Show Tab Content & add active class | ||
+ | jQuery(contentLocation).show().addClass('active').siblings().hide().removeClass('active'); | ||
+ | |||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Site Hover Effects | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function hoverEffects() { | ||
+ | |||
+ | /* Button Hover */ | ||
+ | jQuery("a.button, button").hover(function() { | ||
+ | jQuery(this).animate({ backgroundColor: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | jQuery(this).css("text-shadow", "none"); | ||
+ | jQuery(this).css("border-bottom", "1px solid #777"); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ backgroundColor: "#777" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | jQuery(this).css("text-shadow", "0px 1px 0px #444"); | ||
+ | jQuery(this).css("border-bottom", "1px solid #444"); | ||
+ | }); | ||
+ | |||
+ | /* Border Hover */ | ||
+ | jQuery(".footer a.borderhover img").hover(function() { | ||
+ | jQuery(this).animate({ borderColor: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ borderColor: "#3e3e3e" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery("a.borderhover img").not(".footer a.borderhover img").hover(function() { | ||
+ | jQuery(this).animate({ borderColor: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ borderColor: "#ddd" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | |||
+ | /* Social Tooltip Hover */ | ||
+ | function addSocialHover(socialitem) { | ||
+ | var descrdiv = jQuery(socialitem).parent().find('div'); | ||
+ | jQuery(socialitem).hover(function() { | ||
+ | descrdiv.css("opacity", "0"); | ||
+ | descrdiv.css("display", "block"); | ||
+ | descrdiv.animate({opacity:1},{duration:200,queue:false}); | ||
+ | },function() { | ||
+ | descrdiv.animate({opacity:0},{duration:200,queue:false}); | ||
+ | }); | ||
+ | } | ||
+ | addSocialHover("a.social_facebook"); | ||
+ | addSocialHover("a.social_twitter"); | ||
+ | addSocialHover("a.social_rss"); | ||
+ | addSocialHover("a.social_vimeo"); | ||
+ | addSocialHover("a.social_googleplus"); | ||
+ | addSocialHover("a.social_linkedin"); | ||
+ | addSocialHover("a.social_flickr"); | ||
+ | addSocialHover("a.social_youtube"); | ||
+ | addSocialHover("a.social_pinterest"); | ||
+ | |||
+ | /* Link Hover */ | ||
+ | jQuery("a").not(".author a, a.button, .tabs a, .topline a, a.portfolio_selector, .footer a, .subfooter a, .flex-caption a, .mainmenu a, a.titlelink, a.link, a.linkbg, .subline a, h6 a, h5 a, h4 a, h3 a, h2 a, h1 a, .blogpages li a").hover(function() { | ||
+ | jQuery(this).animate({ color: "#000" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery(".topline a").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#333" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery(".blogpages li a").not(".blogpages li a.selected").hover(function() { | ||
+ | jQuery(this).animate({ backgroundColor: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ backgroundColor: "#777" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery("h6 a, h5 a, h4 a, h3 a, h2 a, h1 a").not(".blogtitle h4 a").hover(function() { | ||
+ | jQuery(this).animate({ color: "#000" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery(".blogtitle h4 a, .author a").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#000" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery(".footer a").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#ccc" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery(".subfooter a").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#777" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery(".flex-caption a").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#fff" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery("a.link").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#777" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | jQuery("a.linkbg").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | jQuery(this).css("backgroundColor", "transparent"); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#fff" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | jQuery(this).css("backgroundColor", $apex_highlightcolor); | ||
+ | }); | ||
+ | jQuery(".subline a").hover(function() { | ||
+ | jQuery(this).animate({ color: "#fff" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | jQuery(this).css("backgroundColor", $apex_highlightcolor); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#777" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | jQuery(this).css("backgroundColor", "transparent"); | ||
+ | }); | ||
+ | jQuery("a.titlelink, .postinfo a").hover(function() { | ||
+ | jQuery(this).animate({ color: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ color: "#999" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | |||
+ | /* Top Level Menu Hover | ||
+ | jQuery(".ddsmoothmenu ul li a").hover(function() { | ||
+ | jQuery(this).animate({ backgroundColor: "#222" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ backgroundColor: "#111" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | });*/ | ||
+ | |||
+ | /* Sub Menu Hover */ | ||
+ | jQuery(".ddsmoothmenu ul li ul li a").hover(function() { | ||
+ | jQuery(this).animate({ backgroundColor: $apex_highlightcolor },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | },function() { | ||
+ | jQuery(this).animate({ backgroundColor: "#222222" },{duration:200,queue:false}, 'easeOutSine'); | ||
+ | }); | ||
+ | |||
+ | /* Image Hover */ | ||
+ | jQuery('.hovering').hover( | ||
+ | function() { | ||
+ | var $this=jQuery(this); | ||
+ | var $bordertop=jQuery(this).parent().find('.topline'); | ||
+ | var $borderbottom=jQuery(this).parent(); | ||
+ | |||
+ | if (jQuery.browser.msie && jQuery.browser.version==8) { | ||
+ | jQuery('body').data('somethinghovered',1); | ||
+ | } | ||
+ | |||
+ | if (!$this.find('img:first').hasClass("underanimation")) { | ||
+ | if (jQuery.browser.msie && jQuery.browser.version<9 && $this.find('.overlay').length>0) { | ||
+ | // IS ALREADY IN ACTION | ||
+ | |||
+ | } else { | ||
+ | |||
+ | var img = $this.find('img:first'); | ||
+ | var w=img.width(); | ||
+ | var h=img.height(); | ||
+ | var btw = parseInt(img.css('border-top-width'),0); | ||
+ | var blw = parseInt(img.css('border-left-width'),0); | ||
+ | if (btw>0 && btw<1000) { | ||
+ | } else { | ||
+ | btw=0; | ||
+ | } | ||
+ | if (blw>0 && blw<1000) { | ||
+ | } else { | ||
+ | blw=0; | ||
+ | } | ||
+ | |||
+ | |||
+ | var t=img.position().top + btw; | ||
+ | var l=img.position().left + blw; | ||
+ | |||
+ | |||
+ | // ADD THE OVERLAY ON THE A TAG BY HOVER | ||
+ | |||
+ | $this.append('<div class="overlay" style="overflow:hidden;position:absolute;cursor:pointer;"></div>'); | ||
+ | |||
+ | $this.find('.overlay').css({'top':t+'px', | ||
+ | 'left':l+'px', | ||
+ | 'width':w+'px', | ||
+ | 'height':h+'px'}); | ||
+ | |||
+ | $this.find('.overlay').css({'opacity':0}); | ||
+ | $this.find('.overlay').animate({'opacity':0.25},{duration:350,queue:false}, 'easeOutSine'); | ||
+ | |||
+ | /* Border Animate */ | ||
+ | $bordertop.animate({ borderColor: $apex_highlightcolor },{duration:350,queue:false}, 'easeOutSine'); | ||
+ | $borderbottom.animate({ borderColor: $apex_highlightcolor },{duration:350,queue:false}, 'easeOutSine'); | ||
+ | |||
+ | // ADD THE TEXT CAPTION ON THE HOVERED A TAG IMAGE | ||
+ | if ($this.data('text')!=undefined) { | ||
+ | $this.append('<div class="overlaytext" style="position:absolute;top:'+t+'px;left:'+(l+40)+'px;opacity:0.0">'+$this.data("text")+'</div>'); | ||
+ | var txt=$this.find('.overlaytext'); | ||
+ | |||
+ | txt.css({'top':(t+h/2-parseInt(txt.outerHeight(),0)/2)+"px"}); | ||
+ | txt.css({'left':(l+w/2-parseInt(txt.outerWidth(),0)/2)+"px"}); | ||
+ | txt.animate({'opacity':'1.0'},{duration:350,queue:false}, 'easeOutExpo'); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | function() { | ||
+ | |||
+ | |||
+ | |||
+ | var $this=jQuery(this); | ||
+ | var $bordertop=jQuery(this).parent().find('.topline'); | ||
+ | var $borderbottom=jQuery(this).parent(); | ||
+ | $this.find('.overlay').stop(); | ||
+ | $this.find('.overlay').animate({'opacity':0},{duration:350,queue:false}, 'easeOutSine'); | ||
+ | $this.find('.overlaytext').animate({'opacity':0},{duration:350,queue:false}, 'easeOutSine'); | ||
+ | $bordertop.animate({ borderColor: "#ddd" },{duration:350,queue:false}, 'easeOutSine'); | ||
+ | $borderbottom.animate({ borderColor: "#ddd" },{duration:350,queue:false}, 'easeOutSine'); | ||
+ | $this.data('removetimer',setTimeout(function() { | ||
+ | $this.find('.overlay').remove(); | ||
+ | $this.find('.overlaytext').remove(); | ||
+ | |||
+ | },350)); | ||
+ | |||
+ | }); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | /* #Background Image | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | /** | ||
+ | * jQuery.fullBg | ||
+ | * Version 1.0 | ||
+ | * Copyright (c) 2010 c.bavota - http://bavotasan.com | ||
+ | * Dual licensed under MIT and GPL. | ||
+ | * Date: 02/23/2010 | ||
+ | **/ | ||
+ | (function($) { | ||
+ | $.fn.fullBg = function(){ | ||
+ | var bgImg = $(this); | ||
+ | |||
+ | function resizeImg() { | ||
+ | var imgwidth = bgImg.width(); | ||
+ | var imgheight = bgImg.height(); | ||
+ | |||
+ | var winwidth = $(window).width(); | ||
+ | var winheight = $(window).height(); | ||
+ | |||
+ | var widthratio = winwidth / imgwidth; | ||
+ | var heightratio = winheight / imgheight; | ||
+ | |||
+ | var widthdiff = heightratio * imgwidth; | ||
+ | var heightdiff = widthratio * imgheight; | ||
+ | |||
+ | if(heightdiff>winheight) { | ||
+ | bgImg.css({ | ||
+ | width: winwidth+'px', | ||
+ | height: heightdiff+'px' | ||
+ | }); | ||
+ | } else { | ||
+ | bgImg.css({ | ||
+ | width: widthdiff+'px', | ||
+ | height: winheight+'px' | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | resizeImg(); | ||
+ | bgImg.fadeIn('fast'); | ||
+ | $(window).resize(function() { | ||
+ | resizeImg(); | ||
+ | }); | ||
+ | }; | ||
+ | })(jQuery) | ||
+ | |||
+ | |||
+ | |||
+ | /* #Forms | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | function addForm(formtype) { | ||
+ | |||
+ | var formid = jQuery(formtype); | ||
+ | var emailsend = false; | ||
+ | |||
+ | formid.find("button[name=send]").click(sendemail); | ||
+ | |||
+ | function validator() { | ||
+ | |||
+ | var emailcheck = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | ||
+ | var othercheck = /.{4}/; | ||
+ | var noerror = true; | ||
+ | |||
+ | formid.find(".requiredfield").each(function () { | ||
+ | |||
+ | var fieldname = jQuery(this).attr('name'); | ||
+ | var value = jQuery(this).val(); | ||
+ | if(value == "Name *" || value == "Email *" || value == "Message *"){ | ||
+ | value = ""; | ||
+ | } | ||
+ | |||
+ | if(fieldname == "email"){ | ||
+ | if (!emailcheck.test(value)) { | ||
+ | jQuery(this).addClass("formerror"); | ||
+ | noerror = false; | ||
+ | } else { | ||
+ | jQuery(this).removeClass("formerror"); | ||
+ | } | ||
+ | }else{ | ||
+ | if (!othercheck.test(value)) { | ||
+ | jQuery(this).addClass("formerror"); | ||
+ | noerror = false; | ||
+ | } else { | ||
+ | jQuery(this).removeClass("formerror"); | ||
+ | } | ||
+ | } | ||
+ | }) | ||
+ | |||
+ | if(!noerror){ | ||
+ | formid.find(".errormessage").fadeIn(); | ||
+ | } | ||
+ | |||
+ | return noerror; | ||
+ | } | ||
+ | |||
+ | function resetform() { | ||
+ | formid.find("input").each(function () { | ||
+ | jQuery(this).val(""); | ||
+ | }) | ||
+ | formid.find("textarea").val(""); | ||
+ | emailsend = false; | ||
+ | } | ||
+ | |||
+ | function sendemail() { | ||
+ | formid.find(".successmessage").hide(); | ||
+ | var phpfile = ""; | ||
+ | if(formtype=="#contactform"){ | ||
+ | phpfile = "php/contact.php"; | ||
+ | }else if(formtype=="#quickcontact"){ | ||
+ | phpfile = "php/quickcontact.php"; | ||
+ | }else{ | ||
+ | phpfile = ""; | ||
+ | } | ||
+ | if (validator()) { | ||
+ | if(!emailsend){ | ||
+ | emailsend = true; | ||
+ | formid.find(".errormessage").hide(); | ||
+ | formid.find(".sendingmessage").show(); | ||
+ | jQuery.post(phpfile, formid.serialize(), function() { | ||
+ | formid.find(".sendingmessage").hide(); | ||
+ | formid.find(".successmessage").fadeIn(); | ||
+ | resetform(); | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | return false | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /* #Portfolio | ||
+ | ================================================== */ | ||
+ | |||
+ | |||
+ | |||
+ | (function($,undefined){ | ||
+ | |||
+ | |||
+ | |||
+ | //////////////////////////// | ||
+ | // THE PLUGIN STARTS HERE // | ||
+ | //////////////////////////// | ||
+ | |||
+ | $.fn.extend({ | ||
+ | |||
+ | |||
+ | // OUR PLUGIN HERE :) | ||
+ | tpportfolio: function(options) { | ||
+ | |||
+ | |||
+ | |||
+ | //////////////////////////////// | ||
+ | // SET DEFAULT VALUES OF ITEM // | ||
+ | //////////////////////////////// | ||
+ | var defaults = { | ||
+ | speed:500, | ||
+ | row:4, | ||
+ | nonSelectedAlpha:0, | ||
+ | portfolioContainer:".portfolio" | ||
+ | }; | ||
+ | |||
+ | options = $.extend({}, $.fn.tpportfolio.defaults, options); | ||
+ | |||
+ | |||
+ | return this.each(function() { | ||
+ | |||
+ | var opt=options; | ||
+ | var bod= $(this); | ||
+ | |||
+ | var start=0; | ||
+ | var many =bod.find('.all-group').length; | ||
+ | var lasts = many - (Math.floor(many / opt.row) * opt.row); | ||
+ | |||
+ | if (opt.nonSelectedAlpha===0) { | ||
+ | bod.find(opt.portfolioContainer).wrap('<div class="portfoliooutterholder" style="position:relative;clear:both;overflow:hidden;"></div>'); | ||
+ | } | ||
+ | |||
+ | if (lasts==0) lasts=opt.row; | ||
+ | |||
+ | |||
+ | |||
+ | // ADD ALPHA AND OMEGA CLASS FOR FIRST AND LAST ITEM ! | ||
+ | bod.find('.all-group').each(function(i) { | ||
+ | start++; | ||
+ | var item=$(this); | ||
+ | |||
+ | //alert(item.find('img:first').width()); | ||
+ | if (start==1) | ||
+ | item.addClass('alpha'); | ||
+ | |||
+ | |||
+ | if (start===opt.row) { | ||
+ | item.addClass('omega'); | ||
+ | start=0; | ||
+ | } | ||
+ | |||
+ | if (i>=many-lasts) item.addClass('nopadding'); | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | // SET UP THE CLICKS AND THE ANIMATIONS | ||
+ | bod.find('.portfolio_selector').each(function(){ | ||
+ | |||
+ | // PREPARE THE FIRST START HERE | ||
+ | var selector=$(this); | ||
+ | if (selector.data('group') === "all-group") { | ||
+ | selector.addClass('selected_selector'); | ||
+ | } else { | ||
+ | selector.animate({'opacity':0.6},{duration:200,queue:false}); | ||
+ | } | ||
+ | |||
+ | |||
+ | // HOVER EFFECT | ||
+ | selector.hover( | ||
+ | function() { | ||
+ | var sels=$(this); | ||
+ | sels.stop(); | ||
+ | sels.animate({'opacity':1},{duration:opt.speed,queue:false}); | ||
+ | }, | ||
+ | function() { | ||
+ | var sels=$(this); | ||
+ | if (!(sels.hasClass('selected_selector'))) { | ||
+ | sels.stop(); | ||
+ | sels.animate({'opacity':0.6},{duration:200,queue:false}); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | // CLICK EFFECT | ||
+ | selector.click(function() { | ||
+ | |||
+ | // FOR HIDING PORTFOLIO SET THE OUTER CONTAINER HEIGHT | ||
+ | if (opt.nonSelectedAlpha===0) { | ||
+ | // SET THE OUTTER AND INNER HEIGHT OF THE CONTAINER DIV | ||
+ | var oholder = bod.find('.portfoliooutterholder'); | ||
+ | var iholder = bod.find(opt.portfolioContainer); | ||
+ | oholder.css({'width':'100%','height':iholder.height()+"px"}); | ||
+ | |||
+ | if (!oholder.hasClass("row")) oholder.addClass("row"); | ||
+ | } | ||
+ | |||
+ | |||
+ | // ADD AND REMOVE THE FADES FROM THE SELECTORS !! | ||
+ | // FIRST REMOVE THE SELECTED SELECTORS | ||
+ | bod.find('.portfolio_selector').each(function(){ | ||
+ | var sels=$(this); | ||
+ | sels.removeClass('selected_selector'); | ||
+ | }); | ||
+ | |||
+ | // THAN ADD THE SELECTED SELECTOR TO THE NEW ONE | ||
+ | selector.addClass("selected_selector"); | ||
+ | |||
+ | // THAN FADE OUT ALL NOT NEEDED SELECTOR | ||
+ | bod.find('.portfolio_selector').each(function(){ | ||
+ | var sels=$(this); | ||
+ | sels.stop(); | ||
+ | if (sels.hasClass('selected_selector')) { | ||
+ | sels.animate({'opacity':1},{duration:200,queue:false}); | ||
+ | } else { | ||
+ | sels.animate({'opacity':0.6},{duration:200,queue:false}); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | // DEPENDING ON HOW FAR WE SHOUD HIDE THE REsT OF THE ITEMS, WE NEED TO REORGANISE THE FULL PORTFOLIO | ||
+ | if (opt.nonSelectedAlpha===0) { | ||
+ | |||
+ | var aoh = 0; // Amount Of Items to Hide | ||
+ | var aos = 0; // Amount Of Items to Show | ||
+ | |||
+ | $('body').find('.all-group').each(function(i) { | ||
+ | |||
+ | var item=$(this); | ||
+ | item.stop(); | ||
+ | |||
+ | var img=item.find('img:first'); | ||
+ | |||
+ | // CALCULATE THE CURRENT IMAGE SIZES | ||
+ | var l=img.position().left; | ||
+ | var t=img.position().top; | ||
+ | var iw=img.width(); | ||
+ | var ih=img.height(); | ||
+ | |||
+ | item.css({'position':'relative'}); | ||
+ | |||
+ | if (item.find('.deletemesoon').length==0) | ||
+ | img.wrap('<div class="deletemesoon" style="position:relative;overflow:hidden;width:100%;height:'+ih+'px"></div>'); | ||
+ | img.css({'position':'absolute'}); | ||
+ | |||
+ | //if (item.css('display') != "none") aoh++; | ||
+ | setTimeout(function() { | ||
+ | img.animate({'top':ih+'px'},{duration:opt.speed,queue:false}); | ||
+ | item.animate({'opacity':0},{duration:opt.speed,queue:false}); | ||
+ | },aoh*125); | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | // REMOVE THE ITEMS WE DONT NEED, AND REMOVE THE CLASSES | ||
+ | setTimeout(function() { | ||
+ | $('body').find('.all-group').each(function(i) { | ||
+ | var item=$(this); | ||
+ | |||
+ | |||
+ | |||
+ | if (!item.hasClass(selector.data('group'))) | ||
+ | { | ||
+ | item.css({'display':'none'}) | ||
+ | } else { | ||
+ | item.css({'display':'block','opacity':0}) | ||
+ | } | ||
+ | item.removeClass('alpha') | ||
+ | item.removeClass('omega') | ||
+ | item.remove('nopadding'); | ||
+ | |||
+ | |||
+ | }); | ||
+ | },opt.speed+aoh*125); | ||
+ | |||
+ | |||
+ | setTimeout(function() { | ||
+ | |||
+ | var start=0; | ||
+ | var many = $('body').find('.'+selector.data('group')).length; | ||
+ | var lasts = many - (Math.floor(many / opt.row) * opt.row); | ||
+ | if (lasts==0) lasts=opt.row; | ||
+ | |||
+ | $('body').find('.'+selector.data('group')).each(function(i) { | ||
+ | start++; | ||
+ | var item=$(this); | ||
+ | item.css({'display':'block','opacity':0}); | ||
+ | |||
+ | // STOP IMG ANIMATION | ||
+ | var img=item.find('img:first'); | ||
+ | var dele=item.find('.deletemesoon'); | ||
+ | dele.css({'width':'100%'}); | ||
+ | img.css({'top':'0px'}); | ||
+ | dele.css({'height':img.height()+"px"}); | ||
+ | |||
+ | img.stop(); | ||
+ | img.css({'position':'absolute','top':img.height()+"px"}); | ||
+ | img.animate({'top':'0px'},{duration:opt.speed,queue:false}); | ||
+ | |||
+ | var oholder = bod.find('.portfoliooutterholder'); | ||
+ | |||
+ | |||
+ | setTimeout(function() { | ||
+ | img.prependTo(item.find('a:first')); | ||
+ | img.css({'position':'relative','top':'0px'}); | ||
+ | item.find('.deletemesoon').remove(); | ||
+ | |||
+ | |||
+ | },opt.speed+10+aoh*125); | ||
+ | |||
+ | |||
+ | |||
+ | item.stop(); | ||
+ | item.animate({'opacity':1},{duration:opt.speed,queue:false}); | ||
+ | |||
+ | if (start==1) | ||
+ | item.addClass('alpha'); | ||
+ | |||
+ | if (start===opt.row) { | ||
+ | item.addClass('omega'); | ||
+ | start=0; | ||
+ | } | ||
+ | if (i>=many-lasts) { | ||
+ | item.addClass('nopadding'); | ||
+ | } else { | ||
+ | item.removeClass('nopadding'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | buildRows(opt); | ||
+ | |||
+ | // SET HEIGHT OF PORTFOLIO HOLDER | ||
+ | |||
+ | |||
+ | var iholder = bod.find(opt.portfolioContainer); | ||
+ | oholder.stop(); | ||
+ | |||
+ | oholder.animate({'height':iholder.outerHeight()+"px"},{duration:400,queue:false}); | ||
+ | |||
+ | },(opt.speed+20)+(aoh*125)); | ||
+ | |||
+ | } else { | ||
+ | |||
+ | |||
+ | $('body').find('.nonclickbar').remove(); | ||
+ | // IF UNSLECTED ARE STILL VISIBLE, WE DONT NEED TO REMOVE THEM... | ||
+ | |||
+ | |||
+ | $('body').find('.all-group').each(function() { | ||
+ | |||
+ | var item=$(this); | ||
+ | item.stop(); | ||
+ | if (item.hasClass(selector.data('group'))) { | ||
+ | item.animate({'opacity':1},{duration:opt.speed,queue:false}); | ||
+ | } else { | ||
+ | |||
+ | var w=item.outerWidth(); | ||
+ | var h=item.outerHeight(); | ||
+ | |||
+ | |||
+ | |||
+ | var t=item.position().top; | ||
+ | var l=item.position().left; | ||
+ | |||
+ | |||
+ | // ADD THE OVERLAY ON THE A TAG BY HOVER | ||
+ | item.parent().append('<div class="nonclickbar" style="position:absolute;top:'+t+'px;left:'+l+'px;width:'+w+'px;height:'+h+'px;background:#000"></div>'); | ||
+ | |||
+ | item.parent().find('.nonclickbar').css({'opacity':0.0}).addClass(item.data('row')); | ||
+ | |||
+ | |||
+ | item.animate({'opacity':opt.nonSelectedAlpha/100},{duration:opt.speed,queue:false}); | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | }); | ||
+ | setTimeout(function() {buildRows(opt);},100); | ||
+ | } | ||
+ | return false; | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | |||
+ | var lodedimg=0; | ||
+ | bod.find('.all-group').waitForImages( | ||
+ | function() { | ||
+ | buildRows(opt); | ||
+ | if (opt.nonSelectedAlpha===0) { | ||
+ | // SET THE OUTTER AND INNER HEIGHT OF THE CONTAINER DIV | ||
+ | var oholder = bod.find('.portfoliooutterholder'); | ||
+ | var iholder = bod.find(opt.portfolioContainer); | ||
+ | oholder.css({'width':'100%','height':iholder.height()+"px"}); | ||
+ | if (!oholder.hasClass("row")) oholder.addClass("row"); | ||
+ | } | ||
+ | |||
+ | }, | ||
+ | |||
+ | function() { | ||
+ | lodedimg = lodedimg+1; | ||
+ | buildRows(opt); | ||
+ | |||
+ | } | ||
+ | |||
+ | ); | ||
+ | |||
+ | buildRows(opt,true); | ||
+ | $(window).resize(function() { | ||
+ | |||
+ | clearTimeout(opt.resized); | ||
+ | opt.resized=setTimeout(function() { | ||
+ | buildRows(opt,true); | ||
+ | },100); | ||
+ | |||
+ | }); | ||
+ | |||
+ | }) | ||
+ | } | ||
+ | }) | ||
+ | |||
+ | ////////////////////////////////////////////// | ||
+ | // BUILD THE ROWS ON RESCALING OR AT START // | ||
+ | //////////////////////////////////////////// | ||
+ | function buildRows(opt,no) { | ||
+ | |||
+ | |||
+ | var bod=$('body'); | ||
+ | |||
+ | // REMOVE ACTUAL ROWS (IF THERE IS ANY) | ||
+ | bod.find('.rowwrap').each(function(i) { | ||
+ | var item=$(this).find('.rowed:first'); | ||
+ | item.unwrap(); | ||
+ | |||
+ | }); | ||
+ | |||
+ | // REMOVE THE ROWED AND ROWx CLASSES | ||
+ | bod.find('.rowed').each(function(i) { | ||
+ | var item=$(this); | ||
+ | item.removeClass(item.data('row')); | ||
+ | item.removeClass('rowed'); | ||
+ | }); | ||
+ | |||
+ | var row=0; | ||
+ | |||
+ | // GO THROUGH, AND CHECK ALPHAS AND OMEGAS | ||
+ | bod.find('.all-group').each(function(i) { | ||
+ | var item=$(this); | ||
+ | item.addClass('row'+row); | ||
+ | item.addClass('rowed'); | ||
+ | item.data('row','row'+row); | ||
+ | if (item.hasClass('omega')) { | ||
+ | row++; | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // CREATE ROWS AROUND THE ITEMS | ||
+ | for (i=0;i<row;i++) { | ||
+ | bod.find('.row'+i).wrapAll('<div class="rowwrap" style="position:relative;height:0px;width:100%;"></div>'); | ||
+ | } | ||
+ | |||
+ | // SET HEIGHT OF EACH ROW HERE | ||
+ | |||
+ | bod.find('.killerclear').remove(); | ||
+ | var maxrowa = bod.find('.rowwrap').length; | ||
+ | |||
+ | bod.find('.rowwrap').each(function(j) { | ||
+ | var $this=$(this); | ||
+ | var max=0; | ||
+ | $this.find('.rowed').each(function(i) { | ||
+ | if ($(this).css('display')!="none") { | ||
+ | //console.log(j+". Row Element "+i+". height:"+$(this).outerHeight()); | ||
+ | if (max<$(this).height()) max=$(this).outerHeight(); | ||
+ | } | ||
+ | }); | ||
+ | //console.log(j+'. Row Berechnete:'+max); | ||
+ | $this.css({'height':(max)+"px"}); //max+"px"}); | ||
+ | //if (j<maxrowa-1) { | ||
+ | //console.log('Added Clear'); | ||
+ | $this.after('<div style="clear:both" class="killerclear"></div>'); | ||
+ | //} else { | ||
+ | // console.log('Last Row has no Clear !!'); | ||
+ | //} | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | var oholder = bod.find('.portfoliooutterholder'); | ||
+ | var iholder = bod.find(opt.portfolioContainer); | ||
+ | oholder.stop(); | ||
+ | oholder.animate({'height':iholder.outerHeight()+"px"},{duration:400,queue:false}); | ||
+ | |||
+ | }; | ||
+ | |||
+ | |||
+ | })(jQuery); | ||
+ | |||
+ | |||
+ | |||
+ | /* | ||
+ | * waitForImages 1.3.3 | ||
+ | * ----------------- | ||
+ | * Provides a callback when all images have loaded in your given selector. | ||
+ | * http://www.alexanderdickson.com/ | ||
+ | * | ||
+ | * | ||
+ | * Copyright (c) 2011 Alex Dickson | ||
+ | * Licensed under the MIT licenses. | ||
+ | * See website for more info. | ||
+ | * | ||
+ | */ | ||
+ | |||
+ | ;(function($) { | ||
+ | |||
+ | // CSS properties which contain references to images. | ||
+ | $.waitForImages = { | ||
+ | hasImageProperties: [ | ||
+ | 'backgroundImage', | ||
+ | 'listStyleImage', | ||
+ | 'borderImage', | ||
+ | 'borderCornerImage' | ||
+ | ] | ||
+ | }; | ||
+ | |||
+ | // Custom selector to find `img` elements that have a valid `src` attribute and have not already loaded. | ||
+ | $.expr[':'].uncached = function(obj) { | ||
+ | // Firefox will always return `true` even if the image has not been downloaded. | ||
+ | // Doing it this way works in Firefox. | ||
+ | var img = document.createElement('img'); | ||
+ | img.src = obj.src; | ||
+ | return $(obj).is('img[src!=""]') && ! img.complete; | ||
+ | }; | ||
+ | |||
+ | $.fn.waitForImages = function(finishedCallback, eachCallback, waitForAll) { | ||
+ | |||
+ | // Handle options object. | ||
+ | if ($.isPlainObject(arguments[0])) { | ||
+ | eachCallback = finishedCallback.each; | ||
+ | waitForAll = finishedCallback.waitForAll; | ||
+ | finishedCallback = finishedCallback.finished; | ||
+ | } | ||
+ | |||
+ | // Handle missing callbacks. | ||
+ | finishedCallback = finishedCallback || $.noop; | ||
+ | eachCallback = eachCallback || $.noop; | ||
+ | |||
+ | // Convert waitForAll to Boolean | ||
+ | waitForAll = !! waitForAll; | ||
+ | |||
+ | // Ensure callbacks are functions. | ||
+ | if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) { | ||
+ | throw new TypeError('An invalid callback was supplied.'); | ||
+ | }; | ||
+ | |||
+ | return this.each(function() { | ||
+ | // Build a list of all imgs, dependent on what images will be considered. | ||
+ | var obj = $(this), | ||
+ | allImgs = []; | ||
+ | |||
+ | if (waitForAll) { | ||
+ | // CSS properties which may contain an image. | ||
+ | var hasImgProperties = $.waitForImages.hasImageProperties || [], | ||
+ | matchUrl = /url\((['"]?)(.*?)\1\)/g; | ||
+ | |||
+ | // Get all elements, as any one of them could have a background image. | ||
+ | obj.find('*').each(function() { | ||
+ | var element = $(this); | ||
+ | |||
+ | // If an `img` element, add it. But keep iterating in case it has a background image too. | ||
+ | if (element.is('img:uncached')) { | ||
+ | allImgs.push({ | ||
+ | src: element.attr('src'), | ||
+ | element: element[0] | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | $.each(hasImgProperties, function(i, property) { | ||
+ | var propertyValue = element.css(property); | ||
+ | // If it doesn't contain this property, skip. | ||
+ | if ( ! propertyValue) { | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | // Get all url() of this element. | ||
+ | var match; | ||
+ | while (match = matchUrl.exec(propertyValue)) { | ||
+ | allImgs.push({ | ||
+ | src: match[2], | ||
+ | element: element[0] | ||
+ | }); | ||
+ | }; | ||
+ | }); | ||
+ | }); | ||
+ | } else { | ||
+ | // For images only, the task is simpler. | ||
+ | obj | ||
+ | .find('img:uncached') | ||
+ | .each(function() { | ||
+ | allImgs.push({ | ||
+ | src: this.src, | ||
+ | element: this | ||
+ | }); | ||
+ | }); | ||
+ | }; | ||
+ | |||
+ | var allImgsLength = allImgs.length, | ||
+ | allImgsLoaded = 0; | ||
+ | |||
+ | // If no images found, don't bother. | ||
+ | if (allImgsLength == 0) { | ||
+ | finishedCallback.call(obj[0]); | ||
+ | }; | ||
+ | |||
+ | $.each(allImgs, function(i, img) { | ||
+ | |||
+ | var image = new Image; | ||
+ | |||
+ | // Handle the image loading and error with the same callback. | ||
+ | $(image).bind('load error', function(event) { | ||
+ | allImgsLoaded++; | ||
+ | |||
+ | // If an error occurred with loading the image, set the third argument accordingly. | ||
+ | eachCallback.call(img.element, allImgsLoaded, allImgsLength, event.type == 'load'); | ||
+ | |||
+ | if (allImgsLoaded == allImgsLength) { | ||
+ | finishedCallback.call(obj[0]); | ||
+ | return false; | ||
+ | }; | ||
+ | |||
+ | }); | ||
+ | |||
+ | image.src = img.src; | ||
+ | }); | ||
+ | }); | ||
+ | }; | ||
+ | })(jQuery); | ||
+ | |||
+ | /* http://keith-wood.name/backgroundPos.html | ||
+ | Background position animation for jQuery v1.0.1. | ||
+ | Written by Keith Wood (kbwood{at}iinet.com.au) November 2010. | ||
+ | Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and | ||
+ | MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. | ||
+ | Please attribute the author if you use it. */ | ||
+ | (function($){var g='bgPos';$.fx.step['backgroundPosition']=$.fx.step['background-position']=function(a){if(!a.set){var b=$(a.elem);var c=b.data(g);b.css('backgroundPosition',c);a.start=parseBackgroundPosition(c);a.end=parseBackgroundPosition($.fn.jquery>='1.6'?a.end:a.options.curAnim['backgroundPosition']||a.options.curAnim['background-position']);for(var i=0;i<a.end.length;i++){if(a.end[i][0]){a.end[i][1]=a.start[i][1]+(a.end[i][0]=='-='?-1:+1)*a.end[i][1]}}a.set=true}$(a.elem).css('background-position',((a.pos*(a.end[0][1]-a.start[0][1])+a.start[0][1])+a.end[0][2])+' '+((a.pos*(a.end[1][1]-a.start[1][1])+a.start[1][1])+a.end[1][2]))};function parseBackgroundPosition(c){var d={center:'50%',left:'0%',right:'100%',top:'0%',bottom:'100%'};var e=c.split(/ /);var f=function(a){var b=(d[e[a]]||e[a]||'50%').match(/^([+-]=)?([+-]?\d+(\.\d*)?)(.*)$/);e[a]=[b[1],parseFloat(b[2]),b[4]||'px']};if(e.length==1&&$.inArray(e[0],['top','bottom'])>-1){e[1]=e[0];e[0]='50%'}f(0);f(1);return e}$.fn.animate=function(e){return function(a,b,c,d){if(a['backgroundPosition']||a['background-position']){this.data(g,this.css('backgroundPosition')||'center')}return e.apply(this,[a,b,c,d])}}($.fn.animate)})(jQuery);</script> | ||
</head> | </head> |
Revision as of 13:54, 15 October 2018
<!DOCTYPE html>
\
\
\
',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:' \
\
\
\
\
\
\
\
\
\
\
{content}
',custom_markup:'',social_tools:''},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal)
$.prettyPhoto.close();e.preventDefault();break;};};};});};$.prettyPhoto.initialize=function(){settings=pp_settings;if(settings.theme=='pp_default')settings.horizontal_padding=16;if(settings.ie6_fallback&&$.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));if(pp_images.length>30)settings.overlay_gallery=false;set_position=jQuery.inArray($(this).attr('href'),pp_images);rel_index=(isSet)?set_position:$("a[rel^='"+theRel+"']").index($(this));_build_overlay(this);if(settings.allow_resize)
$(window).bind('scroll.prettyphoto',function(){_center_overlay();});$.prettyPhoto.open();return false;}
$.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;_build_overlay(event.target);}
if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if(settings.deeplinking)
setHashtag();if(settings.social_tools){facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));$pp_pic_holder.find('.pp_social').html(facebook_like_link);}
if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());if(pp_descriptions[set_position]!=""){$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));}else{$pp_pic_holder.find('.pp_description').hide();}
movie_width=(parseFloat(getParam('width',pp_images[set_position])))?getParam('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(getParam('height',pp_images[set_position])))?getParam('height',pp_images[set_position]):settings.default_height.toString();percentBased=false;if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;}
if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}
$pp_pic_holder.fadeIn(function(){(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(' ');imgPreloader="";skipInjection=false;switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=getParam('v',pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split('youtu.be/');movie_id=movie_id[1];if(movie_id.indexOf('?')>0)
movie_id=movie_id.substr(0,movie_id.indexOf('?'));if(movie_id.indexOf('&')>0)
movie_id=movie_id.substr(0,movie_id.indexOf('&'));}
movie='#embed/'+movie_id;(getParam('rel',pp_images[set_position]))?movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='#video/'+match[2]+'?title=0&byline=0&portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'ajax':doresize=false;pp_dimensions=_fitToViewport(movie_width,movie_height);doresize=true;skipInjection=true;$.get(pp_images[set_position],function(responseHTML){toInject=settings.inline_markup.replace(/{content}/g,responseHTML);$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();});break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().append('').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader&&!skipInjection){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0)set_position=$(pp_images).size()-1;}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1)set_position=0;}else{set_position=direction;};rel_index=set_position;if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0;}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage;}else{currentGalleryPage=direction;};slide_speed=(direction=='next'||direction=='previous')?settings.animation_speed:0;slide_to=currentGalleryPage*(itemsPerPage*itemWidth);$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};}
$.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;}
$.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');$(this).remove();$(window).unbind('scroll.prettyphoto');clearHashtag();settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand').hide();}
if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);if((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight)){_fitToViewport(pp_containerWidth,pp_containerHeight)};};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+(settings.horizontal_padding*2),contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bajax=true\b/i)){return'ajax';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;if(contentHeight>windowHeight)
return;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"&&(settings.ie6_fallback&&!($.browser.msie&&parseInt($.browser.version)==6))){itemWidth=52+5;navWidth=(settings.theme=="facebook"||settings.theme=="pp_default")?50:30;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage