PageSourceSearch

https://sidiese.com/sites/sidiese.com/modules/custom/gonnaeat/js/gonnaeat.js?v=1.x

js sidiese.com collected 2026-10-04 16:35:04 UTC 15,956 bytes, 510 lines download raw bytes

1/* DISABLE EMPTY TAGS IN CKEDITOR */
2
3(function ($, Drupal) {
4  Drupal.behaviors.customCKEditorConfig = {
5    attach: function (context, settings) {
6      if (typeof CKEDITOR !== "undefined") {
7        CKEDITOR.dtd.$removeEmpty["i"] = false;
8        CKEDITOR.dtd.$removeEmpty["span"] = false;
9        CKEDITOR.dtd.$removeEmpty["a"] = false;
10        //console.log('CKE',CKEDITOR.config);
11        CKEDITOR.config.disableObjectResizing = false;
12        //console.log(CKEDITOR.dtd);
13      }
14    },
15  };
16})(jQuery, Drupal);
17
18(function ($, Drupal) {
19  var initialized;
20  function init() {
21    if (!initialized) {
22      initialized = true;
23      var windowWidth = $(window).width();
24
25      // IS WINDOWS
26      var isWin = "";
27      navigator.platform.indexOf("Win") > -1 ? (isWin = "isWin") : (isWin = "");
28      $("body").addClass(isWin);
29
30      // INDENT TAXONOMY CHECKBOXES
31      $(".form-checkboxes label.option").each(function () {
32        var str = $(this).text();
33        if (!str.startsWith("-")) {
34          $(this).css({ "font-weight": "bolder" });
35        } else {
36          $(this).css({ "padding-left": 10 });
37        }
38      });
39      // VIEWS EXPOSED TO LINKS
40      /*
41			$("#edit-k").each(function() {
42			    //$(this).hide();  //Uncomment this
43			    var $ul = $("<ul/>", {
44			      'class': 'selectlist'
45			    });
46			    $ul.data('select', $(this));
47			    $(this).find('option').each(function() {
48			      var $li = $("<li/>", {
49			        'class': 'selectlist-option',
50			        'data-value': $(this).val(),
51			        'text': $(this).text()
52			      });
53			      $ul.append($li);
54			    });
55			    $(this).after($ul);
56			    $ul.on('click', '.selectlist-option', function() {
57			      var $selectlist = $(this).closest('.selectlist');
58			      $selectlist.find('.selectlist-option').removeClass('active');
59			      $(this).addClass('active');
60			      $($selectlist.data('select')).val($(this).data('value'));
61			    })
62
63			  });
64			  */
65
66      // BOOTSTRAP CAROUSEL RESPONSIVE
67      $(".make-responsive .carousel .carousel-item").each(function () {
68        var minPerSlide = 3;
69        var next = $(this).next();
70        if (!next.length) {
71          next = $(this).siblings(":first");
72        }
73        next.children(":first-child").clone().appendTo($(this));
74
75        for (var i = 0; i < minPerSlide; i++) {
76          next = next.next();
77          if (!next.length) {
78            next = $(this).siblings(":first");
79          }
80
81          next.children(":first-child").clone().appendTo($(this));
82        }
83      });
84
85      // SLIDER MULTIPLE COLUMNS
86      $(".slickit-2-col").slick({
87        dots: true,
88        speed: 300,
89        arrows: true,
90        slidesToShow: 2,
91        slidesToScroll: 2,
92        infinite: true,
93        adaptiveHeight: true,
94        focusOnChange: true,
95        prevArrow:
96          '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
97        nextArrow:
98          '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
99        responsive: [
100          {
101            breakpoint: 768,
102            settings: {
103              slidesToShow: 1,
104              slidesToScroll: 1,
105            },
106          },
107        ],
108      });
109      $(".slickit-3-col").slick({
110        dots: true,
111        speed: 300,
112        arrows: true,
113        slidesToShow: 3,
114        slidesToScroll: 3,
115        infinite: true,
116        adaptiveHeight: true,
117        focusOnChange: true,
118        prevArrow:
119          '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
120        nextArrow:
121          '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
122        responsive: [
123          {
124            breakpoint: 1024,
125            settings: {
126              slidesToShow: 2,
127              slidesToScroll: 2,
128            },
129          },
130          {
131            breakpoint: 767,
132            settings: {
133              slidesToShow: 1,
134              slidesToScroll: 1,
135            },
136          },
137        ],
138      });
139
140      // SLIDER MULTIPLE COLUMNS
141      $(".slickit-4-col").slick({
142        dots: true,
143        speed: 300,
144        arrows: true,
145        slidesToShow: 4,
146        slidesToScroll: 4,
147        infinite: true,
148        adaptiveHeight: true,
149        focusOnChange: true,
150        prevArrow:
151          '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
152        nextArrow:
153          '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
154        responsive: [
155          {
156            breakpoint: 1024,
157            settings: {
158              slidesToShow: 3,
159              slidesToScroll: 3,
160            },
161          },
162          {
163            breakpoint: 767,
164            settings: {
165              slidesToShow: 2,
166              slidesToScroll: 2,
167            },
168          },
169          {
170            breakpoint: 480,
171            settings: {
172              slidesToShow: 1,
173              slidesToScroll: 1,
174            },
175          },
176        ],
177      });
178
179      // SLIDER MULTIPLE COLUMNS
180      $(".slickit-5-col").slick({
181        dots: true,
182        speed: 300,
183        arrows: true,
184        slidesToShow: 5,
185        slidesToScroll: 5,
186        infinite: true,
187        adaptiveHeight: true,
188        focusOnChange: true,
189        prevArrow:
190          '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
191        nextArrow:
192          '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
193        responsive: [
194          {
195            breakpoint: 1024,
196            settings: {
197              slidesToShow: 4,
198              slidesToScroll: 4,
199            },
200          },
201          {
202            breakpoint: 767,
203            settings: {
204              slidesToShow: 3,
205              slidesToScroll: 3,
206            },
207          },
208          {
209            breakpoint: 480,
210            settings: {
211              slidesToShow: 2,
212              slidesToScroll: 2,
213            },
214          },
215        ],
216      });
217
218      // SLIDER MULTIPLE COLUMNS
219      $(".slickit-6-col").slick({
220        dots: true,
221        speed: 300,
222        arrows: true,
223        slidesToShow: 6,
224        slidesToScroll: 6,
225        infinite: true,
226        adaptiveHeight: true,
227        //focusOnChange: true,
228        prevArrow:
229          '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
230        nextArrow:
231          '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
232        responsive: [
233          {
234            breakpoint: 1024,
235            settings: {
236              slidesToShow: 5,
237              slidesToScroll: 5,
238            },
239          },
240          {
241            breakpoint: 767,
242            settings: {
243              slidesToShow: 4,
244              slidesToScroll: 4,
245            },
246          },
247          {
248            breakpoint: 480,
249            settings: {
250              slidesToShow: 2,
251              slidesToScroll: 2,
252            },
253          },
254        ],
255      });
256
257      // SLIDER PARAGRAPH 2COLIMG
258      $(".slickit-twocolimg").slick({
259        dots: false,
260        speed: 300,
261        arrows: true,
262        slidesToShow: 1,
263        slidesToScroll: 1,
264        infinite: true,
265        adaptiveHeight: true,
266        focusOnChange: true,
267        fade: true,
268        cssEase: "linear",
269        prevArrow:
270          '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
271        nextArrow:
272          '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
273      });
274      //I just called $(ELEMENT).unslick(); before slickCarousel = $(ELEMENT).slick({}); to fix this issue.
275      // SLIDER
276      $(".slickit").on("init", function (event, slick) {
277        slick["$dots"].find("button").each(function (index, value) {
278          var slideNum = index + 1;
279          $(this).html(Drupal.t("Slide") + " " + slideNum);
280        });
281      });
282      if (!$(".slickit").hasClass("slick-initialized")) {
283        $(".slickit").slick({
284          dots: true,
285          speed: 300,
286          arrows: true,
287          slidesToShow: 1,
288          slidesToScroll: 1,
289          infinite: true,
290          adaptiveHeight: false,
291          variableWidth: true,
292          focusOnChange: true,
293          fade: true,
294          prevArrow:
295            '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button">Previous slide</button>',
296          nextArrow:
297            '<button class="slick-next slick-arrow" aria-label="Next slide" type="button">Next slide</button>',
298        });
299      }
300      $(".slickit-home").on("init", function (event, slick) {
301        if (slick["$dots"]) {
302          slick["$dots"].find("button").each(function (index, value) {
303            var slideNum = index + 1;
304            $(this).html(Drupal.t("Slide") + " " + slideNum);
305          });
306        }
307      });
308      if (!$(".slickit-home").hasClass("slick-initialized")) {
309        $(".slickit-home").slick({
310          dots: false,
311          speed: 500,
312          arrows: true,
313          slidesToShow: 1,
314          slidesToScroll: 1,
315          infinite: true,
316          adaptiveHeight: false,
317          variableWidth: false,
318          focusOnChange: true,
319          fade: true,
320          prevArrow:
321            '<button class="slick-prev slick-arrow" aria-label="Previous slide" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 50 50"><path d="M25,0H50V50H0V25A25,25,0,0,1,25,0Z" transform="translate(50 50) rotate(180)" fill="#c7c2ba"/><g transform="translate(32.604 28.456) rotate(180)"><path d="M14.733,3.2h0L11.691.17a.582.582,0,0,0-.821.825l2.042,2.033H.582a.582.582,0,1,0,0,1.164h12.33L10.869,6.224a.582.582,0,0,0,.821.825l3.042-3.027h0A.583.583,0,0,0,14.733,3.2Z" transform="translate(0)" fill="#fff"/></g></svg><span class="sr-only">
321Previous slide</span></button>',
322          nextArrow:
323            '<button class="slick-next slick-arrow" aria-label="Next slide" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 50 50"><path d="M25,0H50V50H0V25A25,25,0,0,1,25,0Z" fill="#c7c2ba"/><g transform="translate(17.396 21.544)"><path d="M14.733,3.2h0L11.691.17a.582.582,0,0,0-.821.825l2.042,2.033H.582a.582.582,0,1,0,0,1.164h12.33L10.869,6.224a.582.582,0,0,0,.821.825l3.042-3.027h0A.583.583,0,0,0,14.733,3.2Z" transform="translate(0 0)" fill="#fff"/></g></svg><span class="sr-only">Next slide</span></button>',
324        });
325      }
326
327      // MASONRY
328      if ($(".view-news").length) {
329        /*
330				var $container = $('.view-news');
331				var $container = $('.view-news .view-content');
332				var containerWidth = $container.width();
333				// initialize Masonry after all images have loaded
334				$container.imagesLoaded(function() {
335					$container.masonry({
336						itemSelector: '.news',
337						isAnimated: true,
338						columnWidth: '.news',
339
340					});
341				});
342				*/
343      }
344
345      // IE DEBUG
346      var IEversion = detectIE();
347      if (IEversion) {
348        // STICKY
349        $(".header.sticky-top").css({
350          position: "fixed",
351          width: "100%",
352          "z-index": 100,
353        });
354      }
355
356      // SVG ALTER
357      svgAlter();
358
359      // ACCESSIBILITY
360      // SPACEBAR = CLICK
361      $('a[role="button"], a.button').keypress(function (event) {
362        if (event.keyCode === 13 || event.keyCode === 32) {
363          event.preventDefault();
364          //$(this).trigger('click');
365          $(this)[0].click();
366        }
367      });
368    } /* END INITIALIZE */
369
370    function svgAlter() {
371      // SVG ALTER
372      $("img.svg-alter").each(function () {
373        var $img = $(this);
374        var imgID = $img.attr("id");
375        var imgClass = $img.attr("class");
376        var imgURL = $img.attr("src");
377        var imgW = $img.attr("width");
378        var imgH = $img.attr("height");
379        var imgAlt = $img.attr("alt");
380
381        $.get(
382          imgURL,
383          function (data) {
384            // Get the SVG tag, ignore the rest
385            var $svg = $(data).find("svg");
386
387            // Add replaced image's ID to the new SVG
388            if (typeof imgID !== "undefined") {
389              $svg = $svg.attr("id", imgID);
390            }
391            // Add replaced image's classes to the new SVG
392            if (typeof imgClass !== "undefined") {
393              $svg = $svg.attr("class", imgClass + " replaced-svg");
394            }
395
396            // Remove any invalid XML tags as per http://validator.w3.org
397            $svg = $svg.removeAttr("xmlns:a");
398
399            // Check if the viewport is set, else we gonna set it if we can.
400            if (
401              !$svg.attr("viewBox") &&
402              $svg.attr("height") &&
403              $svg.attr("width")
404            ) {
405              $svg.attr(
406                "viewBox",
407                "0 0 " + $svg.attr("height") + " " + $svg.attr("width")
408              );
409            }
410            if (imgW > 0 && imgH > 0) {
411              $svg.css({ width: imgW, height: imgH });
412            }
413
414            // Replace image with new SVG
415            $img.replaceWith($svg);
416
417            $svg = $svg.attr("alt", imgAlt);
418          },
419          "xml"
420        );
421      });
422    }
423
424    function detectIE() {
425      var ua = window.navigator.userAgent;
426
427      var msie = ua.indexOf("MSIE ");
428      if (msie > 0) {
429        // IE 10 or older => return version number
430        return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)), 10);
431      }
432
433      var trident = ua.indexOf("Trident/");
434      if (trident > 0) {
435        // IE 11 => return version number
436        var rv = ua.indexOf("rv:");
437        return parseInt(ua.substring(rv + 3, ua.indexOf(".", rv)), 10);
438      }
439
440      var edge = ua.indexOf("Edge/");
441      if (edge > 0) {
442        // Edge (IE 12+) => return version number
443        return parseInt(ua.substring(edge + 5, ua.indexOf(".", edge)), 10);
444      }
445
446      // other browser
447      return false;
448    }
449  }
450
451  Drupal.behaviors.gonnaeat = {
452    attach: function (context, settings) {
453      // RUN ONCE ELEMENTS
454      init();
455
456      normalizeSlideHeights();
457      $(window).on("resize orientationchange", normalizeSlideHeights);
458
459      // MODAL OPEN CALLBACK
460      $("#drupal-modal").on("show.bs.modal", function (e) {
461        // BEFORE SHOW
462      });
463      $("#drupal-modal").on("shown.bs.modal", function (e) {
464        // AFTER SHOW
465      });
466      // AJAX CALLBACK
467      /*
468				$(document).once('ajaxCustomCallback').ajaxSuccess(function (event, data) {
469					console.log('drupalSettings',drupalSettings);
470					console.log('event',event);
471					console.log('data',data);
472					if (drupalSettings && drupalSettings.views && drupalSettings.views.ajaxViews) {
473						var ajaxViews = drupalSettings.views.ajaxViews;
474						Object.keys(ajaxViews || {}).forEach(function (i) {
475							//if (ajaxViews[i]['view_name'] == 'participants' && ajaxViews[i]['view_path'] == '/views/ajax') {
476							if (ajaxViews[i]['view_path'] == '/views/ajax') {
477								var viewDomID = '.js-view-dom-id-'+ajaxViews[i]['view_dom_id'];
478								$(viewDomID).find('.row').not('.has-rip').addClass('no-top-rip', 'has-rip');
479
480							}
481						});
482					}
483				});
484			*/
485    },
486  };
487})(jQuery, Drupal);
488
489function activateButton() {
490  console.log("open dialog");
491}
492
493// BOOTSTRAP CAROUSEL HEIGHT
494function normalizeSlideHeights() {
495  jQuery(".carousel").each(function () {
496    var items = jQuery(".carousel-item", this);
497    // reset the height
498    items.css("min-height", 0);
499    // set the height
500    var maxHeight = Math.max.apply(
501      null,
502      items
503        .map(function () {
504          return $(this).outerHeight();
505        })
506        .get()
507    );
508    items.css("min-height", maxHeight + "px");
509  });
510}

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.