jQuery(function($) { let shop_id = 615; var modTablicaActive = {"facebook":{"url":"https:\/\/www.facebook.com\/efloorPL","hover":"Nasz Facebook"},"instagram":{"url":"https:\/\/www.instagram.com\/efloorpl\/?hl=pl","hover":"Nasz Instagram"},"youtube":{"url":"https:\/\/www.youtube.com\/channel\/UC2hfREWPaF98j42vr2ZOHQw?view_as=subscriber","hover":"Nasz Kana\u0142 "},"pinterest":{"url":"https:\/\/pl.pinterest.com\/efloorPL\/_created\/","hover":"Nasze Piny"}}; var distanceTop = "200"; var distanceTopMobile = "100"; var app_active = "1"; var app_activeOnMobile = "0"; var modFbWidget = "0"; var isMobile = 0; var modDataHref = ""; var modFbWidgetWidth = "300"; var modFbWidgetHeight = "400"; var modUseSmallHeader = "0"; var execHideCover = "0"; var execshowFriends = "0"; var execTabs = "timeline, messages"; var modPosition = "prawo"; //console.log(isMobile+' - '+app_activeOnMobile); if (app_active != 0) { if (isMobile == 1) { if (app_activeOnMobile == 1) { app_active = 1; } else { app_active = 0; } } } if (app_active == 1) { $.each(modTablicaActive, function(index, value) { //console.log( index + ": " + value ); let cur_src = 'https://maxtest.cube-shops.com/appSocialMedia/gfx/'+index+'.png'; if(index == 'instagram' && shop_id==839) { cur_src = 'https://maxtest.cube-shops.com/appSocialMedia/gfx/'+index+'1.png'; index = 'instagram1'; } $('').attr( { src:cur_src, width: '42px' }).appendTo($('').html(''+value['hover']+'').attr( { href: value['url'], target: '_blank', class: 'modSocMedImg mosSoc'+index }).appendTo($('body'))); if (value['hover'] != 0) { $('.mosSoc'+index).addClass('hoverMod'); } }); $('.modSocMedImg').wrapAll('
'); var modFbWidgetLeft = modFbWidgetWidth-330; if (modPosition == 'lewo') { $('.modSocMedFix').addClass('modLe'); } else { $('.modSocMedFix').addClass('modPr'); $('.modSocMedImg').each(function() { $(this).find('span').detach().insertAfter($(this).find('img')); }); } if (isMobile != 1) { if (modFbWidget != 0) { //fb widget $('
').attr( { 'data-href': modDataHref, 'data-tabs': execTabs, 'data-small-header': modUseSmallHeader, 'data-adapt-container-width': 1, 'data-hide-cover': execHideCover, 'data-show-facepile': execshowFriends, 'data-width': modFbWidgetWidth, 'data-height': modFbWidgetHeight }).appendTo('body'); (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/pl_PL/sdk.js#xfbml=1&version=v2.10"; fjs.parentNode.insertBefore(js, fjs); } (document, 'script', 'facebook-jssdk')); $('.fb-page').detach().appendTo('.mosSocfacebook'); $('.mosSocfacebook').addClass('modFBWidget'); $('.modFBWidget').removeClass('hoverMod'); //fb widget - koniec if (modPosition == 'lewo') { $('.modFBWidget').css ({ 'background': 'none', 'height': '42px', 'z-index': '0', 'width': modFbWidgetWidth, 'left': -modFbWidgetLeft+'px' }); $('.modFBWidget').hover(function() { $(this).css( { 'left': '330px' }); },function() { $(this).css( { 'left': -modFbWidgetLeft+'px' }); }); } else //prawo { $('.modFBWidget').css ({ 'background': 'none', 'height': '42px', 'z-index': '0', 'width': modFbWidgetWidth, 'left': '0' }); $('.modFBWidget').hover(function() { $(this).css( { 'left': -modFbWidgetWidth+'px' }); },function() { $(this).css( { 'left': '0' }); }); } } else { /* $('.mosSocfacebook').hover(function() { $(this).css( { 'left': '289px' }); },function() { $(this).css( { 'left': '0' }); });*/ } if (modPosition == 'lewo') { $('.hoverMod span').each(function() { var modSpanWidth = $(this).width(); $(this).parent().attr('id', modSpanWidth+15); $('.hoverMod').hover(function() { $(this).css( { 'left': $(this).attr('id')+'px' }); },function() { $(this).css( { 'left': '0' }); }); }); $('.modSocMedFix').css ({ 'position': 'fixed', 'left': '-289px', 'top': distanceTop+'px', 'z-index': '9999', 'width': '330px' }); } else //prawo { $('.hoverMod span').each(function() { var modSpanWidth = $(this).width(); $(this).parent().attr('id', modSpanWidth+20); $('.hoverMod').hover(function() { $(this).css( { 'left': -$(this).attr('id')+'px' }); },function() { $(this).css( { 'left': '0' }); }); }); $('.modSocMedFix').css ({ 'position': 'fixed', 'right': '-289px', 'top': distanceTop+'px', 'z-index': '9999', 'width': '330px' }); } } else { if (modFbWidget != 0) { //fb widget $('
').attr( { 'data-href': modDataHref, 'data-tabs': execTabs, 'data-small-header': modUseSmallHeader, 'data-adapt-container-width': 1, 'data-hide-cover': execHideCover, 'data-show-facepile': execshowFriends, 'data-width': modFbWidgetWidth, 'data-height': modFbWidgetHeight }).appendTo('body'); (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/pl_PL/sdk.js#xfbml=1&version=v2.10"; fjs.parentNode.insertBefore(js, fjs); } (document, 'script', 'facebook-jssdk')); $('.fb-page').detach().appendTo('.mosSocfacebook'); $('.mosSocfacebook').addClass('modFBWidget'); $('.modFBWidget').removeClass('hoverMod'); //fb widget - koniec if (modPosition == 'lewo') { $('.modFBWidget').css ({ 'background': 'none', 'height': '42px', 'z-index': '0', 'width': modFbWidgetWidth, 'left': -modFbWidgetLeft+'px' }); $('.modFBWidget').on('click', function() { event.preventDefault(); var clicks = $(this).data('clicks'); if (clicks) { $(this).css( { 'left': '330px' }); } else { $(this).css( { 'left': -modFbWidgetLeft+'px' }); } $(this).data("clicks", !clicks); }); } else //prawo { $('.modFBWidget').css ({ 'background': 'none', 'height': '42px', 'z-index': '0', 'width': modFbWidgetWidth, 'left': '0' }); $('.modFBWidget').click(function() { var clicks = $(this).data('clicks'); if (clicks) { $(this).css( { 'left': -modFbWidgetWidth+'px' }); } else { $(this).css( { 'left': '0' }); } $(this).data("clicks", !clicks); }); } } if (modPosition == 'lewo') { $('.modSocMedFix').css ({ 'position': 'fixed', 'left': '-289px', 'top': distanceTopMobile+'px', 'z-index': '9999', 'width': '330px' }); } else //prawo { $('.modSocMedFix').css ({ 'position': 'fixed', 'right': '-289px', 'top': distanceTopMobile+'px', 'z-index': '9999', 'width': '330px' }); } } } }); $(document).ready(function() { $('.modFBWidget').click(); //fix na konieczność dwukliku na FBWidget });