1/** 2 * Match the Divi Library footer gradient to the final page section. 3 * 4 * On standard WordPress pages, this checks the last top-level Divi section 5 * inside the main builder content. When that section contains a row with the 6 * `.brown-toggles` class, its computed background color is used to replace 7 * the white portion of the footer's background gradient. 8 * 9 * The update is applied only to the footer section with the 10 * `.divi-library-footer-layout` class. 11 */ 12 13jQuery(function ($) { 14 // Only run on standard WordPress pages. 15 const $builderContent = $( 16 '.page.page-template-default #page-container #main-content .et_builder_inner_content' 17 ).first(); 18 19 if (!$builderContent.length) { 20 return; 21 } 22 23 // Get the final top-level Divi section in the page builder content. 24 const $lastSection = $builderContent 25 .children('.et_pb_section') 26 .last(); 27 28 if (!$lastSection.length) { 29 return; 30 } 31 32 // Only continue when that section contains a brown-toggles Divi row. 33 const $brownTogglesRow = $lastSection.find( 34 '.et_pb_row.brown-toggles' 35 ).first(); 36 37 if (!$brownTogglesRow.length) { 38 return; 39 } 40 41 // Get the final page section's computed background color. 42 const sectionBackgroundColor = window 43 .getComputedStyle($lastSection[0]) 44 .getPropertyValue('background-color') 45 .trim(); 46 47 // Do not replace the gradient with a transparent color. 48 if ( 49 !sectionBackgroundColor || 50 sectionBackgroundColor === 'transparent' || 51 sectionBackgroundColor === 'rgba(0, 0, 0, 0)' 52 ) { 53 return; 54 } 55 56 // Find the Divi Library footer section. 57 const $footerSection = $( 58 '#main-footer .et_pb_section.divi-library-footer-layout' 59 ).first(); 60 61 if (!$footerSection.length) { 62 return; 63 } 64 65 const footerBackgroundImage = [ 66 'url("https://browncounty.com/wp-content/uploads/2023/02/footer-back.svg")', 67 'linear-gradient(180deg, ' + 68 sectionBackgroundColor + 69 ' 63%, #603913 64%)' 70 ].join(', '); 71 72 // Use setProperty so the dynamically applied value is also !important. 73 $footerSection[0].style.setProperty( 74 'background-image', 75 footerBackgroundImage, 76 'important' 77 ); 78}); 79 80 81 82 83jQuery(document).ready(function ($) { 84 $(".geodir-page-cpt-gd_stay.search-results .card .website-custom-field a").text("Book Now"); 85 86 var $lpGform = $("#lp-gform"); 87 if ($lpGform.length) { 88 // Look inside #lp-gform for a confirmation wrapper that contains a confirmation message 89 if ($lpGform.find('div[id^="gform_confirmation_wrapper_"] div[id^="gform_confirmation_message_"]').length > 0) { 90 // Find the closest parent with the class "et_pb_row" 91 var $parentRow = $lpGform.closest(".et_pb_row"); 92 if ($parentRow.length) { 93 // Find the #main-content div 94 var $mainContent = $("#main-content"); 95 var adjustment = 0; 96 if ($mainContent.length) { 97 // Calculate the distance from the top of the page including its top padding 98 var mainContentOffset = $mainContent.offset().top; 99 var mainContentPaddingTop = parseInt($mainContent.css("padding-top"), 10) || 0; 100 adjustment = mainContentOffset + mainContentPaddingTop; 101 } 102 // Scroll to the parent's position plus the adjustment 103 $("html, body").animate( 104 { 105 scrollTop: $parentRow.offset().top - adjustment, 106 }, 107 1000 108 ); // 1000ms animation duration 109 } 110 } 111 } 112}); 113 114// $(document).ready(function () { 115// lines 4-29 were inside this declaration but were throwing $ is not a function. moved up to quell error. 116// }); 117 118 119 120 121// Modify MEC single event page to grab images from plugin-styled hero image gallery, 122// and break them up into two separate elements. The first is just to replace the hero 123// image, and the second takes the remaining images and creates a Slick Slider gallery between the 124// event info and the google map. 125 126jQuery(function ($) { 127 // Only run on single MEC event pages 128 var $body = $('body'); 129 if (!$body.hasClass('single-mec-events')) return; 130 131 var $list = $('body.single-mec-events ul.mec-event-gallery-list'); 132 if (!$list.length) return; 133 134 // Collect full-size image URLs from li > img[data-full-src] 135 var urls = []; 136 $list.find('li').each(function () { 137 var $img = $(this).find('img[data-full-src]').first(); 138 var full = ($img.attr('data-full-src') || '').trim(); 139 if (full) urls.push(full); 140 }); 141 142 // If we didn't find anything, bail 143 if (!urls.length) return; 144 145 // Hide the original MEC gallery wrapper 146 $('.mec-event-gallery-wrapper').hide(); 147 148 // --- 1) Replace/augment hero: insert first image as the first child under .mec-events-event-image 149 var heroUrl = urls[0]; 150 var $heroWrap = $('.mec-events-event-image').first(); 151 if ($heroWrap.length) { 152 // Remove any previously injected hero image (in case of re-init) 153 $heroWrap.find('img.mec-injected-hero').remove(); 154 155 // Insert new hero image as first child 156 var $heroImg = $('<img/>', { 157 class: 'mec-injected-hero', 158 src: heroUrl, 159 alt: '' 160 }); 161 162 $heroWrap.prepend($heroImg); 163 } 164 165 // --- 2) Build synced Slick sliders from remaining images 166 var rest = urls.slice(1); 167 if (!rest.length) return; 168 169 // Build slider markup
170 var $main = $('<div class="mec-injected-gallery mec-injected-gallery--main"></div>'); 171 var $thumbs = $('<div class="mec-injected-gallery mec-injected-gallery--thumbs"></div>'); 172 173 rest.forEach(function (u) { 174 // Main slider (still uses <img>) 175 $main.append( 176 $('<div class="mec-injected-slide"></div>').append( 177 $('<img/>', { src: u, alt: '' }) 178 ) 179 ); 180 181 // Thumbs slider (background-image div) 182 $thumbs.append( 183 $('<div></div>').append( 184 $('<div class="mec-injected-thumb-bg"></div>').css( 185 'background-image', 186 'url(' + u + ')' 187 ) 188 ) 189 ); 190 }); 191 192 var $wrap = $( 193 '<div class="mec-injected-gallery-wrap">' + 194 '<div class="mec-injected-gallery-thumbs"></div>' + 195 '<div class="mec-injected-gallery-main"></div>' + 196 '</div>' 197 ); 198 199 $wrap.find('.mec-injected-gallery-main').append($main); 200 $wrap.find('.mec-injected-gallery-thumbs').append($thumbs); 201 202 // Inject after .mec-single-links-wrap 203 var $after = $('.mec-single-links-wrap').first(); 204 if (!$after.length) return; 205 206 // Remove any prior injected wrap (safety) 207 $after.next('.mec-injected-gallery-wrap').remove(); 208 $after.after($wrap); 209 210 // If Slick isn't available, stop here (markup will still be present) 211 if (typeof $.fn.slick !== 'function') return; 212 213 // If Slick already initialized (some weird reflow), destroy first 214 if ($main.hasClass('slick-initialized')) $main.slick('unslick'); 215 if ($thumbs.hasClass('slick-initialized')) $thumbs.slick('unslick'); 216 217 var emptyArrowPrev = '<button type="button" class="slick-prev" aria-label=""><i class="fa-solid fa-circle-chevron-left"></i></button>'; 218 var emptyArrowNext = '<button type="button" class="slick-next" aria-label=""><i class="fa-solid fa-circle-chevron-right"></i></button>'; 219 220 // Init synced sliders 221 $main.slick({ 222 slidesToShow: 1, 223 slidesToScroll: 1, 224 arrows: false, 225 fade: true, 226 autoplay: true, 227 autoplaySpeed: 8000, // ~5 seconds 228 asNavFor: '.mec-injected-gallery--thumbs' 229 }); 230 231 var thumbCount = rest.length; 232 var slidesVisible = 5; 233 234 $thumbs.slick({ 235 slidesToShow: Math.min(slidesVisible, thumbCount), 236 slidesToScroll: 1, 237 asNavFor: '.mec-injected-gallery--main', 238 dots: false, 239 arrows: true, 240 focusOnSelect: true, 241 adaptiveHeight: true, 242 variableWidth: false, 243 centerMode: thumbCount > slidesVisible, 244 centerPadding: '0px', 245 prevArrow: emptyArrowPrev, 246 nextArrow: emptyArrowNext, 247 }); 248});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.