Current Path : /var/test/www/foundation/wp-content/plugins/CuteSlider/js/ |
Current File : /var/test/www/foundation/wp-content/plugins/CuteSlider/js/cute.gallery.plugin.js |
Cute.CuteGallery=function(){this.element=document.createElement("div");this.element.className="br-cutegallery";this.fs_btn=document.createElement("div");this.fs_btn.className="br-fullscreen-btn";this.slider_wrapper=document.createElement("div");this.slider_wrapper.className="br-gallery-wrapper";this.top_cont=document.createElement("div");this.top_cont.className="br-top";this.bot_cont=document.createElement("div");this.bot_cont.className="br-bottom";this.play_btn=document.createElement("div");this.play_btn.className="br-play-btn"};Cute.CuteGallery.prototype={constructor:Cute.CuteGallery,setup:function(e){this.slider=e;var t=e.element.parentElement;var n=document.createElement("div");t.removeChild(e.element);t.appendChild(this.element);this.slider_wrapper.appendChild(e.element);this.thumbList=new Cute.ThumbList(e.slideManager);this.thumbList.config.type="horizontal";this.thumbList.setup(n);this.thumbList.list.type="horizontal";this.next=new Cute.Next(e.slideManager);this.next.setup(n);this.prev=new Cute.Previous(e.slideManager);this.prev.setup(n);this.bot_cont.appendChild(this.play_btn);this.bot_cont.appendChild(this.thumbList.domElement);if(!Cute.FallBack.isIE7&&!Cute.FallBack.isIE8)this.element.appendChild(this.fs_btn);this.top_cont.appendChild(this.slider_wrapper);this.top_cont.appendChild(this.next.domElement);this.top_cont.appendChild(this.prev.domElement);this.element.appendChild(this.top_cont);this.element.appendChild(this.bot_cont);var r=this.element;var i=false;var s=this;var o=function(){i=true;if(r.mozRequestFullScreen)r.mozRequestFullScreen();else if(r.webkitRequestFullScreen)r.webkitRequestFullScreen();else{s.element.style.position="fixed";s.element.style.left="0";s.element.style.top="0";s.element.style.height=window.innerHeight+"px"}e.__setSize();e.slideManager.resize();s.bot_cont.className+=" fullscreen";s.slider_wrapper.className+=" fullscreen";s.fs_btn.className+=" fullscreen";s.__onresize();window.addResizeListener(s.__onresize,s)};var u=function(){i=false;if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{s.element.style.position="";s.element.style.height="";s.element.style.left="";s.element.style.top=""}e.__setSize();e.slideManager.resize();s.element.style.height="auto";s.bot_cont.className="br-bottom";s.slider_wrapper.className="br-gallery-wrapper";s.fs_btn.className="br-fullscreen-btn";e.element.style.top="";window.removeResizeListener(s.__onresize,s)};var a=function(){if(!i)o();else u()};this.__onresize=function(){if(i){e.element.style.top=(window.innerHeight-s.bot_cont.offsetHeight-parseInt(e.element.style.height))/2+"px";s.element.style.height=window.innerHeight+"px"}};this.fs_btn.onclick=a;if(r.mozRequestFullScreen||r.webkitRequestFullScreen){document.addEventListener("mozfullscreenchange",function(){if(!document.mozFullScreen&&i)u()},false);document.addEventListener("webkitfullscreenchange",function(){if(!document.webkitIsFullScreen&&i)u()},false)}e.wrapper=this.slider_wrapper;e.__setSize();e.slideManager.resize();if(!Cute.AbstractControl.paused)this.play_btn.className+=" br-pause-btn";this.play_btn.onclick=function(){if(Cute.AbstractControl.paused){s.slider.play();this.className="br-play-btn"}else{s.slider.pause();this.className+=" br-pause-btn"}}}}