'+no_more_posts_text+'');
$cff.find('.cff-error-msg').remove();
}
if($(this).find('.cff-masonry-posts').length < 1) $(this).find('#cff.cff-masonry .cff-item, #cff.cff-masonry .cff-likebox, #cff.cff-masonry .cff-event, #cff.cff-masonry .cff-album-item').wrapAll('
');
if($cff.find('.cff-album-item').length){
$cff.removeClass('cff-masonry cff-masonry-css');
}
$cff.find('.cff-more-dates').on('click', function(){
$(this).siblings('.cff-multiple-dates').slideToggle(100);
});
});
if(cffmetatrans!='false'&&$('.cff-timeline-feed').length&&(typeof cffdisablecommentcaching=='undefined')){
$.ajax({
url: cffajaxurl,
type: 'POST',
async: true,
cache: false,
data:{
action: 'get_meta'
},
success: function(data){
if(data==''||data.length < 1){
metaArr=[];
}else{
data=decodeURI(data);
data=data.replace(/\\'/g, "'");
metaArr=JSON.parse(data);
}
$cff.each(function(){
$(this).find('.cff-item.cff-new:not(.cff-event)').each(function(){
var $self=$(this),
post_id_orig=$self.find('.cff-view-comments').attr('id'),
object_id=$self.closest('.cff-item').attr('data-object-id');
if(metaArr.hasOwnProperty(post_id_orig)){
cffCreateComments($self, metaArr[post_id_orig]);
cffAddFullsizeImageURLs($self, metaArr[post_id_orig]);
}else{
cffGetMetaAPI($self, post_id_orig, object_id);
}});
});
},
error: function(xhr,textStatus,e){
return;
}});
}else{
$('#cff .cff-item.cff-new:not(.cff-event)').each(function(){
var $self=$(this),
post_id_orig=$self.find('.cff-view-comments').attr('id'),
object_id=$self.closest('.cff-item').attr('data-object-id');
cffGetMetaAPI($self, post_id_orig, object_id);
});
}
function cffGetMetaAPI($self, post_id_orig, object_id){
if($self.find('.cff-view-comments').length==0) return;
if(typeof object_id=='undefined'||object_id.length < 2) object_id='';
var object_id_query=''+object_id,
post_id_query='?post_id='+post_id_orig,
use_id='object',
post_comment_count=$self.find('.cff-comments .cff-count').text(),
post_likes_count=$self.find('.cff-likes .cff-count').text(),
cff_page_id=$self.attr('data-page-id');
if(typeof post_comment_count=='undefined'||post_comment_count=='') post_comment_count=0;
if(typeof post_likes_count=='undefined'||post_likes_count=='') post_likes_count=0;
if(typeof object_id=='undefined'||object_id.length < 2||$self.find('.cff-comments-box').hasClass('cff-shared-story')||$self.hasClass('cff-timeline-event')) use_id='post';
var timeline_event='';
if($self.hasClass('cff-timeline-event')) timeline_event='&timeline_event=true';
var usegrouptoken='',
useowntoken='';
if($self.closest('#cff').hasClass('cff-group')) usegrouptoken='&usegrouptoken=true';
if($self.closest('#cff').attr('data-own-token')=='true') useowntoken='&useowntoken=true';
shortcode_token_param=cffGetShortcodeToken($self.closest('#cff'));
var cff_is_video_post=$self.hasClass('cff-video-post') ? '&isvideo=true':'';
var url=cffsiteurl + "/custom-facebook-feed-pro/query.php?o_id=" + object_id + '&post_id='+post_id_orig + '&use_id=' + use_id + timeline_event + usegrouptoken + useowntoken + '&comments_num=' + post_comment_count + '&likes_num=' + post_likes_count + '&type=meta' + cff_is_video_post + '&pageid=' + cff_page_id + shortcode_token_param;
if($self.hasClass('cff-album')) url +='&timelinealbum=true';
if(locatefile==true){
$.ajax({
method: "GET",
url: url,
success: function(data){
metaArr[ post_id_orig ]=data;
newMetaArr[ post_id_orig ]=data;
cffCreateComments($self, data);
cffAddFullsizeImageURLs($self, data);
cffSetMetaCache(newMetaArr);
}});
}}
var cffSetMetaCache_executed=false;
function cffSetMetaCache(newMetaArr){
if(typeof cffdisablecommentcaching!='undefined') return;
if(!cffSetMetaCache_executed){
var cffTimesCached=0,
cffCacheDelay=setTimeout(function(){
var cffCacheInterval=setInterval(function(){
cffCacheMeta(newMetaArr);
cffTimesCached++;
if(cffTimesCached==2) clearInterval(cffCacheInterval);
}, 3000);
cffCacheMeta(newMetaArr);
}, 500);
cffSetMetaCache_executed=true;
}
function cffCacheMeta(newMetaArr){
var jsonstring=JSON.stringify(newMetaArr);
jsonstring=encodeURI(jsonstring);
var opts={
url: cffajaxurl,
type: 'POST',
async: true,
cache: false,
data:{
action: 'cache_meta',
metadata: jsonstring
},
success: function(response){
return;
},
error: function(xhr,textStatus,e){
return;
}};
$.ajax(opts);
}}
function cffGetParameterByName(name, url){
name=name.replace(/[\[\]]/g, "\\$&");
var regex=new RegExp("[?&]" + name + "(=([^]*)|&|#|$)"),
results=regex.exec(url);
if(!results) return null;
if(!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function cffLinkify(inputText){
var replacedText, replacePattern1, replacePattern2, replacePattern3;
replacePattern1=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
replacedText=inputText.replace(replacePattern1, '
$1');
replacePattern2=/(^|[^\/])(www\.[\S]+(\b|$))/gim;
replacedText=replacedText.replace(replacePattern2, '$1
$2');
replacePattern3=/(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
replacedText=replacedText.replace(replacePattern3, '
$1');
return replacedText;
}
$(document).off('click', '#cff .cff-html5-video .cff-html5-play').on('click', '#cff .cff-html5-video .cff-html5-play', function(e){
e.preventDefault();
var $self=$(this),
$videoWrapper=$self.closest('.cff-html5-video'),
video=$self.siblings('video')[0];
video.play();
$self.hide();
$self.siblings('.cff-poster').hide();
if(video.hasAttribute("controls")){
video.removeAttribute("controls")
}else{
video.setAttribute("controls","controls")
}
if($videoWrapper.innerWidth() < 150&&!$videoWrapper.hasClass('cff-no-video-expand')){
$videoWrapper.css('width','100%').closest('.cff-item').find('.cff-text-wrapper').css('width','100%');
}});
function cffAddFullsizeImageURLs($self, data){
var data=jQuery.parseJSON(data);
if(typeof data.images!=='undefined'&&data.images!==null) $self.find('.cff-lightbox-link').attr('href', data.images[0].source);
if($self.find('.cff-html5-video').length&&typeof data.attachments!=='undefined'&&data.attachments!==null){
$self.find('.cff-poster').attr('src', data.attachments.data[0].media.image.src);
$self.find('.cff-lightbox-link').attr('href', data.attachments.data[0].media.image.src);
}}
function cffCreateComments($self, data){
if(data.substring(0, 1)=="<") return false;
var data=jQuery.parseJSON(data),
cff_comments='',
cff_likes_this='',
commentShow=parseInt($self.find('.cff-comments-box').attr('data-num')),
like_count=(typeof data.likes!=='undefined') ? data.likes.summary.total_count:0
$cffCommentsBox=$self.find('.cff-comments-box'),
$cffCommentLikes=$cffCommentsBox.find('.cff-comment-likes'),
cff_hide_comment_avatars=Boolean($self.find('.cff-comments-box').attr('data-cff-hide-avatars')),
cff_expand_comments=Boolean($self.find('.cff-comments-box').attr('data-cff-expand-comments')),
cff_translate_like_this_text=$cffCommentsBox.attr('data-cff-like-text'),
cff_translate_likes_this_text=$cffCommentsBox.attr('data-cff-likes-text'),
cff_translate_reacted_to_this_text=$cffCommentsBox.attr('data-cff-reacted-text'),
cff_translate_and_text=$cffCommentsBox.attr('data-cff-and-text'),
cff_translate_other_text=$cffCommentsBox.attr('data-cff-other-text'),
cff_translate_others_text=$cffCommentsBox.attr('data-cff-others-text'),
cff_translate_reply_text=$cffCommentsBox.attr('data-cff-reply-text'),
cff_translate_replies_text=$cffCommentsBox.attr('data-cff-replies-text'),
cff_total_comments_count=(typeof data.comments!=='undefined') ? data.comments.summary.total_count:0,
cff_meta_link_color=$self.find('.cff-comments-box').attr('data-cff-meta-link-color'),
cff_post_tags=Boolean($self.find('.cff-comments-box').attr('data-cff-post-tags'));
var cff_haha_count=(typeof data.haha!=='undefined') ? data.haha.summary.total_count:0;
var cff_love_count=(typeof data.love!=='undefined') ? data.love.summary.total_count:0;
var cff_wow_count=(typeof data.wow!=='undefined') ? data.wow.summary.total_count:0;
var cff_sad_count=(typeof data.sad!=='undefined') ? data.sad.summary.total_count:0;
var cff_angry_count=(typeof data.angry!=='undefined') ? data.angry.summary.total_count:0;
var reactions_arr=[cff_haha_count, cff_love_count, cff_wow_count, cff_sad_count, cff_angry_count];
var reaction_first_num=reactions_arr.sort(sortNumber)[0];
var reaction_second_num=reactions_arr.sort(sortNumber)[1];
function sortNumber(a,b){
return b - a;
}
var reactions_html='',
love_added=false,
haha_added=false,
wow_added=false,
sad_added=false,
angry_added=false;
var reaction_one_html='';
if(reaction_first_num > 0){
if(data.love.summary.total_count==reaction_first_num){
reaction_one_html +='
';
love_added=true;
}
if(data.haha.summary.total_count==reaction_first_num){
reaction_one_html +='
';
haha_added=true;
}
if(data.wow.summary.total_count==reaction_first_num){
reaction_one_html +='
';
wow_added=true;
}
if(data.sad.summary.total_count==reaction_first_num){
reaction_one_html +='
';
sad_added=true;
}
if(data.angry.summary.total_count==reaction_first_num){
reaction_one_html +='
';
angry_added=true;
}
reactions_html +=reaction_one_html;
}
if(reaction_one_html.split('cff-reaction-one').length < 3){
if(reaction_second_num > 0){
var reaction_two_html='';
if(data.love.summary.total_count==reaction_second_num&&!love_added){
reaction_two_html='
';
}
if(data.haha.summary.total_count==reaction_second_num&&!haha_added){
reaction_two_html='
';
}
if(data.wow.summary.total_count==reaction_second_num&&!wow_added){
reaction_two_html='
';
}
if(data.sad.summary.total_count==reaction_second_num&&!sad_added){
reaction_two_html='
';
}
if(data.angry.summary.total_count==reaction_second_num&&!angry_added){
reaction_two_html='
';
}
reactions_html +=reaction_two_html;
}}
$self.find('.cff-meta .cff-likes .cff-icon').after(reactions_html);
if(parseInt(like_count)==0&&(parseInt(cff_love_count) > 0||parseInt(cff_haha_count) > 0||parseInt(cff_wow_count) > 0||parseInt(cff_sad_count) > 0||parseInt(cff_angry_count) > 0)){
$self.find('.cff-meta .cff-likes .cff-icon').remove();
$self.find('.cff-meta .cff-likes span').addClass('cff-no-animate');
}
var cff_reactions_count=parseInt(like_count) + parseInt(cff_love_count) + parseInt(cff_haha_count) + parseInt(cff_wow_count) + parseInt(cff_sad_count) + parseInt(cff_angry_count);
if(cff_reactions_count > 0) $self.find('.cff-meta .cff-likes .cff-count').text(cff_reactions_count);
var cff_no_reactions=false;
if(cff_love_count==0&&cff_haha_count==0&&cff_wow_count==0&&cff_sad_count==0&&cff_angry_count==0) cff_no_reactions=true;
var reactions_count_html='
';
if(parseInt(like_count) > 0){
reactions_count_html +='';
if(!cff_no_reactions){
if(parseInt(like_count) > 0) reactions_count_html +=''+like_count+'';
if(cff_love_count > 0) reactions_count_html +=''+cff_love_count+'';
if(cff_haha_count > 0) reactions_count_html +=''+cff_haha_count+'';
if(cff_wow_count > 0) reactions_count_html +=''+cff_wow_count+'';
if(cff_sad_count > 0) reactions_count_html +=''+cff_sad_count+'';
if(cff_angry_count > 0) reactions_count_html +=''+cff_angry_count+'';
}}
reactions_count_html +='';
if(typeof data.likes!=='undefined'){
if(data.likes.data.length){
cff_likes_this +='
';
var liker_one='',
liker_two='';
if(like_count > 0&&typeof data.likes.data[0]!=='undefined') liker_one=''+data.likes.data[0].name+'';
if(like_count > 1&&typeof data.likes.data[1]!=='undefined') liker_two=''+data.likes.data[1].name+'';
if(like_count==1){
cff_likes_this +=liker_one+' '+cff_translate_likes_this_text;
}else if(like_count==2){
cff_likes_this +=liker_one+' '+cff_translate_and_text+' '+liker_two+' '+cff_translate_like_this_text;
}else if(like_count==3){
cff_likes_this +=liker_one+', '+liker_two+' '+cff_translate_and_text+' 1 '+cff_translate_other_text+' '+cff_translate_like_this_text;
}else{
cff_likes_this +=liker_one+', '+liker_two+' '+cff_translate_and_text+' ';
if(like_count==25) cff_likes_this +='';
cff_likes_this +=' '+cff_translate_others_text;
if(parseInt(cff_reactions_count)==parseInt(like_count)){
cff_likes_this +=' '+cff_translate_like_this_text;
}else{
cff_likes_this +=' '+cff_translate_reacted_to_this_text;
}}
cff_likes_this +='';
$cffCommentLikes.append(reactions_count_html + cff_likes_this);
}else{
if(cff_no_reactions){
$cffCommentLikes.hide();
}else{
$cffCommentLikes.append(reactions_count_html);
}}
}
if(typeof data.comments!=='undefined'){
$.each(data.comments.data, function(i, commentItem){
var comment_message=cffEncodeHTML(commentItem.message),
comment_message=cffLinkify(comment_message),
cff_comment_author_info=true;
if(typeof commentItem.from!=='undefined'){
cff_comment_from_id=commentItem.from.id;
}else{
cff_hide_comment_avatars=true;
cff_comment_author_info=false;
cff_comment_from_id='';
}
cff_comments +='';
});
}
$self.find('.cff-comments-wrap').html(cff_comments);
$self.find('.cff-show-more-comments').attr('data-cff-comments-total', cff_total_comments_count);
setTimeout(function(){
if($self.closest('.cff').hasClass('cff-masonry')&&!$self.closest('.cff').hasClass('cff-masonry-css')) cffAddMasonry($self.closest('.cff'));
}, 200);
}})(jQuery);
var imgLiquid=imgLiquid||{VER: '0.9.944'};
imgLiquid.bgs_Available=false;
imgLiquid.bgs_CheckRunned=false;
jQuery('.cff-new .cff-album-cover img, .cff-new .cff-crop img').css('visibility', 'hidden');
jQuery('#cff .cff-img-attachments .cff-crop img').css('opacity', 0);
(function ($){
function checkBgsIsavailable(){
if(imgLiquid.bgs_CheckRunned) return;
else imgLiquid.bgs_CheckRunned=true;
var spanBgs=$('
');
$('body').append(spanBgs);
!function (){
var bgs_Check=spanBgs[0];
if(!bgs_Check||!window.getComputedStyle) return;
var compStyle=window.getComputedStyle(bgs_Check, null);
if(!compStyle||!compStyle.backgroundSize) return;
imgLiquid.bgs_Available=(compStyle.backgroundSize==='cover');
}();
spanBgs.remove();
}
$.fn.extend({
imgLiquid: function (options){
this.defaults={
fill: true,
verticalAlign: 'center', // 'top' // 'bottom' // '50%' // '10%'
horizontalAlign: 'center', // 'left' // 'right' // '50%' // '10%'
useBackgroundSize: true,
useDataHtmlAttr: true,
responsive: true,
delay: 0,
fadeInTime: 0,
removeBoxBackground: true,
hardPixels: true,
responsiveCheckTime: 500,
timecheckvisibility: 500,
onStart: null,
onFinish: null,
onItemStart: null,
onItemFinish: null,
onItemError: null
};
checkBgsIsavailable();
var imgLiquidRoot=this;
this.options=options;
this.settings=$.extend({}, this.defaults, this.options);
if(this.settings.onStart) this.settings.onStart();
return this.each(function ($i){
var settings=imgLiquidRoot.settings,
$imgBoxCont=$(this),
$img=$('img:first',$imgBoxCont);
if(!$img.length){onError(); return;}
if(!$img.data('imgLiquid_settings')){
settings=$.extend({}, imgLiquidRoot.settings, getSettingsOverwrite());
}else{
$imgBoxCont.removeClass('imgLiquid_error').removeClass('imgLiquid_ready');
settings=$.extend({}, $img.data('imgLiquid_settings'), imgLiquidRoot.options);
}
$img.data('imgLiquid_settings', settings);
if(settings.onItemStart) settings.onItemStart($i, $imgBoxCont, $img);
if(imgLiquid.bgs_Available&&settings.useBackgroundSize)
processBgSize();
else
processOldMethod();
function processBgSize(){
if($imgBoxCont.css('background-image').indexOf(encodeURI($img.attr('src')))===-1){
$imgBoxCont.css({'background-image': 'url("' + encodeURI($img.attr('src')) + '")'});
}
$imgBoxCont.css({
'background-size': (settings.fill) ? 'cover':'contain',
'background-position': (settings.horizontalAlign + ' ' + settings.verticalAlign).toLowerCase(),
'background-repeat': 'no-repeat'
});
$('a:first', $imgBoxCont).css({
'display': 'block',
'width': '100%',
'height': '100%'
});
$('img', $imgBoxCont).css({'display': 'none'});
if(settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img);
$imgBoxCont.addClass('imgLiquid_bgSize');
$imgBoxCont.addClass('imgLiquid_ready');
checkFinish();
}
function processOldMethod(){
if($img.data('oldSrc')&&$img.data('oldSrc')!==$img.attr('src')){
var $imgCopy=$img.clone().removeAttr('style');
$imgCopy.data('imgLiquid_settings', $img.data('imgLiquid_settings'));
$img.parent().prepend($imgCopy);
$img.remove();
$img=$imgCopy;
$img[0].width=0;
setTimeout(processOldMethod, 10);
return;
}
if($img.data('imgLiquid_oldProcessed')){
makeOldProcess(); return;
}
$img.data('imgLiquid_oldProcessed', false);
$img.data('oldSrc', $img.attr('src'));
$('img:not(:first)', $imgBoxCont).css('display', 'none');
$imgBoxCont.css({'overflow': 'hidden'});
$img.fadeTo(0, 0).removeAttr('width').removeAttr('height').css({
'visibility': 'visible',
'max-width': 'none',
'max-height': 'none',
'width': 'auto',
'height': 'auto',
'display': 'block'
});
$img.on('error', onError);
$img[0].onerror=onError;
function onLoad(){
if($img.data('imgLiquid_error')||$img.data('imgLiquid_loaded')||$img.data('imgLiquid_oldProcessed')) return;
if($imgBoxCont.is(':visible')&&$img[0].complete&&$img[0].width > 0&&$img[0].height > 0){
$img.data('imgLiquid_loaded', true);
setTimeout(makeOldProcess, $i * settings.delay);
}else{
setTimeout(onLoad, settings.timecheckvisibility);
}}
onLoad();
checkResponsive();
}
function checkResponsive(){
if(!settings.responsive&&!$img.data('imgLiquid_oldProcessed')) return;
if(!$img.data('imgLiquid_settings')) return;
settings=$img.data('imgLiquid_settings');
$imgBoxCont.actualSize=$imgBoxCont.get(0).offsetWidth + ($imgBoxCont.get(0).offsetHeight / 10000);
if($imgBoxCont.sizeOld&&$imgBoxCont.actualSize!==$imgBoxCont.sizeOld) makeOldProcess();
$imgBoxCont.sizeOld=$imgBoxCont.actualSize;
setTimeout(checkResponsive, settings.responsiveCheckTime);
}
function onError(){
$img.data('imgLiquid_error', true);
$imgBoxCont.addClass('imgLiquid_error');
if(settings.onItemError) settings.onItemError($i, $imgBoxCont, $img);
checkFinish();
}
function getSettingsOverwrite(){
var SettingsOverwrite={};
if(imgLiquidRoot.settings.useDataHtmlAttr){
var dif=$imgBoxCont.attr('data-imgLiquid-fill'),
ha=$imgBoxCont.attr('data-imgLiquid-horizontalAlign'),
va=$imgBoxCont.attr('data-imgLiquid-verticalAlign');
if(dif==='true'||dif==='false') SettingsOverwrite.fill=Boolean (dif==='true');
if(ha!==undefined&&(ha==='left'||ha==='center'||ha==='right'||ha.indexOf('%')!==-1)) SettingsOverwrite.horizontalAlign=ha;
if(va!==undefined&&(va==='top'||va==='bottom'||va==='center'||va.indexOf('%')!==-1)) SettingsOverwrite.verticalAlign=va;
}
if(imgLiquid.isIE&&imgLiquidRoot.settings.ieFadeInDisabled) SettingsOverwrite.fadeInTime=0;
return SettingsOverwrite;
}
function makeOldProcess(){
var w, h, wn, hn, ha, va, hdif, vdif,
margT=0,
margL=0,
$imgCW=$imgBoxCont.width(),
$imgCH=$imgBoxCont.height();
if($img.data('owidth')===undefined) $img.data('owidth', $img[0].width);
if($img.data('oheight')===undefined) $img.data('oheight', $img[0].height);
if(settings.fill===($imgCW / $imgCH) >=($img.data('owidth') / $img.data('oheight'))){
w='100%';
h='auto';
wn=Math.floor($imgCW);
hn=Math.floor($imgCW * ($img.data('oheight') / $img.data('owidth')));
}else{
w='auto';
h='100%';
wn=Math.floor($imgCH * ($img.data('owidth') / $img.data('oheight')));
hn=Math.floor($imgCH);
}
ha=settings.horizontalAlign.toLowerCase();
hdif=$imgCW - wn;
if(ha==='left') margL=0;
if(ha==='center') margL=hdif * 0.5;
if(ha==='right') margL=hdif;
if(ha.indexOf('%')!==-1){
ha=parseInt (ha.replace('%',''), 10);
if(ha > 0) margL=hdif * ha * 0.01;
}
va=settings.verticalAlign.toLowerCase();
vdif=$imgCH - hn;
if(va==='left') margT=0;
if(va==='center') margT=vdif * 0.5;
if(va==='bottom') margT=vdif;
if(va.indexOf('%')!==-1){
va=parseInt (va.replace('%',''), 10);
if(va > 0) margT=vdif * va * 0.01;
}
if(settings.hardPixels){w=wn; h=hn;}
$img.css({
'width': w,
'height': h,
'margin-left': Math.floor(margL),
'margin-top': Math.floor(margT)
});
if(!$img.data('imgLiquid_oldProcessed')){
$img.fadeTo(settings.fadeInTime, 1);
$img.data('imgLiquid_oldProcessed', true);
if(settings.removeBoxBackground) $imgBoxCont.css('background-image', 'none');
$imgBoxCont.addClass('imgLiquid_nobgSize');
$imgBoxCont.addClass('imgLiquid_ready');
}
if(settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img);
checkFinish();
}
function checkFinish(){
if($i===imgLiquidRoot.length - 1) if(imgLiquidRoot.settings.onFinish) imgLiquidRoot.settings.onFinish();
}});
}});
})(jQuery);
setTimeout(function(){
jQuery('#cff .embed-responsive video, #cff .embed-responsive iframe').unwrap();
}, 500);
!function (){
var css=imgLiquid.injectCss,
head=document.getElementsByTagName('head')[0],
style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=css;
}else{
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
}();
jQuery(".cff-new .cff-album-cover, .cff-new .cff-crop").imgLiquid({fill:true});
}
cff_init();
function cffGetShortcodeToken($cff){
var shortcode_token_param='';
if($cff.attr('data-cff-shortcode')){
if($cff.attr('data-cff-shortcode').indexOf('accesstoken')!==-1){
var shortcode_att=$cff.attr('data-cff-shortcode'),
shortcode_att_arr=JSON.parse(shortcode_att);
shortcode_token_param=encodeURI('&at=' + shortcode_att_arr['accesstoken']);
}}
return shortcode_token_param;
}
window.cffLinkify=(function(){var k="[a-z\\d.-]+://",h="(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])",c="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",n="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",f="(?:"+c+n+"|"+h+")",o="(?:[;/][^#?<>\\s]*)?",e="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",d="\\b"+k+"[^<>\\s]+",a="\\b"+f+o+e+"(?!\\w)",m="mailto:",j="(?:"+m+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+f+e+"(?!\\w)",l=new RegExp("(?:"+d+"|"+a+"|"+j+")","ig"),g=new RegExp("^"+k,"i"),b={"'":"`",">":"<",")":"(","]":"[","}":"{","B;":"B+","b:":"b9"},i={callback:function(q,p){return p?'
'+q+"":q},punct_regexp:/(?:[!?.,:;'"]|(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(u,z){z=z||{};var w,v,A,p,x="",t=[],s,E,C,y,q,D,B,r;for(v in i){if(z[v]===undefined){z[v]=i[v]}}while(w=l.exec(u)){A=w[0];E=l.lastIndex;C=E-A.length;if(/[\/:]/.test(u.charAt(C-1))){continue}do{y=A;r=A.substr(-1);B=b[r];if(B){q=A.match(new RegExp("\\"+B+"(?!$)","g"));D=A.match(new RegExp("\\"+r,"g"));if((q?q.length:0)<(D?D.length:0)){A=A.substr(0,A.length-1);E--}}if(z.punct_regexp){A=A.replace(z.punct_regexp,function(F){E-=F.length;return""})}}while(A.length&&A!==y);p=A;if(!g.test(p)){p=(p.indexOf("@")!==-1?(!p.indexOf(m)?"":m):!p.indexOf("irc.")?"irc://":!p.indexOf("ftp.")?"ftp://":"http://")+p}if(s!=C){t.push([u.slice(s,C)]);s=E}t.push([A,p])}t.push([u.substr(s)]);for(v=0;v
' + replacementString + '';
}}
function cffReplaceTags(tag){
var replacementString=jQuery.trim(tag);
return '' + replacementString + '';
}
var hashRegex=/[#]+[A-Za-z0-9-_]+/g,
tagRegex=/[@]+[A-Za-z0-9-_]+/g;
function cffEncodeHTML(raw){
if(typeof raw==='undefined'){
return '';
}
var encoded=raw.replace(/(>)/g,'>'),
encoded=encoded.replace(/(<)/g,'<');
encoded=encoded.replace(/(<br\/>)/g,'
');
encoded=encoded.replace(/(<br>)/g,'
');
return encoded;
}
function cffLoadCommentReplies($this){
var usegrouptoken='',
useowntoken='',
$cffClosestContainer=jQuery('#cff_'+$this.parent().attr('data-id')).closest('#cff');
if($cffClosestContainer.hasClass('cff-group')) usegrouptoken='&usegrouptoken=true';
if($cffClosestContainer.attr('data-own-token')=='true') useowntoken='&useowntoken=true';
var cff_page_id=$this.closest('.cff-item').attr('data-page-id'),
shortcode_token_param=cffGetShortcodeToken($cffClosestContainer),
$commentReplies=$this.parent(),
$commentRepliesBox=$commentReplies.siblings('.cff-comment-replies-box'),
comments_url=cffsiteurl + "/custom-facebook-feed-pro/comments.php?id=" + $commentReplies.attr('data-id') + usegrouptoken + useowntoken + '&pageid=' + cff_page_id + shortcode_token_param;
if($commentReplies.hasClass('cff-hide')){
$commentRepliesBox.hide();
$commentReplies.removeClass('cff-hide');
}else{
$commentRepliesBox.show();
$commentReplies.addClass('cff-hide');
if($commentRepliesBox.hasClass('cff-empty')){
var $commentRepliesA=$commentReplies.find('a');
$commentRepliesA.append('');
$commentReplies.find('.cff-loader').css('background-color', $commentRepliesA.css('color'));
jQuery.ajax({
method: "GET",
url: comments_url,
success: function(data){
$commentReplies.find('.cff-loader').remove();
var data=jQuery.parseJSON(data),
allComments='';
if(typeof data.comments!=='undefined'){
jQuery.each(data.comments.data, function(i, commentItem){
var cff_comment_author_info=true;
if(typeof commentItem.from!=='undefined'){
cff_comment_from_id=commentItem.from.id;
}else{
cff_comment_author_info=false;
cff_comment_from_id='';
}
allComments +='';
});
}
$commentRepliesBox.html(allComments).removeClass('cff-empty');
if($this.closest('#cff').hasClass('cff-masonry')&&!$this.closest('#cff').hasClass('cff-masonry-css')) cffAddMasonry($this.closest('#cff'));
}});
}}
}
function cffLightbox(){
(function(){
var $=jQuery;
var LightboxOptions=(function(){
function LightboxOptions(){
this.fadeDuration=300;
this.fitImagesInViewport=true;
this.resizeDuration=400;
this.positionFromTop=50;
this.showImageNumberLabel=true;
this.alwaysShowNavOnTouchDevices=false;
this.wrapAround=false;
}
LightboxOptions.prototype.albumLabel=function(curImageNum, albumSize){
return curImageNum + " / " + albumSize;
};
return LightboxOptions;
})();
var Lightbox=(function(){
function Lightbox(options){
this.options=options;
this.album=[];
this.currentImageIndex=void 0;
this.init();
}
Lightbox.prototype.init=function(){
this.enable();
this.build();
};
Lightbox.prototype.enable=function(){
var self=this;
$('body').on('click', 'a[data-cff-lightbox], area[data-cff-lightbox]', function(event){
self.start($(event.currentTarget));
return false;
});
};
Lightbox.prototype.build=function(){
var self=this;
$("").appendTo($('body'));
this.$lightbox=$('#cff-lightbox-wrapper');
this.$overlay=$('#cff-lightbox-overlay');
this.$outerContainer=this.$lightbox.find('.cff-lightbox-outerContainer');
this.$container=this.$lightbox.find('.cff-lightbox-container');
this.containerTopPadding=parseInt(this.$container.css('padding-top'), 10);
this.containerRightPadding=parseInt(this.$container.css('padding-right'), 10);
this.containerBottomPadding=parseInt(this.$container.css('padding-bottom'), 10);
this.containerLeftPadding=parseInt(this.$container.css('padding-left'), 10);
this.$overlay.hide().on('click', function(){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
this.$lightbox.hide().on('click', function(event){
if($(event.target).attr('id')==='cff-lightbox-wrapper'){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}
return false;
});
this.$outerContainer.on('click', function(event){
if($(event.target).attr('id')==='cff-lightbox-wrapper'){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}
return false;
});
this.$lightbox.find('.cff-lightbox-prev').on('click', function(){
if(self.currentImageIndex===0){
self.changeImage(self.album.length - 1);
}else{
self.changeImage(self.currentImageIndex - 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
this.$lightbox.find('.cff-lightbox-next').on('click', function(){
if(self.currentImageIndex===self.album.length - 1){
self.changeImage(0);
}else{
self.changeImage(self.currentImageIndex + 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
$('.cff-lightbox-thumbs').on('click', '.cff-lightbox-attachment', function (){
var $thumb=$(this),
$thumbImg=$thumb.find('img'),
captionText=$thumb.attr('data-caption');
if(captionText==''||captionText=='undefined') captionText=$thumb.attr('orig-caption');
self.changeImage(parseInt($thumb.attr('data-cff-lightbox-order')), $thumb.attr('href'), $thumbImg.attr('width'), $thumbImg.attr('height'), $thumb.attr('data-facebook'), captionText);
return false;
});
this.$lightbox.find('.cff-lightbox-loader, .cff-lightbox-close').on('click', function(){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
};
Lightbox.prototype.start=function($link){
var self=this;
var $window=$(window);
$window.on('resize', $.proxy(this.sizeOverlay, this));
$('select, object, embed').css({
visibility: "hidden"
});
this.sizeOverlay();
if(this.album.length==0) this.album=[];
var imageNumber=0;
function addToAlbum($link){
var found=false;
$.each(self.album, function(i, imageitem){
if(imageitem.link==$link.attr('href')){
found=true;
return;
}});
if(found==true) return;
self.album.push({
link: $link.attr('href'),
title: $link.attr('data-title')||$link.attr('title'),
postid: $link.attr('data-id'),
showthumbs: $link.attr('data-thumbs'),
facebookurl: $link.attr('data-url'),
video: $link.attr('data-video'),
iframe: $link.attr('data-iframe'),
type: $link.attr('data-type'),
cffgroupalbums: $link.attr('data-cffgroupalbums'),
isthumbnail: $link.attr('data-cff-isthumbnail'),
pagename: $link.parent().attr('data-cff-page-name'),
posttime: $link.parent().attr('data-cff-post-time'),
lbcomments: $link.attr('data-lb-comments')
});
}
var dataLightboxValue=$link.attr('data-cff-lightbox');
var $links;
if(dataLightboxValue){
$links=$($link.prop("tagName") + '[data-cff-lightbox="' + dataLightboxValue + '"]');
for (var i=0; i < $links.length; i=++i){
addToAlbum($($links[i]));
if($links[i]===$link[0]){
imageNumber=i;
$.each(self.album, function(i, image){
if((image.postid==$link.attr('data-id'))&&image.isthumbnail!=true) imageNumber=i;
});
}}
}else{
if($link.attr('rel')==='lightbox'){
addToAlbum($link);
}else{
$links=$($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]');
for (var j=0; j < $links.length; j=++j){
addToAlbum($($links[j]));
if($links[j]===$link[0]){
imageNumber=j;
}}
}}
var top=$window.scrollTop() + this.options.positionFromTop;
var left=$window.scrollLeft();
this.$lightbox.css({
top: top + 'px',
left: left + 'px'
}).fadeIn(this.options.fadeDuration);
this.changeImage(imageNumber);
};
Lightbox.prototype.changeImage=function(imageNumberVal, imageUrl, imgWidth, imgHeight, facebookLink, captionText){
var self=this,
isThumb=false,
bottomPadding=120;
imageNumber=imageNumberVal;
if(typeof imageUrl!=='undefined') isThumb=true;
this.disableKeyboardNav();
var $image=this.$lightbox.find('.cff-lightbox-image');
this.$overlay.fadeIn(this.options.fadeDuration);
$('.cff-lightbox-loader').fadeIn('slow');
this.$lightbox.find('.cff-lightbox-image, .cff-lightbox-nav, .cff-lightbox-prev, .cff-lightbox-next, .cff-lightbox-dataContainer, .cff-lightbox-numbers, .cff-lightbox-caption').hide();
this.$outerContainer.addClass('animating');
var preloader=new Image();
preloader.onload=function(){
var $preloader, imageHeight, imageWidth, maxImageHeight, maxImageWidth, windowHeight, windowWidth;
$image.attr('src', self.album[imageNumber].link);
if(isThumb){
$image.attr('src', imageUrl);
$('.cff-lightbox-facebook').attr('href', facebookLink);
$('.cff-lightbox-caption .cff-lightbox-caption-text').html(captionText);
preloader.width=imgWidth;
preloader.height=imgHeight;
bottomPadding=180;
}
$preloader=$(preloader);
$image.width(preloader.width);
$image.height(preloader.height);
if(self.options.fitImagesInViewport){
windowWidth=$(window).width();
windowHeight=$(window).height();
var cff_lb_comments_width=0;
if($('#cff_' + self.album[0].postid).closest('#cff').attr('data-lb-comments')=='true'&&windowWidth > 640) cff_lb_comments_width=300;
maxImageWidth=windowWidth - self.containerLeftPadding - self.containerRightPadding - 20 - cff_lb_comments_width;
maxImageHeight=windowHeight - self.containerTopPadding - self.containerBottomPadding - bottomPadding;
if((preloader.width > maxImageWidth)||(preloader.height > maxImageHeight)){
if((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)){
imageWidth=maxImageWidth;
imageHeight=parseInt(preloader.height / (preloader.width / imageWidth), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}else{
imageHeight=maxImageHeight;
imageWidth=parseInt(preloader.width / (preloader.height / imageHeight), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}}
}
self.sizeContainer($image.width(), $image.height());
};
preloader.src=this.album[imageNumber].link;
this.currentImageIndex=imageNumber;
};
Lightbox.prototype.sizeOverlay=function(){
this.$overlay
.width($(window).width())
.height($(document).height());
};
Lightbox.prototype.sizeContainer=function(imageWidth, imageHeight){
var self=this;
var oldWidth=this.$outerContainer.outerWidth();
var oldHeight=this.$outerContainer.outerHeight();
var newWidth=imageWidth + this.containerLeftPadding + this.containerRightPadding;
var newHeight=imageHeight + this.containerTopPadding + this.containerBottomPadding;
function postResize(){
self.$lightbox.find('.cff-lightbox-dataContainer').width(newWidth);
self.$lightbox.find('.cff-lightbox-prevLink').height(newHeight);
self.$lightbox.find('.cff-lightbox-nextLink').height(newHeight);
self.showImage();
}
if(oldWidth!==newWidth||oldHeight!==newHeight){
this.$outerContainer.animate({
width: newWidth,
height: newHeight
}, this.options.resizeDuration, 'swing', function(){
postResize();
});
}else{
postResize();
}};
Lightbox.prototype.showImage=function(){
this.$lightbox.find('.cff-lightbox-loader').hide();
this.$lightbox.find('.cff-lightbox-image').fadeIn('slow');
this.updateNav();
this.updateDetails();
this.preloadNeighboringImages();
this.enableKeyboardNav();
};
Lightbox.prototype.updateNav=function(){
var alwaysShowNav=false;
try {
document.createEvent("TouchEvent");
alwaysShowNav=(this.options.alwaysShowNavOnTouchDevices)? true: false;
} catch (e){}
this.$lightbox.find('.cff-lightbox-nav').show();
if(this.album.length > 1){
if(this.options.wrapAround){
if(alwaysShowNav){
this.$lightbox.find('.cff-lightbox-prev, .cff-lightbox-next').css('opacity', '1');
}
this.$lightbox.find('.cff-lightbox-prev, .cff-lightbox-next').show();
}else{
if(this.currentImageIndex > 0){
this.$lightbox.find('.cff-lightbox-prev').show();
if(alwaysShowNav){
this.$lightbox.find('.cff-lightbox-prev').css('opacity', '1');
}}
if(this.currentImageIndex < this.album.length - 1){
this.$lightbox.find('.cff-lightbox-next').show();
if(alwaysShowNav){
this.$lightbox.find('.cff-lightbox-next').css('opacity', '1');
}}
}}
};
var thumbsArr={};
Lightbox.prototype.updateDetails=function(){
var self=this;
var origCaption='';
this.$lightbox.find('.cff-lightbox-nav, .cff-lightbox-nav a').show();
if($('.cff-lightbox-video').length==0) $('.cff-lightbox-container').prepend("");
if(cff_supports_video()){
$('#cff-lightbox-wrapper').removeClass('cff-has-video');
if(typeof this.album[this.currentImageIndex].video!=='undefined'){
if(this.album[this.currentImageIndex].video.length){
$('#cff-lightbox-wrapper').addClass('cff-has-video');
$('.cff-lightbox-video').attr({
'src':this.album[this.currentImageIndex].video,
'poster':this.album[this.currentImageIndex].link,
'autoplay':'true'
});
}}
}
var cff_lb_comments=(this.album[this.currentImageIndex].lbcomments=='true'&&$('#cff_'+this.album[this.currentImageIndex].postid+' .cff-lightbox-link').attr('data-lb-comments')!='false') ? true:false;
if($(window).width() <=640) cff_lb_comments=false;
if(cff_lb_comments){
var lb_post_id=this.album[this.currentImageIndex].postid,
page_id=lb_post_id.split('_')[0],
author_name=this.album[this.currentImageIndex].pagename,
date_in_correct_format=this.album[this.currentImageIndex].posttime,
$lightbox_sidebar=$('.cff-lightbox-container .cff-lightbox-sidebar'),
$lightbox_thumbs_holder=$('.cff-lightbox-thumbs-holder'),
from_id=$('#cff_'+this.album[this.currentImageIndex].postid).attr('data-cff-from');
$('.cff-lightbox-wrapper').addClass('cff-enable-lb-comments');
$('.cff-lightbox-dataContainer').css('width', $('.cff-lightbox-dataContainer').innerWidth() + 300);
$lightbox_sidebar.css('display', 'block');
var cff_post_author="";
if(typeof from_id!=='undefined'){
cff_post_author="";
}else{
cff_post_author=""+date_in_correct_format+"
";
}
$('.cff-lightbox-dataContainer .cff-lightbox-close').remove();
$lightbox_sidebar.html("' + $('#cff_'+this.album[this.currentImageIndex].postid+' .cff-comments-box')[0].outerHTML);
this.$lightbox.find('.cff-lightbox-close').on('click', function(){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
setTimeout(function(){
if($lightbox_thumbs_holder.find('a').length > 1){
$lightbox_sidebar.find('.cff-page-name a').text($lightbox_thumbs_holder.find('a.cff-selected').attr('data-page-name'));
$lightbox_sidebar.find('.cff-date').text($lightbox_thumbs_holder.find('a.cff-selected').attr('data-post-date'));
}}, 0);
$('.cff-lightbox-dataContainer .cff-lightbox-caption').remove();
$lightbox_thumbs_holder.css('margin-top', -10);
if($lightbox_sidebar.find('.cff-reactions-count').innerWidth() > 150){
$lightbox_sidebar.find('.cff-likes-this-text').addClass('cff-long');
}
$lightbox_sidebar.find('.cff-comment:visible').each(function(){
var $thisComment=jQuery(this);
$thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a').html('');
});
$lightbox_sidebar.find('.cff-comment-replies a').on('click', function(){
cffLoadCommentReplies($(this));
});
$lightbox_sidebar.find('.cff-show-more-comments a').attr('href', $lightbox_sidebar.find('.cff-comment-on-facebook a').attr('href'));
}else{
$('.cff-lightbox-wrapper .cff-lightbox-sidebar').html('');
$('.cff-lightbox-wrapper').removeClass('cff-enable-lb-comments');
}
$('#cff-lightbox-wrapper').removeClass('cff-has-iframe cff-fb-player');
if(typeof this.album[this.currentImageIndex].iframe!=='undefined'){
if(this.album[this.currentImageIndex].iframe.length){
var videoURL=this.album[this.currentImageIndex].iframe;
$('#cff-lightbox-wrapper').addClass('cff-has-iframe');
if(videoURL.indexOf("https://www.facebook.com/v2.3/plugins/video.php?")!=-1) $('#cff-lightbox-wrapper').addClass('cff-fb-player');
if(videoURL.indexOf(".swf") > -1||videoURL.indexOf("&autoplay=1")!=-1){
var autoplayParam='';
}else{
var autoplayParam='?autoplay=1';
}
var vInt=setTimeout(function(){
$('#cff-lightbox-wrapper iframe').attr({
'src':videoURL + autoplayParam + "&mute=0"
});
}, 500);
}}
var isThumbnail=false;
if(this.album[this.currentImageIndex].isthumbnail) isThumbnail=true;
if(!isThumbnail) $('.cff-lightbox-thumbs-holder').empty();
if(this.album[this.currentImageIndex].link==$('.cff-lightbox-image').attr('src')){
$('.cff-lightbox-facebook').attr('href', this.album[this.currentImageIndex].facebookurl);
}
if(this.album[this.currentImageIndex].showthumbs=='true'){
$('.cff-lightbox-thumbs').show();
var thisPostId=this.album[this.currentImageIndex].postid,
albumInfo='',
albumThumbs='',
albumsonly=false;
if(this.album[this.currentImageIndex].type=='albumsonly') albumsonly=true;
if(typeof thumbsArr[thisPostId]!=='undefined'){
$.each(thumbsArr[thisPostId], function(i, thumb){
var origCaption=thumb[5].replace(/"/g, '"');
var albumIndex=0;
$.each(self.album, function(i, albumItem){
if(albumItem.postid==thisPostId){
albumIndex=i;
return false;
}});
var lightboxImageOrder=(parseInt(albumIndex)+parseInt(i));
if(typeof thumb[8]=='undefined') thumb[8]=thumb[0];
albumThumbs +='';
if(i > 0){
cffInsertLightboxImage(lightboxImageOrder, thumb[0], thumb[4], thumb[3], thisPostId, albumsonly, true, thumb[6], thumb[7], thumb[8]);
}});
$('.cff-lightbox-thumbs-holder').html('' + albumThumbs + '
');
jQuery(".cff-lightbox-thumbs-holder a").imgLiquid({fill:true});
$('.cff-loader').hide();
$('.cff-lightbox-thumbs-holder').css('min-height', 0);
}else{
if(typeof cffsiteurl==='undefined'||cffsiteurl=='') cffsiteurl=window.location.host + '/wp-content/plugins';
var $cffClosest=$('#cff_'+thisPostId).closest('.cff'),
cff_page_id=$('#cff_'+thisPostId).attr('data-page-id'),
shortcode_token_param=cffGetShortcodeToken($cffClosest),
useowntoken='';
if($cffClosest.attr('data-own-token')=='true') useowntoken='&useowntoken=true';
var cffAttachmentsUrl=cffsiteurl + "/custom-facebook-feed-pro/thumbs.php?id=" + thisPostId + '&pageid=' + cff_page_id + useowntoken + shortcode_token_param,
thumbsData=[];
if(albumsonly){
cffAttachmentsUrl=cffAttachmentsUrl + '&albumsonly=true';
$('.cff-lightbox-thumbs-holder').css('min-height', 45).after('');
}
var cffgroupalbums=this.album[this.currentImageIndex].cffgroupalbums;
if(cffgroupalbums) cffAttachmentsUrl=cffAttachmentsUrl + '&usegrouptoken=' + cffgroupalbums;
$.ajax({
method: "GET",
url: cffAttachmentsUrl,
success: function(data){
data=jQuery.parseJSON(data);
if(albumsonly){
$.each(data.data, function(i, photoItem){
var dataCaption='';
if(photoItem.name) dataCaption=photoItem.name;
dataCaption=cffLinkify(dataCaption);
dataCaption=dataCaption.replace(hashRegex , cffReplaceHashtags);
dataCaption=String(dataCaption).replace(/& /g, '& ').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, "
");
origCaption=String(origCaption).replace(/& /g, '& ').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, "
");
var lightboxImageOrder=(parseInt(self.currentImageIndex)+parseInt(i));
var cffThumbHref=photoItem.source,
cffPhotoItemWidth=photoItem.width,
cffPhotoItemHeight=photoItem.height;
if(typeof photoItem.images[0]!=='undefined'){
cffThumbHref=photoItem.images[0].source;
cffPhotoItemWidth=photoItem.images[0].width;
cffPhotoItemHeight=photoItem.images[0].height;
}
if(typeof photoItem.images[ photoItem.images.length-2 ]!=='undefined'){
var cffThumbImg=photoItem.images[ photoItem.images.length-2 ].source;
}else{
var cffThumbImg=cffThumbHref;
}
albumThumbs +='';
thumbsData.push([cffThumbHref, cffPhotoItemWidth, cffPhotoItemHeight, 'http://facebook.com/'+photoItem.id, dataCaption, origCaption, undefined, undefined, cffThumbImg]);
if(i > 0){
cffInsertLightboxImage(lightboxImageOrder, cffThumbHref, dataCaption, 'http://facebook.com/'+photoItem.id, thisPostId, albumsonly, true, cffThumbImg);
}});
}else{
if(typeof data.attachments!=='undefined'){
$.each(data.attachments.data[0].subattachments.data, function(i, subattachment){
var dataCaption='';
if(subattachment.description) dataCaption=subattachment.description;
origCaption=String(origCaption).replace(/"/g, '"');
dataCaption=cffLinkify(dataCaption);
dataCaption=dataCaption.replace(hashRegex , cffReplaceHashtags);
dataCaption=String(dataCaption).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, "
");
var lightboxImageOrder=(parseInt(self.currentImageIndex)+parseInt(i));
albumThumbs +='';
thumbsData.push([subattachment.media.image.src, subattachment.media.image.width, subattachment.media.image.height, subattachment.url, dataCaption, origCaption, author_name, date_in_correct_format]);
if(i > 0){
cffInsertLightboxImage(lightboxImageOrder, subattachment.media.image.src, dataCaption, subattachment.url, thisPostId, albumsonly, true, author_name, date_in_correct_format, subattachment.media.image.src);
}});
}}
$('.cff-lightbox-thumbs-holder').append('' + albumThumbs + '
');
jQuery(".cff-lightbox-thumbs-holder .cff-lightbox-attachment").imgLiquid({fill:true});
$('.cff-loader').hide();
$('.cff-lightbox-thumbs-holder').css('min-height', 0);
thumbsArr[ thisPostId ]=thumbsData;
}});
}}else{
$('.cff-lightbox-thumbs').hide();
}
$(".cff-lightbox-attachment").removeClass('cff-selected');
$(".cff-lightbox-attachment[href='"+$('.cff-lightbox-image').attr('src')+"']").addClass('cff-selected');
function cffInsertLightboxImage(currentImageIndex, link, title, facebookurl, postid, albumsonly, isThumbnail, cffThumbImg){
var found=false;
$.each(self.album, function(i, thumbitem){
if(thumbitem.link==link){
found=true;
return;
}});
if(found==true) return;
(albumsonly) ? postType='albumsonly':postType='';
(albumsonly) ? lbcomments='false':lbcomments='true';
self.album.splice(currentImageIndex, 0, {
link: link,
title: title,
postid: postid,
showthumbs: 'true',
facebookurl: facebookurl,
video: '',
iframe: '',
type: postType,
cffgroupalbums: undefined,
isthumbnail: isThumbnail,
lbcomments: lbcomments,
thumbimg: cffThumbImg
});
}
this.$lightbox.find('.cff-lightbox-caption').fadeIn('fast');
if(typeof this.album[this.currentImageIndex].title!=='undefined'&&this.album[this.currentImageIndex].title!==""){
var origCaption=this.album[this.currentImageIndex].title;
origCaption=origCaption.replace(hashRegex , cffReplaceHashtags);
origCaption=String(origCaption).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"');
var $lightboxCaption=this.$lightbox.find('.cff-lightbox-caption'),
$lightboxCaptionText=$lightboxCaption.find('.cff-lightbox-caption-text');
if(this.album[this.currentImageIndex].link==$('.cff-lightbox-image').attr('src')) $lightboxCaptionText.html(origCaption);
if($lightboxCaptionText.text()==' '||$lightboxCaptionText.text()==''){
$lightboxCaption.addClass('cff-no-caption');
}else{
$lightboxCaption.removeClass('cff-no-caption');
}}else{
this.$lightbox.find('.cff-lightbox-caption').addClass('cff-no-caption').find('.cff-lightbox-caption-text').html('');
}
this.$lightbox.find('.cff-lightbox-facebook, .cff-lightbox-caption-text a, .cff-lightbox-sidebar a:not(.cff-comment-replies-a)').unbind().on('click', function(event){
window.open($(this).attr('href'),
'_blank'
)
}
);
if(this.album.length > 1&&this.options.showImageNumberLabel){
this.$lightbox.find('.cff-lightbox-number').text(this.options.albumLabel(this.currentImageIndex + 1, this.album.length)).fadeIn('fast');
}else{
this.$lightbox.find('.cff-lightbox-number').hide();
}
this.$outerContainer.removeClass('animating');
this.$lightbox.find('.cff-lightbox-dataContainer').fadeIn(this.options.resizeDuration, function(){
return self.sizeOverlay();
});
};
Lightbox.prototype.preloadNeighboringImages=function(){
if(this.album.length > this.currentImageIndex + 1){
var preloadNext=new Image();
preloadNext.src=this.album[this.currentImageIndex + 1].link;
}
if(this.currentImageIndex > 0){
var preloadPrev=new Image();
preloadPrev.src=this.album[this.currentImageIndex - 1].link;
}};
Lightbox.prototype.enableKeyboardNav=function(){
$(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
};
Lightbox.prototype.disableKeyboardNav=function(){
$(document).off('.keyboard');
};
Lightbox.prototype.keyboardAction=function(event){
var KEYCODE_ESC=27;
var KEYCODE_LEFTARROW=37;
var KEYCODE_RIGHTARROW=39;
var keycode=event.keyCode;
var key=String.fromCharCode(keycode).toLowerCase();
if(keycode===KEYCODE_ESC||key.match(/x|o|c/)){
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
this.end();
}else if(key==='p'||keycode===KEYCODE_LEFTARROW){
if(this.currentImageIndex!==0){
this.changeImage(this.currentImageIndex - 1);
}else if(this.options.wrapAround&&this.album.length > 1){
this.changeImage(this.album.length - 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}else if(key==='n'||keycode===KEYCODE_RIGHTARROW){
if(this.currentImageIndex!==this.album.length - 1){
this.changeImage(this.currentImageIndex + 1);
}else if(this.options.wrapAround&&this.album.length > 1){
this.changeImage(0);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}};
Lightbox.prototype.end=function(){
this.disableKeyboardNav();
$(window).off("resize", this.sizeOverlay);
this.$lightbox.fadeOut(this.options.fadeDuration);
this.$overlay.fadeOut(this.options.fadeDuration);
$('select, object, embed').css({
visibility: "visible"
});
};
return Lightbox;
})();
$(function(){
var options=new LightboxOptions();
var lightbox=new Lightbox(options);
});
}).call(this);
function cff_supports_video(){
return !!document.createElement('video').canPlayType;
}}
if(jQuery('#cff.cff-lb').length) cffLightbox();
};
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.2",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t(s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.2",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));t&&this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.2",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),+function(t){"use strict";function e(e){e&&3===e.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=i(o),s={relatedTarget:this};n.hasClass("open")&&(n.trigger(e=t.Event("hide.bs.dropdown",s)),e.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger("hidden.bs.dropdown",s)))}))}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.2",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=i(n),a=s.hasClass("open");if(e(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('').insertAfter(t(this)).on("click",e);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",r)}return!1}},a.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var o=t(this);if(e.preventDefault(),e.stopPropagation(),!o.is(".disabled, :disabled")){var n=i(o),a=n.hasClass("open");if(!a&&27!=e.which||a&&27==e.which)return 27==e.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find('[role="menu"]'+r+', [role="listbox"]'+r);if(l.length){var h=l.index(e.target);38==e.which&&h>0&&h--,40==e.which&&h').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i&&i.$tip&&i.$tip.is(":visible")?void(i.hoverState="in"):(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.options.container?t(this.options.container):this.$element.parent(),g=this.getPosition(u);r="bottom"==r&&d.bottom+c>g.bottom?"top":"top"==r&&d.top-c
'; if(cff_comment_author_info) cff_comments +=''+commentItem.from.name+''; if(cff_post_tags&&commentItem.hasOwnProperty('message_tags')){ $.each(commentItem.message_tags, function(i, message_tag){ tag_name=message_tag.name; tag_link=''+message_tag.name+''; comment_message=comment_message.replace(tag_name, tag_link); }); } cff_comments +=comment_message+'
'; if(commentItem.hasOwnProperty('attachment')){ if(commentItem.attachment.hasOwnProperty('media')){ cff_comments +=''; }} cff_comments +=''; var cff_middot='', cff_comment_time=$self.find('#cff_'+commentItem.id).attr('data-cff-comment-date'); if(typeof cff_comment_time!=='undefined'){ cff_comments +=cff_comment_time; cff_middot=' · '; } if(commentItem.like_count > 0) cff_comments +=''+cff_middot+''+commentItem.like_count+''; cff_comments +=''; var cff_comment_count=parseInt(commentItem.comment_count); if(cff_comment_count > 0){ var cff_replies_text_string=''; (cff_comment_count==1) ? cff_replies_text_string=cff_translate_reply_text:cff_replies_text_string=cff_translate_replies_text; cff_comments +=''+cff_comment_count+' '+cff_replies_text_string+'
'; } cff_comments +='