1jQuery(document).ready(function() { 2 if (jQuery("a.sd-my-account-link").length) { 3 jQuery('a.sd-my-account-link').click(function(e) { 4 e.preventDefault(); 5 e.stopPropagation(); 6 jQuery('.sd-my-account-dd').toggle(); 7 }); 8 jQuery(document).click(function(e) { 9 if (e.target.class != 'sd-my-account-dd' && !jQuery('.sd-my-account-dd').find(e.target).length) { 10 jQuery('.sd-my-account-dd').hide(); 11 } 12 }); 13 } 14 15 jQuery("body").on("geodir_setup_search_form", function() { 16 if (jQuery(".featured-area .geodir-cat-list-tax").length) { 17 var postType = jQuery('.featured-area .search_by_post').val(); 18 jQuery(".geodir-cat-list-tax").val(postType); 19 jQuery(".geodir-cat-list-tax").change(); 20 } 21 }); 22 23 jQuery("#showMap").click(function() { 24 jQuery('body').addClass('sd-map-only').removeClass('sd-listings-only'); 25 jQuery("#hideMap").appendTo(".gd_listing_map_TopLeft"); 26 }); 27 28 jQuery("#hideMap").click(function() { 29 jQuery('body').addClass('sd-listings-only').removeClass('sd-map-only'); 30 jQuery("#hideMap").appendTo(".sd-mobile-search-controls"); 31 }); 32 33 jQuery("#showSearch").click(function() { 34 jQuery("body").toggleClass('sd-show-search'); 35 if (typeof geodir_reposition_compass == 'function') { 36 geodir_reposition_compass(); 37 } 38 }); 39 40 if (jQuery(".sd-detail-cta a.dt-btn").length) { 41 jQuery(".sd-detail-cta a.dt-btn").click(function() { 42 sd_scroll_to_reviews(); 43 }); 44 } 45 46 jQuery(".sd-detail-cta .gd-write-a-review-badge > a, .sd-ratings .geodir-post-rating .gd-list-rating-link").on('click', function(e) { 47 e.preventDefault(); 48 sd_scroll_to_reviews(); 49 }); 50 51 //if (jQuery(".sd-ratings a.geodir-pcomments").length) { 52 //jQuery(".sd-ratings a.geodir-pcomments").click(function() { 53 //sd_scroll_to_reviews(); 54 //}); 55 //} 56 57 // fire any resize functions 58 jQuery(window).on('resize', function() { 59 // var win = $(this); //this = window 60 // if (win.height() >= 820) { /* ... */ } 61 // if (win.width() >= 1280) { /* ... */ } 62 sd_archive_container_max_height(); 63 }); 64}); 65 66function sd_archive_container_max_height() { 67 if (jQuery("body.geodir-fixed-archive").length) { 68 $offsetHeight = jQuery('.sd-container .container .entry-content').offset().top; 69 $maxHeight = window.innerHeight - $offsetHeight; 70 //jQuery('body.geodir-fixed-archive .sd-container .container .entry-content').css('max-height', $maxHeight); 71 jQuery("#gd_map_canvas_archive").css("min-height", $maxHeight); 72 jQuery('.main_map_wrapper, #gd_map_canvas_archive, #gd_map_canvas_archive_loading_div').css('height', $maxHeight); 73 } 74} 75 76function sd_scroll_to_reviews() { 77 jQuery('.geodir-tab-head [data-tab="#reviews"]').closest('dd').trigger('click'); 78 79 setTimeout(function() { 80 jQuery('html,body').animate({ 81 scrollTop: jQuery('#comments #respond').offset().top 82 }, 'slow'); 83 jQuery('#comments #respond #comment').focus(); 84 }, 100); 85} 86 87var $sd_sidebar_position = ''; 88(function() { 89 // set the sidebar position var 90 if (jQuery('body.sd-right-sidebar').length) { 91 $sd_sidebar_position = 'right'; 92 } else { 93 $sd_sidebar_position = 'left'; 94 } 95 96 if (jQuery(".featured-img").length) { 97 var windowHeight = screen.height; 98 var parallax = document.querySelectorAll(".featured-img"), 99 speed = 0.6; 100 var bPos = jQuery(".featured-img").css("background-position"); 101 var arrBpos = bPos.split(' '); 102 var originalBpos = arrBpos[1]; 103 var fetHeight = parseInt(jQuery(".featured-area").css("height")); 104 var fetAreHeight = jQuery(".featured-area").offset().top + fetHeight; 105 106 window.onscroll = function() { 107 var f = 0; 108 [].slice.call(parallax).forEach(function(el, i) { 109 if (f > 1) { 110 return; 111 } 112 var windowYOffset = window.pageYOffset; 113 originalBpos = parseInt(originalBpos); 114 var perc = windowYOffset / fetAreHeight + (originalBpos / 100); 115 //"50% calc("+originalBpos+" - " + (windowYOffset * speed) + "px)" 116 parallaxPercent = 100 * perc; 117 if (parallaxPercent > 100) { 118 parallaxPercent = 100; 119 } 120 jQuery(el).css("background-position", "50% " + parallaxPercent + "%"); 121 f++; 122 }); 123 }; 124 } 125 126 jQuery("#sd-home-scroll").click(function(event) { 127 event.preventDefault(); 128 jQuery('html, body').animate({ 129 scrollTop: jQuery(".featured-area").outerHeight() 130 }, 1000); 131 }); 132 133 sd_insert_archive_resizer(); 134})(); 135 136// insert archive page size adjuster 137function sd_insert_archive_resizer() { 138 $screen_width = screen.width; 139 if (jQuery('body.geodir-fixed-archive .sd-container .container').length && $screen_width > 992) { 140 jQuery('body.geodir-fixed-archive .sd-container .container').append('<button class="sd-archive-resizer"><i class="fas fa-arrows-alt-h"></i></button>'); 141 sd_position_archive_resizer(); 142 } 143} 144 145function sd_position_archive_resizer() { 146 var $container = '.entry-content'; 147 var $offset = 21; 148 if ($sd_sidebar_position == 'left') { 149 $container = '.sd-sidebar'; 150 $offset = 13; 151 } 152 $width = jQuery('body.geodir-fixed-archive .sd-container .container ' + $container).outerWidth() - $offset; 153 jQuery('.sd-archive-resizer').css('left', $width); 154} 155 156var $sd_set_archive_width = false;
157// function to adjust width of archive elements 158jQuery('body.geodir-fixed-archive .sd-archive-resizer').mousedown(function(e) { 159 e.preventDefault(); 160 var $container = '.entry-content'; 161 if ($sd_sidebar_position == 'left') { 162 $container = '.sd-sidebar'; 163 } 164 jQuery(document).mousemove(function(e) { 165 jQuery('.container ' + $container).css("width", e.pageX + 2); 166 sd_position_archive_resizer(); 167 $sd_set_archive_width = true; 168 }); 169}); 170 171jQuery(document).mouseup(function(e) { 172 jQuery(document).unbind('mousemove'); 173 174 // set the value if we have localstorage 175 if ($sd_set_archive_width && geodir_is_localstorage()) { 176 var $container = '.entry-content'; 177 var $offset = 21; 178 if ($sd_sidebar_position == 'left') { 179 $container = '.sd-sidebar'; 180 $offset = 13; 181 } 182 $width = jQuery('body.geodir-fixed-archive .sd-container .container ' + $container).outerWidth() - $offset; 183 localStorage.setItem('sd_archive_width', $width); 184 window.dispatchEvent(new Event('resize')); // so map tiles fill in 185 } 186});
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.