// source --> http://www.carlgamaz.com/wp-content/plugins/jetpack/_inc/build/related-posts/related-posts.min.js?ver=20150408 /* Do not modify this file directly. It is compiled from other files. */ /* jshint onevar: false */ /* globals related_posts_js_options */ !function(t){function e(){s.cleanupTrackedUrl();var e=s.getEndpointURL(),a=t("#jp-relatedposts");t.getJSON(e,function(e){if(0!==e.items.length&&0!==a.length){s.response=e;var o,p,r={};"undefined"!=typeof wp&&wp.customize?(p=wp.customize.instance("jetpack_relatedposts[show_thumbnails]").get(),r.showDate=wp.customize.instance("jetpack_relatedposts[show_date]").get(),r.showContext=wp.customize.instance("jetpack_relatedposts[show_context]").get(),r.layout=wp.customize.instance("jetpack_relatedposts[layout]").get()):(p=e.show_thumbnails,r.showDate=e.show_date,r.showContext=e.show_context,r.layout=e.layout),o=p?s.generateVisualHtml(e.items,r):s.generateMinimalHtml(e.items,r),a.append(o),s.setVisualExcerptHeights(),r.showDate&&a.find(".jp-relatedposts-post-date").show(),a.show(),t("#jp-relatedposts a.jp-relatedposts-post-a").click(function(){this.href=s.getTrackedUrl(this)})}})}var s={response:null,getEndpointURL:function(e){var s,a="undefined"!=typeof wp&&wp.customize&&wp.customize.settings&&wp.customize.settings.url&&wp.customize.settings.url.self;a?(s=document.createElement("a"),s.href=wp.customize.settings.url.self):s=document.location,"string"==typeof e&&e.match(/^https?:\/\//)&&(s=document.createElement("a"),s.href=e);var o="relatedposts=1";t("#jp-relatedposts").data("exclude")&&(o+="&relatedposts_exclude="+t("#jp-relatedposts").data("exclude")),a&&(o+="&jetpackrpcustomize=1");var p=s.pathname;return"/"!==p[0]&&(p="/"+p),""===s.search?p+"?"+o:p+s.search+"&"+o},getAnchor:function(e,s){var a=e.title;""!=""+e.excerpt&&(a+="\n\n"+e.excerpt);var o=t("");o.attr({class:s,href:e.url,title:a,rel:e.rel,"data-origin":e.url_meta.origin,"data-position":e.url_meta.position});var p=t("
").append(o).html();return[p.substring(0,p.length-4),""]},generateMinimalHtml:function(e,s){var a=this,o="";return t.each(e,function(t,e){var p=a.getAnchor(e,"jp-relatedposts-post-a"),r="jp-relatedposts-post jp-relatedposts-post"+t;e.classes.length>0&&(r+=" "+e.classes.join(" ")),o+='

