FB._https = (window.location.protocol == "https:");
FB.init({
appId: '2511208999168874',
status: true,
cookie: true,
xfbml: true,
channelUrl: 'https://'+window.location.hostname+'/channel.html',
oauth: true,
version: 'v3.0'
});
FB.AppEvents.logPageView();
function FBresize() {
FB.Canvas.setSize({width: 640, height: 810});
FB.Canvas.setAutoGrow();
}
function fwl() {
var time = new Date().getTime();
top.location.href = 'https://'+window.location.hostname+'/main';
}
function FB_login() {
FB.login(function (response) {
if (response.authResponse) {
setTimeout(fwl(), 1000);
}
else {
setTimeout(fwl(), 1000);
}
}, {scope: 'email,pages_manage_posts,pages_show_list,pages_read_engagement,business_management,ads_management,read_insights,public_profile,pages_manage_ads,instagram_content_publish,instagram_basic,publish_to_groups,leads_retrieval,pages_manage_metadata,ads_read,pages_read_user_content,publish_video,read_insights,instagram_manage_insights'});
};
function auto_grow(element) {
element.style.height = "5px";
if (element.scrollHeight < 100) {
element.style.height = "99px";
} else {
element.style.height = element.scrollHeight + "px";
}
}
function count_letters_textarea(){
var htags=$("#link_text").val().split('#').length-1;
var conunt_l=$("#link_text").val().length;
var insta=$("#chk_instagram").val();
if(insta==1){
if(htags>=30){
if(localStorage.getItem('htags_status')!=1){
Toastify({text: "Przekroczono limit 30 hashtagów.",className: "bg-danger",duration: 6000}).showToast();
localStorage.setItem('htags_status', '1');
}
htags=""+htags+"";
}else{
localStorage.setItem('htags_status', '0');
}
if(conunt_l>=2200){
if(localStorage.getItem('conunt_l_status')!=1){
Toastify({text: "Przekroczono limit 2200 znaków.",className: "bg-danger",duration: 6000}).showToast();
localStorage.setItem('conunt_l_status', '1');
}else{
localStorage.setItem('conunt_l_status', '0');
}
conunt_l=""+conunt_l+"";
}
}
$("#count-text").html(conunt_l+" #"+htags);
//Toastify({text: html[1],className: "bg-danger",duration: 6000}).showToast();
}
$(document).ready(function () {
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
} else if (response.status === 'not_authorized') {
} else {
}
});
});
setTimeout(function () {
var ap = 1;
$('.ap').hover(function () {
$(this).css('animation-name', 'pulse');
}).mouseleave(function () {
if (ap == 1) {
ap = 0;
setTimeout(function () {
$('.ap').css('animation-name', 'none');
ap = 1;
}, 2500);
}
});
}, 4000);
//menu_post
//onmousein=\"$('.promo-item2').toggle(300);\"
$('.ti-menu').click(function () {
$('.promo-item2').toggle(300);
})
//formularz dodawania posta
$(document).ready(function () {
$('#link_form').submit(function (event) {
//$('#post_add_title').html('Trwa dodawanie Twojego posta');
$('#ModalPost').modal('show');
$('#modal_send').html('