PageSourceSearch

https://strandproperties.com/wp-content/themes/px8/js/common-2024.js?v=20251023

js strandproperties.com collected 2026-10-10 01:17:40 UTC 10,381 bytes, 341 lines download raw bytes

1jQuery(function ($) {
2    $(document).on("click", "#customBrochure a", function () {
3      window.location =
4        $(this).attr("url") + "&ref=" + $("#customBrochureInput").val();
5    });
6  
7    $(document).on("click", "#wp-admin-bar-createBrochureModal", function () {
8      $("#customBrochure").modal("show");
9    });
10  
11    $(document).on("click", "#windowBrochure a", function () {
12      window.location =
13        $(this).attr("url") + "&ref=" + $("#windowBrochureInput").val();
14    });
15  
16    $(document).on(
17      "click",
18      "#wp-admin-bar-createWindowBrochureModal",
19      function () {
20        $("#windowBrochure").modal("show");
21      }
22    );
23  
24    //Smooth scroll for frontpage hero links
25    /*$('.frontpage-hero').on('click', 'a[href^="#"]', function (event) {
26    event.preventDefault();
27    $('html, body').animate({
28        scrollTop: $($.attr(this, 'href')).offset().top
29    }, 1000);
30  })*/
31  
32    $(".wpml-ls-legacy-dropdown .wpml-ls-native").each(function (key, value) {
33      $(value).attr("full_name", $(value).html());
34    });
35  
36    function checkAndChangeWPMLSwitcher() {
37      var attr_name = "full_name";
38      if ($(window).width() < 768) {
39        attr_name = "lang";
40      }
41      $(".wpml-ls-legacy-dropdown .wpml-ls-native").each(function (key, value) {
42        //        if($(this).attr('lang')){
43        //            let lang = $(this).attr('lang');
44        //            let fullname = $(this).attr('full_name');
45        //            console.log($('[full_name="'+fullname+'"]'));
46        //            $('[full_name="'+fullname+'"]').attr('lang', lang)
47        //        }
48        var fullname = $(this).attr("full_name");
49        //        $(value).attr('lang', fullname.substring(0, 2));
50        //        if(fullname == 'Dutch'){
51        //            $(this).attr('lang', 'NL');
52        //        }
53        $(value).html($(value).attr(attr_name)).css("opacity", "1");
54      });
55    }
56  
57    var query = {
58      filter: {
59        feature: [97, 35],
60      },
61      //    id : 1,
62      //    sort : {constructYear : "DESC"},
63      //    onPage : 1,
64      //    currentPage : 1
65    };
66    //console.log($.param(query));
67    //$.ajax({
68    //    url : '/wp-json/inmoba/properties',
69    //    type : 'GET',
70    //    data : $.param(query),
71    //    success : function(data){
72    //        //console.log(data);
73    //    }
74    //});
75  
76    //var query = {
77    //    options:['feature','pool', 'garage', 'garden']
78    //
79    //}
80    //    $.ajax({
81    //    url : '/wp-json/inmoba/properties/option',
82    //    type : 'GET',
83    //    data : $.param(query),
84    //    success : function(data){
85    //        console.log(data);
86    //    }
87    //});
88  
89    var parallaxes = [];
90    var mobileNav = $(".mobile-nav"); // CSS Class of Nav Menu
91    var navToggle = $(".nav-toggle"); // CSS Class of Toggle Button
92    var content = $(".site-container"); // Site Container
93  
94    var isOpen = 0; // Is the menu open or closed?
95    var menuWidth = 440;
96    var menuWidthInverse = "-" + menuWidth;
97    var offset = 300;
98    var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
99    var userAgent = window.navigator.userAgent;
100  
101    $(".text-block .read-more").click(function () {
102      let hidden_element = $(this)
103        .parents(".text-block__inner")
104        .find(".hidden-text");
105      hidden_element.removeClass("hidden");
106      gsap.fromTo(hidden_element, { opacity: 0 }, { opacity: 1, duration: 0.5 });
107      $(this).remove();
108    });
109  
110    $("head").append('<style id="button-before"></style>');
111  
112    if ($(window).width() >= 767) {
113      $(".parallaxie").parallaxie();
114    } else {
115      $(".parallaxie").css("background-size", "cover");
116    }
117    //$('.parallaxie').each(function(){
118    //     parallaxes.push($(this).attr('data-parallaxie'));
119    //});
120  
121    //$('.frontpage-listings-list').slick({slidesToShow: 1});
122    function ChangeLangs() {
123      if ($(window).width() <= 767) {
124        $(".language-switcher [lang_code]").each(function () {
125          $(this).html($(this).attr("lang_code"));
126          $(this).html();
127        });
128      } else {
129        $(".language-switcher [lang_name]").each(function () {
130          $(this).html($(this).attr("lang_name"));
131        });
132      }
133    }
134    function ChangeParallax() {
135      if ($(window).width() >= 767) {
136      if (!userAgent.match(/iPad/i) && !userAgent.match(/iPhone/i)) {
137        $(".parallaxie").each(function (key, value) {
138          $(this).attr("data-parallaxie", parallaxes[key]);
139        });
140        if ($(window).width() <= 767) {
141          $(".parallaxie").each(function (key, value) {
142            $(this).attr("data-parallaxie", parallaxes[key]);
143          });
144          $(".parallaxie").attr("data-parallaxie", null);
145        }
146        $(".parallaxie").parallaxie();
147      } else {
148        $(".parallaxie").css("background-size", "cover");
149      }
150      }
151    }
152  
153    //function FrontpageSliders(){
154    //    $slider=$('.frontpage-listings-list');
155    //    console.log('lil');
156    //    if($(window).width() <= 767){
157    //        if(!$slider.hasClass('slick-slider')){
158    //            $slider.slick({
159    //                slidesToShow: 1,
160    //                dots: false,
161    //                arrows: false,
162    //                infinite: false
163    //            })
164    //        }
165    //    }else{
166    //        if($slider.hasClass('slick-slider')){
167    //            $slider.slick('unslick');
168    //        }
169    //    }
170    //}
171    function FrontpageSliders() {
172      $slider = $(".frontpage-listings-list");
173      if ($(window).width() <= 767) {
174        if (!$slider.hasClass("slick-slider")) {
175          $slider.slick({
176            slidesToShow: 1,
177            dots: false,
178            arrows: false,
179            infinite: false,
180          });
181        }
182      } else {
183        if ($slider.hasClass("slick-slider")) {
184          $slider.slick("unslick");
185        }
186      }
187    }
188    function ChangeMenu() {
189      if ($(window).width() <= 767) {
190        menuWidthInverse = "-100%";
191      } else {
192        menuWidthInverse = "-" + menuWidth;
193      }
194      // if (isOpen == 0) {
195      //   gsap.to(mobileNav, {
196      //     left: menuWidthInverse,
197      //     duration: 0.1,
198      //     ease: "expo.out",
199      //   });
200      // }
201    }
202  
203    $(window).on("resize", function () {
204      ChangeMenu();
205      ChangeParallax();
206      //    FrontpageSliders();
207      ChangeLangs();
208      checkAndChangeWPMLSwitcher();
209    });
210    ChangeMenu();
211    ChangeParallax();
212    ChangeLangs();
213    checkAndChangeWPMLSwitcher();
214    //FrontpageSliders();
215  
216    if ($(".hero-slider").length != 0) {
217      $(".hero-slider").slick({ slidesToShow: 1 });
218    }
219  
220    document.addEventListener(
221      "wpcf7mailsent",
222      function (event) {
223        $(".contact-form__field").removeClass("active");
224      },
225      false
226    );
227  
228    $(".contact-form__field .wpcf7-text")
229      .parent()
230      .find("label")
231      .append('<span class="required-field"> *</span>');
232  
233    $(".wpcf7-list-item input").after('<div class="checkbox"></div>');
234  
235    let form = document.querySelector("input[type=submit]");
236    if (form) {
237      form.addEventListener("keyup keypress", function (e) {
238        e.preventDefault();
239      });
240    }
241  
242    $(".contact-form__field input, .contact-form__field textarea").on(
243      "input",
244      function () {
245        let val = $(this).val();
246        if (val != "") {
247          $(this).parent().addClass("active");
248        } else {
249          $(this).parent().removeClass("active");
250        }
251      }
252    );
253    // Controls the slide in/out functionality of the menu
254  
255    /*
256    $(navToggle).click(function () {
257      $this = $(this);
258      if (isOpen == 0) {
259        gsap.to(mobileNav, {
260          left: 0,
261          duration: 0.1,
262          ease: "expo.out",
263          onComplete: function () {
264            $(navToggle).addClass("fa-times");
265            $(this).addClass("hidden");
266            $(".mobile-nav .menu-btn").removeClass("hidden");
267            //          $('.site-overlay').css('transition', 'all .3s ease-in');
268            $(".site-container .site-overlay").removeClass("hidden");
269            //          $('.site-container .site-overlay').animate({ opacity: 0.3 }, 100, function() {});
270            $("body").addClass("overflow-hidden");
271  
272            isOpen++;
273          },
274        });
275      } else {
276        gsap.to(mobileNav, {
277          left: menuWidthInverse,
278          duration: 0.1,
279          ease: "expo.out",
280          onComplete: function () {
281            $(this).addClass("hidden");
282            $(".left__header .menu-btn").removeClass("hidden");
283            //          $('.site-overlay').css('transition', 'all .3s ease-out');
284            $(".site-container .site-overlay").addClass("hidden");
285            //          $('.site-container .site-overlay').animate({ opacity: 0 }, 100, function() {});
286            $("body").removeClass("overflow-hidden");
287            isOpen--;
288          },
289        });
290      }
291    });
292    */
293  
294  
295  
296    $("#select_type").change(function () {});
297  
298    /*if ($("select").length != 0) {
299      $("select").selectmenu();
300    }
301    $("select").selectmenu();*/
302    
303    document.addEventListener(
304      "wpcf7mailsent",
305      function (event) {
306        var currentPath = window.location.pathname + window.location.search;
307        let lang_code = jQuery("#language_code").val();
308        location = "https://strandproperties.com/" + lang_code + "/thank-you/?link=" + currentPath;
309      },
310      false
311    );
312  
313    $('.customest-select-map input[type="checkbox"]').on("change", function () {
314      let allValues = [];
315      $(".customest-select-map input:checked").each(function (key, value) {
316        allValues[key] = $(value).parent().parent().parent().text().trim();
317      });
318      let string = allValues.join(", ");
319      if (string.length > 1) {
320        //$('.customest-select-map .title input').val(string); //Tämä poistettu käytöstä 25.1.2022 / Ari
321      } else {
322      }
323    });
324  });
325  
326  function _e(text) {
327    let lang_code = jQuery("#language_code").val();
328    //console.log('lang_code: ' + lang_code);
329    if (lang_code == "fi") {
330      if (text == "bed") {
331        return "mh";
332      } else if (text == "bath") {
333        return "kph";
334      } else if (text == "plot") {
335        return "tontti";
336      }
337    } else {
338      return text;
339    }
340  }
341  

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.