',o+='",s.showDate&&(o+='"),s.showContext&&(o+='"),o+="

"}),'"},generateVisualHtml:function(e,s){var a=this,o="";return t.each(e,function(e,p){var r=a.getAnchor(p,"jp-relatedposts-post-a"),i="jp-relatedposts-post jp-relatedposts-post"+e;if(p.classes.length>0&&(i+=" "+p.classes.join(" ")),p.img.src?i+=" jp-relatedposts-post-thumbs":i+=" jp-relatedposts-post-nothumbs",o+='
',p.img.src)o+=r[0]+''+r[1];else{var n=a.getAnchor(p,"jp-relatedposts-post-a jp-relatedposts-post-aoverlay");o+=n[0]+n[1]}o+="<"+related_posts_js_options.post_heading+' class="jp-relatedposts-post-title">'+r[0]+p.title+r[1]+"",o+='

").text(p.excerpt).html()+"

",s.showDate&&(o+='"),s.showContext&&(o+='"),o+="
"}),'"},setVisualExcerptHeights:function(){var e=t("#jp-relatedposts .jp-relatedposts-post-nothumbs .jp-relatedposts-post-excerpt");if(!(0>=e.length)){var s=parseInt(e.first().css("font-size"),10),a=parseInt(e.first().css("line-height"),10);e.css("max-height",5*a/s+"em")}},getTrackedUrl:function(e){var s="relatedposts_hit=1";s+="&relatedposts_origin="+t(e).data("origin"),s+="&relatedposts_position="+t(e).data("position");var a=e.pathname;return"/"!==a[0]&&(a="/"+a),""===e.search?a+"?"+s:a+e.search+"&"+s},cleanupTrackedUrl:function(){if("function"==typeof history.replaceState){var t=document.location.search.replace(/\brelatedposts_[a-z]+=[0-9]*&?\b/gi,"");"?"===t&&(t=""),document.location.search!==t&&history.replaceState({},document.title,document.location.pathname+t)}}};t(function(){"undefined"!=typeof wp&&wp.customize?(wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(t){"jetpack_relatedposts"===t.partial.id&&e()}),wp.customize.bind("preview-ready",e)):e()})}(jQuery); // source --> http://www.carlgamaz.com/wp-content/plugins/photo-gallery/js/bwg_frontend.js?ver=2.3.59 function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, type, srch_btn, title, sortByParam, load_more) { var masonry_loaded = 0; var mosaic_loaded = 0; if (typeof load_more == "undefined") { var load_more = false; } var page_number = jQuery("#page_number_" + current_view).val(); var bwg_load_more = jQuery("#bwg_load_more_" + current_view).val(); var bwg_previous_album_ids = jQuery('#bwg_previous_album_id_' + current_view).val(); var bwg_previous_album_page_numbers = jQuery('#bwg_previous_album_page_number_' + current_view).val(); var post_data = {}; if (album_gallery_id == 'back') { // Back from album. var bwg_previous_album_id = bwg_previous_album_ids.split(","); album_gallery_id = bwg_previous_album_id[1]; jQuery('#bwg_previous_album_id_' + current_view).val(bwg_previous_album_ids.replace(bwg_previous_album_id[0] + ',', '')); var bwg_previous_album_page_number = bwg_previous_album_page_numbers.split(","); page_number = bwg_previous_album_page_number[0]; jQuery('#bwg_previous_album_page_number_' + current_view).val(bwg_previous_album_page_numbers.replace(bwg_previous_album_page_number[0] + ',', '')); } else if (cur_album_id != '') { // Enter album (not change the page). jQuery('#bwg_previous_album_id_' + current_view).val(album_gallery_id + ',' + bwg_previous_album_ids); if (page_number) { jQuery('#bwg_previous_album_page_number_' + current_view).val(page_number + ',' + bwg_previous_album_page_numbers); } page_number = 1; } if (srch_btn) { // Start search. page_number = 1; } if (typeof title == "undefined" || title == '') { var title = ""; } if (typeof sortByParam == "undefined" || sortByParam == '') { var sortByParam = jQuery(".bwg_order_" + current_view).val(); } post_data["page_number_" + current_view] = page_number; post_data["bwg_load_more_" + current_view] = bwg_load_more; post_data["album_gallery_id_" + current_view] = album_gallery_id; post_data["bwg_previous_album_id_" + current_view] = jQuery('#bwg_previous_album_id_' + current_view).val(); post_data["bwg_previous_album_page_number_" + current_view] = jQuery('#bwg_previous_album_page_number_' + current_view).val(); post_data["type_" + current_view] = type; post_data["title_" + current_view] = title; post_data["sortImagesByValue_" + current_view] = sortByParam; if (jQuery("#bwg_search_input_" + current_view).length > 0) { // Search box exists. post_data["bwg_search_" + current_view] = jQuery("#bwg_search_input_" + current_view).val(); } post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val(); // Loading. jQuery("#ajax_loading_" + current_view).css('display', ''); jQuery.post( window.location, post_data, function (data) { masonry_loaded = jQuery(data).find('#' + form_id).find(".bwg_masonry_thumb_spun_" + current_view + " img").length; mosaic_loaded = jQuery(data).find('#' + form_id).find(".bwg_mosaic_thumb_spun_" + current_view + " img").length; if (load_more) { var strr = jQuery(data).find('#' + id).html(); jQuery('#' + id).append(strr); jQuery("div[id^='bwg_container1_'] form").each(function () { if (jQuery(this).data("current") == current_view) { var str = jQuery(data).find('.bwg_nav_cont_' + current_view).html(); jQuery('.bwg_nav_cont_' + current_view).html(str); } else { var str = jQuery(this).find('span[class^="bwg_nav_cont_"]').html(); jQuery(this).find('span[class^="bwg_nav_cont_"]').html(str); } }); } else { var str = jQuery(data).find('#' + form_id).html(); jQuery('#' + form_id).html(str); } // There are no images. if (jQuery("#bwg_search_input_" + current_view).length > 0 && album_gallery_id == 0) { // Search box exists and not album view. var bwg_images_count = jQuery('#bwg_images_count_' + current_view).val(); if (bwg_images_count == 0) { var cont = jQuery("#" + id).parent().html(); var error_msg = '

