WordPress.org

Plugin Directory

Changeset 1771903


Ignore:
Timestamp:
11/21/17 00:00:37 (2 months ago)
Author:
Magenta Cuda
Message:

version 1.8.2.4.1

Location:
bb-gallery/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bb-gallery/trunk/bbg_xiv-gallery.php

    r1766478 r1771903  
    55Plugin URI: https://bbfgallery.wordpress.com/ 
    66Description: Gallery using Backbone.js, Bootstrap 3 and CSS3 Flexbox 
    7 Version: 1.8.2.4 
     7Version: 1.8.2.4.1 
    88Author: Magenta Cuda 
    99Author URI: https://profiles.wordpress.org/magenta-cuda/ 
  • bb-gallery/trunk/css/bbg_xiv-gallery.css

    r1766478 r1771903  
    830830  height: calc(0.9 * (100vh - (2 * 21px)) ); } 
    831831 
    832 body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
     832body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
    833833  height: calc(0.9 * (100vh - (32px + (2 * 21px)))); } 
    834834  @media screen and (max-width: 782px) { 
    835     body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
     835    body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
    836836      height: calc(0.9 * (100vh - (46px + (2 * 21px)))); } } 
    837837 
    838 body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
     838body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
    839839  height: calc(0.9 * (100vh - 32px)); } 
    840840  @media screen and (max-width: 782px) { 
    841     body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
     841    body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-embedded_carousel div.carousel.slide { 
    842842      height: calc(0.9 * (100vh - 46px)); } } 
    843843 
     
    979979      height: auto; } } 
    980980 
    981 body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
     981body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
    982982  height: calc(70vh - (32px + 21px)); } 
    983983  @media screen and (max-width: 782px) { 
    984     body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
     984    body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
    985985      height: calc(70vh - (46px + 21px)); } } 
    986986  @media (max-aspect-ratio: 1 / 1) { 
    987     body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-twentysixteen_with_border.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
     987    body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-twentysixteen_with_border.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
    988988      height: auto; } } 
    989989 
    990 body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
     990body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
    991991  height: calc(70vh - 32px); } 
    992992  @media screen and (max-width: 782px) { 
    993     body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
     993    body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
    994994      height: calc(70vh - 46px); } } 
    995995  @media (max-aspect-ratio: 1 / 1) { 
    996     body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.admin-bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
     996    body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-template_tabs_container div.tab-content figure img.bbg_xiv-tabs_img, body.bbg_xiv-fixed_admin_bar div.bbg_xiv-bootstrap div.bbg_xiv-gallery_tabs_container div.tab-content figure img.bbg_xiv-tabs_img { 
    997997      height: auto; } } 
    998998 
  • bb-gallery/trunk/js/bbg_xiv-gallery.js

    r1766478 r1771903  
    654654                            // If WordPress admin bar is showing on frontend page adjust for it. 
    655655                            var $body            = jQuery( 'body' ); 
    656                             var adminBarHeight   = $body.hasClass( 'admin-bar' ) ? jQuery( 'div#wpadminbar' ).outerHeight() : 0; 
     656                            var $adminBar        = jQuery( 'div#wpadminbar' ); 
     657                            var adminBarHeight   = $body.hasClass( 'admin-bar' ) && $adminBar.css( 'position' ) == 'fixed' ? $adminBar.outerHeight() : 0; 
    657658                            var bodyBeforeHeight = 0; 
    658659                            if ( $body.hasClass( 'bbg_xiv-twentysixteen_with_border' ) ) { 
     
    727728                        } else { 
    728729                            var $body            = jQuery( 'body' ); 
     730                            var $adminBar        = jQuery( 'div#wpadminbar' ); 
    729731                            // If WordPress admin bar is showing on frontend page adjust for it. 
    730                             var adminBarHeight   = $body.hasClass( 'admin-bar' ) ? jQuery( 'div#wpadminbar' ).outerHeight() : 0; 
     732                            var adminBarHeight   = $body.hasClass( 'admin-bar' ) && $adminBar.css( 'position' ) == 'fixed' ? $adminBar.outerHeight() : 0; 
    731733                            var bodyBeforeHeight = 0; 
    732734                            if ( $body.hasClass( 'bbg_xiv-twentysixteen_with_border' ) ) { 
     
    18331835        }); 
    18341836        jQuery( window ).on( 'orientationchange', function() { 
     1837            var $body = jQuery( 'body' ); 
     1838            if ( $body.hasClass( 'admin-bar' ) && jQuery( 'div#wpadminbar' ).css( 'position' ) == 'fixed' ) { 
     1839                $body.addClass( 'bbg_xiv-fixed_admin_bar' ); 
     1840            } else { 
     1841                $body.removeClass( 'bbg_xiv-fixed_admin_bar' ); 
     1842            } 
    18351843            jQuery("div.bbg_xiv-gallery").each(function(){ 
    18361844                bbg_xiv.resetGallery(jQuery(this)); 
     
    18501858            } 
    18511859        } 
     1860        if ( $body.hasClass( 'admin-bar' ) && jQuery( 'div#wpadminbar' ).css( 'position' ) == 'fixed' ) { 
     1861            $body.addClass( 'bbg_xiv-fixed_admin_bar' ); 
     1862        } 
    18521863         
    18531864    });   // jQuery(document).ready(function(){ 
  • bb-gallery/trunk/js/bbg_xiv-gallery.min.js

    r1766478 r1771903  
    1 !function(){var e=window.bbg_xiv=window.bbg_xiv||{};e.helpMVPUrl="https://bbfgallery.wordpress.com/#navbar",e.helpOptionsUrl="https://bbfgallery.wordpress.com/#options",e.galleryOfGalleriesTitle=bbg_xiv_lang.galleryOfGalleriesTitle,e.templateOptions={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},e.images={},e.search={},e.galleries={},e.Image=Backbone.Model.extend({idAttribute:window.bbg_xiv.bbg_xiv_wp_rest_api?"id":"ID"}),e.Images=Backbone.Collection.extend({model:e.Image}),e.ImageView=Backbone.View.extend({render:function(e){var i=this.template(this.model.attributes);return e?i:(this.$el.html(i),this)}}),e.GalleryView=Backbone.View.extend({render:function(){var e=this.template(this.model.attributes);return this.$el.html(e),this}}),e.renderBootstrapGallery=function(i,t){var a=new e.ImageView;a.template=_.template(jQuery("script#bbg_xiv-template_gallery_item").html(),null,e.templateOptions);var r="";t.forEach(function(e,i){a.model=e,r+=a.render(!0),i%4===3&&(r+='<br class="clearfix visible-lg-block">'),i%3===2&&(r+='<br class="clearfix visible-md-block">'),i%2===1&&(r+='<br class="clearfix visible-sm-block">')});var n=new e.GalleryView({model:{attributes:{items:r}}});n.template=_.template(jQuery("script#bbg_xiv-template_gallery_container").html(),null,e.templateOptions),i.empty(),i.append(n.render().$el.find("div.container"))},e.renderFlex=function(i,t){var a=i.width(),r=new e.ImageView;r.template=_.template(jQuery("script#bbg_xiv-template_flex_item").html(),null,e.templateOptions);var n="";t.forEach(function(e){e.attributes.bbg_xiv_container_width=a,r.model=e,n+=r.render(!0)});var l=new e.GalleryView({model:{attributes:{id:t.id,items:n}}});l.template=_.template(jQuery("script#bbg_xiv-template_flex_container").html(),null,e.templateOptions),i.empty(),i.append(l.render().$el.find("div.bbg_xiv-flex_container")),"touch"===e.guiInterface&&i.find("div.bbg_xiv-flex_container div.bbg_xiv-flex_item div.bbg_xiv-dense_full_btn").addClass("bbg_xiv-touch")},e.renderTiles=function(i,t,a){i.addClass("bbg_xiv-tiles_container"),a.indexOf("contain")!==-1?i.addClass("bbg_xiv-contain"):a.indexOf("fill")!==-1&&i.addClass("bbg_xiv-fill"),e.renderFlex(i,t),Modernizr.objectfit&&a.indexOf("contain")===-1||i.find("div.bbg_xiv-flex_item img").load(function(){this.naturalWidth<this.naturalHeight&&jQuery(this).addClass("bbg_xiv-portrait")});var r=i.find("div.bbg_xiv-flex_container"),n=r.closest("div.bbg_xiv-gallery").addClass("bbg_xiv-caption_visible");i.find("div.bbg_xiv-dense_full_btn").hover(function(){n.hasClass("bbg_xiv-caption_visible")||jQuery(this).parents("div.bbg_xiv-flex_item").find("figure figcaption").each(function(){jQuery(this).show()})},function(){n.hasClass("bbg_xiv-caption_visible")||jQuery(this).parents("div.bbg_xiv-flex_item").find("figure figcaption").each(function(){jQuery(this).hide()})}),"touch"===e.guiInterface&&i.find("div.bbg_xiv-flex_item a").click(function(e){if(!n.hasClass("bbg_xiv-caption_visible")){var t=jQuery(this.parentNode).find("figure figcaption");t.data("visible")||(i.find("div.bbg_xiv-flex_item figure figcaption").data("visible",!1),t.data("visible",!0),e.preventDefault())}})},e.renderCarousel=function(i,t,a){var r=i.width(),n=new e.ImageView;n.template=_.template(jQuery("script#bbg_xiv-template_carousel_item").html(),null,e.templateOptions);var l="",s="";t.forEach(function(i,t){i.attributes.browser=e.browser,i.attributes.index=t,i.attributes.bbg_xiv_container_width=r,n.model=i;var b=0===t?' class="active"':"";l+='<li data-target="#'+a+'" data-slide-to="'+t+'"'+b+"></li>",s+=n.render(!0)});var b=new e.GalleryView({model:{attributes:{id:a,size:t.length,bullets:l,items:s}}});b.template=_.template(jQuery("script#bbg_xiv-template_carousel_container").html(),null,e.templateOptions),i.empty(),i.append(b.render().$el.find("div.carousel.slide"))},e.renderTabs=function(i,t,a){var r=i.width(),n=new e.ImageView;n.template=_.template(jQuery("script#bbg_xiv-template_tabs_tab").html(),null,e.templateOptions);var l=new e.ImageView;l.template=_.template(jQuery("script#bbg_xiv-template_tabs_item").html(),null,e.templateOptions);var s="",b="";t.forEach(function(i,t){i.attributes.browser=e.browser,i.attributes.index=t,i.attributes.bbg_xiv_container_width=r,l.model=n.model=i,s+=n.render(!0),b+=l.render(!0)});var o=new e.GalleryView({model:{attributes:{id:a,tabs:s,items:b}}});o.template=_.template(jQuery("script#bbg_xiv-template_tabs_container").html(),null,e.templateOptions),i.empty(),i.append(o.render().$el.find("div.bbg_xiv-template_tabs_container"))},e.renderDense=function(i,t,a,r){var n=i.width(),l=new e.ImageView;l.template=_.template(jQuery("script#bbg_xiv-template_dense_title").html(),null,e.templateOptions);var s=new e.ImageView;s.template=_.template(jQuery("script#bbg_xiv-template_dense_image").html(),null,e.templateOptions);var b="",o="";t.forEach(function(e,i){e.attributes.mode=r,e.attributes.index=i,e.attributes.bbg_xiv_container_width=n,s.model=l.model=e,b+=l.render(!0),o+=s.render(!0)});var d=new e.GalleryView({model:{attributes:{id:a,gallery:t.id,mode:r,titles:b,images:o}}});d.template=_.template(jQuery("script#bbg_xiv-template_dense_container").html(),null,e.templateOptions),i.empty(),i.append(d.render().$el.find("div.bbg_xiv-dense_container"))},e.renderJustified=function(i,t){var a=new e.ImageView;a.template=_.template(jQuery("script#bbg_xiv-template_justified_item").html(),null,e.templateOptions);var r="";t.forEach(function(e){a.model=e,r+=a.render(!0)});var n=new e.GalleryView({model:{attributes:{id:t.id,items:r}}});n.template=_.template(jQuery("script#bbg_xiv-template_justified_container").html(),null,e.templateOptions),i.empty();var l=n.render().$el.find("div.bbg_xiv-justified_container");i.append(l);var s=l.find("div.bbg_xiv-justified_gallery");s.justifiedGallery({margins:5,rowHeight:e.bbg_xiv_miro_row_height,lastRow:"nojustify",refreshSensitivity:0,refreshTime:250}).on("jg.complete jg.resize",function(){s.find("img").css("margin","0")}),"touch"===e.guiInterface&&s.find("div.bbg_xiv-justified_item > a").click(function(e){e.preventDefault()}),l=i.find("div.bbg_xiv-justified_container");var b=l.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-caption_visible");l.find("div.bbg_xiv-justified_gallery div.bbg_xiv-justified_item").each(function(){var e=this.querySelector("img"),i=this.querySelector("div.caption");[e,i].forEach(function(e){e.addEventListener("mouseover",function(e){b.hasClass("bbg_xiv-caption_visible")&&(i.style.display="block",i.style.opacity="0.7",e.stopImmediatePropagation())}),e.addEventListener("mouseout",function(e){b.hasClass("bbg_xiv-caption_visible")&&(i.style.display="block",i.style.opacity="0.7",e.stopImmediatePropagation())})}),jQuery(e).closest("a").click(function(e){e.preventDefault()}),jQuery(i).find("a").click(function(e){jQuery(this).closest("div.caption").css("opacity")||e.preventDefault()})})},e.renderGeneric=function(i,t,a){var r=new e.ImageView;r.template=_.template(jQuery("script#bbg_xiv-template_"+a+"_item").html(),null,e.templateOptions);var n="";t.forEach(function(e){r.model=e,n+=r.render(!0)});var l=new e.GalleryView({model:{attributes:{items:n}}});l.template=_.template(jQuery("script#bbg_xiv-template_"+a+"_container").html(),null,e.templateOptions),i.empty(),i.append(l.render().$el.find("bbg_xiv-container"))};var i=[];e.dumpFieldNames=function(e){e.forEach(function(e){Object.keys(e.attributes).forEach(function(e){i.indexOf(e)===-1&&i.push(e)})});var t="<tr>";return i.forEach(function(e){t+="<th>"+e+"</th>"}),t+="</tr>"},e.dumpFieldValues=function(e){var t="";return e.forEach(function(e){t+="<tr>",i.forEach(function(i){t+="<td>"+e.attributes[i]+"</td>"}),t+="</tr>"}),t},e.renderTable=function(i,t){var a=new e.GalleryView({model:{attributes:{collection:t}}});a.template=_.template(jQuery("script#bbg_xiv-template_table_container").html(),null,e.templateOptions),i.empty(),i.append(a.render().$el.find("div.bbg_xiv-table"))},e.constructImages=function(i){var t;if(window.bbg_xiv.bbg_xiv_wp_rest_api)t=e.images[i.id];else{t=e.images[i.id]=new e.Images;try{t.reset(JSON.parse(window.bbg_xiv[i.id+"-data"]))}catch(e){return console.log("reset(JSON.parse()) failed:",e),t}}return t.id=i.id,t.constructed=!0,t},e.renderGallery=function(i,t,a){function r(){var i=l.find("div.bbg_xiv-dense_outer"),t=l.find("div.bbg_xiv-dense_inner").click(function(){t.css("opacity","0.0"),i.css("opacity","0.0");var e=jQuery("div.bbg_xiv-gallery nav.bbg_xiv-gallery_navbar").css("opacity","0.99");window.setTimeout(function(){t.hide(),i.hide(),e.css("opacity","1.0")},2e3)}),a=t.find("img"),r=t.find("h1.bbg_xiv-dense_title"),n=t.find("h1.bbg_xiv-dense_caption");"undefined"==typeof e.titleColor&&(e.titleColor=r.css("color"),e.titleShadow=r.css("text-shadow")),"mouse"===e.guiInterface&&a.hover(function(){r.css({color:e.titleColor,textShadow:e.titleShadow}),n.css({color:e.titleColor,textShadow:e.titleShadow})},function(){r.css({color:"transparent",textShadow:"none"}),n.css({color:"transparent",textShadow:"none"})}),l.find("button.bbg_xiv-dense_full_btn").click(function(l){var s,b=jQuery(this);b.hasClass("bbg_xiv-dense_from_image")?s=b.parents("div.bbg_xiv-dense_flex_item").find("img")[0]:b.hasClass("bbg_xiv-dense_from_title")?s=jQuery("div#"+this.parentNode.id.replace("title","image")).find("img")[0]:b.hasClass("bbg_xiv-flex_from_image")?s=b.parents("div.bbg_xiv-flex_item").find("img")[0]:b.hasClass("bbg_xiv-dense_from_justified")&&(s=b.parents("div.bbg_xiv-justified_item").find("img")[0]);var o;try{var _=jQuery(s).parents("div[data-bbg_xiv-gallery-id]")[0].dataset.bbg_xivGalleryId;o=e.images[_].get(s.dataset.bbg_xivImageId).attributes,a[0].src=e.getSrc(o,"viewport",!1),o.bbg_srcset?a[0].srcset=e.getSrcset(o):a[0].removeAttribute("sizes")}catch(e){console.log("##### broken 1"),a[0].src=s.src}r[0].textContent=e.getTitle(o),n[0].textContent=e.getCaption(o),i.show(),t.show(),"touch"===e.guiInterface&&(r.css({color:e.titleColor,textShadow:e.titleShadow}),n.css({color:e.titleColor,textShadow:e.titleShadow})),window.setTimeout(function(){t.css("opacity","1.0"),i.css("opacity","0.93")},100),l.preventDefault(),l.stopPropagation()})}function n(e){var i=jQuery(e).parents("div.carousel");i.carousel("pause"),i.find("a.bbg_xiv-carousel_play span.glyphicon").removeClass("glyphicon-pause").addClass("glyphicon-play")}a||(a=[]),i.dataset.flags&&(a=a.concat(i.dataset.flags.split(",")));var l=jQuery(i),s=e.images[i.id];s&&s.constructed||(s=e.constructImages(i)),e.galleries[i.id]=e.galleries[i.id]||{images:{gallery_home:s},view:"gallery_home"};var b=l.parents("div.bbg_xiv-gallery").find("nav.navbar button.bbg_xiv-titles").hide();switch(t){case"Gallery":a.indexOf("tiles")!==-1?(e.renderTiles(l,s,a),r(),b.show()):Modernizr.flexbox&&Modernizr.flexwrap&&!window.bbg_xiv.bbg_xiv_disable_flexbox?(e.renderFlex(l,s),r()):e.renderBootstrapGallery(l,s),window.setTimeout(function(){jQuery(window).resize()},100);break;case"Justified":e.renderJustified(l,s),r(),b.show();break;case"Carousel":a.indexOf("embedded-carousel")!==-1?l.addClass("bbg_xiv-embedded_carousel"):jQuery("html").css("overflow-y","hidden");var o="bbg_xiv-carousel_"+i.id;e.renderCarousel(l,s,o),l.find("a.bbg_xiv-carousel_play").click(function(e){var i=jQuery(this).parents("div.carousel"),t=jQuery(this).find("span.glyphicon");t.hasClass("glyphicon-pause")?n(this):(t.removeClass("glyphicon-play").addClass("glyphicon-pause"),i.carousel("next"),i.carousel("cycle")),e.preventDefault()}),l.find("a.bbg_xiv-carousel_left, a.bbg_xiv-carousel_right").click(function(){n(this)}),l.find("a.bbg_xiv-carousel_first span.glyphicon,a.bbg_xiv-carousel_last span.glyphicon").click(function(e){n(this);var i=jQuery(this).parents("div.carousel");jQuery(this.parentNode).hasClass("bbg_xiv-carousel_first")?i.carousel(0):i.carousel(s.length-1),e.preventDefault()}),l.find("a.bbg_xiv-carousel_close").click(function(i){l.removeClass("bbg_xiv-embedded_carousel"),e.resetGallery(jQuery(this).parents("div.bbg_xiv-gallery"),"Carousel"),jQuery("html").css("overflow-y",""),i.preventDefault()});var _=l.find("div.bbg_xiv-jquery_mobile input[type='range']");_.slider();var d,v=!1;_.attr("type","number").val("1").change(function(){if(!v){d=Date.now();var e=jQuery(this).parents("div.carousel");n(_),window.setTimeout(function(){if(Date.now()-d>=500){var i=_.val();jQuery.isNumeric(i)&&(i=parseInt(i,10)-1,i>=0&&i<s.length&&(e.carousel(i),n(_)))}},500)}}).keypress(function(e){13===e.which&&(jQuery(this).blur(),e.preventDefault())}).focus(function(){n(this)}).on("slidestart",function(){n(this)}),l.find("div.carousel").on("slide.bs.carousel slid.bs.carousel",function(e){v=!0,jQuery(this).find('div.bbg_xiv-jquery_mobile input[type="number"]').val(parseInt(e.relatedTarget.dataset.index,10)+1).change(),v=!1}),a.indexOf("embedded-carousel")!==-1&&window.setTimeout(function(){var e=l.closest("div.bbg_xiv-gallery"),i=l.find("div.carousel");if(e.hasClass("bbg_xiv-fullscreen_gallery"))window.matchMedia("(max-aspect-ratio:1/1)").matches||e.scrollTop(e[0].scrollHeight-e.height());else if(window.matchMedia("(max-aspect-ratio:1/1)").matches)jQuery(window).scrollTop(i.offset().top-jQuery(window).height()/6);else{var t=jQuery("body"),a=t.hasClass("admin-bar")?jQuery("div#wpadminbar").outerHeight():0,r=0;if(t.hasClass("bbg_xiv-twentysixteen_with_border")){var n=window.getComputedStyle(t[0],":before");r=n&&"fixed"===n.position?parseInt(n.height,10):0}jQuery(window).scrollTop(i.offset().top-i.outerHeight()/18-a-r)}},500),jQuery("#"+o).carousel({interval:e.bbg_xiv_carousel_interval,pause:!1});break;case"Tabs":e.renderTabs(l,s,"bbg_xiv-tabs_"+i.id),e.prettifyTabs(l,!0),l.find("nav.navbar ul.nav li a").click(function(){Modernizr.objectfit||jQuery(this.href.substr(this.href.lastIndexOf("#"))+" img").each(function(){var e,i=this,t=0,a=0;window.setTimeout(function r(){var n=i.naturalWidth,l=i.naturalHeight,s=jQuery(i.parentNode.parentNode.parentNode),b=s.width(),o=.7*jQuery(window).height();if(!n||!l||!b||!o||b<64||o<64)return void(t++<16&&window.setTimeout(r,250));var _=Math.max(n/b,l/o);_<.125||_>8||"undefined"!=typeof e&&_===e||(n=Math.floor(n/_),l=Math.floor(l/_),jQuery(i).css({width:n+"px",height:l+"px"}),e=_,a++<16&&window.setTimeout(r,250))},250)}),window.setTimeout(function(){var e=jQuery(window),i=l.closest("div.bbg_xiv-gallery"),t=i.hasClass("bbg_xiv-fullscreen_gallery"),a=l.find("div.tab-content");if(window.matchMedia("(max-aspect-ratio:1/1)").matches)t?i.scrollTop(i.scrollTop()+a.position().top-e.height()/3-20):e.scrollTop(a.offset().top-e.height()/3-20);else if(t)i.scrollTop(i.scrollTop()+a.position().top-90);else{var r=jQuery("body"),n=r.hasClass("admin-bar")?jQuery("div#wpadminbar").outerHeight():0,s=0;if(r.hasClass("bbg_xiv-twentysixteen_with_border")){var b=window.getComputedStyle(r[0],":before");s=b&&"fixed"===b.position?parseInt(b.height,10):0}var o=e.height()>=480?80:40;e.scrollTop(a.offset().top-o-n-s)}},500)}),l.hasClass("bbg_xiv-gallery_icons_mode")&&l.find("div.bbg_xiv-template_tabs_container div.tab-content figure.tab-pane a").click(function(e){var i=l.parent().find("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li.bbg_xiv-alt_gallery");i.filter(".bbg_xiv-alt_gallery_home").hasClass("active")&&(i.find("a[data-view='gallery_"+this.dataset.galleryIndex+"']").click(),e.preventDefault())}),l.find("a.bbg_xiv-tabs_brand").click(function(e){var i=jQuery(this).siblings("button.navbar-toggle");"none"!==i.css("display")&&i.click(),e.preventDefault()}),"touch"===e.guiInterface&&jQuery("div.bbg_xiv-gallery nav.bbg_xiv-gallery_navbar").find("span.glyphicon-collapse-down").each(function(){var e=jQuery(this);"none"!==e.css("display")&&e.click()});break;case"Dense":jQuery("html").css("overflow-y","hidden"),e.renderDense(l,s,"bbg_xiv-dense_"+i.id,"title"),l.find("div.bbg_xiv-dense_images div.bbg_xiv-dense_flex_images div.bbg_xiv-dense_flex_item").css("width",100/e.bbg_xiv_flex_number_of_dense_view_columns+"%");var g=jQuery("div.bbg_xiv-dense_container button#bbg_xiv-normal_color").css("background-color"),c=jQuery("div.bbg_xiv-dense_container button#bbg_xiv-highlight_color").css("background-color");l.find("div.bbg_xiv-dense_titles ul li").hover(function(){jQuery(this).css({"background-color":c});var e=jQuery("div#"+this.id.replace("title","image")).css({"border-color":c}),i=e.position().top,t=e.height(),a=i+t,r=e.parents("div.bbg_xiv-dense_images"),n=r.scrollTop(),l=r.height();i<0?r.scrollTop(n+i-l/2-t/2):a>l&&r.scrollTop(n+(a-l)+l/2-t/2)},function(){jQuery(this).css({"background-color":g}),jQuery("div#"+this.id.replace("title","image")).css({"border-color":g})}),l.find("div.bbg_xiv-dense_flex_item").hover(function(){jQuery(this).css({"border-color":c});var e=jQuery("li#"+this.id.replace("image","title")).css({"background-color":c}),i=e.position().top,t=e.height(),a=i+t,r=e.parents("div.bbg_xiv-dense_titles"),n=r.scrollTop(),l=r.height();i<0?r.scrollTop(n+i-l/2-t/2):a>l&&r.scrollTop(n+(a-l)+l/2-t/2)},function(){jQuery(this).css({"border-color":g}),jQuery("li#"+this.id.replace("image","title")).css({"background-color":g})}),l.find("input.bbg_xiv-dense_li_mode").change(function(){if(this.checked){var e=jQuery("div.bbg_xiv-dense_container div.bbg_xiv-dense_titles");"title"===this.value?(e.find("span.bbg_xiv-dense_li_caption").hide(),e.find("span.bbg_xiv-dense_li_title").show(),e.find("span.bbg_xiv-dense_li_alt").hide()):"caption"===this.value?(e.find("span.bbg_xiv-dense_li_title").hide(),e.find("span.bbg_xiv-dense_li_caption").show(),e.find("span.bbg_xiv-dense_li_alt").hide()):"alt"===this.value&&(e.find("span.bbg_xiv-dense_li_title").hide(),e.find("span.bbg_xiv-dense_li_caption").hide(),e.find("span.bbg_xiv-dense_li_alt").show())}}),l.find("button.bbg_xiv-dense_close_btn").click(function(i){e.resetGallery(jQuery(this).parents("div.bbg_xiv-gallery")),jQuery("html").css("overflow-y",""),i.preventDefault()}),r();break;case"Table":e.renderTable(l,s)}var u=jQuery(i.parentNode).find("nav.bbg_xiv-gallery_navbar ul.nav ul.bbg_xiv-view_menu li").show();if(("mouse"!==e.guiInterface||jQuery(window).width()<e.bbg_xiv_flex_min_width_for_dense_view)&&u.filter(".bbg_xiv-large_viewport_only").hide(),e.search[i.id])jQuery("div#"+i.id+"-alt_gallery_heading").hide(),jQuery("div#"+i.id+"-heading").show();else if(e.galleries[i.id]){jQuery("div#"+i.id+"-heading").hide();var p="undefined"!=typeof e.images[i.id].models[0].attributes.gallery_index,f=jQuery("div#"+i.id+"-alt_gallery_heading");p&&(f.find("span.bbg_xiv-alt_gallery_heading").text(e.galleryOfGalleriesTitle),l.find("a.bbg_xiv-gallery_icon").click(function(e){l.parent().find('nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li.bbg_xiv-alt_gallery > a[data-view="gallery_'+this.dataset.galleryIndex+'"]').click(),e.preventDefault()}),u.filter(".bbg_xiv-hide_for_gallery_icons").hide()),("gallery_home"!==e.galleries[i.id].view||p)&&f.show()}},e.prettifyTabs=function(e,i){var t=e.find("nav.navbar"),a=t.find("button.navbar-toggle");"none"!==a.css("display")&&a.click(),t.find("div.navbar-collapse ul.nav").each(function(){jQuery(this).height()-8<=jQuery(this.parentNode).height()&&(jQuery(this).parents("nav.navbar").find("span.glyphicon").hide(),jQuery(this.parentNode).addClass("bbg_xiv-hide_scroll"))}),i&&e.find("span.glyphicon-collapse-down, span.glyphicon-collapse-up").click(function(){var e=jQuery(this),i=jQuery(this.parentNode).find("div.navbar-collapse");e.hasClass("glyphicon-collapse-down")?(e.removeClass("glyphicon-collapse-down").addClass("glyphicon-collapse-up"),i.removeClass("bbg_xiv-closed").addClass("bbg_xiv-open")):(e.removeClass("glyphicon-collapse-up").addClass("glyphicon-collapse-down"),i.removeClass("bbg_xiv-open").addClass("bbg_xiv-closed"))})},e.resetGallery=function(i,t){var a=i.find("div.bbg_xiv-gallery_envelope")[0],r="undefined"!=typeof e.images[a.id].models[0].attributes.gallery_index,n=e.getDefaultView(jQuery(a),r);"Carousel"===t&&"Carousel"===n&&(n="Gallery"),e.renderGallery(a,n);var l=i.find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view"),s=l.find("ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_"+n.toLowerCase()).addClass("active");l.find("a.bbg_xiv-selected_view span").text(s.text()),jQuery(window).resize()},e.getSrc=function(i,t,a){switch(e.bandwidth){case"normal":return e.bbg_xiv_wp_rest_api?i.source_url:i.url;case"low":return a?i.bbg_thumbnail_src[0]:"viewport"===t?i.bbg_large_src[0]:i.bbg_medium_large_src[0];case"very low":return a?i.bbg_thumbnail_src[0]:"viewport"===t?i.bbg_medium_large_src[0]:i.bbg_medium_src[0]}},e.getSrcset=function(i){return"auto"!==e.bbg_xiv_bandwidth?"":i.bbg_srcset},e.getTitle=function(i){return(e.bbg_xiv_wp_rest_api?i.title.rendered:i.post_title).trim()},e.getCaption=function(i,t){var a=e.bbg_xiv_wp_rest_api?jQuery(i.caption.rendered).text():i.post_excerpt;return a||t||(a=e.getAlt(i,!0)),a.trim()},e.getAlt=function(i,t){var a=e.bbg_xiv_wp_rest_api?i.alt_text:i.image_alt;return a||t||(a=e.getCaption(i,!0)),a.trim()},e.getPostContent=function(i){var t=e.bbg_xiv_wp_rest_api?i.bbg_post_content:i.post_content;return t?t:e.getCaption(i)},e.getSizes=function(i,t,a){return"auto"!==e.bbg_xiv_bandwidth?"":i?i.bbg_srcset?a?"10vw":"viewport"===t?"90vw":"container"===t?i.bbg_xiv_container_width+"px":"50vw":"":"viewport"!==t||a?"50vw":"100vw"};try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test"),e.localStorageAvailable=!0}catch(i){e.localStorageAvailable=!1}e.setCookie=function(i,t,a){if(e.localStorageAvailable)localStorage.setItem(i,t);else{var r=new Date;r.setTime(r.getTime()+24*a*60*60*1e3),document.cookie=i+"="+t+"; expires="+r.toUTCString()+"; path=/"}},e.getCookie=function(i){if(e.localStorageAvailable)return localStorage.getItem(i);var t=document.cookie;t+=";";var a=t.indexOf(i+"=");if(a===-1)return null;a+=i.length+1;var r=t.indexOf(";",a);return r===-1?null:t.substring(a,r)},e.calcBreakpoints=function(){var i=window.bbg_xiv.bbg_xiv_flex_min_width;e.breakpoints=[{width:2*i,cssClass:"100"},{width:3*i,cssClass:"50"},{width:4*i,cssClass:"33_3333"},{width:5*i,cssClass:"25"},{width:6*i,cssClass:"20"},{width:7*i,cssClass:"16_6666"},{width:8*i,cssClass:"14_2857"},{width:9*i,cssClass:"12_5"},{width:10*i,cssClass:"11_1111"},{width:11*i,cssClass:"10"},{width:12*i,cssClass:"9_0909"},{width:1e6,cssClass:"8_3333"}]},e.getOptionsFromCookie=function(){var i=e.getCookie("bbg_xiv");if(i){var t=JSON.parse(i),a=t.bbg_xiv_carousel_interval;jQuery.isNumeric(a)&&a>=1e3&&(e.bbg_xiv_carousel_interval=a);var r=t.bbg_xiv_flex_min_width;jQuery.isNumeric(r)&&r>=32&&r<=1024&&(e.bbg_xiv_flex_min_width=r);var n=t.bbg_xiv_miro_row_height;jQuery.isNumeric(n)&&n>=32&&n<=512&&(e.bbg_xiv_miro_row_height=n);var l=t.bbg_xiv_max_search_results;jQuery.isNumeric(l)&&l>=1&&l<1048576&&(e.bbg_xiv_max_search_results=l);var s=t.bbg_xiv_flex_number_of_dense_view_columns;jQuery.isNumeric(s)&&s>=2&&s<=32&&(e.bbg_xiv_flex_number_of_dense_view_columns=s),"string"==typeof t.bbg_xiv_default_view?(e.bbg_xiv_default_view=t.bbg_xiv_default_view,e.usingServerDefaultView=!1):e.usingServerDefaultView=!0,"string"==typeof t.bbg_xiv_bandwidth&&(e.bbg_xiv_bandwidth=t.bbg_xiv_bandwidth),"string"==typeof t.bbg_xiv_interface&&(e.bbg_xiv_interface=t.bbg_xiv_interface)}else e.usingServerDefaultView=!0,e.bbg_xiv_bandwidth="auto",e.bbg_xiv_interface="auto";var b=navigator.userAgent;b.indexOf("Firefox")!==-1?e.browser="Firefox":e.browser="","auto"===e.bbg_xiv_bandwidth?Modernizr.lowbandwidth?e.bandwidth="very low":/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(b)?e.bandwidth="very low":e.bandwidth="low":e.bandwidth=e.bbg_xiv_bandwidth,"auto"===e.bbg_xiv_interface?Modernizr.touchevents?e.guiInterface="touch":e.guiInterface="mouse":e.guiInterface=e.bbg_xiv_interface,e.bbg_xiv_wp_rest_api&&(e.wpRestApiMaxPerPage=100)},e.getOptionsFromCookie(),e.calcBreakpoints(),jQuery(window).resize(function(){var i=e.breakpoints;jQuery("div.bbg_xiv-flex_container,div.bbg_xiv-gallery_container").each(function(){var e,t=jQuery(this),a=t.width(),r=window.bbg_xiv.bbg_xiv_flex_min_width_for_caption;if(t.parents("div.bbg_xiv-gallery_envelope").hasClass("bbg_xiv-tiles_container"))e=Math.floor(a/Math.floor(a/window.bbg_xiv.bbg_xiv_flex_min_width))-1,t.find("div.bbg_xiv-flex_item").css({width:e,height:e}),e<r&&t.find("div.bbg_xiv-flex_item figcaption").hide();else{i.forEach(function(e){t.removeClass("bbg_xiv-flex_width_"+e.cssClass)});for(var n=0;n<i.length;n++)if(a<i[n].width){var l=i[n].cssClass;t.addClass("bbg_xiv-flex_width_"+l),e=parseFloat(l.replace("_","."))/100*a,e<r?t.addClass("bbg_xiv-flex_no_caption"):t.removeClass("bbg_xiv-flex_no_caption");break}}}),"mouse"===e.guiInterface&&jQuery(window).width()>=e.bbg_xiv_flex_min_width_for_dense_view?jQuery(".bbg_xiv-configure_inner .bbg_xiv-mouse_only_option").show():jQuery(".bbg_xiv-configure_inner .bbg_xiv-mouse_only_option").hide(),jQuery("div.bbg_xiv-gallery_envelope").each(function(){var i=jQuery(this.parentNode).find("nav.bbg_xiv-gallery_navbar ul.nav ul.bbg_xiv-view_menu li").show();("mouse"!==e.guiInterface||jQuery(window).width()<e.bbg_xiv_flex_min_width_for_dense_view)&&i.filter(".bbg_xiv-large_viewport_only").hide(),"undefined"!=typeof e.images[this.id].models[0].attributes.gallery_index&&i.filter(".bbg_xiv-hide_for_gallery_icons").hide()})}),e.getDefaultView=function(i,t){var a;return t||null===t&&i.hasClass("bbg_xiv-gallery_icons_mode")?a="Gallery":(a=e.bbg_xiv_default_view?e.bbg_xiv_default_view:"Gallery",e.usingServerDefaultView&&(i.hasClass("bbg_xiv-default_view_gallery")?a="Gallery":i.hasClass("bbg_xiv-default_view_justified")?a="Justified":i.hasClass("bbg_xiv-default_view_carousel")?a="Carousel":i.hasClass("bbg_xiv-default_view_tabs")&&(a="Tabs")),i.parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_"+a.toLowerCase()).addClass("active")),a},jQuery(document).ready(function(){jQuery("div.bbg_xiv-gallery_envelope").each(function(){var i=this,t=e.getDefaultView(jQuery(i),null);e.prettifyTabs(jQuery(i.parentNode).find("div.bbg_xiv-container"),!0),e.bbg_xiv_wp_rest_api?wp.api.loadPromise.done(function(){var a=e.images[i.id]=new wp.api.collections.Media;a.reset(JSON.parse(e[i.id+"-data"])),e.renderGallery(i,t,["initial"]),jQuery(i).closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery"),jQuery(window).resize()}):(e.renderGallery(i,t,["initial"]),jQuery(i).closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery"))}),jQuery("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li > a").click(function(i){function t(i){u&&(jQuery.mobile.loading("hide"),jQuery(o).children().detach()),i?(d.images[a]=e.constructImages(o),d.view=a,b.find("div#"+o.id+"-alt_gallery_heading span.bbg_xiv-alt_gallery_heading").text(_),e.renderGallery(o,g)):jQuery(o).empty().append('<h1 class="bbg_xiv-warning">'+bbg_xiv_lang["Nothing Found"]+"</h1>"),jQuery(o.parentNode).find("nav.navbar form.bbg_xiv-search_form button").prop("disabled",!1)}var a=this.dataset.view,r=jQuery(this),n=r.parent(),l=n.parent(),s=n.parents("li.bbg_xiv-select_view"),b=r.parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery"),o=b.find("div.bbg_xiv-gallery_envelope")[0];if(["Gallery","Carousel","Justified","Tabs","Dense"].indexOf(a)>=0)l.find("li.bbg_xiv-view").removeClass("active"),n.addClass("active"),s.find("a.bbg_xiv-selected_view span").text(this.textContent),e.renderGallery(o,a);else{e.search[o.id]&&delete e.search[o.id],b.find("div#"+o.id+"-alt_gallery_heading").hide();var _=this.textContent,d=e.galleries[o.id],v="gallery_home"===a&&null,g=e.getDefaultView(jQuery(o),v);l.find("li.bbg_xiv-view").removeClass("active");var c=l.find("li.bbg_xiv-view_"+g.toLowerCase()).addClass("active");if(s.find("a.bbg_xiv-selected_view span").text(c.text()),l.find("li.bbg_xiv-alt_gallery").removeClass("active"),n.addClass("active"),d.images[a])return e.images[o.id]=d.images[a],d.view=a,"gallery_home"!==a&&b.find("div#"+o.id+"-alt_gallery_heading span.bbg_xiv-alt_gallery_heading").text(_),e.renderGallery(o,g),b.find("div.bbg_xiv-gallery_tabs_container nav.navbar ul.nav-tabs li").removeClass("active").find("a[data-view='"+a+"']").parent().addClass("active"),"gallery_home"!==a?r.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-home_gallery"):r.closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery"),void i.preventDefault();jQuery("div#"+o.id+"-heading").hide();var u=!0;try{jQuery(o).empty().append(jQuery.mobile.loading("show",{text:"Loading... please wait.",textVisible:!0,textonly:!1}))}catch(e){console.log(e),jQuery(o).empty().append('<h1 class="bbg_xiv-info">Loading... please wait.</h1>'),jQuery.mobile.loading._widget=void 0,u=!1}var p=this.dataset.specifiers;if(e.bbg_xiv_wp_rest_api)var f={id:"parent",ids:"include",bb_tags:"bb-tags"},x={ASC:"asc",DESC:"desc"};var h=p.match(/(\w+)="([^"]+)"/g),m={},y=!1;h.forEach(function(i){var t=i.match(/(\w+)="([^"]+)"/);e.bbg_xiv_wp_rest_api?(m[f[t[1]]?f[t[1]]:t[1]]=x[t[2]]?x[t[2]]:t[2],"ids"===t[1]&&(y=!0)):m[t[1]]=t[2]}),e.bbg_xiv_wp_rest_api&&y&&!m.orderby&&(m.orderby="include");var w=r.parents("div.navbar-collapse").first().find("form[role='search']");if(e.bbg_xiv_wp_rest_api){var j=e.images[o.id]=new wp.api.collections.Media;j.once("sync",function(){t(!!this.length)},j),m.per_page=e.wpRestApiMaxPerPage,j.fetch({data:m,success:function(){},error:function(e,i){console.log("error:r=",i),t(!1)}})}else{var Q={action:"bbg_xiv_search_media",_wpnonce:w.find("input[name='_wpnonce']").val(),_wp_http_referer:w.find("input[name='_wp_http_referer']").val()};for(var C in m)Q[C]=m[C];jQuery.post(e.ajaxurl,Q,function(i){"-1"===i&&(i=""),e.images[o.id]=null,e[o.id+"-data"]=i,t(!!i)})}r.parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("div.bbg_xiv-gallery_tabs_container nav.navbar ul.nav-tabs li").removeClass("active").find("a[data-view='"+a+"']").parent().addClass("active"),"gallery_home"!==a?r.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-home_gallery"):r.closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery")}i.preventDefault()}),jQuery("div.bbg_xiv-gallery_tabs_container nav.navbar ul.nav-tabs li a[data-view^='gallery_']").click(function(e){jQuery(this).parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li > a[data-view='"+this.dataset.view+"']").click(),e.preventDefault()}),jQuery("form.bbg_xiv-search_form input[type='text']").keypress(function(e){13===e.which&&jQuery(this).blur()}),jQuery("form.bbg_xiv-search_form button").each(function(){var i,t,a,r=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER;jQuery(this).click(function(l){function s(l){if(f&&(jQuery.mobile.loading("hide"),jQuery(g).children().detach()),l){var s=e.constructImages(g),_=t,c=i,p=jQuery("div#"+g.id+"-heading"),x=e.search[g.id];window.bbg_xiv.bbg_xiv_wp_rest_api&&a<=n||!window.bbg_xiv.bbg_xiv_wp_rest_api&&t+s.models.length<r?(t+=b,u.val("").attr("placeholder",v),p.find("button.bbg_xiv-search_scroll_right").attr("disabled",!1)):(x.done=!0,u.attr("placeholder",d).val(i),i=void 0,t=void 0,p.find("button.bbg_xiv-search_scroll_right").attr("disabled",!0)),p.find("span.bbg_xiv-search_heading_first").text(bbg_xiv_lang["Search Results for"]+' "'+c+'"');var h;h=window.bbg_xiv.bbg_xiv_wp_rest_api?bbg_xiv_lang.Page+" "+(a-1)+" "+bbg_xiv_lang.of+" "+(n!==Number.MAX_SAFE_INTEGER?n:"?"):bbg_xiv_lang.Images+" "+(_+1)+" "+bbg_xiv_lang.to+" "+(_+s.models.length)+" "+bbg_xiv_lang.of+" "+(r!==Number.MAX_SAFE_INTEGER?r:"?"),p.find("span.bbg_xiv-search_heading_second").text(h),x.history.push({images:s,title:h}),x.index=x.history.length-1;var m=e.getDefaultView(jQuery(g),null);e.renderGallery(g,m),p.find("button.bbg_xiv-search_scroll_left").attr("disabled",0===x.index)}else jQuery(g).empty().append('<h1 class="bbg_xiv-warning">'+bbg_xiv_lang["Nothing Found"]+"</h1>");var y=jQuery(g.parentNode).find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view"),w=y.find("ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_gallery").addClass("active"); 
    2 y.find("a.bbg_xiv-selected_view span").text(w.text()),o.prop("disabled",!1)}var b=parseInt(e.bbg_xiv_max_search_results,10);e.bbg_xiv_wp_rest_api&&b>e.wpRestApiMaxPerPage&&(b=e.wpRestApiMaxPerPage);var o=jQuery(this);o.prop("disabled",!0);var _,d="search images on site",v="continue current search",g=o.parents("div.bbg_xiv-gallery").find("div.bbg_xiv-gallery_envelope")[0],c=o.parents("form[role='search']"),u=c.find("input[type='text']"),p=u.val();if(p)i=p,t=0,a=1,e.search[g.id]={history:[],index:-1,done:!1},window.bbg_xiv.bbg_xiv_wp_rest_api||(_={action:"bbg_xiv_search_media_count",query:i,_wpnonce:c.find("input[name='_wpnonce']").val(),_wp_http_referer:c.find("input[name='_wp_http_referer']").val()},jQuery.post(e.ajaxurl,_,function(e){r=parseInt(e,10)}));else if("undefined"==typeof i)return void l.preventDefault();jQuery("div#"+g.id+"-alt_gallery_heading").hide();var f=!0;try{jQuery(g).empty().append(jQuery.mobile.loading("show",{text:"Loading... please wait.",textVisible:!0,textonly:!1}))}catch(e){console.log(e),jQuery(g).empty().append('<h1 class="bbg_xiv-info">Loading... please wait.</h1>'),jQuery.mobile.loading._widget=void 0,f=!1}if(jQuery(g).parent().find("div.bbg_xiv-search_header").hide(),window.bbg_xiv.bbg_xiv_wp_rest_api){var x=e.images[g.id]=new wp.api.collections.Media;x.once("sync",function(){s(!!this.length)},x),x.fetch({data:{search:i,page:a++,per_page:b},success:function(e,i,t){var l=t.xhr.getResponseHeader("link");if(l){var s=l.match(/(\?|&)page=(\d+)(&[^>]+>;|>;)\s+rel="next"/);s&&4===s.length&&jQuery.isNumeric(s[2])&&(a=parseInt(s[2],10))}r=x.state.totalObjects,n=x.state.totalPages},error:function(e,i){console.log("error:r=",i),s(!1)}})}else _={action:"bbg_xiv_search_media",query:i,limit:b,offset:t,_wpnonce:c.find("input[name='_wpnonce']").val(),_wp_http_referer:c.find("input[name='_wp_http_referer']").val()},jQuery.post(e.ajaxurl,_,function(i){e.images[g.id]=null,e[g.id+"-data"]=i,s(!!i)});o.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-home_gallery"),l.preventDefault()})}),jQuery("button.bbg_xiv-home").click(function(e){jQuery(this).parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li > a[data-view='gallery_home']").click(),e.preventDefault()}),jQuery("button.bbg_xiv-fullscreen").click(function(){var e=jQuery(this).closest("div.bbg_xiv-gallery");e.hasClass("bbg_xiv-fullscreen_gallery")?(e.removeClass("bbg_xiv-fullscreen_gallery"),jQuery("html").removeClass("bbg_xiv-fullscreen_gallery")):(e.addClass("bbg_xiv-fullscreen_gallery"),jQuery("html").addClass("bbg_xiv-fullscreen_gallery")),jQuery(window).resize()}),jQuery("button.bbg_xiv-titles").click(function(){var e=jQuery(this).closest("div.bbg_xiv-bootstrap.bbg_xiv-gallery"),i=e.find("div.bbg_xiv-flex_container");if(i.length){var t=i.find("div.bbg_xiv-flex_item figure"),a=t.find("figcaption");return e.hasClass("bbg_xiv-caption_visible")?(a.hide(1e3),e.removeClass("bbg_xiv-caption_visible")):(a.show(1e3),e.addClass("bbg_xiv-caption_visible")),void(i.hasClass("bbg_xiv-contain")&&(e.hasClass("bbg_xiv-caption_visible")?t.find("img").removeClass("bbg_xiv-vertical_center"):t.find("img").addClass("bbg_xiv-vertical_center")))}i=e.find("div.bbg_xiv-justified_container"),i.length&&(e.hasClass("bbg_xiv-caption_visible")?e.removeClass("bbg_xiv-caption_visible"):e.addClass("bbg_xiv-caption_visible"),window.setTimeout(function(){var t=i.find("div.caption");e.hasClass("bbg_xiv-caption_visible")?t.css({display:"block",opacity:"0.7"}):t.css({display:"none",opacity:"0.0"})},1e3))}),jQuery("button.bbg_xiv-configure").click(function(t){i.find("input#bbg_xiv-carousel_delay").val(e.bbg_xiv_carousel_interval),i.find("input#bbg_xiv-min_image_width").val(e.bbg_xiv_flex_min_width),i.find("input#bbg_xiv-miro_row_height").val(e.bbg_xiv_miro_row_height),i.find("input#bbg_xiv-max_search_results").val(e.bbg_xiv_max_search_results),i.find("input#bbg_xiv-columns_in_dense_view").val(e.bbg_xiv_flex_number_of_dense_view_columns),i.find("input[name='bbg_xiv-default_view']").prop("checked",!1),e.usingServerDefaultView===!1&&i.find("input[name='bbg_xiv-default_view'][value='"+e.bbg_xiv_default_view+"']").prop("checked",!0),i.find("input[name='bbg_xiv-bandwidth']").prop("checked",!1),i.find("input[name='bbg_xiv-bandwidth'][value='"+e.bbg_xiv_bandwidth+"']").prop("checked",!0),i.find("input[name='bbg_xiv-interface']").prop("checked",!1),i.find("input[name='bbg_xiv-interface'][value='"+e.bbg_xiv_interface+"']").prop("checked",!0);var a=jQuery(this).parents("div.bbg_xiv-gallery"),r=a.find("div.bbg_xiv-configure_outer");r.show();var n=a.find("div.bbg_xiv-configure_inner");n.show(),t.preventDefault()});var i=jQuery(".bbg_xiv-configure_inner");i.find('input[type="number"]#bbg_xiv-max_search_results').change(function(){var i=jQuery(this),t=parseInt(i.val(),10),a=parseInt(i.attr("max"),10);e.bbg_xiv_wp_rest_api&&a>e.wpRestApiMaxPerPage&&(a=e.wpRestApiMaxPerPage),t>a&&i.val(a)}),i.find("button.bbg_xiv-configure_close,button.bbg_xiv-cancel_options").click(function(){var e=jQuery(this).parents("div.bbg_xiv-gallery"),i=e.find("div.bbg_xiv-configure_outer");i.hide();var t=e.find("div.bbg_xiv-configure_inner");t.hide()}),i.find("button.bbg_xiv-help_options").click(function(i){window.open(e.helpOptionsUrl,"_blank"),i.preventDefault()}),i.find("button.bbg_xiv-save_options").click(function(t){e.bbg_xiv_carousel_interval=i.find("input#bbg_xiv-carousel_delay").val(),e.bbg_xiv_flex_min_width=i.find("input#bbg_xiv-min_image_width").val(),e.bbg_xiv_miro_row_height=i.find("input#bbg_xiv-miro_row_height").val(),e.bbg_xiv_max_search_results=i.find("input#bbg_xiv-max_search_results").val(),e.bbg_xiv_flex_number_of_dense_view_columns=i.find("input#bbg_xiv-columns_in_dense_view").val();var a=i.find("input[name='bbg_xiv-default_view']:checked").val();a?(e.bbg_xiv_default_view=a,e.usingServerDefaultView=!1):e.usingServerDefaultView=!0,e.bbg_xiv_bandwidth=i.find("input[name='bbg_xiv-bandwidth']:checked").val(),e.bbg_xiv_interface=i.find("input[name='bbg_xiv-interface']:checked").val();var r={bbg_xiv_carousel_interval:e.bbg_xiv_carousel_interval,bbg_xiv_flex_min_width:e.bbg_xiv_flex_min_width,bbg_xiv_miro_row_height:e.bbg_xiv_miro_row_height,bbg_xiv_max_search_results:e.bbg_xiv_max_search_results,bbg_xiv_flex_number_of_dense_view_columns:e.bbg_xiv_flex_number_of_dense_view_columns,bbg_xiv_bandwidth:e.bbg_xiv_bandwidth,bbg_xiv_interface:e.bbg_xiv_interface};e.usingServerDefaultView===!1&&(r.bbg_xiv_default_view=e.bbg_xiv_default_view),r=JSON.stringify(r),e.setCookie("bbg_xiv",r,30),e.getOptionsFromCookie(),e.calcBreakpoints();var n=jQuery(this).parents("div.bbg_xiv-gallery"),l=n.find("div.bbg_xiv-configure_outer");l.hide();var s=n.find("div.bbg_xiv-configure_inner");s.hide(),e.resetGallery(jQuery(this).parents("div.bbg_xiv-gallery")),t.preventDefault()}),jQuery("button.bbg_xiv-help").click(function(i){window.open(e.helpMVPUrl,"_blank"),this.blur(),i.preventDefault()}),jQuery("div.bbg_xiv-search_header button.bbg_xiv-search_scroll_left,div.bbg_xiv-search_header button.bbg_xiv-search_scroll_right").click(function(){var i=jQuery(this),t=i.parents("div.bbg_xiv-search_header"),a=t.attr("id").replace("-heading",""),r=t.parents("div.bbg_xiv-gallery"),n=e.search[a];if(i.hasClass("bbg_xiv-search_scroll_left"))n.index>0&&(--n.index||i.attr("disabled",!0),t.find("button.bbg_xiv-search_scroll_right").attr("disabled",!1));else{if(!(n.index<n.history.length-1))return void r.find("nav.navbar form.bbg_xiv-search_form button[type='submit']").click();++n.index,n.index===n.history.length-1&&n.done&&t.find("button.bbg_xiv-search_scroll_right").attr("disabled",!0),t.find("button.bbg_xiv-search_scroll_left").attr("disabled",!1)}if(n.index>=0&&n.index<n.history.length){var l=n.history[n.index];e.images[a]=l.images,t.find("span.bbg_xiv-search_heading_second").text(l.title);var s=r.find("div.bbg_xiv-gallery_envelope"),b=e.getDefaultView(s,null);e.renderGallery(s[0],b);var o=r.find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view"),_=o.find("ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_gallery").addClass("active");o.find("a.bbg_xiv-selected_view span").text(_.text())}}),jQuery("a.bbg_xiv-images_brand,a.bbg_xiv-tabs_brand").click(function(e){var i=jQuery(this).siblings("button.navbar-toggle");"none"!==i.css("display")&&i.click(),e.preventDefault()}),jQuery(window).on("swipe",function(i){var t=jQuery("div.bbg_xiv-gallery_envelope div.carousel");if(t.length){if(i.pageY>jQuery("div.carousel-indicators").offset().top-50)return;return void(i.swipestop.coords[0]>i.swipestart.coords[0]?t.find("a.left.carousel-control").click():t.find("a.right.carousel-control").click())}var a=jQuery("div.bbg_xiv-dense_inner");a.find(".bbg_xiv-dense_title, .bbg_xiv-dense_caption").each(function(){var i=jQuery(this),t=i.css("color");"transparent"!==t&&"rgba(0, 0, 0, 0)"!==t?i.css({color:"transparent",textShadow:"none"}):i.css({color:e.titleColor,textShadow:e.titleShadow})})}),jQuery(window).on("orientationchange",function(){jQuery("div.bbg_xiv-gallery").each(function(){e.resetGallery(jQuery(this))})}),e.bbg_xiv_wp_rest_api||jQuery(window).resize();var t=jQuery("body"),a=window.getComputedStyle(t[0],":before");if(a&&"fixed"===a.position&&a.zIndex>0){var r=parseInt(a.height,10);r>8&&r<64&&t.addClass("bbg_xiv-twentysixteen_with_border")}})}(); 
     1!function(){var e=window.bbg_xiv=window.bbg_xiv||{};e.helpMVPUrl="https://bbfgallery.wordpress.com/#navbar",e.helpOptionsUrl="https://bbfgallery.wordpress.com/#options",e.galleryOfGalleriesTitle=bbg_xiv_lang.galleryOfGalleriesTitle,e.templateOptions={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},e.images={},e.search={},e.galleries={},e.Image=Backbone.Model.extend({idAttribute:window.bbg_xiv.bbg_xiv_wp_rest_api?"id":"ID"}),e.Images=Backbone.Collection.extend({model:e.Image}),e.ImageView=Backbone.View.extend({render:function(e){var i=this.template(this.model.attributes);return e?i:(this.$el.html(i),this)}}),e.GalleryView=Backbone.View.extend({render:function(){var e=this.template(this.model.attributes);return this.$el.html(e),this}}),e.renderBootstrapGallery=function(i,t){var a=new e.ImageView;a.template=_.template(jQuery("script#bbg_xiv-template_gallery_item").html(),null,e.templateOptions);var r="";t.forEach(function(e,i){a.model=e,r+=a.render(!0),i%4===3&&(r+='<br class="clearfix visible-lg-block">'),i%3===2&&(r+='<br class="clearfix visible-md-block">'),i%2===1&&(r+='<br class="clearfix visible-sm-block">')});var n=new e.GalleryView({model:{attributes:{items:r}}});n.template=_.template(jQuery("script#bbg_xiv-template_gallery_container").html(),null,e.templateOptions),i.empty(),i.append(n.render().$el.find("div.container"))},e.renderFlex=function(i,t){var a=i.width(),r=new e.ImageView;r.template=_.template(jQuery("script#bbg_xiv-template_flex_item").html(),null,e.templateOptions);var n="";t.forEach(function(e){e.attributes.bbg_xiv_container_width=a,r.model=e,n+=r.render(!0)});var l=new e.GalleryView({model:{attributes:{id:t.id,items:n}}});l.template=_.template(jQuery("script#bbg_xiv-template_flex_container").html(),null,e.templateOptions),i.empty(),i.append(l.render().$el.find("div.bbg_xiv-flex_container")),"touch"===e.guiInterface&&i.find("div.bbg_xiv-flex_container div.bbg_xiv-flex_item div.bbg_xiv-dense_full_btn").addClass("bbg_xiv-touch")},e.renderTiles=function(i,t,a){i.addClass("bbg_xiv-tiles_container"),a.indexOf("contain")!==-1?i.addClass("bbg_xiv-contain"):a.indexOf("fill")!==-1&&i.addClass("bbg_xiv-fill"),e.renderFlex(i,t),Modernizr.objectfit&&a.indexOf("contain")===-1||i.find("div.bbg_xiv-flex_item img").load(function(){this.naturalWidth<this.naturalHeight&&jQuery(this).addClass("bbg_xiv-portrait")});var r=i.find("div.bbg_xiv-flex_container"),n=r.closest("div.bbg_xiv-gallery").addClass("bbg_xiv-caption_visible");i.find("div.bbg_xiv-dense_full_btn").hover(function(){n.hasClass("bbg_xiv-caption_visible")||jQuery(this).parents("div.bbg_xiv-flex_item").find("figure figcaption").each(function(){jQuery(this).show()})},function(){n.hasClass("bbg_xiv-caption_visible")||jQuery(this).parents("div.bbg_xiv-flex_item").find("figure figcaption").each(function(){jQuery(this).hide()})}),"touch"===e.guiInterface&&i.find("div.bbg_xiv-flex_item a").click(function(e){if(!n.hasClass("bbg_xiv-caption_visible")){var t=jQuery(this.parentNode).find("figure figcaption");t.data("visible")||(i.find("div.bbg_xiv-flex_item figure figcaption").data("visible",!1),t.data("visible",!0),e.preventDefault())}})},e.renderCarousel=function(i,t,a){var r=i.width(),n=new e.ImageView;n.template=_.template(jQuery("script#bbg_xiv-template_carousel_item").html(),null,e.templateOptions);var l="",s="";t.forEach(function(i,t){i.attributes.browser=e.browser,i.attributes.index=t,i.attributes.bbg_xiv_container_width=r,n.model=i;var b=0===t?' class="active"':"";l+='<li data-target="#'+a+'" data-slide-to="'+t+'"'+b+"></li>",s+=n.render(!0)});var b=new e.GalleryView({model:{attributes:{id:a,size:t.length,bullets:l,items:s}}});b.template=_.template(jQuery("script#bbg_xiv-template_carousel_container").html(),null,e.templateOptions),i.empty(),i.append(b.render().$el.find("div.carousel.slide"))},e.renderTabs=function(i,t,a){var r=i.width(),n=new e.ImageView;n.template=_.template(jQuery("script#bbg_xiv-template_tabs_tab").html(),null,e.templateOptions);var l=new e.ImageView;l.template=_.template(jQuery("script#bbg_xiv-template_tabs_item").html(),null,e.templateOptions);var s="",b="";t.forEach(function(i,t){i.attributes.browser=e.browser,i.attributes.index=t,i.attributes.bbg_xiv_container_width=r,l.model=n.model=i,s+=n.render(!0),b+=l.render(!0)});var o=new e.GalleryView({model:{attributes:{id:a,tabs:s,items:b}}});o.template=_.template(jQuery("script#bbg_xiv-template_tabs_container").html(),null,e.templateOptions),i.empty(),i.append(o.render().$el.find("div.bbg_xiv-template_tabs_container"))},e.renderDense=function(i,t,a,r){var n=i.width(),l=new e.ImageView;l.template=_.template(jQuery("script#bbg_xiv-template_dense_title").html(),null,e.templateOptions);var s=new e.ImageView;s.template=_.template(jQuery("script#bbg_xiv-template_dense_image").html(),null,e.templateOptions);var b="",o="";t.forEach(function(e,i){e.attributes.mode=r,e.attributes.index=i,e.attributes.bbg_xiv_container_width=n,s.model=l.model=e,b+=l.render(!0),o+=s.render(!0)});var d=new e.GalleryView({model:{attributes:{id:a,gallery:t.id,mode:r,titles:b,images:o}}});d.template=_.template(jQuery("script#bbg_xiv-template_dense_container").html(),null,e.templateOptions),i.empty(),i.append(d.render().$el.find("div.bbg_xiv-dense_container"))},e.renderJustified=function(i,t){var a=new e.ImageView;a.template=_.template(jQuery("script#bbg_xiv-template_justified_item").html(),null,e.templateOptions);var r="";t.forEach(function(e){a.model=e,r+=a.render(!0)});var n=new e.GalleryView({model:{attributes:{id:t.id,items:r}}});n.template=_.template(jQuery("script#bbg_xiv-template_justified_container").html(),null,e.templateOptions),i.empty();var l=n.render().$el.find("div.bbg_xiv-justified_container");i.append(l);var s=l.find("div.bbg_xiv-justified_gallery");s.justifiedGallery({margins:5,rowHeight:e.bbg_xiv_miro_row_height,lastRow:"nojustify",refreshSensitivity:0,refreshTime:250}).on("jg.complete jg.resize",function(){s.find("img").css("margin","0")}),"touch"===e.guiInterface&&s.find("div.bbg_xiv-justified_item > a").click(function(e){e.preventDefault()}),l=i.find("div.bbg_xiv-justified_container");var b=l.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-caption_visible");l.find("div.bbg_xiv-justified_gallery div.bbg_xiv-justified_item").each(function(){var e=this.querySelector("img"),i=this.querySelector("div.caption");[e,i].forEach(function(e){e.addEventListener("mouseover",function(e){b.hasClass("bbg_xiv-caption_visible")&&(i.style.display="block",i.style.opacity="0.7",e.stopImmediatePropagation())}),e.addEventListener("mouseout",function(e){b.hasClass("bbg_xiv-caption_visible")&&(i.style.display="block",i.style.opacity="0.7",e.stopImmediatePropagation())})}),jQuery(e).closest("a").click(function(e){e.preventDefault()}),jQuery(i).find("a").click(function(e){jQuery(this).closest("div.caption").css("opacity")||e.preventDefault()})})},e.renderGeneric=function(i,t,a){var r=new e.ImageView;r.template=_.template(jQuery("script#bbg_xiv-template_"+a+"_item").html(),null,e.templateOptions);var n="";t.forEach(function(e){r.model=e,n+=r.render(!0)});var l=new e.GalleryView({model:{attributes:{items:n}}});l.template=_.template(jQuery("script#bbg_xiv-template_"+a+"_container").html(),null,e.templateOptions),i.empty(),i.append(l.render().$el.find("bbg_xiv-container"))};var i=[];e.dumpFieldNames=function(e){e.forEach(function(e){Object.keys(e.attributes).forEach(function(e){i.indexOf(e)===-1&&i.push(e)})});var t="<tr>";return i.forEach(function(e){t+="<th>"+e+"</th>"}),t+="</tr>"},e.dumpFieldValues=function(e){var t="";return e.forEach(function(e){t+="<tr>",i.forEach(function(i){t+="<td>"+e.attributes[i]+"</td>"}),t+="</tr>"}),t},e.renderTable=function(i,t){var a=new e.GalleryView({model:{attributes:{collection:t}}});a.template=_.template(jQuery("script#bbg_xiv-template_table_container").html(),null,e.templateOptions),i.empty(),i.append(a.render().$el.find("div.bbg_xiv-table"))},e.constructImages=function(i){var t;if(window.bbg_xiv.bbg_xiv_wp_rest_api)t=e.images[i.id];else{t=e.images[i.id]=new e.Images;try{t.reset(JSON.parse(window.bbg_xiv[i.id+"-data"]))}catch(e){return console.log("reset(JSON.parse()) failed:",e),t}}return t.id=i.id,t.constructed=!0,t},e.renderGallery=function(i,t,a){function r(){var i=l.find("div.bbg_xiv-dense_outer"),t=l.find("div.bbg_xiv-dense_inner").click(function(){t.css("opacity","0.0"),i.css("opacity","0.0");var e=jQuery("div.bbg_xiv-gallery nav.bbg_xiv-gallery_navbar").css("opacity","0.99");window.setTimeout(function(){t.hide(),i.hide(),e.css("opacity","1.0")},2e3)}),a=t.find("img"),r=t.find("h1.bbg_xiv-dense_title"),n=t.find("h1.bbg_xiv-dense_caption");"undefined"==typeof e.titleColor&&(e.titleColor=r.css("color"),e.titleShadow=r.css("text-shadow")),"mouse"===e.guiInterface&&a.hover(function(){r.css({color:e.titleColor,textShadow:e.titleShadow}),n.css({color:e.titleColor,textShadow:e.titleShadow})},function(){r.css({color:"transparent",textShadow:"none"}),n.css({color:"transparent",textShadow:"none"})}),l.find("button.bbg_xiv-dense_full_btn").click(function(l){var s,b=jQuery(this);b.hasClass("bbg_xiv-dense_from_image")?s=b.parents("div.bbg_xiv-dense_flex_item").find("img")[0]:b.hasClass("bbg_xiv-dense_from_title")?s=jQuery("div#"+this.parentNode.id.replace("title","image")).find("img")[0]:b.hasClass("bbg_xiv-flex_from_image")?s=b.parents("div.bbg_xiv-flex_item").find("img")[0]:b.hasClass("bbg_xiv-dense_from_justified")&&(s=b.parents("div.bbg_xiv-justified_item").find("img")[0]);var o;try{var _=jQuery(s).parents("div[data-bbg_xiv-gallery-id]")[0].dataset.bbg_xivGalleryId;o=e.images[_].get(s.dataset.bbg_xivImageId).attributes,a[0].src=e.getSrc(o,"viewport",!1),o.bbg_srcset?a[0].srcset=e.getSrcset(o):a[0].removeAttribute("sizes")}catch(e){console.log("##### broken 1"),a[0].src=s.src}r[0].textContent=e.getTitle(o),n[0].textContent=e.getCaption(o),i.show(),t.show(),"touch"===e.guiInterface&&(r.css({color:e.titleColor,textShadow:e.titleShadow}),n.css({color:e.titleColor,textShadow:e.titleShadow})),window.setTimeout(function(){t.css("opacity","1.0"),i.css("opacity","0.93")},100),l.preventDefault(),l.stopPropagation()})}function n(e){var i=jQuery(e).parents("div.carousel");i.carousel("pause"),i.find("a.bbg_xiv-carousel_play span.glyphicon").removeClass("glyphicon-pause").addClass("glyphicon-play")}a||(a=[]),i.dataset.flags&&(a=a.concat(i.dataset.flags.split(",")));var l=jQuery(i),s=e.images[i.id];s&&s.constructed||(s=e.constructImages(i)),e.galleries[i.id]=e.galleries[i.id]||{images:{gallery_home:s},view:"gallery_home"};var b=l.parents("div.bbg_xiv-gallery").find("nav.navbar button.bbg_xiv-titles").hide();switch(t){case"Gallery":a.indexOf("tiles")!==-1?(e.renderTiles(l,s,a),r(),b.show()):Modernizr.flexbox&&Modernizr.flexwrap&&!window.bbg_xiv.bbg_xiv_disable_flexbox?(e.renderFlex(l,s),r()):e.renderBootstrapGallery(l,s),window.setTimeout(function(){jQuery(window).resize()},100);break;case"Justified":e.renderJustified(l,s),r(),b.show();break;case"Carousel":a.indexOf("embedded-carousel")!==-1?l.addClass("bbg_xiv-embedded_carousel"):jQuery("html").css("overflow-y","hidden");var o="bbg_xiv-carousel_"+i.id;e.renderCarousel(l,s,o),l.find("a.bbg_xiv-carousel_play").click(function(e){var i=jQuery(this).parents("div.carousel"),t=jQuery(this).find("span.glyphicon");t.hasClass("glyphicon-pause")?n(this):(t.removeClass("glyphicon-play").addClass("glyphicon-pause"),i.carousel("next"),i.carousel("cycle")),e.preventDefault()}),l.find("a.bbg_xiv-carousel_left, a.bbg_xiv-carousel_right").click(function(){n(this)}),l.find("a.bbg_xiv-carousel_first span.glyphicon,a.bbg_xiv-carousel_last span.glyphicon").click(function(e){n(this);var i=jQuery(this).parents("div.carousel");jQuery(this.parentNode).hasClass("bbg_xiv-carousel_first")?i.carousel(0):i.carousel(s.length-1),e.preventDefault()}),l.find("a.bbg_xiv-carousel_close").click(function(i){l.removeClass("bbg_xiv-embedded_carousel"),e.resetGallery(jQuery(this).parents("div.bbg_xiv-gallery"),"Carousel"),jQuery("html").css("overflow-y",""),i.preventDefault()});var _=l.find("div.bbg_xiv-jquery_mobile input[type='range']");_.slider();var d,v=!1;_.attr("type","number").val("1").change(function(){if(!v){d=Date.now();var e=jQuery(this).parents("div.carousel");n(_),window.setTimeout(function(){if(Date.now()-d>=500){var i=_.val();jQuery.isNumeric(i)&&(i=parseInt(i,10)-1,i>=0&&i<s.length&&(e.carousel(i),n(_)))}},500)}}).keypress(function(e){13===e.which&&(jQuery(this).blur(),e.preventDefault())}).focus(function(){n(this)}).on("slidestart",function(){n(this)}),l.find("div.carousel").on("slide.bs.carousel slid.bs.carousel",function(e){v=!0,jQuery(this).find('div.bbg_xiv-jquery_mobile input[type="number"]').val(parseInt(e.relatedTarget.dataset.index,10)+1).change(),v=!1}),a.indexOf("embedded-carousel")!==-1&&window.setTimeout(function(){var e=l.closest("div.bbg_xiv-gallery"),i=l.find("div.carousel");if(e.hasClass("bbg_xiv-fullscreen_gallery"))window.matchMedia("(max-aspect-ratio:1/1)").matches||e.scrollTop(e[0].scrollHeight-e.height());else if(window.matchMedia("(max-aspect-ratio:1/1)").matches)jQuery(window).scrollTop(i.offset().top-jQuery(window).height()/6);else{var t=jQuery("body"),a=jQuery("div#wpadminbar"),r=t.hasClass("admin-bar")&&"fixed"==a.css("position")?a.outerHeight():0,n=0;if(t.hasClass("bbg_xiv-twentysixteen_with_border")){var s=window.getComputedStyle(t[0],":before");n=s&&"fixed"===s.position?parseInt(s.height,10):0}jQuery(window).scrollTop(i.offset().top-i.outerHeight()/18-r-n)}},500),jQuery("#"+o).carousel({interval:e.bbg_xiv_carousel_interval,pause:!1});break;case"Tabs":e.renderTabs(l,s,"bbg_xiv-tabs_"+i.id),e.prettifyTabs(l,!0),l.find("nav.navbar ul.nav li a").click(function(){Modernizr.objectfit||jQuery(this.href.substr(this.href.lastIndexOf("#"))+" img").each(function(){var e,i=this,t=0,a=0;window.setTimeout(function r(){var n=i.naturalWidth,l=i.naturalHeight,s=jQuery(i.parentNode.parentNode.parentNode),b=s.width(),o=.7*jQuery(window).height();if(!n||!l||!b||!o||b<64||o<64)return void(t++<16&&window.setTimeout(r,250));var _=Math.max(n/b,l/o);_<.125||_>8||"undefined"!=typeof e&&_===e||(n=Math.floor(n/_),l=Math.floor(l/_),jQuery(i).css({width:n+"px",height:l+"px"}),e=_,a++<16&&window.setTimeout(r,250))},250)}),window.setTimeout(function(){var e=jQuery(window),i=l.closest("div.bbg_xiv-gallery"),t=i.hasClass("bbg_xiv-fullscreen_gallery"),a=l.find("div.tab-content");if(window.matchMedia("(max-aspect-ratio:1/1)").matches)t?i.scrollTop(i.scrollTop()+a.position().top-e.height()/3-20):e.scrollTop(a.offset().top-e.height()/3-20);else if(t)i.scrollTop(i.scrollTop()+a.position().top-90);else{var r=jQuery("body"),n=jQuery("div#wpadminbar"),s=r.hasClass("admin-bar")&&"fixed"==n.css("position")?n.outerHeight():0,b=0;if(r.hasClass("bbg_xiv-twentysixteen_with_border")){var o=window.getComputedStyle(r[0],":before");b=o&&"fixed"===o.position?parseInt(o.height,10):0}var _=e.height()>=480?80:40;e.scrollTop(a.offset().top-_-s-b)}},500)}),l.hasClass("bbg_xiv-gallery_icons_mode")&&l.find("div.bbg_xiv-template_tabs_container div.tab-content figure.tab-pane a").click(function(e){var i=l.parent().find("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li.bbg_xiv-alt_gallery");i.filter(".bbg_xiv-alt_gallery_home").hasClass("active")&&(i.find("a[data-view='gallery_"+this.dataset.galleryIndex+"']").click(),e.preventDefault())}),l.find("a.bbg_xiv-tabs_brand").click(function(e){var i=jQuery(this).siblings("button.navbar-toggle");"none"!==i.css("display")&&i.click(),e.preventDefault()}),"touch"===e.guiInterface&&jQuery("div.bbg_xiv-gallery nav.bbg_xiv-gallery_navbar").find("span.glyphicon-collapse-down").each(function(){var e=jQuery(this);"none"!==e.css("display")&&e.click()});break;case"Dense":jQuery("html").css("overflow-y","hidden"),e.renderDense(l,s,"bbg_xiv-dense_"+i.id,"title"),l.find("div.bbg_xiv-dense_images div.bbg_xiv-dense_flex_images div.bbg_xiv-dense_flex_item").css("width",100/e.bbg_xiv_flex_number_of_dense_view_columns+"%");var g=jQuery("div.bbg_xiv-dense_container button#bbg_xiv-normal_color").css("background-color"),c=jQuery("div.bbg_xiv-dense_container button#bbg_xiv-highlight_color").css("background-color");l.find("div.bbg_xiv-dense_titles ul li").hover(function(){jQuery(this).css({"background-color":c});var e=jQuery("div#"+this.id.replace("title","image")).css({"border-color":c}),i=e.position().top,t=e.height(),a=i+t,r=e.parents("div.bbg_xiv-dense_images"),n=r.scrollTop(),l=r.height();i<0?r.scrollTop(n+i-l/2-t/2):a>l&&r.scrollTop(n+(a-l)+l/2-t/2)},function(){jQuery(this).css({"background-color":g}),jQuery("div#"+this.id.replace("title","image")).css({"border-color":g})}),l.find("div.bbg_xiv-dense_flex_item").hover(function(){jQuery(this).css({"border-color":c});var e=jQuery("li#"+this.id.replace("image","title")).css({"background-color":c}),i=e.position().top,t=e.height(),a=i+t,r=e.parents("div.bbg_xiv-dense_titles"),n=r.scrollTop(),l=r.height();i<0?r.scrollTop(n+i-l/2-t/2):a>l&&r.scrollTop(n+(a-l)+l/2-t/2)},function(){jQuery(this).css({"border-color":g}),jQuery("li#"+this.id.replace("image","title")).css({"background-color":g})}),l.find("input.bbg_xiv-dense_li_mode").change(function(){if(this.checked){var e=jQuery("div.bbg_xiv-dense_container div.bbg_xiv-dense_titles");"title"===this.value?(e.find("span.bbg_xiv-dense_li_caption").hide(),e.find("span.bbg_xiv-dense_li_title").show(),e.find("span.bbg_xiv-dense_li_alt").hide()):"caption"===this.value?(e.find("span.bbg_xiv-dense_li_title").hide(),e.find("span.bbg_xiv-dense_li_caption").show(),e.find("span.bbg_xiv-dense_li_alt").hide()):"alt"===this.value&&(e.find("span.bbg_xiv-dense_li_title").hide(),e.find("span.bbg_xiv-dense_li_caption").hide(),e.find("span.bbg_xiv-dense_li_alt").show())}}),l.find("button.bbg_xiv-dense_close_btn").click(function(i){e.resetGallery(jQuery(this).parents("div.bbg_xiv-gallery")),jQuery("html").css("overflow-y",""),i.preventDefault()}),r();break;case"Table":e.renderTable(l,s)}var u=jQuery(i.parentNode).find("nav.bbg_xiv-gallery_navbar ul.nav ul.bbg_xiv-view_menu li").show();if(("mouse"!==e.guiInterface||jQuery(window).width()<e.bbg_xiv_flex_min_width_for_dense_view)&&u.filter(".bbg_xiv-large_viewport_only").hide(),e.search[i.id])jQuery("div#"+i.id+"-alt_gallery_heading").hide(),jQuery("div#"+i.id+"-heading").show();else if(e.galleries[i.id]){jQuery("div#"+i.id+"-heading").hide();var p="undefined"!=typeof e.images[i.id].models[0].attributes.gallery_index,f=jQuery("div#"+i.id+"-alt_gallery_heading");p&&(f.find("span.bbg_xiv-alt_gallery_heading").text(e.galleryOfGalleriesTitle),l.find("a.bbg_xiv-gallery_icon").click(function(e){l.parent().find('nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li.bbg_xiv-alt_gallery > a[data-view="gallery_'+this.dataset.galleryIndex+'"]').click(),e.preventDefault()}),u.filter(".bbg_xiv-hide_for_gallery_icons").hide()),("gallery_home"!==e.galleries[i.id].view||p)&&f.show()}},e.prettifyTabs=function(e,i){var t=e.find("nav.navbar"),a=t.find("button.navbar-toggle");"none"!==a.css("display")&&a.click(),t.find("div.navbar-collapse ul.nav").each(function(){jQuery(this).height()-8<=jQuery(this.parentNode).height()&&(jQuery(this).parents("nav.navbar").find("span.glyphicon").hide(),jQuery(this.parentNode).addClass("bbg_xiv-hide_scroll"))}),i&&e.find("span.glyphicon-collapse-down, span.glyphicon-collapse-up").click(function(){var e=jQuery(this),i=jQuery(this.parentNode).find("div.navbar-collapse");e.hasClass("glyphicon-collapse-down")?(e.removeClass("glyphicon-collapse-down").addClass("glyphicon-collapse-up"),i.removeClass("bbg_xiv-closed").addClass("bbg_xiv-open")):(e.removeClass("glyphicon-collapse-up").addClass("glyphicon-collapse-down"),i.removeClass("bbg_xiv-open").addClass("bbg_xiv-closed"))})},e.resetGallery=function(i,t){var a=i.find("div.bbg_xiv-gallery_envelope")[0],r="undefined"!=typeof e.images[a.id].models[0].attributes.gallery_index,n=e.getDefaultView(jQuery(a),r);"Carousel"===t&&"Carousel"===n&&(n="Gallery"),e.renderGallery(a,n);var l=i.find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view"),s=l.find("ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_"+n.toLowerCase()).addClass("active");l.find("a.bbg_xiv-selected_view span").text(s.text()),jQuery(window).resize()},e.getSrc=function(i,t,a){switch(e.bandwidth){case"normal":return e.bbg_xiv_wp_rest_api?i.source_url:i.url;case"low":return a?i.bbg_thumbnail_src[0]:"viewport"===t?i.bbg_large_src[0]:i.bbg_medium_large_src[0];case"very low":return a?i.bbg_thumbnail_src[0]:"viewport"===t?i.bbg_medium_large_src[0]:i.bbg_medium_src[0]}},e.getSrcset=function(i){return"auto"!==e.bbg_xiv_bandwidth?"":i.bbg_srcset},e.getTitle=function(i){return(e.bbg_xiv_wp_rest_api?i.title.rendered:i.post_title).trim()},e.getCaption=function(i,t){var a=e.bbg_xiv_wp_rest_api?jQuery(i.caption.rendered).text():i.post_excerpt;return a||t||(a=e.getAlt(i,!0)),a.trim()},e.getAlt=function(i,t){var a=e.bbg_xiv_wp_rest_api?i.alt_text:i.image_alt;return a||t||(a=e.getCaption(i,!0)),a.trim()},e.getPostContent=function(i){var t=e.bbg_xiv_wp_rest_api?i.bbg_post_content:i.post_content;return t?t:e.getCaption(i)},e.getSizes=function(i,t,a){return"auto"!==e.bbg_xiv_bandwidth?"":i?i.bbg_srcset?a?"10vw":"viewport"===t?"90vw":"container"===t?i.bbg_xiv_container_width+"px":"50vw":"":"viewport"!==t||a?"50vw":"100vw"};try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test"),e.localStorageAvailable=!0}catch(i){e.localStorageAvailable=!1}e.setCookie=function(i,t,a){if(e.localStorageAvailable)localStorage.setItem(i,t);else{var r=new Date;r.setTime(r.getTime()+24*a*60*60*1e3),document.cookie=i+"="+t+"; expires="+r.toUTCString()+"; path=/"}},e.getCookie=function(i){if(e.localStorageAvailable)return localStorage.getItem(i);var t=document.cookie;t+=";";var a=t.indexOf(i+"=");if(a===-1)return null;a+=i.length+1;var r=t.indexOf(";",a);return r===-1?null:t.substring(a,r)},e.calcBreakpoints=function(){var i=window.bbg_xiv.bbg_xiv_flex_min_width;e.breakpoints=[{width:2*i,cssClass:"100"},{width:3*i,cssClass:"50"},{width:4*i,cssClass:"33_3333"},{width:5*i,cssClass:"25"},{width:6*i,cssClass:"20"},{width:7*i,cssClass:"16_6666"},{width:8*i,cssClass:"14_2857"},{width:9*i,cssClass:"12_5"},{width:10*i,cssClass:"11_1111"},{width:11*i,cssClass:"10"},{width:12*i,cssClass:"9_0909"},{width:1e6,cssClass:"8_3333"}]},e.getOptionsFromCookie=function(){var i=e.getCookie("bbg_xiv");if(i){var t=JSON.parse(i),a=t.bbg_xiv_carousel_interval;jQuery.isNumeric(a)&&a>=1e3&&(e.bbg_xiv_carousel_interval=a);var r=t.bbg_xiv_flex_min_width;jQuery.isNumeric(r)&&r>=32&&r<=1024&&(e.bbg_xiv_flex_min_width=r);var n=t.bbg_xiv_miro_row_height;jQuery.isNumeric(n)&&n>=32&&n<=512&&(e.bbg_xiv_miro_row_height=n);var l=t.bbg_xiv_max_search_results;jQuery.isNumeric(l)&&l>=1&&l<1048576&&(e.bbg_xiv_max_search_results=l);var s=t.bbg_xiv_flex_number_of_dense_view_columns;jQuery.isNumeric(s)&&s>=2&&s<=32&&(e.bbg_xiv_flex_number_of_dense_view_columns=s),"string"==typeof t.bbg_xiv_default_view?(e.bbg_xiv_default_view=t.bbg_xiv_default_view,e.usingServerDefaultView=!1):e.usingServerDefaultView=!0,"string"==typeof t.bbg_xiv_bandwidth&&(e.bbg_xiv_bandwidth=t.bbg_xiv_bandwidth),"string"==typeof t.bbg_xiv_interface&&(e.bbg_xiv_interface=t.bbg_xiv_interface)}else e.usingServerDefaultView=!0,e.bbg_xiv_bandwidth="auto",e.bbg_xiv_interface="auto";var b=navigator.userAgent;b.indexOf("Firefox")!==-1?e.browser="Firefox":e.browser="","auto"===e.bbg_xiv_bandwidth?Modernizr.lowbandwidth?e.bandwidth="very low":/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(b)?e.bandwidth="very low":e.bandwidth="low":e.bandwidth=e.bbg_xiv_bandwidth,"auto"===e.bbg_xiv_interface?Modernizr.touchevents?e.guiInterface="touch":e.guiInterface="mouse":e.guiInterface=e.bbg_xiv_interface,e.bbg_xiv_wp_rest_api&&(e.wpRestApiMaxPerPage=100)},e.getOptionsFromCookie(),e.calcBreakpoints(),jQuery(window).resize(function(){var i=e.breakpoints;jQuery("div.bbg_xiv-flex_container,div.bbg_xiv-gallery_container").each(function(){var e,t=jQuery(this),a=t.width(),r=window.bbg_xiv.bbg_xiv_flex_min_width_for_caption;if(t.parents("div.bbg_xiv-gallery_envelope").hasClass("bbg_xiv-tiles_container"))e=Math.floor(a/Math.floor(a/window.bbg_xiv.bbg_xiv_flex_min_width))-1,t.find("div.bbg_xiv-flex_item").css({width:e,height:e}),e<r&&t.find("div.bbg_xiv-flex_item figcaption").hide();else{i.forEach(function(e){t.removeClass("bbg_xiv-flex_width_"+e.cssClass)});for(var n=0;n<i.length;n++)if(a<i[n].width){var l=i[n].cssClass;t.addClass("bbg_xiv-flex_width_"+l),e=parseFloat(l.replace("_","."))/100*a,e<r?t.addClass("bbg_xiv-flex_no_caption"):t.removeClass("bbg_xiv-flex_no_caption");break}}}),"mouse"===e.guiInterface&&jQuery(window).width()>=e.bbg_xiv_flex_min_width_for_dense_view?jQuery(".bbg_xiv-configure_inner .bbg_xiv-mouse_only_option").show():jQuery(".bbg_xiv-configure_inner .bbg_xiv-mouse_only_option").hide(),jQuery("div.bbg_xiv-gallery_envelope").each(function(){var i=jQuery(this.parentNode).find("nav.bbg_xiv-gallery_navbar ul.nav ul.bbg_xiv-view_menu li").show();("mouse"!==e.guiInterface||jQuery(window).width()<e.bbg_xiv_flex_min_width_for_dense_view)&&i.filter(".bbg_xiv-large_viewport_only").hide(),"undefined"!=typeof e.images[this.id].models[0].attributes.gallery_index&&i.filter(".bbg_xiv-hide_for_gallery_icons").hide()})}),e.getDefaultView=function(i,t){var a;return t||null===t&&i.hasClass("bbg_xiv-gallery_icons_mode")?a="Gallery":(a=e.bbg_xiv_default_view?e.bbg_xiv_default_view:"Gallery",e.usingServerDefaultView&&(i.hasClass("bbg_xiv-default_view_gallery")?a="Gallery":i.hasClass("bbg_xiv-default_view_justified")?a="Justified":i.hasClass("bbg_xiv-default_view_carousel")?a="Carousel":i.hasClass("bbg_xiv-default_view_tabs")&&(a="Tabs")),i.parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_"+a.toLowerCase()).addClass("active")),a},jQuery(document).ready(function(){jQuery("div.bbg_xiv-gallery_envelope").each(function(){var i=this,t=e.getDefaultView(jQuery(i),null);e.prettifyTabs(jQuery(i.parentNode).find("div.bbg_xiv-container"),!0),e.bbg_xiv_wp_rest_api?wp.api.loadPromise.done(function(){var a=e.images[i.id]=new wp.api.collections.Media;a.reset(JSON.parse(e[i.id+"-data"])),e.renderGallery(i,t,["initial"]),jQuery(i).closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery"),jQuery(window).resize()}):(e.renderGallery(i,t,["initial"]),jQuery(i).closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery"))}),jQuery("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li > a").click(function(i){function t(i){u&&(jQuery.mobile.loading("hide"),jQuery(o).children().detach()),i?(d.images[a]=e.constructImages(o),d.view=a,b.find("div#"+o.id+"-alt_gallery_heading span.bbg_xiv-alt_gallery_heading").text(_),e.renderGallery(o,g)):jQuery(o).empty().append('<h1 class="bbg_xiv-warning">'+bbg_xiv_lang["Nothing Found"]+"</h1>"),jQuery(o.parentNode).find("nav.navbar form.bbg_xiv-search_form button").prop("disabled",!1)}var a=this.dataset.view,r=jQuery(this),n=r.parent(),l=n.parent(),s=n.parents("li.bbg_xiv-select_view"),b=r.parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery"),o=b.find("div.bbg_xiv-gallery_envelope")[0];if(["Gallery","Carousel","Justified","Tabs","Dense"].indexOf(a)>=0)l.find("li.bbg_xiv-view").removeClass("active"),n.addClass("active"),s.find("a.bbg_xiv-selected_view span").text(this.textContent),e.renderGallery(o,a);else{e.search[o.id]&&delete e.search[o.id],b.find("div#"+o.id+"-alt_gallery_heading").hide();var _=this.textContent,d=e.galleries[o.id],v="gallery_home"===a&&null,g=e.getDefaultView(jQuery(o),v);l.find("li.bbg_xiv-view").removeClass("active");var c=l.find("li.bbg_xiv-view_"+g.toLowerCase()).addClass("active");if(s.find("a.bbg_xiv-selected_view span").text(c.text()),l.find("li.bbg_xiv-alt_gallery").removeClass("active"),n.addClass("active"),d.images[a])return e.images[o.id]=d.images[a],d.view=a,"gallery_home"!==a&&b.find("div#"+o.id+"-alt_gallery_heading span.bbg_xiv-alt_gallery_heading").text(_),e.renderGallery(o,g),b.find("div.bbg_xiv-gallery_tabs_container nav.navbar ul.nav-tabs li").removeClass("active").find("a[data-view='"+a+"']").parent().addClass("active"),"gallery_home"!==a?r.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-home_gallery"):r.closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery"),void i.preventDefault();jQuery("div#"+o.id+"-heading").hide();var u=!0;try{jQuery(o).empty().append(jQuery.mobile.loading("show",{text:"Loading... please wait.",textVisible:!0,textonly:!1}))}catch(e){console.log(e),jQuery(o).empty().append('<h1 class="bbg_xiv-info">Loading... please wait.</h1>'),jQuery.mobile.loading._widget=void 0,u=!1}var p=this.dataset.specifiers;if(e.bbg_xiv_wp_rest_api)var f={id:"parent",ids:"include",bb_tags:"bb-tags"},x={ASC:"asc",DESC:"desc"};var h=p.match(/(\w+)="([^"]+)"/g),m={},y=!1;h.forEach(function(i){var t=i.match(/(\w+)="([^"]+)"/);e.bbg_xiv_wp_rest_api?(m[f[t[1]]?f[t[1]]:t[1]]=x[t[2]]?x[t[2]]:t[2],"ids"===t[1]&&(y=!0)):m[t[1]]=t[2]}),e.bbg_xiv_wp_rest_api&&y&&!m.orderby&&(m.orderby="include");var w=r.parents("div.navbar-collapse").first().find("form[role='search']");if(e.bbg_xiv_wp_rest_api){var j=e.images[o.id]=new wp.api.collections.Media;j.once("sync",function(){t(!!this.length)},j),m.per_page=e.wpRestApiMaxPerPage,j.fetch({data:m,success:function(){},error:function(e,i){console.log("error:r=",i),t(!1)}})}else{var Q={action:"bbg_xiv_search_media",_wpnonce:w.find("input[name='_wpnonce']").val(),_wp_http_referer:w.find("input[name='_wp_http_referer']").val()};for(var C in m)Q[C]=m[C];jQuery.post(e.ajaxurl,Q,function(i){"-1"===i&&(i=""),e.images[o.id]=null,e[o.id+"-data"]=i,t(!!i)})}r.parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("div.bbg_xiv-gallery_tabs_container nav.navbar ul.nav-tabs li").removeClass("active").find("a[data-view='"+a+"']").parent().addClass("active"),"gallery_home"!==a?r.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-home_gallery"):r.closest("div.bbg_xiv-gallery").addClass("bbg_xiv-home_gallery")}i.preventDefault()}),jQuery("div.bbg_xiv-gallery_tabs_container nav.navbar ul.nav-tabs li a[data-view^='gallery_']").click(function(e){jQuery(this).parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li > a[data-view='"+this.dataset.view+"']").click(),e.preventDefault()}),jQuery("form.bbg_xiv-search_form input[type='text']").keypress(function(e){13===e.which&&jQuery(this).blur()}),jQuery("form.bbg_xiv-search_form button").each(function(){var i,t,a,r=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER;jQuery(this).click(function(l){function s(l){if(f&&(jQuery.mobile.loading("hide"),jQuery(g).children().detach()),l){var s=e.constructImages(g),_=t,c=i,p=jQuery("div#"+g.id+"-heading"),x=e.search[g.id];window.bbg_xiv.bbg_xiv_wp_rest_api&&a<=n||!window.bbg_xiv.bbg_xiv_wp_rest_api&&t+s.models.length<r?(t+=b,u.val("").attr("placeholder",v),p.find("button.bbg_xiv-search_scroll_right").attr("disabled",!1)):(x.done=!0,u.attr("placeholder",d).val(i),i=void 0,t=void 0,p.find("button.bbg_xiv-search_scroll_right").attr("disabled",!0)),p.find("span.bbg_xiv-search_heading_first").text(bbg_xiv_lang["Search Results for"]+' "'+c+'"');var h;h=window.bbg_xiv.bbg_xiv_wp_rest_api?bbg_xiv_lang.Page+" "+(a-1)+" "+bbg_xiv_lang.of+" "+(n!==Number.MAX_SAFE_INTEGER?n:"?"):bbg_xiv_lang.Images+" "+(_+1)+" "+bbg_xiv_lang.to+" "+(_+s.models.length)+" "+bbg_xiv_lang.of+" "+(r!==Number.MAX_SAFE_INTEGER?r:"?"),p.find("span.bbg_xiv-search_heading_second").text(h),x.history.push({images:s,title:h}),x.index=x.history.length-1;var m=e.getDefaultView(jQuery(g),null);e.renderGallery(g,m),p.find("button.bbg_xiv-search_scroll_left").attr("disabled",0===x.index)}else jQuery(g).empty().append('<h1 class="bbg_xiv-warning">'+bbg_xiv_lang["Nothing Found"]+"</h1>"); 
     2var y=jQuery(g.parentNode).find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view"),w=y.find("ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_gallery").addClass("active");y.find("a.bbg_xiv-selected_view span").text(w.text()),o.prop("disabled",!1)}var b=parseInt(e.bbg_xiv_max_search_results,10);e.bbg_xiv_wp_rest_api&&b>e.wpRestApiMaxPerPage&&(b=e.wpRestApiMaxPerPage);var o=jQuery(this);o.prop("disabled",!0);var _,d="search images on site",v="continue current search",g=o.parents("div.bbg_xiv-gallery").find("div.bbg_xiv-gallery_envelope")[0],c=o.parents("form[role='search']"),u=c.find("input[type='text']"),p=u.val();if(p)i=p,t=0,a=1,e.search[g.id]={history:[],index:-1,done:!1},window.bbg_xiv.bbg_xiv_wp_rest_api||(_={action:"bbg_xiv_search_media_count",query:i,_wpnonce:c.find("input[name='_wpnonce']").val(),_wp_http_referer:c.find("input[name='_wp_http_referer']").val()},jQuery.post(e.ajaxurl,_,function(e){r=parseInt(e,10)}));else if("undefined"==typeof i)return void l.preventDefault();jQuery("div#"+g.id+"-alt_gallery_heading").hide();var f=!0;try{jQuery(g).empty().append(jQuery.mobile.loading("show",{text:"Loading... please wait.",textVisible:!0,textonly:!1}))}catch(e){console.log(e),jQuery(g).empty().append('<h1 class="bbg_xiv-info">Loading... please wait.</h1>'),jQuery.mobile.loading._widget=void 0,f=!1}if(jQuery(g).parent().find("div.bbg_xiv-search_header").hide(),window.bbg_xiv.bbg_xiv_wp_rest_api){var x=e.images[g.id]=new wp.api.collections.Media;x.once("sync",function(){s(!!this.length)},x),x.fetch({data:{search:i,page:a++,per_page:b},success:function(e,i,t){var l=t.xhr.getResponseHeader("link");if(l){var s=l.match(/(\?|&)page=(\d+)(&[^>]+>;|>;)\s+rel="next"/);s&&4===s.length&&jQuery.isNumeric(s[2])&&(a=parseInt(s[2],10))}r=x.state.totalObjects,n=x.state.totalPages},error:function(e,i){console.log("error:r=",i),s(!1)}})}else _={action:"bbg_xiv_search_media",query:i,limit:b,offset:t,_wpnonce:c.find("input[name='_wpnonce']").val(),_wp_http_referer:c.find("input[name='_wp_http_referer']").val()},jQuery.post(e.ajaxurl,_,function(i){e.images[g.id]=null,e[g.id+"-data"]=i,s(!!i)});o.closest("div.bbg_xiv-gallery").removeClass("bbg_xiv-home_gallery"),l.preventDefault()})}),jQuery("button.bbg_xiv-home").click(function(e){jQuery(this).parents("div.bbg_xiv-bootstrap.bbg_xiv-gallery").find("nav.bbg_xiv-gallery_navbar ul.nav li.dropdown ul.bbg_xiv-view_menu li > a[data-view='gallery_home']").click(),e.preventDefault()}),jQuery("button.bbg_xiv-fullscreen").click(function(){var e=jQuery(this).closest("div.bbg_xiv-gallery");e.hasClass("bbg_xiv-fullscreen_gallery")?(e.removeClass("bbg_xiv-fullscreen_gallery"),jQuery("html").removeClass("bbg_xiv-fullscreen_gallery")):(e.addClass("bbg_xiv-fullscreen_gallery"),jQuery("html").addClass("bbg_xiv-fullscreen_gallery")),jQuery(window).resize()}),jQuery("button.bbg_xiv-titles").click(function(){var e=jQuery(this).closest("div.bbg_xiv-bootstrap.bbg_xiv-gallery"),i=e.find("div.bbg_xiv-flex_container");if(i.length){var t=i.find("div.bbg_xiv-flex_item figure"),a=t.find("figcaption");return e.hasClass("bbg_xiv-caption_visible")?(a.hide(1e3),e.removeClass("bbg_xiv-caption_visible")):(a.show(1e3),e.addClass("bbg_xiv-caption_visible")),void(i.hasClass("bbg_xiv-contain")&&(e.hasClass("bbg_xiv-caption_visible")?t.find("img").removeClass("bbg_xiv-vertical_center"):t.find("img").addClass("bbg_xiv-vertical_center")))}i=e.find("div.bbg_xiv-justified_container"),i.length&&(e.hasClass("bbg_xiv-caption_visible")?e.removeClass("bbg_xiv-caption_visible"):e.addClass("bbg_xiv-caption_visible"),window.setTimeout(function(){var t=i.find("div.caption");e.hasClass("bbg_xiv-caption_visible")?t.css({display:"block",opacity:"0.7"}):t.css({display:"none",opacity:"0.0"})},1e3))}),jQuery("button.bbg_xiv-configure").click(function(t){i.find("input#bbg_xiv-carousel_delay").val(e.bbg_xiv_carousel_interval),i.find("input#bbg_xiv-min_image_width").val(e.bbg_xiv_flex_min_width),i.find("input#bbg_xiv-miro_row_height").val(e.bbg_xiv_miro_row_height),i.find("input#bbg_xiv-max_search_results").val(e.bbg_xiv_max_search_results),i.find("input#bbg_xiv-columns_in_dense_view").val(e.bbg_xiv_flex_number_of_dense_view_columns),i.find("input[name='bbg_xiv-default_view']").prop("checked",!1),e.usingServerDefaultView===!1&&i.find("input[name='bbg_xiv-default_view'][value='"+e.bbg_xiv_default_view+"']").prop("checked",!0),i.find("input[name='bbg_xiv-bandwidth']").prop("checked",!1),i.find("input[name='bbg_xiv-bandwidth'][value='"+e.bbg_xiv_bandwidth+"']").prop("checked",!0),i.find("input[name='bbg_xiv-interface']").prop("checked",!1),i.find("input[name='bbg_xiv-interface'][value='"+e.bbg_xiv_interface+"']").prop("checked",!0);var a=jQuery(this).parents("div.bbg_xiv-gallery"),r=a.find("div.bbg_xiv-configure_outer");r.show();var n=a.find("div.bbg_xiv-configure_inner");n.show(),t.preventDefault()});var i=jQuery(".bbg_xiv-configure_inner");i.find('input[type="number"]#bbg_xiv-max_search_results').change(function(){var i=jQuery(this),t=parseInt(i.val(),10),a=parseInt(i.attr("max"),10);e.bbg_xiv_wp_rest_api&&a>e.wpRestApiMaxPerPage&&(a=e.wpRestApiMaxPerPage),t>a&&i.val(a)}),i.find("button.bbg_xiv-configure_close,button.bbg_xiv-cancel_options").click(function(){var e=jQuery(this).parents("div.bbg_xiv-gallery"),i=e.find("div.bbg_xiv-configure_outer");i.hide();var t=e.find("div.bbg_xiv-configure_inner");t.hide()}),i.find("button.bbg_xiv-help_options").click(function(i){window.open(e.helpOptionsUrl,"_blank"),i.preventDefault()}),i.find("button.bbg_xiv-save_options").click(function(t){e.bbg_xiv_carousel_interval=i.find("input#bbg_xiv-carousel_delay").val(),e.bbg_xiv_flex_min_width=i.find("input#bbg_xiv-min_image_width").val(),e.bbg_xiv_miro_row_height=i.find("input#bbg_xiv-miro_row_height").val(),e.bbg_xiv_max_search_results=i.find("input#bbg_xiv-max_search_results").val(),e.bbg_xiv_flex_number_of_dense_view_columns=i.find("input#bbg_xiv-columns_in_dense_view").val();var a=i.find("input[name='bbg_xiv-default_view']:checked").val();a?(e.bbg_xiv_default_view=a,e.usingServerDefaultView=!1):e.usingServerDefaultView=!0,e.bbg_xiv_bandwidth=i.find("input[name='bbg_xiv-bandwidth']:checked").val(),e.bbg_xiv_interface=i.find("input[name='bbg_xiv-interface']:checked").val();var r={bbg_xiv_carousel_interval:e.bbg_xiv_carousel_interval,bbg_xiv_flex_min_width:e.bbg_xiv_flex_min_width,bbg_xiv_miro_row_height:e.bbg_xiv_miro_row_height,bbg_xiv_max_search_results:e.bbg_xiv_max_search_results,bbg_xiv_flex_number_of_dense_view_columns:e.bbg_xiv_flex_number_of_dense_view_columns,bbg_xiv_bandwidth:e.bbg_xiv_bandwidth,bbg_xiv_interface:e.bbg_xiv_interface};e.usingServerDefaultView===!1&&(r.bbg_xiv_default_view=e.bbg_xiv_default_view),r=JSON.stringify(r),e.setCookie("bbg_xiv",r,30),e.getOptionsFromCookie(),e.calcBreakpoints();var n=jQuery(this).parents("div.bbg_xiv-gallery"),l=n.find("div.bbg_xiv-configure_outer");l.hide();var s=n.find("div.bbg_xiv-configure_inner");s.hide(),e.resetGallery(jQuery(this).parents("div.bbg_xiv-gallery")),t.preventDefault()}),jQuery("button.bbg_xiv-help").click(function(i){window.open(e.helpMVPUrl,"_blank"),this.blur(),i.preventDefault()}),jQuery("div.bbg_xiv-search_header button.bbg_xiv-search_scroll_left,div.bbg_xiv-search_header button.bbg_xiv-search_scroll_right").click(function(){var i=jQuery(this),t=i.parents("div.bbg_xiv-search_header"),a=t.attr("id").replace("-heading",""),r=t.parents("div.bbg_xiv-gallery"),n=e.search[a];if(i.hasClass("bbg_xiv-search_scroll_left"))n.index>0&&(--n.index||i.attr("disabled",!0),t.find("button.bbg_xiv-search_scroll_right").attr("disabled",!1));else{if(!(n.index<n.history.length-1))return void r.find("nav.navbar form.bbg_xiv-search_form button[type='submit']").click();++n.index,n.index===n.history.length-1&&n.done&&t.find("button.bbg_xiv-search_scroll_right").attr("disabled",!0),t.find("button.bbg_xiv-search_scroll_left").attr("disabled",!1)}if(n.index>=0&&n.index<n.history.length){var l=n.history[n.index];e.images[a]=l.images,t.find("span.bbg_xiv-search_heading_second").text(l.title);var s=r.find("div.bbg_xiv-gallery_envelope"),b=e.getDefaultView(s,null);e.renderGallery(s[0],b);var o=r.find("nav.bbg_xiv-gallery_navbar ul.nav li.bbg_xiv-select_view"),_=o.find("ul.bbg_xiv-view_menu li.bbg_xiv-view").removeClass("active").filter(".bbg_xiv-view_gallery").addClass("active");o.find("a.bbg_xiv-selected_view span").text(_.text())}}),jQuery("a.bbg_xiv-images_brand,a.bbg_xiv-tabs_brand").click(function(e){var i=jQuery(this).siblings("button.navbar-toggle");"none"!==i.css("display")&&i.click(),e.preventDefault()}),jQuery(window).on("swipe",function(i){var t=jQuery("div.bbg_xiv-gallery_envelope div.carousel");if(t.length){if(i.pageY>jQuery("div.carousel-indicators").offset().top-50)return;return void(i.swipestop.coords[0]>i.swipestart.coords[0]?t.find("a.left.carousel-control").click():t.find("a.right.carousel-control").click())}var a=jQuery("div.bbg_xiv-dense_inner");a.find(".bbg_xiv-dense_title, .bbg_xiv-dense_caption").each(function(){var i=jQuery(this),t=i.css("color");"transparent"!==t&&"rgba(0, 0, 0, 0)"!==t?i.css({color:"transparent",textShadow:"none"}):i.css({color:e.titleColor,textShadow:e.titleShadow})})}),jQuery(window).on("orientationchange",function(){var i=jQuery("body");i.hasClass("admin-bar")&&"fixed"==jQuery("div#wpadminbar").css("position")?i.addClass("bbg_xiv-fixed_admin_bar"):i.removeClass("bbg_xiv-fixed_admin_bar"),jQuery("div.bbg_xiv-gallery").each(function(){e.resetGallery(jQuery(this))})}),e.bbg_xiv_wp_rest_api||jQuery(window).resize();var t=jQuery("body"),a=window.getComputedStyle(t[0],":before");if(a&&"fixed"===a.position&&a.zIndex>0){var r=parseInt(a.height,10);r>8&&r<64&&t.addClass("bbg_xiv-twentysixteen_with_border")}t.hasClass("admin-bar")&&"fixed"==jQuery("div#wpadminbar").css("position")&&t.addClass("bbg_xiv-fixed_admin_bar")})}(); 
  • bb-gallery/trunk/readme.txt

    r1766478 r1771903  
    33Tags: gallery, shortcode, lightbox, slideshow, responsive, plug-compatible, replacement 
    44Requires at least: 4.4 
    5 Tested up to: 4.8.3 
    6 Stable tag: 1.8.2.4 
     5Tested up to: 4.9 
     6Stable tag: 1.8.2.4.1 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    4444== Changelog == 
    4545 
     46= 1.8.2.4.1 = 
     47 
     48* css tweaks 
     49 
    4650= 1.8.2.4 = 
    4751 
     
    194198== Upgrade Notice == 
    195199 
     200= 1.8.2.4.1 = 
     201 
     202* css tweaks 
     203 
    196204= 1.8.2.4 = 
    197205 
Note: See TracChangeset for help on using the changeset viewer.