jQuery(function($)
{
let css_assets = document.createElement("style");
css_assets.type = "text/css";
css_assets.id = "appInstagram";
css_assets.textContent = `.modSocMedImg {
display: block;
}
.modSocMedImg {
background: #4D67A3;
width: 330px;
text-align: right;
position: relative;
left: 0;
transition: 0.5s;
}
.mosSoctiktok {
background: #161616;
}
.mosSoctiktok img {
padding: 7px;
box-sizing: border-box;
}
.mosSocfacebook {
background: #4D67A3;
}
.mosSoctwitter {
background: #25A7DF;
}
.mosSocgoogleplus {
background: #D74936;
}
.mosSocinstagram {
background: #40719A;
}
.mosSocinstagram1 {
background: #e8424e;
}
.mosSocyoutube {
background: #CC171E;
}
.mosSoctumblr {
background: #2C4661;
}
.mosSocpinterest {
background: #C62325;
}
.modSocMedImg span {
color: #fff;
font-size: 14px;
font-weight: 600;
position: relative;
top: 1px;
}
.modLe .fb_iframe_widget {
top: -43px !important;
left: -42px !important;
}
.modPr .fb_iframe_widget {
left: 42px;
top: -43px;
}
.modPr .modSocMedImg {
text-align: left;
}
.modFBWidget:hover {
z-index: 9 !important;
}
/*.mosSocfacebook.modFBWidget img {
position: absolute;
z-index: 99999;
right: -42px;
top: 1px;
}*/
.mosSoclinkedin3 {
background: #087FB7;
}
.mosSoclinkedin3 img {
width: 35px;
position: relative;
left: 3px;
margin-right: 7px;
}`;
document.getElementsByTagName("head")[0].appendChild(css_assets);
let shop_id = 365;
var modTablicaActive = {"facebook":{"url":null,"hover":null}};
var distanceTop = "140";
var distanceTopMobile = "80";
var app_active = "1";
var app_activeOnMobile = "1";
var modFbWidget = "1";
var isMobile = 0;
var modDataHref = "https:\/\/www.facebook.com\/siwiaszczykpl";
var modFbWidgetWidth = "400";
var modFbWidgetHeight = "500";
var modUseSmallHeader = "0";
var execHideCover = "0";
var execshowFriends = "0";
var execTabs = "timeline, messages";
var modPosition = "lewo";
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 );
// console.log(shop_id);
let cur_src = 'https://maxtest.cube-shops.com/appSocialMedia/gfx/'+index+'.png';
if(index == 'googleplus')
{
index = 'linkedin3';
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+'.png';
index = 'instagram1';
}
else if(index == 'instagram' && shop_id == 924)
{
index = 'labelart_insta';
cur_src = 'https://maxtest.cube-shops.com/appSocialMedia/gfx/'+index+'.png';
}
else if(index == 'facebook' && shop_id == 924)
{
index = 'labelart_fb';
cur_src = 'https://maxtest.cube-shops.com/appSocialMedia/gfx/'+index+'.png';
}
else if(index == 'tiktok' && shop_id == 924)
{
index = 'labelart_tiktok';
cur_src = 'https://maxtest.cube-shops.com/appSocialMedia/gfx/'+index+'.png';
}
$('
').attr(
{
src:cur_src,
width: '42px'
}).appendTo($('').html(value['hover'] ? '' + 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.modFb').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.modFb').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
});