var cff_js_exists=(typeof cff_js_exists!=='undefined') ? true:false; if(!cff_js_exists){ function cff_init($cff){ var cffTouchDevice=false; if(cffIsTouchDevice()===true) cffTouchDevice=true; function cffIsTouchDevice(){ return true==("ontouchstart" in window||window.DocumentTouch&&document instanceof DocumentTouch); } var firsttime=false; if(typeof $cff==='undefined'){ $cff=jQuery('.cff'); firsttime=true; } (function($){ jQuery(document).off('click', '#cff a.cff-view-comments').on('click', '#cff a.cff-view-comments', function(){ var $commentsBox=jQuery(this).closest('.cff-item').find('.cff-comments-box'); $commentsBox.slideToggle(); $commentsBox.find('.cff-comment:visible').each(function(){ var $thisComment=jQuery(this); $thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a').html('Avatar'); }); }); var locatefile=true; if(typeof cffpath==='undefined'||cffpath=='') cffpath=window.location.host + '/fbfeed'; var metaArr={}, newMetaArr={}; var lb=0; jQuery('#cff.cff-lb').each(function(){ lb++; $(this).attr('data-cff-lb', lb); }); var $cff_post_selector=$cff.find('.cff-item.cff-new, .cff-album-item.cff-new'); if(firsttime){ $cff_post_selector=jQuery('#cff .cff-item.cff-new, #cff .cff-album-item.cff-new'); } $cff_post_selector.each(function(){ var $self=jQuery(this); var expanded=false; if($self.hasClass('cff-event')){ var $post_text=$self.find('.cff-desc .cff-desc-text'), text_limit=$post_text.parent().attr('data-char'); }else{ var $post_text=$self.find('.cff-post-text .cff-text'), text_limit=$self.closest('#cff').attr('data-char'); } if(typeof text_limit==='undefined'||text_limit=='') text_limit=99999; if($post_text.find('a.cff-post-text-link').length) $post_text=$self.find('.cff-post-text .cff-text a'); var full_text=$post_text.html(); if(full_text==undefined) full_text=''; var cff_trunc_regx=new RegExp(/(<[^>]*>)/g); var cff_trunc_counter=0; full_text_arr=full_text.split(cff_trunc_regx); for (var i=0, len=full_text_arr.length; i < len; i++){ if(!(cff_trunc_regx.test(full_text_arr[i]))){ if(cff_trunc_counter==text_limit){ full_text_arr.splice(i, 1); continue; } cff_trunc_counter=cff_trunc_counter + full_text_arr[i].length; if(cff_trunc_counter > text_limit){ var diff=cff_trunc_counter - text_limit; full_text_arr[i]=full_text_arr[i].slice(0, -diff); cff_trunc_counter=text_limit; if(full_text.length > text_limit) $self.find('.cff-expand').show(); }} } short_text=full_text_arr.join(''); var short_text=short_text.replace(/(<(?!\/)[^>]+>)+(<\/[^>]+>)/g, ""); var lastChar=short_text.substr(short_text.length - 1); if(lastChar=='<') short_text=short_text.substring(0, short_text.length - 1); short_text=short_text.replace(/(
\s*)+$/,''); short_text=short_text.replace(/(\s*)+$/,''); $post_text.html(short_text); $self.find('.cff-expand a').unbind('click').bind('click', function(e){ e.preventDefault(); var $expand=jQuery(this), $more=$expand.find('.cff-more'), $less=$expand.find('.cff-less'); if(expanded==false){ $post_text.html(full_text); expanded=true; $more.hide(); $less.show(); }else{ $post_text.html(short_text); expanded=false; $more.show(); $less.hide(); } cffLinkHashtags(); $post_text.find('a').attr('target', '_blank'); if($self.closest('.cff').hasClass('cff-masonry')&&!$self.closest('.cff').hasClass('cff-masonry-css')){ cffAddMasonry($cff); }}); $post_text.find('a').add($self.find('.cff-post-desc a')).attr({ 'target':'_blank', 'rel':'nofollow' }); var post_id=$self.attr('id').substring(4), post_id_orig=$self.find('.cff-view-comments').attr('id'); if(locatefile!=true) $self.find('.cff-lightbox-thumbs-holder').css('min-height', 0); jQuery(document).off('click', '#cff .cff-show-more-comments, .cff-lightbox-sidebar .cff-show-more-comments').on('click', '#cff .cff-show-more-comments, .cff-lightbox-sidebar .cff-show-more-comments', function(){ var $cffMoreCommentsLink=jQuery(this), thisCommentsTotal=parseInt($cffMoreCommentsLink.attr('data-cff-comments-total')); if($cffMoreCommentsLink.hasClass('cff-clicked')&&thisCommentsTotal > 25){ $cffMoreCommentsLink.find('a').attr({ 'href':$cffMoreCommentsLink.closest('.cff-comments-box').find('.cff-comment-on-facebook a').attr('href'), 'target':'_blank' }); } if(thisCommentsTotal <=25) $cffMoreCommentsLink.hide(); $cffMoreCommentsLink.addClass('cff-clicked'); $cffMoreCommentsLink.parent().find('.cff-comment').show().each(function(){ var $thisComment=jQuery(this); $thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a').html('Avatar'); }); }); if($self.hasClass('cff-timeline-event')||$self.hasClass('cff-event')){ if($(this).find('.cff-date .cff-start-date k').text()!==$(this).find('.cff-date .cff-end-date k').text()) $(this).find('.cff-date .cff-end-date k').show(); } var $cffPhotoImg=$self.find('.cff-photo img, .cff-event-thumb img, .cff-poster, .cff-album-cover img'), cffPhotoImgSrc=$cffPhotoImg.attr('src'), cffImgStringAttr=$cffPhotoImg.attr('data-querystring'); if(typeof cffPhotoImgSrc=='undefined') cffPhotoImgSrc=''; if(cffPhotoImgSrc.indexOf('i0.wp.com') > -1||cffPhotoImgSrc.indexOf('i1.wp.com') > -1||cffPhotoImgSrc.indexOf('i2.wp.com') > -1||cffPhotoImgSrc.indexOf('i3.wp.com') > -1||cffPhotoImgSrc.indexOf('i4.wp.com') > -1||cffPhotoImgSrc.indexOf('i5.wp.com') > -1){ var photonSrc=$cffPhotoImg.attr('src').substring(0, $cffPhotoImg.attr('src').indexOf('?')), newSrc=photonSrc.replace('http://', 'https:/').replace(/i0.wp.com|i1.wp.com|i2.wp.com|i3.wp.com|i4.wp.com|i5.wp.com/gi, '') + '?' + cffImgStringAttr; $cffPhotoImg.attr('src', newSrc); } function cffLinkHashtags(){ var cffTextStr=$self.find('.cff-text').html(), cffDescStr=$self.find('.cff-post-desc').html(), regex=/(^|\s)#(\w*[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+\w*)/gi, linkcolor=$self.find('.cff-text').attr('data-color'); function replacer(hash){ var replacementString=jQuery.trim(hash); if(/^#[0-9A-F]{6}$/i.test(replacementString)){ return replacementString; }else{ return ' ' + replacementString + ''; }} if(cfflinkhashtags=='true'){ var $cffText=$self.find('.cff-text'); if($cffText.length > 0){ cffTextStr=cffTextStr.replace(/
/g, "
"); $cffText.html(cffTextStr.replace(regex , replacer)); }} if($self.find('.cff-post-desc').length > 0) $self.find('.cff-post-desc').html(cffDescStr.replace(regex , replacer)); } cffLinkHashtags(); $self.find('.cff-text a').attr('target', '_blank'); if($self.closest('#cff').hasClass('cff-lb')){ $self.find('.cff-photo, .cff-album-cover, .cff-event-thumb, .cff-html5-video, .cff-iframe-wrap').each(function(){ var $photo=$(this), postId=post_id, cffLightboxTitle='', cffShowThumbs=false, postType='', cffgroupalbums=''; cffShowThumbs=true; function cffFormatCaption(text){ return String(text).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, "
"); } if($self.hasClass('cff-albums-only')){ postType='albumsonly'; cffLightboxTitle=cffFormatCaption($self.find('img').attr('alt')); var dataGroup=$self.closest('#cff').attr('data-group'); if(typeof dataGroup!=='undefined') cffgroupalbums='data-cffgroupalbums="true"'; }else if($self.hasClass('cff-timeline-event')){ var capText=''; if($self.find('.cff-author-text .cff-page-name').length) capText +=$self.find('.cff-author-text .cff-page-name').text() + '

'; if(full_text.length > 5) capText +=full_text; cffLightboxTitle=cffFormatCaption(capText); }else if($self.hasClass('cff-event')){ cffLightboxTitle=cffFormatCaption($self.find('.cff-date').text()); }else if($self.hasClass('cff-album-item')){ cffLightboxTitle=cffFormatCaption($self.find('img').attr('alt')); }else{ var lb_title=full_text; if(full_text.trim()=='') lb_title=$self.find('.cff-post-desc').text(); if(lb_title==''&&$self.find('.cff-author .cff-story').length) lb_title=$self.find('.cff-author .cff-page-name').text(); if(lb_title=='') lb_title=' '; cffLightboxTitle=cffFormatCaption(lb_title); } if(cffLightboxTitle.length > 1) cffLightboxTitle=cffLightboxTitle.replace(/"/g, '"'); var cffLightboxTile='
'; $photo.prepend(cffLightboxTile); if(!cffTouchDevice){ $photo.hover(function(){ $self.find('.cff-photo-hover').fadeIn(200); }, function(){ $self.find('.cff-photo-hover').stop().fadeOut(600); }); }}); } $self.find('.cff-share-link').unbind().bind('click', function(){ $self.find('.cff-share-tooltip').toggle(); }); if($self.hasClass('cff-album-item')){ var cff_data_full_size=$self.attr('data-cff-full-size'); if(typeof cff_data_full_size!=='undefined'&&cff_data_full_size!='') $self.find('.cff-lightbox-link').attr('href', cff_data_full_size); } if(( $self.find('.cff-html5-video').length||$self.hasClass('cff-video'))){ var cff_live_video=false; if($self.find('.cff-html5-video').length){ var $vid_sel=$self.find('.cff-html5-video'); if($vid_sel.attr('data-cff-live')=='true') cff_live_video=true; } if($self.hasClass('cff-video')) var $vid_sel=$self; if(cff_live_video&&$(window).width() <=640){ }else{ if($vid_sel.attr('data-cff-video-player')!='standard'){ $self.find('.cff-lightbox-link').attr({ 'data-iframe':'https://www.facebook.com/v2.3/plugins/video.php?href=' + $vid_sel.attr('data-cff-video-link'), 'data-video':'' }); }} } setTimeout(function(){ $self.find('.cff-iframe-wrap .fluid-width-video-wrapper iframe').unwrap().wrap('
'); $self.find('.cff-iframe-wrap .iframe-embed iframe').unwrap('iframe-embed'); }, 500); }); jQuery(document).off('click', '.cff-comment-replies a').on('click', '.cff-comment-replies a', function(){ cffLoadCommentReplies($(this)); }); $('.cff-wrapper').each(function(){ var $cff=$(this).find('#cff'), cff_grid_pag=$cff.attr('data-grid-pag'); function cffCheckWidth(){ if($cff.innerWidth() < 400){ if(!$cff.hasClass('cff-disable-narrow')){ $cff.addClass('narrow'); $('.cff-shared-link .cff-link').each(function(){ }); }}else{ $cff.removeClass('narrow'); }} cffCheckWidth(); function cffActionLinksPos(){ if($cff.innerWidth() < (190 + $('.cff-post-links').innerWidth())){ $cff.find('.cff-post-links').addClass('cff-left') }else{ $cff.find('.cff-post-links').removeClass('cff-left'); }} cffActionLinksPos(); var cffdelay=(function(){ var cfftimer=0; return function(cffcallback, cffms){ clearTimeout (cfftimer); cfftimer=setTimeout(cffcallback, cffms); };})(); window.addEventListener('resize', function(event){ cffdelay(function(){ cffCheckWidth(); cffActionLinksPos(); cffResizeAlbum(); }, 500); }); function cffResizeAlbum(last){ var cffAlbumWidth=$cff.find('.cff-album-item').eq(0).find('a').innerWidth(); $cff.find('.cff-album-item a').css('height', cffAlbumWidth); $cff.find('.cff-photo.cff-crop').css('height', $cff.find('.cff-photo.cff-crop').width()); $cff.find('.cff-item.cff-album .cff-photo.cff-multiple, .cff-video-post .cff-html5-video.cff-multiple').each(function(){ var $cffPhotoEl=$(this); var cffPhotoImgWidth=$cffPhotoEl.find('img').first().width(); if(cffPhotoImgWidth < 10) cffPhotoImgWidth=300; if($cffPhotoEl.hasClass('cff-img-layout-3')) $cffPhotoEl.find('.cff-img-attachments .cff-crop').css('height', cffPhotoImgWidth/2); if($cffPhotoEl.hasClass('cff-img-layout-4')) $cffPhotoEl.find('.cff-img-attachments .cff-crop').css('height', cffPhotoImgWidth/3); if($cffPhotoEl.is('.cff-img-layout-3, .cff-img-layout-4')){ var $cffMainImage=$cffPhotoEl.find('.cff-main-image'), cropPercentage=0.6; if($cffPhotoEl.hasClass('cff-img-layout-4')) cropPercentage=0.8; var cffImageHeight=Math.round(cffPhotoImgWidth / $cffMainImage.find('img').attr('data-ratio')); $cffMainImage.css('height', Math.round(Math.max(cffImageHeight*cropPercentage, $cffPhotoEl.find('.cff-img-attachments').height()))); }else if($cffPhotoEl.is('.cff-img-layout-2')){ var $cffCrop=$cffPhotoEl.find('.cff-img-wrap.cff-crop'); if($cffPhotoEl.hasClass('cff-portrait')){ $cffPhotoEl.find('.cff-img-wrap.cff-crop').css('height', $cffPhotoEl.width()*0.8); }else{ $cffPhotoEl.find('.cff-img-wrap.cff-crop').css('height', $cffPhotoEl.width()/2); }} if(last==true&&($cffPhotoEl.is('.cff-img-layout-3')||$cffPhotoEl.is('.cff-img-layout-4'))&&$cffPhotoEl.find('.cff-main-image').height() < 10) $cffPhotoEl.find('.cff-img-layout-3 .cff-main-image img, .cff-img-layout-4 .cff-main-image img').css({ 'display':'block', 'visibility':'visible' }) if(cffPhotoImgWidth < 200){ $cffPhotoEl.addClass('cff-small-layout'); }else{ $cffPhotoEl.removeClass('cff-small-layout'); }}); } cffResizeAlbum(false); setTimeout(function(){ cffResizeAlbum(false); }, 50); setTimeout(function(){ cffResizeAlbum(true); }, 500); setTimeout(function(){ cffResizeAlbum(true); }, 1500); var num_events=parseInt($cff.attr('data-pag-num')), show_events=num_events; $cff.find('.cff-event').slice(0, num_events).css('display', 'inline-block'); if($cff.hasClass('cff-all-reviews')){ var num_reviews=parseInt($cff.attr('data-pag-num')), show_reviews=num_reviews; var review_offset=parseInt($cff.attr('data-offset')); if(typeof review_offset=='undefined'||isNaN(review_offset)) review_offset=0; $cff.find('.cff-review').slice(0, num_reviews + review_offset).css('display', 'inline-block'); if(review_offset > 0) $cff.find('.cff-review').slice(0, review_offset).remove(); } var $cffLoadMore=$cff.find('#cff-load-more'), cff_no_posts_added=$cff.find('.cff-load-more').attr('data-cff-no-posts-added'); if(typeof cff_no_posts_added==typeof undefined||cff_no_posts_added==false){ $cffLoadMore.attr('data-cff-no-posts-added', 'false'); } if($cff.find('.cff-item, .cff-album-item').length < 1) $cffLoadMore.attr('data-cff-no-posts-added', 'true'); $cffLoadMore.off().on('click', function(){ var shortcodeData=$cff.attr('data-cff-shortcode'), $paginationURL=$cff.find('.cff-pag-url'), pag_url=$paginationURL.attr('data-cff-pag-url'); var events_count=$cff.find('.cff-event').length; if(events_count > 0){ show_events=show_events + num_events; $cff.find('.cff-event').slice(0, show_events).css('display', 'inline-block'); if(show_events > events_count){ $cff.find('#cff-load-more').hide(); cff_no_more_posts($cff, $cffLoadMore); } if($cff.hasClass('cff-masonry')&&!$cff.hasClass('cff-masonry-css')){ cffAddMasonry($cff); } return; } if($cff.hasClass('cff-all-reviews')){ var reviews_count=$cff.find('.cff-review').length; if(reviews_count > 0){ show_reviews=show_reviews + num_reviews; $cff.find('.cff-review').slice(0, show_reviews).css('display', 'inline-block'); if(show_reviews > reviews_count){ $cff.find('#cff-load-more').hide(); cff_no_more_posts($cff, $cffLoadMore); } if($cff.hasClass('cff-masonry')&&!$cff.hasClass('cff-masonry-css')){ cffAddMasonry($cff); } return; }} $cffLoadMore.off().removeAttr('id').addClass('cff-disabled'); $paginationURL.remove(); if($cff.hasClass('cff-album-items-feed')){ var item_sel='.cff-album-item'; }else{ var item_sel='.cff-item'; } if(item_sel=='.cff-album-item'){ if((pag_url==''||pag_url=='{}')) pag_url=$paginationURL.attr('data-cff-prev-url'); var prev_urls=$paginationURL.attr('data-cff-prev-url'); var prev_urls_arr=(typeof prev_urls=='undefined') ? '':JSON.parse(prev_urls); } var pag_url_arr=(typeof pag_url=='undefined') ? '':JSON.parse(pag_url); if(item_sel=='.cff-album-item'){ for (var key in prev_urls_arr){ if(prev_urls_arr.hasOwnProperty(key)){ if(typeof pag_url_arr[key]=='undefined') pag_url_arr[key]=prev_urls_arr[key]; }} } if((pag_url==''||pag_url=='{}')&&item_sel=='.cff-item'){ $cffLoadMore.hide(); cff_no_more_posts($cff, $cffLoadMore); }else{ $cffLoadMore.addClass('cff-loading').append('
'); $cffLoadMore.find('.cff-loader').css('background-color', $cffLoadMore.css('color')); } for (var key in pag_url_arr){ if(pag_url_arr.hasOwnProperty(key)){ var this_url=pag_url_arr[key], until_old=cffGetParameterByName('until', this_url); var until_new=(parseInt($cff.find(item_sel+'.cff-' + key).last().attr('data-cff-timestamp')) - 1).toString(); if(isNaN(parseFloat(until_new))){ until_new=(parseInt($cff.find(item_sel).last().attr('data-cff-timestamp')) - 1).toString(); } if($cffLoadMore.attr('data-cff-no-posts-added')=='true'){ var new_url=this_url; }else{ var new_url=this_url.replace("until="+until_old,"until="+until_new); } if(cff_grid_pag=='offset'){ if(item_sel=='.cff-album-item'){ if(new_url.indexOf('&after=') > -1) new_url=new_url.replace("&after="+cffGetParameterByName('after', new_url),""); key=key.replace(/(:|\.|\[|\]|,|=)/g, "\\$1"); var albumItemCount=$cff.find('.cff-album-item.cff-' + key).length + $cff.find('.cff-empty-album.cff-' + key).length; if(new_url.indexOf('&offset=') > -1){ new_url=new_url.replace("&offset="+cffGetParameterByName('offset', new_url), "&offset="+albumItemCount); }else{ new_url=new_url + "&offset=" + albumItemCount; } key=key.replace(/\\/g, ''); }} if((this_url.indexOf('/events') > -1&&this_url.indexOf('&after=') > -1)||(this_url.indexOf('/ratings') > -1&&this_url.indexOf('&after=') > -1&&$cff.hasClass('cff-all-reviews'))){ new_url=new_url.replace("&after="+cffGetParameterByName('after', new_url),""); } if(new_url.indexOf('&__paging_token') > -1){ new_url=new_url.replace("&__paging_token="+cffGetParameterByName('__paging_token', new_url),""); } pag_url_arr[key]=new_url; }} cffajaxurl=cffpath + "/core/custom-facebook-feed.php"; pag_url=JSON.stringify(pag_url_arr); jQuery.ajax({ url:cffajaxurl, type:'post', data:{ action:'cff_get_new_posts', shortcode_data:shortcodeData, pag_url:pag_url }, success:function(data){ if(data.indexOf('
'+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'); }}); if($('.cff-timeline-feed').length){ cffajaxurl=cffpath + "/core/custom-facebook-feed.php"; $.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(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(); 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'; var cff_is_video_post=$self.hasClass('cff-video-post') ? '&isvideo=true':''; var url=cffpath + "/core/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; 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(!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); cffajaxurl=cffpath + "/core/custom-facebook-feed.php"; 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){ } 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 +=parseInt(cff_reactions_count)-2; 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=cffLinkify(commentItem.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 +='
=commentShow) ? cff_comments +='display: none;':cff_comments +='display: block;'; cff_comments +=$self.find('#cff_'+commentItem.id).attr('style'); cff_comments +='">'; cff_comments +='
'; cff_comments +='

'; 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 +='';
if(commentItem.attachment.hasOwnProperty('title')){
cff_comments +=commentItem.attachment.title;
}else{
cff_comments +='Attachment';
}
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 +='
'; cff_comments +='
'; if(!cff_hide_comment_avatars&&cff_comment_author_info){ cff_comments +=''; } 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); !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(); 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 cffLoadCommentReplies($this){ var usegrouptoken='', useowntoken=''; if($this.closest('#cff').hasClass('cff-group')) usegrouptoken='&usegrouptoken=true'; if($this.closest('#cff').attr('data-own-token')=='true') useowntoken='&useowntoken=true'; var $commentReplies=$this.parent(), $commentRepliesBox=$commentReplies.siblings('.cff-comment-replies-box'), comments_url=cffpath + "/core/comments.php?id=" + $commentReplies.attr('data-id') + usegrouptoken + useowntoken; 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 +='

'; if(cff_comment_author_info) allComments +=''+commentItem.from.name+''; allComments +=commentItem.message+'

'; if(typeof commentItem.attachment!=='undefined') allComments +=''+commentItem.attachment.title+''; if(parseInt(commentItem.like_count) > 0) allComments +=''+commentItem.like_count+''; allComments +='
'; if(cff_comment_author_info) allComments +='
Avatar
'; 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_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'); $lightbox_sidebar.html("
" + "

"+date_in_correct_format+"

"+author_name+"
" + "

" + $('.cff-lightbox-caption-text').html() + '

' + $('#cff_'+this.album[this.currentImageIndex].postid+' .cff-comments-box')[0].outerHTML); 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('Avatar'); }); $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 }); }, 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)); albumThumbs +=''; if(i > 0){ cffInsertLightboxImage(lightboxImageOrder, thumb[0], thumb[4], thumb[3], thisPostId, albumsonly, true, thumb[6], thumb[7]); }}); $('.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 cffpath==='undefined'||cffpath=='') cffpath=window.location.host + '/fbfeed'; var cffAttachmentsUrl=cffpath + "/core/thumbs.php?id=" + thisPostId, 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; albumThumbs +=''; thumbsData.push([cffThumbHref, photoItem.width, photoItem.height, 'http://facebook.com/'+photoItem.id, dataCaption, origCaption]); if(i > 0){ cffInsertLightboxImage(lightboxImageOrder, cffThumbHref, dataCaption, 'http://facebook.com/'+photoItem.id, thisPostId, albumsonly, true); }}); }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); }}); }} $('.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){ 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 }); } 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(); }; !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;i').val(m.extraData[d].value).appendTo(w)[0]:e('').val(m.extraData[d]).appendTo(w)[0]);m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(h){var x=document.createElement("form").submit;x.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(m.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,m)}catch(y){i="parsererror",x.error=r=y||i}}catch(y){a("error caught: ",y),i="error",x.error=r=y||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,m,r])),d&&e.event.trigger("ajaxComplete",[x,m]),d&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,m,d,p,v,g,x,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand ("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),d&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},d=m.global,d&&0===e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(m.extraData=m.extraData||{},m.extraData[b]=y.value,"image"==y.type&&(m.extraData[b+".x"]=w.clk_x,m.extraData[b+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var d=t.traditional;void 0===d&&(d=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,d)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,d);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var b=t.error;t.error=function(e,r,a){var n=t.context||this;b.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;Ec;c++)if(d=u[c],f=d.name,f&&!d.disabled)if(t&&o.clk&&"image"==d.type)o.clk==d&&(a.push({name:f,value:e(d).val(),type:d.type}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}));else if(m=e.fieldValue(d,!0),m&&m.constructor==Array)for(r&&r.push(d),l=0,h=m.length;h>l;l++)a.push({name:f,value:m[l]});else if(n.fileapi&&"file"==d.type){r&&r.push(d);var v=d.files;if(v.length)for(l=0;li;i++)r.push({name:a,value:n[i]});else null!==n&&"undefined"!=typeof n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,c="select-one"==n,l=c?o+1:u.length,f=c?o:0;l>f;f++){var m=u[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),c)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}); (function($){ 'use strict'; if(typeof _wpcf7==='undefined'||_wpcf7===null){ return; } _wpcf7=$.extend({ cached: 0, inputs: [] }, _wpcf7); $.fn.wpcf7InitForm=function(){ this.ajaxForm({ beforeSubmit: function(arr, $form, options){ $form.wpcf7ClearResponseOutput(); $form.find('[aria-invalid]').attr('aria-invalid', 'false'); $form.find('.ajax-loader').addClass('is-active'); return true; }, beforeSerialize: function($form, options){ $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val(''); }); return true; }, data: { '_wpcf7_is_ajax_call': 1 }, dataType: 'json', success: $.wpcf7AjaxSuccess, error: function(xhr, status, error, $form){ var e=$('
').text(error.message); $form.after(e); }}); if(_wpcf7.cached){ this.wpcf7OnloadRefill(); } this.wpcf7ToggleSubmit(); this.find('.wpcf7-submit').wpcf7AjaxLoader(); this.find('.wpcf7-acceptance').click(function(){ $(this).closest('form').wpcf7ToggleSubmit(); }); this.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox(); this.find('.wpcf7-list-item.has-free-text').wpcf7ToggleCheckboxFreetext(); this.find('[placeholder]').wpcf7Placeholder(); if(_wpcf7.jqueryUi&&! _wpcf7.supportHtml5.date){ this.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(_wpcf7.jqueryUi&&! _wpcf7.supportHtml5.number){ this.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } this.find('.wpcf7-character-count').wpcf7CharacterCount(); this.find('.wpcf7-validates-as-url').change(function(){ $(this).wpcf7NormalizeUrl(); }); this.find('.wpcf7-recaptcha').wpcf7Recaptcha(); }; $.wpcf7AjaxSuccess=function(data, status, xhr, $form){ if(! $.isPlainObject(data)||$.isEmptyObject(data)){ return; } _wpcf7.inputs=$form.serializeArray(); var $responseOutput=$form.find('div.wpcf7-response-output'); $form.wpcf7ClearResponseOutput(); $form.find('.wpcf7-form-control').removeClass('wpcf7-not-valid'); $form.removeClass('invalid spam sent failed'); if(data.captcha){ $form.wpcf7RefillCaptcha(data.captcha); } if(data.quiz){ $form.wpcf7RefillQuiz(data.quiz); } if(data.invalids){ $.each(data.invalids, function(i, n){ $form.find(n.into).wpcf7NotValidTip(n.message); $form.find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid'); $form.find(n.into).find('[aria-invalid]').attr('aria-invalid', 'true'); }); $responseOutput.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); $(data.into).wpcf7TriggerEvent('invalid'); }else if(1==data.spam){ $form.find('[name="g-recaptcha-response"]').each(function(){ if(''==$(this).val()){ var $recaptcha=$(this).closest('.wpcf7-form-control-wrap'); $recaptcha.wpcf7NotValidTip(_wpcf7.recaptcha.messages.empty); }}); $responseOutput.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); $(data.into).wpcf7TriggerEvent('spam'); }else if(1==data.mailSent){ $responseOutput.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); if(data.onSentOk){ $.each(data.onSentOk, function(i, n){ eval(n) }); } $(data.into).wpcf7TriggerEvent('mailsent'); }else{ $responseOutput.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); $(data.into).wpcf7TriggerEvent('mailfailed'); } if(data.onSubmit){ $.each(data.onSubmit, function(i, n){ eval(n) }); } $(data.into).wpcf7TriggerEvent('submit'); if(1==data.mailSent){ $form.resetForm(); } $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); $responseOutput.append(data.message).slideDown('fast'); $responseOutput.attr('role', 'alert'); $.wpcf7UpdateScreenReaderResponse($form, data); }; $.fn.wpcf7TriggerEvent=function(name){ return this.each(function(){ var elmId=this.id; var inputs=_wpcf7.inputs; var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: { id: elmId, inputs: inputs }}); this.dispatchEvent(event); $(this).trigger('wpcf7:' + name); $(this).trigger(name + '.wpcf7'); }); }; $.fn.wpcf7ExclusiveCheckbox=function(){ return this.find('input:checkbox').click(function(){ var name=$(this).attr('name'); $(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); }; $.fn.wpcf7Placeholder=function(){ if(_wpcf7.supportHtml5.placeholder){ return this; } return this.each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); }; $.fn.wpcf7AjaxLoader=function(){ return this.each(function(){ $(this).after(''); }); }; $.fn.wpcf7ToggleSubmit=function(){ return this.each(function(){ var form=$(this); if(this.tagName.toLowerCase()!='form'){ form=$(this).find('form').first(); } if(form.hasClass('wpcf7-acceptance-as-validation')){ return; } var submit=form.find('input:submit'); if(! submit.length){ return; } var acceptances=form.find('input:checkbox.wpcf7-acceptance'); if(! acceptances.length){ return; } submit.removeAttr('disabled'); acceptances.each(function(i, n){ n=$(n); if(n.hasClass('wpcf7-invert')&&n.is(':checked') || ! n.hasClass('wpcf7-invert')&&! n.is(':checked')){ submit.attr('disabled', 'disabled'); }}); }); }; $.fn.wpcf7ToggleCheckboxFreetext=function(){ return this.each(function(){ var $wrap=$(this).closest('.wpcf7-form-control'); if($(this).find(':checkbox, :radio').is(':checked')){ $(this).find(':input.wpcf7-free-text').prop('disabled', false); }else{ $(this).find(':input.wpcf7-free-text').prop('disabled', true); } $wrap.find(':checkbox, :radio').change(function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); var $freetext=$(':input.wpcf7-free-text', $wrap); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); }; $.fn.wpcf7CharacterCount=function(){ return this.each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function($target){ var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $count.closest('form').find(':input[name="' + name + '"]').each(function(){ updateCount($(this)); $(this).keyup(function(){ updateCount($(this)); }); }); }); }; $.fn.wpcf7NormalizeUrl=function(){ return this.each(function(){ var val=$.trim($(this).val()); if(val&&! val.match(/^[a-z][a-z0-9.+-]*:/i)){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; $.fn.wpcf7NotValidTip=function(message){ return this.each(function(){ var $into=$(this); $into.find('span.wpcf7-not-valid-tip').remove(); $into.append('' + message + ''); if($into.is('.use-floating-validation-tip *')){ $('.wpcf7-not-valid-tip', $into).mouseover(function(){ $(this).wpcf7FadeOut(); }); $(':input', $into).focus(function(){ $('.wpcf7-not-valid-tip', $into).not(':hidden').wpcf7FadeOut(); }); }}); }; $.fn.wpcf7FadeOut=function(){ return this.each(function(){ $(this).animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }); }; $.fn.wpcf7OnloadRefill=function(){ return this.each(function(){ var url=$(this).attr('action'); if(0 < url.indexOf('#')){ url=url.substr(0, url.indexOf('#')); } var id=$(this).find('input[name="_wpcf7"]').val(); var unitTag=$(this).find('input[name="_wpcf7_unit_tag"]').val(); $.getJSON(url, { _wpcf7_is_ajax_call: 1, _wpcf7: id, _wpcf7_request_ver: $.now() }, function(data){ if(data&&data.captcha){ $('#' + unitTag).wpcf7RefillCaptcha(data.captcha); } if(data&&data.quiz){ $('#' + unitTag).wpcf7RefillQuiz(data.quiz); }} ); }); }; $.fn.wpcf7RefillCaptcha=function(captcha){ return this.each(function(){ var form=$(this); $.each(captcha, function(i, n){ form.find(':input[name="' + i + '"]').clearFields(); form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }); }; $.fn.wpcf7RefillQuiz=function(quiz){ return this.each(function(){ var form=$(this); $.each(quiz, function(i, n){ form.find(':input[name="' + i + '"]').clearFields(); form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }); }; $.fn.wpcf7ClearResponseOutput=function(){ return this.each(function(){ $(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role'); $(this).find('span.wpcf7-not-valid-tip').remove(); $(this).find('.ajax-loader').removeClass('is-active'); }); }; $.fn.wpcf7Recaptcha=function(){ return this.each(function(){ var events='wpcf7:spam wpcf7:mailsent wpcf7:mailfailed'; $(this).closest('div.wpcf7').on(events, function(e){ if(recaptchaWidgets&&grecaptcha){ $.each(recaptchaWidgets, function(index, value){ grecaptcha.reset(value); }); }}); }); }; $.wpcf7UpdateScreenReaderResponse=function($form, data){ $('.wpcf7 .screen-reader-response').html('').attr('role', ''); if(data.message){ var $response=$form.siblings('.screen-reader-response').first(); $response.append(data.message); if(data.invalids){ var $invalids=$('
    '); $.each(data.invalids, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }}; $.wpcf7SupportHtml5=function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; }; $(function(){ _wpcf7.supportHtml5=$.wpcf7SupportHtml5(); $('div.wpcf7 > form').wpcf7InitForm(); }); })(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('