' + bwg_objectL10n.bwg_search_result + '

'; jQuery("#" + id).parent().html(error_msg + cont) } } } ).success(function(jqXHR, textStatus, errorThrown) { jQuery("div[id^='bwg_container1_'] img").each(function () { if (jQuery(this).attr("data-lazy-src") != '') { jQuery(this).attr("src", jQuery(this).attr("data-lazy-src")); } else if (jQuery(this).attr("data-src") != '') { jQuery(this).attr("src", jQuery(this).attr("data-src")); } }); jQuery(".blog_style_image_buttons_conteiner_" + current_view).find(jQuery(".bwg_blog_style_img_" + current_view)).load(function(){ jQuery(".bwg_blog_style_img_" + current_view).closest(jQuery(".blog_style_image_buttons_conteiner_" + current_view)).show(); }); jQuery("#ajax_loading_" + current_view).css('display', 'none'); jQuery("#bwg_tags_id_" + id).val(jQuery("#bwg_tag_id_" + id).val()); if (jQuery(".pagination-links_" + current_view).length) { jQuery("html, body").animate({scrollTop: jQuery('#' + form_id).offset().top - 150}, 500); } /* For all*/ window["bwg_document_ready_" + current_view](); /* For masonry view.*/ if (id == "bwg_masonry_thumbnails_" + current_view || id == "bwg_album_masonry_" + current_view) { window["bwg_masonry_ajax_"+ current_view](masonry_loaded); } /* For mosaic view.*/ if (id == "bwg_mosaic_thumbnails_" + current_view) { window["bwg_mosaic_ajax_" + current_view](mosaic_loaded); } /* For Blog style view.*/ jQuery(".blog_style_images_conteiner_" + current_view + " .bwg_embed_frame_16x9_" + current_view).each(function (e) { jQuery(this).width(jQuery(this).parent().width()); jQuery(this).height(jQuery(this).width() * 0.5625); }); jQuery(".blog_style_images_conteiner_" + current_view + " .bwg_embed_frame_instapost_" + current_view).each(function (e) { jQuery(this).width(jQuery(this).parent().width()); /* 16 is 2*padding inside iframe */ /* 96 is 2*padding(top) + 1*padding(bottom) + 40(footer) + 32(header) */ jQuery(this).height((jQuery(this).width() - 16) * jQuery(this).attr('data-height') / jQuery(this).attr('data-width') + 96); }); /* For Image browser view.*/ jQuery('#bwg_embed_frame_16x9_' + current_view).width(jQuery('#bwg_embed_frame_16x9_' + current_view).parent().width()); jQuery('#bwg_embed_frame_16x9_' + current_view).height(jQuery('#bwg_embed_frame_16x9_' + current_view).width() * 0.5625); jQuery('#bwg_embed_frame_instapost_' + current_view).width(jQuery('#bwg_embed_frame_16x9_' + current_view).parent().width()); /* 16 is 2*padding inside iframe */ /* 96 is 2*padding(top) + 1*padding(bottom) + 40(footer) + 32(header) */ jQuery('.bwg_embed_frame_instapost_' + current_view).height((jQuery('.bwg_embed_frame_instapost_' + current_view).width() - 16) * jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-height') / jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-width') + 96); }); // if (event.preventDefault) { // event.preventDefault(); // } // else { // event.returnValue = false; // } return false; } function bwg_select_tag(current_view, form_id, cur_gal_id, album_gallery_id, type, reset) { if (reset) { jQuery("#bwg_tag_id_" + cur_gal_id).val(''); } spider_frontend_ajax(form_id, current_view, cur_gal_id, album_gallery_id, '', type, 1, ''); };