PageSourceSearch

https://rnkishon.co.il/wp-content/themes/twentytwentyfour-child/assets/js/custom.js?ver=1791194462

js rnkishon.co.il collected 2026-10-05 22:01:27 UTC 12,967 bytes, 423 lines download raw bytes

1jQuery(document).ready(function () {
2
3
4  //var date = new Date();
5 // var today = new Date(date.getFullYear(), date.getMonth(), date.getDate());
6  // var date = new Date();
7  // date.setDate(date.getDate());
8  // $( "#datepicker" ).datepicker({
9  //     startDate: date,
10  //     format: 'dd/mm/yyyy'
11  // });
12  // $( "#enddatepicker" ).datepicker (
13  //   {
14  //     startDate: date,
15  //     format: 'dd/mm/yyyy'
16  //      // minDate:today
17  //        // maxDate: '+14d'
18  //   }
19  // );
20
21  jQuery(function ($) {
22    jQuery(".navbar-nav").addClass("responsive-menu");
23    jQuery(window).resize(function () {
24        if (window.innerWidth > 767) {
25          jQuery(".navbar-nav, nav .sub-menu").removeAttr("style");
26          jQuery(".responsive-menu > .nav-item").removeClass("menu-open");
27        }
28    });
29    jQuery(".menu-item-has-children").click(function (event) {
30        if (event.target !== this)
31            return;
32          jQuery(this).children().siblings(".sub-menu").slideToggle(function () {
33            jQuery(this).parent().toggleClass("menu-open");
34        });
35    });
36  });
37
38// Infinite Swiper Banner
39  var slidenames = [];
40  jQuery(".banner_swiper .swiper-slide").each(function(i) {
41    slidenames.push(jQuery(this).data("name"));
42  });
43  var bannerswiper = new Swiper(".banner_swiper", {
44    slidesPerView: 1,
45    spaceBetween: 0,
46    loop: true,
47    freeMode: false,
48    allowTouchMove: false,
49    autoHeight: false,
50    speed: 1000,
51    autoplay: {
52      delay: 6000,
53      disableOnInteraction: false,
54    },
55    pagination: {
56        el: ".banner_pagination",
57        clickable: true,
58        renderBullet: function (index, className) {
59          return '<span class="' + className + ' ' + 'Slide' + (index + 1) + '">' + (slidenames[index]) + '</span>';
60        },
61    },
62    navigation: {
63        nextEl: ".banner_next",
64        prevEl: ".banner_prev",
65    },
66    // breakpoints: {
67    //     768: {
68    //         slidesPerView: 2,
69    //         spaceBetween: 30,
70    //     },
71    //     992: {
72    //         slidesPerView: 4,
73    //         spaceBetween: 30,
74    //     },
75    //     1500: {
76    //         slidesPerView: 4,
77    //         spaceBetween: 74,
78    //     },
79    // },
80  });
81
82  jQuery(window).scroll(function () {
83    if (jQuery(window).scrollTop() >= '100') {
84      jQuery('.navbar').addClass('fixed_navbar');
85    } else {
86      jQuery('.navbar').removeClass('fixed_navbar');
87    }
88  });
89
90  //
91
92  //
93  jQuery('.event_announcement_content').scrollLeft(jQuery(this).height())
94  jQuery('.projects_content').scrollLeft(jQuery(this).height())
95
96
97  jQuery(window).resize(function() {
98    jQuery('.event_announcement_content').scrollLeft(jQuery(this).height())
99    jQuery('.projects_content').scrollLeft(jQuery(this).height())
100  }).resize();
101
102});
103
104var workswiper = new Swiper(".work_progress_slider", {
105    loop: true,
106    spaceBetween: 20,
107    slidesPerView: 1,
108    freeMode: false,
109    navigation: {
110      nextEl: ".work_progress_btn_next",
111      prevEl: ".work_progress_btn_prev",
112    },
113    // breakpoints: {
114    //     768: {
115    //       slidesPerView: 2,
116    //       slidesPerGroup: 2,
117    //     },
118    //   },
119  });
120var eventswiper = new Swiper(".event_latest_holder_slider", {
121    loop: true,
122    spaceBetween: 10,
123    slidesPerView: 1,
124    autoplay: {
125        delay: 5000,
126        disableOnInteraction: false,
127      },
128});
129var swiper = new Swiper(".thumb_slider", {
130    // loop: true,
131    spaceBetween: 14,
132    slidesPerView: 4,
133    freeMode: true,
134    watchSlidesProgress: true,
135    // watchSlidesVisibility: true,
136    breakpoints: {
137        640: {
138          slidesPerView: 2,
139          spaceBetween: 20,
140        },
141        768: {
142          slidesPerView: 4,
143          spaceBetween: 14,
144        },
145        992: {
146          slidesPerView: 5,
147        },
148        1700: {
149          slidesPerView: 7,
150        },
151      },
152  });
153  var swiper2 = new Swiper(".gallery_slider", {
154    // loop: true,
155    spaceBetween: 10,
156	   navigation: {
157      nextEl: ".swiper-content-next",
158      prevEl: ".swiper-content-prev",
159    },
160    pagination: {
161      el: ".swiper-content-pagination",
162    },
163    thumbs: {
164      swiper: swiper,
165    },
166  });
167// Single Posts slider
168  var swiper = new Swiper(".post_thumb_slider", {
169    loop: true,
170    spaceBetween: 11,
171    slidesPerView: 4,
172    freeMode: true,
173    watchSlidesProgress: true,
174    breakpoints: {
175        768: {
176          slidesPerView: 5
177        },
178      },
179  });
180  var swiper2 = new Swiper(".post_gallery_slider", {
181    loop: true,
182    spaceBetween: 11,
183	   navigation: {
184      nextEl: ".swiper_gallery_next",
185      prevEl: ".swiper_gallery_prev",
186    },
187    pagination: {
188      el: ".swiper_gallery_pagination",
189    },
190    thumbs: {
191      swiper: swiper,
192    },
193  });
194
195  document.querySelectorAll(".drop-zone__input").forEach((inputElement) => {
196    const dropZoneElement = inputElement.closest(".drop-zone");
197
198    dropZoneElement.addEventListener("click", (e) => {
199      inputElement.click();
200    });
201
202    inputElement.addEventListener("change", (e) => {
203      if (inputElement.files.length) {
204        updateThumbnail(dropZoneElement, inputElement.files[0]);
205      }
206    });
207
208    dropZoneElement.addEventListener("dragover", (e) => {
209      e.preventDefault();
210      dropZoneElement.classList.add("drop-zone--over");
211    });
212
213    ["dragleave", "dragend"].forEach((type) => {
214      dropZoneElement.addEventListener(type, (e) => {
215        dropZoneElement.classList.remove("drop-zone--over");
216      });
217    });
218
219    dropZoneElement.addEventListener("drop", (e) => {
220      e.preventDefault();
221
222      if (e.dataTransfer.files.length) {
223        inputElement.files = e.dataTransfer.files;
224        updateThumbnail(dropZoneElement, e.dataTransfer.files[0]);
225      }
226
227      dropZoneElement.classList.remove("drop-zone--over");
228    });
229  });
230
231  function updateThumbnail(dropZoneElement, file) {
232    let thumbnailElement = dropZoneElement.querySelector(".drop-zone__thumb");
233
234    // First time - remove the prompt
235    if (dropZoneElement.querySelector(".drop-zone__prompt")) {
236      dropZoneElement.querySelector(".drop-zone__prompt").classList.add('d-none');
237    }
238    // First time - remove the prompt
239    if (dropZoneElement.querySelector(".drop_zone_add")) {
240      dropZoneElement.querySelector(".drop_zone_add").classList.add('d-none');
241    }
242
243    // First time - there is no thumbnail element, so lets create it
244    if (!thumbnailElement) {
245      thumbnailElement = document.createElement("div");
246      thumbnailElement.classList.add("drop-zone__thumb");
247      dropZoneElement.appendChild(thumbnailElement);
248    }
249
250    thumbnailElement.dataset.label = file.name;
251
252    // Show thumbnail for image files
253    if (file.type.startsWith("image/")) {
254      const reader = new FileReader();
255
256      reader.readAsDataURL(file);
257      reader.onload = () => {
258        thumbnailElement.style.backgroundImage = `url('${reader.result}')`;
259      };
260    } else {
261      thumbnailElement.style.backgroundImage = null;
262    }
263  }
264
265
266  // file input js
267  var inputs = document.querySelectorAll('.file-input')
268
269  for (var i = 0, len = inputs.length; i < len; i++) {
270    customInput(inputs[i])
271  }
272
273  function customInput (el) {
274    const fileInput = el.querySelector('[type="file"]')
275    const label = el.querySelector('[data-js-label]')
276
277    fileInput.onchange =
278    fileInput.onmouseout = function () {
279      if (!fileInput.value) return
280
281      var value = fileInput.value.replace(/^.*[\\\/]/, '')
282      // el.className += ' -בחר קובץ'
283      label.innerText = value
284    }
285  }
286
287
288  // image input js
289  var hiddenBtn = document.getElementById('hiddenBtn');
290  var chooseBtn = document.getElementById('chooseBtn');
291
292  if(jQuery('#hiddenBtn').length > 0)
293  {
294    hiddenBtn.addEventListener('change', function() {
295        if (hiddenBtn.files.length > 0) {
296            chooseBtn.innerText = hiddenBtn.files[0].name;
297        } else {
298            chooseBtn.innerText = 'בחר קובץ';
299        }
300    });
301  }
302
303    //  accordion card
304jQuery(document).on('click',".accordion .accordion-item .accordion-button, .accordion .accordion-item .btn-outline-dark, .accordion .accordion-item .btn-close",function (e) {
305	var $this = jQuery(this);
306	(jQuery(this).closest('.accordion-item').hasClass('active')) ? $cls = 1: $cls = 0;
307	jQuery('.accordion-item').removeClass('active');
308	if ($cls == 1) {
309		jQuery(this).closest('.accordion-item').removeClass('active');
310	} else {
311		jQuery(this).closest('.accordion-item').addClass('active');
312	}
313});
314
315///////
316// jQuery(document).ready(function () {
317//   const $mapWrapper = jQuery('.kishon_map_wrapper');
318//   const $banner = jQuery('.single_post_banner, .banner_wrapper');
319//   const $content = jQuery('.single_post_page_content');
320
321//   const originalTop = parseInt($mapWrapper.css('top'), 10) || 0; // Retrieve the original 'top' from CSS
322//   const originalStyles = $mapWrapper.attr('style') || ''; // Save original styles
323
324//   jQuery(window).on('scroll', function () {
325//     const bannerOffsetTop = $banner.offset().top;
326//     const contentOffsetTop = $content.offset().top;
327//     const contentHeight = $content.outerHeight();
328//     const contentBottom = contentOffsetTop + contentHeight;
329//     const scrollTop = jQuery(window).scrollTop();
330//     const mapHeight = $mapWrapper.outerHeight();
331
332//     // Sticky while scrolling within bounds
333//     if (scrollTop > bannerOffsetTop && scrollTop + mapHeight + originalTop < contentBottom - 50) {
334//       $mapWrapper.css({
335//         position: 'fixed',
336//         top: `${originalTop}px`,
337//         bottom: 'auto'
338//       });
339//     }
340//     // Stop sticky with a calculated top position to avoid shifting
341//     else if (scrollTop + mapHeight + originalTop >= contentBottom - 50) {
342//       const topPosition = contentBottom - bannerOffsetTop - mapHeight - 50;
343//       $mapWrapper.css({
344//         position: 'absolute',
345//         top: `${topPosition}px`,
346//         bottom: 'auto'
347//       });
348//     }
349//     // Reset to original styles when above the banner
350//     else {
351//       $mapWrapper.attr('style', originalStyles);
352//     }
353//   });
354// });
355jQuery(document).ready(function () {
356  const $mapWrapper = jQuery('.kishon_map_wrapper');
357  const $parentBanner = $mapWrapper.closest('.single_post_banner, .banner_wrapper'); // Identify the closest parent dynamically
358  const $content = jQuery('.single_post_page_content');
359  const $gallerySection = jQuery('.single_post_page_content_inner'); // Find the correct gallery section
360
361  if (!$parentBanner.length) {
362    console.error("Parent banner not found for kishon_map_wrapper");
363    return;
364  }
365
366  const originalTop = parseInt($mapWrapper.css('top'), 10) || 0; // Retrieve original 'top' value from CSS
367  const originalStyles = $mapWrapper.attr('style') || ''; // Save original styles
368
369  jQuery(window).on('scroll', function () {
370    const bannerOffsetTop = $parentBanner.offset().top;
371    const contentOffsetTop = $content.offset().top;
372    const contentHeight = $content.outerHeight();
373    const galleryOffsetTop = $gallerySection.offset()?.top || 0;
374    const galleryHeight = $gallerySection.outerHeight() || 0;
375    const scrollTop = jQuery(window).scrollTop();
376    const mapHeight = $mapWrapper.outerHeight();
377
378    if ($gallerySection.length) {
379      // Behavior when single_post_gallery exists
380      const galleryBottom = galleryOffsetTop + galleryHeight;
381
382      // If the map is scrolled past the banner and within the bounds of the gallery section
383      if (scrollTop > bannerOffsetTop && scrollTop + mapHeight + originalTop < galleryBottom - 50) {
384        $mapWrapper.css({
385          position: 'fixed',
386          top: `${originalTop}px`,
387          bottom: 'auto'
388        });
389      } else if (scrollTop + mapHeight + originalTop >= galleryBottom - 50) {
390        // Stop sticky behavior just before the bottom of the single_post_gallery
391        const topPosition = galleryBottom - bannerOffsetTop - mapHeight - 50;
392        $mapWrapper.css({
393          position: 'absolute',
394          top: `${topPosition}px`,
395          bottom: 'auto'
396        });
397      } else {
398        // Reset styles when not in sticky mode
399        $mapWrapper.attr('style', originalStyles);
400      }
401    } else {
402      // If single_post_gallery does not exist, apply the same logic as before (for single_post_page_content)
403      const contentBottom = contentOffsetTop + contentHeight;
404
405      if (scrollTop > bannerOffsetTop && scrollTop + mapHeight + originalTop < contentBottom - 50) {
406        $mapWrapper.css({
407          position: 'fixed',
408          top: `${originalTop}px`,
409          bottom: 'auto'
410        });
411      } else if (scrollTop + mapHeight + originalTop >= contentBottom - 50) {
412        const topPosition = contentBottom - bannerOffsetTop - mapHeight - 50;
413        $mapWrapper.css({
414          position: 'absolute',
415          top: `${topPosition}px`,
416          bottom: 'auto'
417        });
418      } else {
419        $mapWrapper.attr('style', originalStyles);
420      }
421    }
422  });
423});

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.