1jQuery( document ).ready( 2 function ($) { 3 4 function cu_pr_ta_ma_adjust_layout() { 5 var width = $( window ).width(); 6 var gallery_modal = $( "section.cu_pr_ta_ma_gallery_modal" ); 7 gallery_modal.each( 8 function () { 9 if (width < 240) { 10 updateTopPosition( $( this ), 40, -30 ); 11 } else if (width >= 240 && width < 420) { 12 updateTopPosition( $( this ), 60, -20 ); 13 } else { 14 updateTopPosition( $( this ), 60, -20 ); 15 } 16 } 17 ); 18 } 19 cu_pr_ta_ma_adjust_layout(); 20 21 $( window ).resize( cu_pr_ta_ma_adjust_layout() ); 22 23 function updateTopPosition(Modal, initialTop, scrollOffset) { 24 $( window ).on( 25 "scroll", 26 function () { 27 if (Modal) { 28 var newTop = "calc(" + initialTop + "% + " + (scrollOffset + 70) + "px)"; 29 $( "section.cu_pr_ta_ma_gallery_modal" ).css( 'top', newTop ); 30 } 31 } 32 ); 33 } 34 35 var gallery_model = $( ".cu_pr_ta_ma_gallery_modal" ); 36 if (gallery_model) { 37 gallery_model.hide(); 38 gallery_model.siblings( "div.cu_pr_ta_ma_gallery_overlay" ).hide(); 39 } 40 41 $( document ).on( 42 "click", 43 ".cu_pr_ta_ma_gallery_btn_close", 44 function () { 45 var close_btn = $( this ); 46 modal = close_btn.closest( ".cu_pr_ta_ma_gallery_modal" ); 47 modal.find( 'video' ).trigger( 'pause' ); 48 modal.hide(); 49 modal.siblings( ".cu_pr_ta_ma_gallery_overlay" ).hide(); 50 51 $( ".cu_pr_ta_ma_slideshow-container" ).each( 52 function () { 53 $( this ).find( 'span.cu_pr_ta_ma_dot_0' ).click(); 54 $( this ).find( 'span.cu_pr_ta_ma_dot_0' ).addClass( 'cu_pr_ta_ma_active-dot' ); 55 } 56 ); 57 58 } 59 ); 60 61 // close modal when the Esc key is pressed 62 63 $( document ).on( 64 'keydown', 65 function (e) { 66 if (e.key === "Escape" && ! $( ".cu_pr_ta_ma_image_gallery_modal" ).hasClass( "cu_pr_ta_ma_gallery_hidden" )) { 67 $( ".cu_pr_ta_ma_gallery_btn_close" ).click(); 68 } 69 if (e.key === "Escape" && ! $( ".cu_pr_ta_ma_video_gallery_modal" ).hasClass( "cu_pr_ta_ma_gallery_hidden" )) { 70 $( ".cu_pr_ta_ma_gallery_btn_close" ).click(); 71 } 72 73 } 74 ); 75 76 // open Modal function 77 $( document ).on( 78 "click", 79 ".cu_pr_ta_ma_view_gallery_btn", 80 function () { 81 var this_btn = $( this ); 82 83 if (this_btn.attr( 'value' ) === 'img' || this_btn.attr( 'value' ) === 'video') { 84 var element = $( this ).find( this_btn.attr( 'value' ) ); 85 var modal = this_btn.closest( 'div.cu_pr_ta_ma_gallery_front' ).siblings( "section.cu_pr_ta_ma_gallery_modal" ); 86 87 if (this_btn.attr( 'value' ) === 'video') { 88 element = $( '<video >' ).attr( 'src',this_btn.find( 'video' ).attr( 'src' ) ); 89 element.attr( 'controls',true ); 90 } 91 92 modal.css( {'top': 'calc(60%' + '50px)'} ); 93 modal.find( '.cu_pr_ta_ma_gallery_modal_body' ).html( element.prop( 'outerHTML' ) ); 94 modal.show(); 95 modal.siblings( "div.cu_pr_ta_ma_gallery_overlay" ).show(); 96 } 97 } 98 ); 99 100 $( ".cu_pr_ta_ma_slideshow-container" ).each( 101 function () { 102 var currentSlide = 0; 103 var slideshowContainer = $( this ); 104 var autoplayEnabled = slideshowContainer.data( "autoplay_enable" ) === "yes"; // Check if autoplay is enabled 105 var filesNumber = parseInt( slideshowContainer.data( "files_number" ) ); // Number of files to show 106 107 function showSlide(slideNumber) { 108 slideshowContainer.find( ".cu_pr_ta_ma_mySlides" ).hide(); 109 // slideshowContainer.find(".cu_pr_ta_ma_mySlides").css({'flex':'0 0 '+ 90/filesNumber+'%' }); 110 111 for (var i = 1; i <= filesNumber; i++) { 112 slide = slideNumber + i; 113 slideshowContainer.find( ".cu_pr_ta_ma_mySlides:nth-child(" + slide + ")" ).show(); 114 115 } 116 117 slideshowContainer.find( ".cu_pr_ta_ma_dot" ).removeClass( "cu_pr_ta_ma_active-dot" ); 118 slideshowContainer.find( ".cu_pr_ta_ma_dot[data-current=" + slideNumber + "]" ).addClass( "cu_pr_ta_ma_active-dot" ); 119 } 120 121 function autoplay() { 122 if (autoplayEnabled) { 123 if (currentSlide + filesNumber >= slideshowContainer.find( ".cu_pr_ta_ma_mySlides" ).length) { 124 currentSlide = 0; 125 } else { 126 currentSlide++; 127 } 128 showSlide( currentSlide ); 129 } 130 } 131 132 showSlide( currentSlide ); 133 134 slideshowContainer.find( ".cu_pr_ta_ma_move_slide" ).on( 135 "click", 136 function () { 137 var move = parseInt( $( this ).data( "move" ) ); 138 var last_child = slideshowContainer.find( ".cu_pr_ta_ma_mySlides:last-child" ); 139 var first_child = slideshowContainer.find( ".cu_pr_ta_ma_mySlides:first-child" ); 140 141 if (currentSlide + filesNumber >= slideshowContainer.find( ".cu_pr_ta_ma_mySlides" ).length && move === 1) { 142 currentSlide = 0; 143 } else if (first_child.is( ':visible' ) && move === -1) { 144 currentSlide = slideshowContainer.find( ".cu_pr_ta_ma_mySlides" ).length - filesNumber; 145 } else { 146 currentSlide += move; 147 } 148 showSlide( currentSlide ); 149 } 150 ); 151 152 slideshowContainer.find( ".cu_pr_ta_ma_dot" ).on( 153 "click", 154 function () { 155 currentSlide = parseInt( $( this ).data( "current" ) ); 156 showSlide( currentSlide ); 157 } 158 ); 159 160 if (autoplayEnabled) { 161 setInterval( autoplay, 3000 ); 162 } 163 } 164 ); 165 166 function get_google_map_location(current_element) { 167 168 var mapOptions = { "center": { lat: 25.2, lng: 55.2 }, "clickableIcons": true, "disableDoubleClickZoom": false, "draggable": true, "fullscreenControl": true, "keyboardShortcuts": true, "mapTypeControl": true, "mapTypeControlOptions": { "text": "Default (depends on viewport size etc.)", "style": 0 }, "mapTypeId": "roadmap", "rotateControl": true, "scaleControl": true, "scrollwheel": true, "streetViewControl": true, "styles": [ { "featureType": "all", "elementType": "labels.text.fill", "stylers": [ { "saturation": 36 }, { "color": "#ffffff" }, { "lightness": 40 } ] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [ { "visibility": "off" }, { "color": "#000000" }, { "lightness": 16 } ] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [ { "color": "#c0c0c0" }, { "lightness": 20 }, { "visibility": "on" } ] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [ { "color": "#000000" }, { "lightness": 17 }, { "weight": 1.2 }, { "visibility": "off" } ] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [ { "color": "#000000" }, { "lightness": 20 } ] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [ { "color": "#3f3f3f" } ] }, { "featureType": "landscape", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "landscape.man_made", "elementType": "geometry.fill", "stylers": [ { "color": "#333333" }, { "visibility": "on" }, { "saturation": "0" }, { "lightness": "0" }, { "gamma": "1.00" } ] }, { "featureType": "landscape.man_made", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "landscape.natural", "elementType": "geometry.fill", "stylers": [ { "color": "#2b2b2b" }, { "visibility": "on" }, { "gamma": "1" }, { "lightness": "0" }, { "saturation": "0" } ] }, { "featureType": "landscape.natural", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "landscape.natural.landcover", "elementType": "geometry.fill", "stylers": [ { "visibility": "off" }, { "color": "#ff0000" } ] }, { "featureType": "landscape.natural.landcover", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "landscape.natural.terrain", "elementType": "geometry.fill", "stylers": [ { "visibility": "on" }, { "color": "#222222" } ] }, { "featureType": "landscape.natural.terrain", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi", "elementType": "geometry", "stylers": [ { "color": "#000000" }, { "lightness": 21 } ] }, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [ { "color": "#4a4a4a" }, { "visibility": "on" } ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ { "color": "#ac9455" }, { "lightness": "0" }, { "gamma": "1.00" } ] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [ { "color": "#000000" }, { "lightness": 29 }, { "weight": 0.2 } ] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [ { "color": "#ac9455" }, { "lightness": "0" } ] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [ { "color": "#ac9455" } ] }, { "featureType": "road.arterial", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [ { "color": "#000000" }, { "lightness": 16 } ] }, { "featureType": "road.local", "elementType": "geometry.fill", "stylers": [ { "color": "#222222" } ] }, { "featureType": "road.local", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit", "elementType": "geometry", "stylers": [ { "color": "#000000" }, { "lightness": 19 } ] }, { "featureType": "water", "elementType": "geometry", "stylers": [ { "color": "#000000" }, { "lightness": 17 } ] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [ { "color": "#1a1a1a" } ] } ], "zoom": 15, "zoomControl": true}; 169 170 var mapElement = current_element.find( 'div.ez-map' );
171 var hiddenInput = current_element.find( 'input.af_all_address' ); 172 console.log( hiddenInput ); 173 if (hiddenInput) { 174 var lat = parseFloat( hiddenInput.attr( 'data-lat' ) ); 175 var lng = parseFloat( hiddenInput.attr( 'data-long' ) ); 176 177 if ( ! isNaN( lat ) && ! isNaN( lng )) { 178 mapOptions.center = { lat: lat, lng: lng }; 179 } 180 181 var map = new google.maps.Map( mapElement[0], mapOptions ); 182 183 var heatmap = new google.maps.visualization.HeatmapLayer( {data: []} ); 184 heatmap.setOptions( {"dissipating":false,"opacity":0.6,"radius":2} ); 185 heatmap.setMap( map ); 186 187 var geocoder = new google.maps.Geocoder(); 188 geocoder.geocode( 189 {'address':hiddenInput.val() }, 190 function (results, status) { 191 if (status === 'OK') { 192 var marker = new google.maps.Marker( 193 { 194 map: map, 195 position: results[0].geometry.location 196 } 197 ); 198 } 199 } 200 ); 201 } 202 203 window.addEventListener( 204 "resize", 205 function() { 206 var center = map.getCenter(); 207 google.maps.event.trigger( map, "resize" ); 208 } 209 ); 210 211 } 212 $( '.cu_pr_ta_ma_store_location_front' ).each( 213 function(){ 214 window.addEventListener( 'load', get_google_map_location( $( this ) ) ); 215 } 216 ); 217 218 } 219);
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.