/************************************************************************************************/ //if (consolelogsttatus) console.log("******************************************************************************************"); //if (consolelogsttatus) console.log("******************************************************************************************"); /* -------------------------------------------------------------------------------------------------------------- Injections statauses -------------------------------------------------------------------------------------------------------------- | 0 - start | | 1 - JSlibrariesDone | | 2 - CSSs are injected | | 3 - asset request sent | | 4 - aseet respose received (got all good generated HTML) | | 5 - html injected | | 6 - all injection done | -------------------------------------------------------------------------------------------------------------- */ if (consolelogsttatus) console.log("Im coming from Phalcon now :) "); if (consolelogsttatus) console.log("***********************************Device orientation******************************************"); function setVideoList() { $("#setVideoInnerPlaylist").css("top", $(".tabContects").innerHeight() - 100 + "px"); //if (consolelogsttatus) console.log("attempt"); } /****************** switchin on/off javascript event log in the console *************************/ var consolelogsttatus = true; /***********************************************************************************************/ var height = $(window).height(); var width = $(window).width(); var r360loaded = false; var mouseStillDown = false; var imageListWidth = 0; var orientation = null; var Hover360 = true; //IS IE if (navigator.userAgent.indexOf("Trident")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1 ) { var isIE = true; }else var isIE = false; if (width > height) { //Landscape orientation = 2; //if (consolelogsttatus) console.log("LANDSCAPE"); } else { //Portrait orientation = 1; //if (consolelogsttatus) console.log("PORTRAIT"); } //if (consolelogsttatus) console.log("*************** bandwidth measurement ***************************************"); var DAY_IN_MS = 1; var d1 = new Date(); $.ajax({ url: "://rmp.kondor.co.uk/files/bandwidth/100kdummyfile.jpg", cache: false, success: function (response) { var d2 = new Date(); //if (consolelogsttatus) console.log("done"); //if (consolelogsttatus) console.log("dowload time : " + (d2 - d1) / DAY_IN_MS); var timediff = (d2 - d1) / DAY_IN_MS var speed = 100 / (timediff / 1000) * 8; if (speed > 0 && speed <= 350) { quailityType = 2; //if (consolelogsttatus) console.log(speed + " Bandwidth : GPRS/EDGE -> using quality compression down to 35%"); } if (speed > 350 && speed <= 800) { quailityType = 3; //if (consolelogsttatus) console.log(speed + " kb/s"); //if (consolelogsttatus) console.log(speed + " Bandwidth : G3 -> using quality compression down to 50%"); } if (speed > 800 && speed <= 3000) { quailityType = 4; //if (consolelogsttatus) console.log(speed + " kb/s"); //if (consolelogsttatus) console.log(speed + " Bandwidth : cheap home DSL / 4G -> using quality compression down to 60%"); } if (speed > 3000) { quailityType = 5; //if (consolelogsttatus) console.log(speed + " kb/s"); //if (consolelogsttatus) console.log(speed + " Bandwidth : a good internet lucky user -> using quality compression down to 75%"); } //if (consolelogsttatus) console.log("***********************************Checking jquery******************************************"); var loadingStatus = 0; if (typeof jQuery === 'undefined') { } //if (consolelogsttatus) console.log("***********************************START loading******************************************"); //if (consolelogsttatus) console.log("OK Jquery is fine"); //if (consolelogsttatus) console.log("***********************************START loading******************************************"); var jsCounter = 0; jQuery.noConflict(); var bypassCashing = Math.round(Math.random()*1000000); console.log("random : "+bypassCashing); if (quailityType > 2) { var jsLibraries = new Array( ////////////////////////////////////////////////////////////////////////////////////////// // // Comment : loading in esential JS libraries such as Jquery // "://rmp.kondor.co.uk/js/rmp/config/config.js", "://rmp.kondor.co.uk/js/rmp/libraries/jquery.js", "://rmp.kondor.co.uk/js/rmp/libraries/migeateJqueryto19.js", "://rmp.kondor.co.uk/js/rmp/libraries/jquery-ui.min.js", /*"://rmp.kondor.co.uk/js/rmp/libraries/jquery.mobile-1.4.5.min.js",*/ "://rmp.kondor.co.uk/js/rmp/libraries/jquery.mobile.vmouse.js", /************************************** RMP ***************************************/ "://rmp.kondor.co.uk/js/rmp/expo360/Expo360.js?Nocache="+bypassCashing, /************************************** Video ***************************************/ /************************************** GALLERY ***************************************/ "://rmp.kondor.co.uk/js/rmp/gallery/jquery.magnify.js" ); } else { var jsLibraries = new Array( /************************************** general libraries ***************************************/ "://rmp.kondor.co.uk/js/rmp/libraries/jquery.js", "://rmp.kondor.co.uk/js/rmp/libraries/migeateJqueryto19.js", "://rmp.kondor.co.uk/js/rmp/libraries/jquery.mobile-1.4.5.min.js", "://rmp.kondor.co.uk/js/rmp/libraries/jquery.mobile.vmouse.js", "://rmp.kondor.co.uk/js/rmp/libraries/jquery.mousewheel.min.js" ); } /************************************************************************************************/ /************* including 3rd party contects as Jquery and other JS libraries ********************/ function loadLibrary() { jQuery.ajaxSetup({ cache: true }); library = jsLibraries[jsCounter]; jQuery.getScript(library, function (data, textStatus, jqxhr) { //if (consolelogsttatus) console.log(library + " *** " + textStatus + " *** " + jqxhr.status); // Data returned jsCounter++; if (jsCounter < jsLibraries.length) { loadLibrary(); } else { //if (consolelogsttatus) console.log("JS libraries are ready to use"); //if (consolelogsttatus) console.log("*********************************Loading CSS******************************************"); loadCss(); } }); } /* function onlyloadThisLibrary() { library = jsLibraries[jsCounter]; $.getScript(library, function (data, textStatus, jqxhr) { //if (consolelogsttatus) console.log(library + " *** " + textStatus + " *** " + jqxhr.status); // Data returned jsCounter++; if (jsCounter < jsLibraries.length) { loadLibrary(); } else { //if (consolelogsttatus) console.log("JS libraries are ready to use"); } }); }*/ loadLibrary(); /****************************************CSS LOADER *********************************************/ /************************************************************************************************/ var cssCounter = 0; var cssFiles = new Array( "://rmp.kondor.co.uk/css/rmp/combined.css" /* // basic css for the rmp framework layout "://rmp.kondor.co.uk/css/rmp/RMPFramework.css" // css for the rmp video player - attempt 1. , "://rmp.kondor.co.uk/css/rmp/RMPVideoPlayer.css" // css for the rmp image gallery- attempt 1. , "://rmp.kondor.co.uk/css/rmp/RMPGallery.css" // css for the rmp details page - attempt 1. , "://rmp.kondor.co.uk/css/rmp/RMPDetailsPage.css" // css for the rmp hotspots - attempt 1. , "://rmp.kondor.co.uk/css/rmp/hotspots.css" //css for zooom , "://rmp.kondor.co.uk/css/rmp/magnify.css" */ // css for 360 Expo rotator //,"://rmp.kondor.co.uk/css/rmp/main.css" // css for 360 Expo rotators fancy font - not using - acctualy not sure what it is for //,"://rich-media-player.timico.dev/css/fonts.css" // Google Fonts Muli // , "://fonts.googleapis.com/css?family=Muli" ); /********************** pulling in a the custom channel css if it's set *******************/ if (typeof customCSS != 'undefined' ){ if (customCSS!=""){ //console.log("custom css is available and has been added to the css queue") cssFiles.push(customCSS); }else{ //console.log("custom css is NOT available and the default css goning to be used"); cssFiles.push("://rmp.kondor.co.uk/css/rmp/channelDefault.css"); } }else{ //console.log("custom css is NOT available and the default css goning to be used"); cssFiles.push("://rmp.kondor.co.uk/css/rmp/channelDefault.css"); } /**********************************************************************************************/ /**********************************************************************************************/ function makeid() { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var i = 0; i < 10; i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } /**********************************************************************************************/ /**********************************************************************************************/ function loadCss() { cssContent = cssFiles[cssCounter]; var cssLink = $(""); $("head").append(cssLink); //if (consolelogsttatus) console.log(cssContent + " *** StyleSheet has been loaded"); cssCounter++; if (cssCounter < cssFiles.length) { loadCss(); } else { loadAssets(); } } /************************************************************************************************/ /************************************************************************************************/ function loadAssets(args) { //if (consolelogsttatus) console.log("CSS files are ready to use"); //if (consolelogsttatus) console.log("******************************************************************************************"); var uniquRequstCode = makeid(); /* var avilableWitdh = $("#RMPContentDiv").innerWidth(); if ( (orientation==1 && avilableWitdh>0 && avilableWitdh<=280) || (orientation==2 && avilableWitdh>0 && avilableWitdh<=500) ) { // the image with what we need it 500px sizeTypeId = 1; }else{ // the image with what we need it 880px sizeTypeId = 2; } */ // bandWith 3G - means image quailty is going to be half of the original image quality //var quailityType = 4; //if (consolelogsttatus) console.log("Asset request was sent setting ( size : " + $("#RMPContentDiv").innerWidth() + ", quality : " + quailityType + ")"); //if (consolelogsttatus) console.log("Directory rmp.kondor.co.uk"); if (typeof requestMode == 'undefined') { requestMode = "production" } rmpHTMLContentCreatorURL = "://rmp.kondor.co.uk/asset/index/" + channelCode+"/"+ productCode + "/" + uniquRequstCode + "/" + orientation + "/" + $("#RMPContentDiv").innerWidth() + "/" + quailityType +"/" +requestMode; $.ajax({ url: rmpHTMLContentCreatorURL, //dataType: "script", cache: false, success: function (response) { /************************************************************************************************/ /******************************* HTML injector **************************************************/ $("#RMPContentDiv").animate({opacity: 0}, 250, function () { //if (consolelogsttatus) console.log(response); $("#RMPContentDiv").hide(); $("#RMPContentDiv").html(response); $("#RMPContentDiv").show(); $("#RMPContentDiv").css("opacity", "0"); $("#RMPContentDiv").animate({opacity: 1}, 100,function(){ $(".ui-loader").remove(); /* document.getElementById("zoomable").addEventListener("DOMAttrModified", function (ev) { //console.log("image changed"); }, false)*/ /******* GOOGLE ANALYTICS EVENTS *******/ /************ RMP Channel specific **************/ if (typeof channelGACode != 'undefined' && channelGACode!="" ){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga2'); ga2('create', channelGACode, 'none'); ga2('send', 'event', 'button', 'click', 'RMP opening tab for - ' + productCode ); $('#explore-tab').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP explore-tab for - ' + productCode ); }); $('#gallery-tab').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP gallery-tab for - ' + productCode); }); $('#video-tab').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP video-tab for - ' + productCode); }); $('#details-tab').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP details-tab for - ' + productCode); }); $('#facebook-share').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP facebook-share for - ' + productCode); }); $('#twitter-share').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP twitter-share for - ' + productCode); }); $('#google-share').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP google-share for - ' + productCode); }); $('#pintrest-share').on('click', function() { ga2('send', 'event', 'button', 'click', 'RMP pintrest-share for - ' + productCode); }); } /************ RMP General tracking **************/ ga('send', 'event', 'button', 'click', 'RMP opening tab for - ' + productCode ); $('#explore-tab').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP explore-tab for - ' + productCode ); }); $('#gallery-tab').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP gallery-tab for - ' + productCode); }); $('#video-tab').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP video-tab for - ' + productCode); }); $('#details-tab').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP details-tab for - ' + productCode); }); $('#facebook-share').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP facebook-share for - ' + productCode); }); $('#twitter-share').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP twitter-share for - ' + productCode); }); $('#google-share').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP google-share for - ' + productCode); }); $('#pintrest-share').on('click', function() { ga('send', 'event', 'button', 'click', 'RMP pintrest-share for - ' + productCode); }); /***************************************/ /***************************************/ /***************************************/ var isthismobile = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i); $("#view").css("height",$(".tabContects").innerHeight()-38+"px"); $(".galleryItems").bind("click", function (e) { /********************************************************************************************************/ /**********************************************************************************************************/ /************************************ Gallery Zoom **********************************************/ console.log($(this).attr("src")); $("#zoomable").attr("src",$(this).attr("src")); $(".magnify-lens").remove(); if (isthismobile==null){ if ($(this).attr("zoomable")=="1"){ $("#zoomable").attr("data-magnify-src",$(this).attr("data-magnify-src")); $('#zoomable').magnify(); } else{ $("#zoomable").attr("data-zoom-image",""); $(".magnify-lens").remove(); } }else{ $(".magnify-lens").remove(); } imagereposition(); }); /*****************tab windows handling************************/ $(".tab").click(function () { r360loaded = 1; //if (consolelogsttatus) console.log(r360loaded); if (r360loaded) { /********************************************************************************************************/ /**********************************************************************************************************/ /************************************ Gallery Zoom **********************************************/ //if (consolelogsttatus) console.log("click event"); $("#galeryItemsWrapperCenter").children().first().click(); //if (consolelogsttatus) console.log($(this).attr("tabindex")); $(".tab").removeClass("active"); $(".tab[tabindex=" + $(this).attr("tabindex") + "]").addClass("active"); $(".tabContent").hide(); $(".tabContent[tabindex=" + $(this).attr("tabindex") + "]").css("opacity", "0"); $(".tabContent[tabindex=" + $(this).attr("tabindex") + "]").show(); $(".tabContent[tabindex=" + $(this).attr("tabindex") + "]").animate({opacity: 1}, 600); setVideoList(); var myVar = null; var mouseState = 0; /*****************************************/ $(".videoChange").click(function(){ //if (consolelogsttatus) console.log($(this).attr("path")); //if (consolelogsttatus) console.log($(this).attr("filename")); //if (consolelogsttatus) console.log($(this).attr("index")); $("#video1").attr("videoIndex") $("#video1").attr("videoindex",$(this).attr("key")); setVideo($(this).attr("path"),$(this).attr("filename"),$(this).attr("index"),$(this).attr("src")); }); $(".tabContent").hover(function () { $("#setVideoInnerPlaylistLayer").animate({ opacity: 1 }, 600); mouseState = 1; //if (consolelogsttatus) console.log("in" + mouseState); myVar = setTimeout(function () { if (mouseState == 1) { $("#setVideoInnerPlaylistLayer").animate({ opacity: 0 }, 600); //if (consolelogsttatus) console.log("timeout" + mouseState); } }, 5000); }, function () { mouseState = 0; $("#setVideoInnerPlaylistLayer").animate({ opacity: 0 }, 200, function () { $("#setVideoInnerPlaylistLayer").clearQueue(); //if (consolelogsttatus) console.log("clearQueue"); }); //if (consolelogsttatus) console.log("out" + mouseState); clearTimeout(myVar); }); ////////////////////////////////////////////////////////////////////////////////////////// // // Comment : Pause Video - if playing when change tag and it s not the video one // if($(this).attr("tabindex")!="2"){ $('#video1').trigger("pause"); } ////////////////////////////////////////////////////////////////////////////////////////// // // Comment : Switching of/on 360 rotator when change tab // if($(this).attr("tabindex")=="0"){ Hover360 = true; expo.updateImage(); }else{ Hover360 = false; } //console.log("changed tab"+$(this).attr("tabindex")); if($(this).attr("tabindex")=="1"){ if ($(".galleryItems[imageindex=0]").length == 1 ){ if ($(".galleryItems[imageindex=0]").attr("zoomable")=="1"){ /* var ez = $('#zoomable').data('elevateZoom'); ez.changeState("enable");*/ $(".galleryItems[imageindex=0]").click(); }} recalculateImageSliderWidth(); $(".zoomContainer").show(); //if (consolelogsttatus) console.log("zoomContainer has set to be visible"); }else{ //console.log("close all"); $(".zoomContainer").hide(); //if (consolelogsttatus) console.log("zoomContainer has set hidden"); } } recalculateHeight(); }); $(window).focus(function() { Hover360 = true; expo.updateImage(); }); $(window).blur(function() { Hover360 = false; $(".magnify-lens").hide(); }); if (!isIE) { $("body:not(#zoomable)").mouseover(function(){ $(".magnify-lens").hide(); }); } recalculateImageSliderWidth(); recalculateHeight(); function recalculateImageSliderWidth(){ //if (consolelogsttatus) console.log("zoom stuff done"); if ($("#zoomable").attr("zoomable")=="0"){ /* $(".zoomLens").css("background-image",""); $(".zoomLens").css("border","none");*/ //if (consolelogsttatus) console.log("removed zooming"); $(".magnify-lens").remove(); }else{ //console.log("BROWSER : "+isthismobile); if (isthismobile==null){ $('#zoomable').magnify(); }else{ $(".magnify-lens").remove(); } } $("#goLeft,#goRight").mouseup(function(event) { mouseStillDown = false; //if (consolelogsttatus) console.log(" ************************** mouseUp *******************************"); }); imageListWidth = 0; //if (consolelogsttatus) console.log("function was called"); $("#galeryItemsWrapperCenter>ul>li").each(function(i,value){ imageListWidth+=$(value).innerWidth(); }); //if (consolelogsttatus) console.log("imageListWidth:"+imageListWidth); /* if (imageListWidth>$("#sliderArea").innerWidth()) $("#goLeft,#goRight").show(); else $("#goLeft,#goRight").hide(); */ } /***************************** gallery slider functions **********************************************/ /***************************** gallery slider functions **********************************************/ /***************************** gallery slider functions **********************************************/ function slideRight(){ mouseStillDown = true; //if (consolelogsttatus) console.log("slide Right"); var sliderArea = $("#sliderArea").innerWidth(); var extra = imageListWidth-sliderArea; recalculateImageSliderWidth(); //if (consolelogsttatus) console.log($("#galeryItemsWrapperCenter>ul>li:first").css("left") + " / "+ extra ); if (!$("#galeryItemsWrapperCenter>ul>li:first").is(':animated')){ if (parseInt($("#galeryItemsWrapperCenter>ul>li:first").css("left"))>(extra*(-1)) ){ $("#galeryItemsWrapperCenter>ul>li").animate({ left: "-=100", }, 600, function() { keepSlidingRight(); }); }else{ //if (consolelogsttatus) console.log("it hit the limit"); } } } function keepSlidingRight(){ if (mouseStillDown){ slideRight(); }else{ return false; } } function slideLeft(){ mouseStillDown = true; //if (consolelogsttatus) console.log("slide Left"); if (!$("#galeryItemsWrapperCenter>ul>li:first").is(':animated')){ recalculateImageSliderWidth(); //if (consolelogsttatus) console.log(parseInt($("#galeryItemsWrapperCenter>ul>li:first").css("left"))); if (parseInt($("#galeryItemsWrapperCenter>ul>li:first").css("left"))<0 ){ $("#galeryItemsWrapperCenter>ul>li").animate({ left: "+=100", }, 600, function() { keepSlidingLeft(); }); }else{ //if (consolelogsttatus) console.log("it hit the limit"); } } } function keepSlidingLeft(){ if (mouseStillDown){ slideLeft(); }else{ return false; } } $("#goRight").mousedown(function(){ slideRight(); }); $("#goLeft").mousedown(function(){ slideLeft(); }); /********************************************************************************************************/ /********************************************************************************************************/ /******************************** switching ON tabs *****************************************************/ if (quailityType > 2) { var expo = new Expo360({ xml: "://rmp.kondor.co.uk/assets/xml/360RotatorRequest" + uniquRequstCode + ".xml", where: "#viewer" }); window.expo = expo; //expo.goTo(50); if (firstGoFrameDegree!=0){ expo.goTo( Math.round(firstGoFrameDegree/76 *360 )); } $("#viewer>div>div").first().css("min-height", "150px"); } $(window).resize(function(){ recalculateHeight(); //console.log("resize"); $("#view").css("height",$(".tabContects").innerHeight()-38+"px"); }); function recalculateHeight(){ recalculateImageSliderWidth(); var tabcontentWidth = Math.round($("#tabContects").innerWidth()*0.68); //if (expo!=undefined) expo.updateThisHotspots(); $("#details-page").css("height",$("#tabContects").innerHeight()); //$("#details-page").css("height",Math.round($("#tabContects").innerHeight()*0.95)+"px"); if ($("#imagesHolder").innerWidth()<478){ $("#hotspotButton0").css("opacity",0); if (expo!=undefined) expo.closeLastHotspot(); }else{ $("#hotspotButton0").css("opacity",1) } var isthismobile = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i); var WindowWidth = $(window).width(); if (WindowWidth<700 && isthismobile!=null ){ ///////////////////////////////////////////////////////////////////////// // // Handling Mobile version // if ($("#zoomableWrapper>div").length==3){ $("#zoomableWrapper>div:nth(0)").css("width","11%") $("#zoomableWrapper>div:nth(2)").css("width","11%") $("#zoomableWrapper>div:nth(1)").css("width","76%") } //console.log("below mobile"); $("#galeryItemsWrapper").hide(); var tabcontentWidth = Math.round($("#tabContects").innerWidth()*0.68); //$("#zoomableWrapper").css("height",tabcontentWidth+"px"); $(".VideoPlaylist").css("height",(tabcontentWidth*0.19)+"px"); $("#VideoPlaylist>img").css("height",(tabcontentWidth*0.19)+"px"); $("#setVideoInnerPlaylistLayer1").css("height",(tabcontentWidth*0.19)+"px"); $("#goLeftMobile").css("margin-top",(tabcontentWidth/2-17)+"px"); $("#goRightMobile").css("margin-top",(tabcontentWidth/2-17)+"px"); $("#goLeftMobile").show(); $("#goRightMobile").show(); if ($(".tabSection").innerHeight()==0) { //console.log("no tabs"); $("#tabContects").css("height","unset"); }else { //console.log("there are tabs"); $("#tabContects").css("height",tabcontentWidth+"px"); } $("#tabContects").css("margin","1em 0"); $("#zoomableWrapper").css("height",(tabcontentWidth*0.75)+"px"); /* if ($('#zoomable').length==1){ var ez = $('#zoomable').data('elevateZoom'); ez.changeState("disable"); }*/ //console.log("here we go"); $(".zoomContainer").hide(); //if (consolelogsttatus) console.log("mobile mode on"); }else{ //console.log("above mobile"); if ($("#zoomableWrapper>div").length==3){ $("#zoomableWrapper>div:nth(0)").css("width","0") $("#zoomableWrapper>div:nth(2)").css("width","0") $("#zoomableWrapper>div:nth(1)").css("width","98%") } var tabcontentWidth = Math.round($("#tabContects").innerWidth()*0.68); //if (consolelogsttatus) console.log("mobile mode off"); console.log("tab.active"+($(".tab.active").attr("tabindex"))); if ($(".tab.active").attr("tabindex")==1) $(".zoomContainer").show(); $("#setVideoInnerPlaylistLayer1").css("height",(tabcontentWidth*0.19)+"px"); if ($(".galleryItems").length>3) $("#galeryItemsWrapper").show(); $("#goLeftMobile").parent().css("height","10px"); $("#goRightMobile").parent().css("height","10px"); $("#goLeftMobile").hide(); $("#goRightMobile").hide(); $("#VideoPlaylist>img").css("height",(tabcontentWidth*0.19)+"px"); $("#tabContects").css("height",tabcontentWidth+"px"); //$("#zoomableWrapper").css("height",(tabcontentWidth*0.8)+"px"); /********************************************************/ //$("#zoomable").css("max-height","390px"); //$("#zoomable").css("max-height",(tabcontentWidth*0.75)+"px"); $("#zoomable").css("max-height", $("#tabContects").innerHeight() +"px"); if ($(".galleryItems").length>1) $("#zoomable").css("height",(tabcontentWidth*0.75)+"px"); $(".galleryItems").css("height",(tabcontentWidth*0.2)+"px"); //$("#details-page").css("height",(tabcontentWidth*0.95)+"px"); $("#details-page").css("height",$("#tabContects").innerHeight()); $("#galleryItems>img").css("height",(tabcontentWidth*0.19)+"px"); $("#goLeft").css("margin-top",(tabcontentWidth*0.19/2-17)+"px"); $("#goRight").css("margin-top",(tabcontentWidth*0.19/2-17)+"px"); } imagereposition(); } $( ".tabContent[tabindex=1]" ).on( "swipeleft", function(){ $("#goRightMobile").click() } ); $(".tabContent[tabindex=1]" ).on( "swiperight", function(){ $("#goLeftMobile").click() } ); $("#goLeftMobile").click(function(){ if ($(this).css("opacity")!="1") { return false; } var currentImage = $("#zoomable").attr("actualImage"); var nextImageIndex = currentImage/1-1; //if (consolelogsttatus) console.log(currentImage+" - "+nextImageIndex); if ( $(".galleryItems[imageIndex="+nextImageIndex+"]").length!=0){ //if (consolelogsttatus) console.log($(".galleryItems[imageIndex="+nextImageIndex+"]").length); $("#zoomable").attr("src",$(".galleryItems[imageIndex="+nextImageIndex+"]").attr("src")); $("#zoomable").attr("data-magnify-src",$(".galleryItems[imageIndex="+nextImageIndex+"]").attr("data-magnify-src")); $("#zoomable").attr("actualImage",nextImageIndex); ////////////////////// if ($(".galleryItems[imageIndex="+1+"]").attr("zoomable")=="0"){ $(".magnify-lens").remove(); }else{ if (isthismobile==null){ $('#zoomable').magnify(); }else{ $(".magnify-lens").remove(); } } ////////////////////// var nextImageIndexLeft = nextImageIndex/1-1; if ( $(".galleryItems[imageIndex="+nextImageIndexLeft+"]").length==0){ $("#goLeftMobile").css("opacity","0.2"); } else $("#goLeftMobile").css("opacity","1"); var nextImageIndexRight = nextImageIndex/1+1; if ( $(".galleryItems[imageIndex="+nextImageIndexRight+"]").length==0){ $("#goRightMobile").css("opacity","0.2"); } else $("#goRightMobile").css("opacity","1"); }else{ //change image to not active } getRealheight() }); $("#goRightMobile").click(function(){ if ($(this).css("opacity")!="1") { return false; } var currentImage = $("#zoomable").attr("actualImage"); var nextImageIndex = currentImage/1+1; //if (consolelogsttatus) console.log(currentImage+" - "+nextImageIndex); if ( $(".galleryItems[imageIndex="+nextImageIndex+"]").length!=0){ //if (consolelogsttatus) console.log($(".galleryItems[imageIndex="+nextImageIndex+"]").length); $("#zoomable").attr("src",$(".galleryItems[imageIndex="+nextImageIndex+"]").attr("src")); $("#zoomable").attr("data-magnify-src",$(".galleryItems[imageIndex="+nextImageIndex+"]").attr("data-magnify-src")); $("#zoomable").attr("actualImage",nextImageIndex); ////////////////////// if ($(".galleryItems[imageIndex="+1+"]").attr("zoomable")=="0"){ $(".magnify-lens").remove(); }else{ if (isthismobile==null){ $('#zoomable').magnify(); }else{ $(".magnify-lens").remove(); } } ////////////////////// var nextImageIndexLeft = nextImageIndex/1-1; if ( $(".galleryItems[imageIndex="+nextImageIndexLeft+"]").length==0){ $("#goLeftMobile").css("opacity","0.2"); } else $("#goLeftMobile").css("opacity","1"); var nextImageIndexRight = nextImageIndex/1+1; if ( $(".galleryItems[imageIndex="+nextImageIndexRight+"]").length==0){ $("#goRightMobile").css("opacity","0.2"); } else $("#goRightMobile").css("opacity","1"); }else{ //change image to not active } getRealheight() }); /********************************************************************************************************/ /********************************************************************************************************/ /****************************************Positioning the video playlist**********************************/ $(window).resize(function () { $("#setVideoInnerPlaylist").css("top", $(".tabContects").innerHeight() - 80 + "px") $("#setVideoInnerPlaylist").css("top", $(".tabContects").innerHeight() - 80 + "px") }); /*********************************************************************************************/ /*********************************************************************************************/ /********************************* Clickable Menu ****************************************/ $('#menu_social_share').click(function (e) { $(".slideMenus").slideUp(200); $("#menu-items").slideToggle(200); }); $('#menu_tabs').click(function () { $(".slideMenus").slideUp(200); $("#social-links").slideToggle(200); }); $(".click-nav").hover(function(){ }, function(){ $(".slideMenus").slideUp(200); //if (consolelogsttatus) console.log("left the menu "); }) }); }); } }); } } }); function setVideo(filePath,fileName,index,poster){ //if (consolelogsttatus) console.log("index:"+index); //if (consolelogsttatus) console.log(poster); $("#video1").attr("index",index); $('#video1').attr('src','://'+filePath+'/assets/videos/'+fileName); $('#video1').attr('poster',poster); $('#video1').load(); } function getRealheight(){ if (($(".tabSection>div").length != 0 && $(".active#gallery-tab").length == 1 ) || ($(".tabSection>div").length == 0 && $(".galleryItems").length!=0 )) { var thisImageHeight = $("#zoomable").innerHeight(); //console.log(thisImageHeight); if (thisImageHeight!="0") { //console.log("skip adjustion"); var tabcontentWidth = Math.round($("#tabContects").innerWidth()*0.68); var thisImageHeight = $("#zoomable").innerHeight(); //$("#zoomable").css("padding-top",Math.round(((tabcontentWidth-thisImageHeight)/2))+"px"); // $(".magnify-lens").css("margin-top",Math.round(((tabcontentWidth-thisImageHeight)/2))+"px"); }else{ //console.log("has not been set to middle"); } }else{ //console.log("skip adjustion"); var tabcontentWidth = Math.round($("#tabContects").innerWidth()*0.68); var thisImageHeight = $("#zoomable").innerHeight(); //$("#zoomable").css("padding-top",Math.round(((tabcontentWidth-thisImageHeight)/2))+"px"); //$(".magnify-lens").css("margin-top",Math.round(((tabcontentWidth-thisImageHeight)/2))+"px"); } } function imagereposition(){ var isthismobile = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i); //console.log(navigator.userAgent); //alert("image resize"); //alert($("#zoomable").attr("src")) //alert("1"); var tabcontentWidth = Math.round($("#tabContects").innerWidth()*0.68); if ($("#zoomable").length==0) { //alert("image is not there yet"); } else{ if ($(".galleryItems").length>1) { /* if ($("#tabContects").innerWidth()<400) var maxheight = tabcontentWidth+"px" else var maxheight = (tabcontentWidth*0.75)+"px";*/ var maxheight = $("#tabContects").innerHeight() }else{ //var maxheight = "450px"; var maxheight = $("#tabContects").innerHeight() } $("#zoomable").animate({ "padding-top": "0px", "max-width": $("#zoomableWrapper>div:nth-child(2)").innerWidth()+"px", "max-height": maxheight },0,function(){ getRealheight() }) } } (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', "UA-64826342-1", 'none'); //ga('send', 'pageview');