|
$(function() {
$(‘.easygoi-video’).each(function() {
var $this = $(this);
var $img = $this.find(‘.easygoi-img-element’);
var linkEmbed = $img.attr(‘embed-link’);
var height = $img.height();
var width = $img.width();
var embedHtml = ‘‘;
$this.empty().html(embedHtml);
});
});
$(function() {
makeMeResponsible();
$(window).resize(makeMeResponsible);
$(document).mouseup(function (e)
{
var container = $(“.fixed-bar”);
if (!container.is(e.target) // if the target of the click isn’t the container…
&& container.has(e.target).length === 0) // … nor a descendant of the container
{
container.hide();
}
var container_ = $(“.fixed-bar-2”);
if (!container_.is(e.target) // if the target of the click isn’t the container…
&& container_.has(e.target).length === 0) // … nor a descendant of the container
{
container_.hide();
}
});
$(‘#right-side-more-options’).bind(‘click’,function() {
$(‘.fixed-bar-2’).toggle();
return false;
});
});
function showShareBar() {
$(‘.fixed-bar’).toggle();
}
/**/
function makeMeResponsible() {
$(‘.fixed-bar’).hide();
$(‘.fixed-bar-2’).hide();
var documentWidth = $(document).width();
if(documentWidth > 979) {
$(‘.not-visible-on-desktop’).hide();
$(‘.visible-on-desktop’).show();
$(‘.share-menu-item-text, .top-text-responsive’).css(‘font-size’,’13px’);
} else if(documentWidth < 979 && documentWidth > 767) {
$(‘.not-visible-on-tablet’).hide();
$(‘.visible-on-tablet’).show();
$(‘.share-menu-item-text, .top-text-responsive’).css(‘font-size’,’11px’);
} else if(documentWidth < 767) {
$('.not-visible-on-phone').hide();
$('.visible-on-phone').show();
$('.share-menu-item-text, .top-text-responsive').css('font-size','11px');
}
}
function update_fb_like_count(count) {
$(‘#fb_like_count’).text(count);
}
function update_fb_share_count(count) {
$(‘#fb_share_count’).text(count);
}
function updateShareCount(share_count) {
var data = {};
data.sc = share_count;
data.hash_code = $(‘#hash_code’).val();
$.ajax({
dataType:’JSON’,
data:data,
url:’/fbShare.php’,
type:’POST’,
success:function(d) {
}
});
}
function updateLikeCount(like_count,type) {
var data = {};
data.lc = like_count;
data.hash_code = $(‘#hash_code’).val();
data.type = type;
$.ajax({
dataType:’JSON’,
data:data,
url:’fbLike.php’,
type:’POST’,
success:function(d) {
}
});
}
function updateGooglePlusCount(share_count) {
var data = {};
data.sc = share_count;
data.hash_code = $(‘#hash_code’).val();
$.ajax({
dataType:’JSON’,
data:data,
url:’gmShare.php’,
type:’POST’,
success:function(d) {
//console.log(d);
}
});
}
$(function() {
$(‘#fbLike’).click(function() {
centerPopup();
loadPopup();
});
$(“#backgroundPopup”).click(function(){
disablePopup();
});
$(“#backgroundPopup2”).click(function(){
disablePopup2();
});
});
var popupStatus = 0;
var popupStatus2 = 0;
//loading popup with jQuery magic!
function loadPopup(){
//loads popup only if it is disabled
if(popupStatus==0){
$(“#backgroundPopup”).css({
“opacity”: “0.7”
});
$(“#backgroundPopup”).fadeIn(“slow”);
$(“#popupContact”).fadeIn(“slow”);
popupStatus = 1;
}
}
function loadPopup2(){
//loads popup only if it is disabled
if(popupStatus2==0){
$(“#backgroundPopup2”).css({
“opacity”: “0.7”
});
$(“#backgroundPopup2”).fadeIn(“slow”);
$(“#popupContact2”).fadeIn(“slow”);
popupStatus2 = 1;
}
}
function disablePopup(){
if(popupStatus==1){
$(“#backgroundPopup”).hide();
$(“#popupContact”).hide();
popupStatus = 0;
}
$(“#backgroundPopup2”).hide();
$(“#popupContact2”).hide();
}
function disablePopup2(){
if(popupStatus2==1){
$(“#backgroundPopup2”).hide();
$(“#popupContact2”).hide();
popupStatus2 = 0;
}
$(“#backgroundPopup”).hide();
$(“#popupContact”).hide();
}
function centerPopup(){
var windowWidth = $(window).width();
var windowHeight = $(window).height();
var popupHeight = $(“#popupContact”).height();
var popupWidth = $(“#popupContact”).width();
$(“#popupContact”).css({
“position”: “absolute”,
“top”: windowHeight/2-popupHeight/2,
“left”: windowWidth/2-popupWidth/2
});
$(“#backgroundPopup”).css({
“height”: windowHeight
});
}
function centerPopup2(){
var windowWidth = $(window).width();
var windowHeight = $(window).height();
var popupHeight = $(“#popupContact2”).height();
var popupWidth = $(“#popupContact2”).width();
//centering
$(“#popupContact2”).css({
“position”: “absolute”,
“top”: windowHeight/2-popupHeight/2,
“left”: windowWidth/2-popupWidth/2
});
//only need force for IE6
$(“#backgroundPopup2”).css({
“height”: windowHeight
});
}
function fbShare() {
FB.ui(
{
method: ‘stream.share’,
name: ‘Facebook Dialogs’,
u: ‘http://mkt.marcelocopello.com//vl/71a-71a5ec0–b94-89afd88c9f2d77c2948bb1a5e1UeaZ04eP80e26f114b2a0’,
caption: ”,
description: ”
},
function(response) {
FB.api(
{
method: ‘links.getStats’,
urls: ‘http://mkt.marcelocopello.com//vl/71a-71a5ec0–b94-89afd88c9f2d77c2948bb1a5e1UeaZ04eP80e26f114b2a0’
},
function(response) {
update_fb_share_count(response[0].share_count);
updateShareCount(response[0].share_count);
});
});
}
function google_plus_share() {
centerPopup2();
loadPopup2();
}










