PageSourceSearch

https://rarefoodsaustralia.com.au/wp-content/themes/hicaliber-them…/assets/js/hicaliber-child-theme.js?ver=1.0

js rarefoodsaustralia.com.au collected 2026-10-04 04:50:29 UTC 9,916 bytes, 279 lines download raw bytes

1(function($){
2	$(document).ready(function(){
3			
4		var characterLimit = 250;
5		var readMoreTxt = " Read More";
6		var readLessTxt = " Read Less";
7
8		$(".clip-text .hic-blurb p").each(function() {
9			if ($(this).find(".firstSec").length)
10				return;
11
12			var allstr = $(this).text();
13			if (allstr.length > characterLimit) {
14				var firstSet = allstr.substring(0, characterLimit);
15				var secdHalf = allstr.substring(characterLimit, allstr.length);
16				var strtoadd = firstSet + "<span class='SecSec'>" + secdHalf + "</span>"; 
17				var btnReadmoreLess = "<span class='read-more'  title='Click to Show More'>" + readMoreTxt + "</span><span class='read-less' title='Click to Show Less'>" + readLessTxt + "</span>";
18				$(this).closest(".hic-blurb").addClass("showlesscontent");
19				$(this).html(strtoadd);
20				if($(this).closest(".hic-blurb").find(".read-more").length  == 0 ){
21					$(this).closest(".hic-blurb").append(btnReadmoreLess);
22				}
23				
24			}
25
26		});
27
28		//Read More and Read Less Click 
29		$(document).on("click", ".clip-text .read-more,.clip-text .read-less", function() {
30			$(this).closest(".hic-blurb").toggleClass("showlesscontent showmorecontent");
31		});
32
33		
34	   var slideUp = {
35		   distance: '40px',
36		   origin: 'bottom',
37		   opacity: 0,
38		   scale: 1,
39		   delay: 100,
40		   interval: 200,
41		   duration: 2000,
42		   easing: "ease",
43		};
44	   var slideRight = {
45		   distance: '40px',
46		   origin: 'left',
47		   opacity: 0,
48		   scale: 1,
49		   delay: 100,
50		   interval: 200,
51		   duration: 2000,
52		   easing: "ease",
53		};
54	   var slideLeft = {
55		   distance: '40px',
56		   origin: 'right',
57		   opacity: 0,
58		   scale: 1,
59		   delay: 100,
60		   interval: 200,
61		   duration: 2000,
62		   easing: "ease",
63		};
64		var fadeIn = {
65			opacity: 0,
66			delay: 300,
67			duration: 2000,
68			easing: "ease",
69		};
70		
71		let sr = ScrollReveal();
72		sr.reveal('.anim-fade-in', fadeIn);	
73		sr.reveal('.anim-slide-left', slideLeft);
74		sr.reveal('.anim-slide-right', slideRight);
75		sr.reveal('.anim-slide-up', slideUp);
76		
77		sr.reveal('.anim-header-fade-in .section-header', fadeIn);
78		sr.reveal('.anim-body-fade-in .section-body', fadeIn);
79		
80		sr.reveal('.anim-header-slide-up .section-header', slideUp);
81		sr.reveal('.anim-body-slide-up .section-body', slideUp);
82		
83		sr.reveal('.anim-header-slide-left .section-header', slideLeft);
84		sr.reveal('.anim-body-slide-left .section-body', slideLeft);
85		
86		sr.reveal('.anim-header-slide-right .section-header', slideRight);
87		sr.reveal('.anim-body-slide-right .section-body', slideRight);
88		
89		sr.reveal('.anim-inner-fade-in .inner-section', fadeIn);
90		
91		//instagram
92		let _insta_link = $(".hic-instagram .sb_instagram_header a");
93		let _insta_block = `<div class='sbi_item insta-dark'><div class='sbi_photo_wrap'><a class="sbi_photo sbi_imgLiquid_bgSize sbi_imgLiquid_ready" href="`+ _insta_link.attr("href") +`" target="_blank" rel="noopener nofollow"><img src="/wp-content/uploads/2021/09/black.png">    
94							<div class="block-follow"><div class='insta-title'>Follow Us on Instagram</div><div class='insta-page'>@`+_insta_link.text().trim() +`</div></div>
95							</a></div></div>`;
96		let _insta_image = $(".hic-instagram #sbi_images");
97		setTimeout(() => _insta_image.prepend(_insta_block), 0);
98		
99		
100		//disable carousel
101    	$('.disabled-carousel .section-body').slick('unslick');
102    	var viewportWidth = $(window).width();
103		if( viewportWidth > 1024 ){
104			var Rows = 2;
105		} else if( viewportWidth < 1023 ){
106			var Rows = 1;
107		}
108    	$('.row-2-carousel .section-body').slick({
109    		dots: false,
110    		arrows: true,
111    		infinite: true,
112    		speed: 300,
113    		slidesToShow: 3,
114    		slidesToScroll: 3,
115			rows: Rows,
116    		 responsive: [
117				 	{
118                        breakpoint: 1024,
119                        settings: {
120                            slidesToShow: 2,
121                            slidesToScroll: 2,
122							arrows: true,
123                        }
124                    },
125                    {
126                        breakpoint: 641,
127                        settings: {
128                            slidesToShow: 1,
129                            slidesToScroll: 1,
130							arrows: true,
131                        }
132                    },
133                 ]
134        });	
135		
136 		$('.has-video-link .hic-content .hic-button-wrap a.button').attr( "data-fancybox",'' );
137 		
138 		var tour_widget = $("#trive-event-tour-widget");
139 		
140		if(tour_widget.length){
141		    var event_dates = tour_widget.find('.event-dates');
142		    var tickets_wrapper = tour_widget.find('.tickets-wrapper');
143		    var tickets = tickets_wrapper.find('.event-ticket');
144		    
145		    var selectedDate = event_dates.children("option:selected").val();
146		    if (selectedDate){
147		        tickets_wrapper.find("#" + selectedDate).show();
148		    }
149		    console.log(selectedDate);
150		        
151		    event_dates.on('change', function(){
152		        var ticket = $(this);
153		        var post_id = ticket.val();
154		       
155		        tickets.hide();
156		        
157		        if(post_id){
158		            tickets_wrapper.find("#" + post_id).show();
159		        }
160                
161                /* AJAX Version
162                
163                var post_id = $(this).attr('data-main-id');
164		        
165		        $.ajax({
166                    url: hep.site_url + "/wp-json/hi-api/get-tribe-ticket/"+post_id,
167                    dataType: 'json',
168                    success: function (data, textStatus, xhr) {
169                        tickets_wrapper.html(data.result);
170                        tickets_wrapper.foundation(); 
171                    }
172                }); */
173		    });
174		}
175	});
176	
177	$('.products.columns-3 .button.product_type_variable').text('View Product');
178	$('.products.columns-3 .button.product_type_simple').text('View Product');
179	
180	var filter_tags = $('[data-target-item="tags"]');
181	var filter_btn = $('.sc-filter-button .button');
182	var tag_item = [];
183	
184           
185
186	filter_btn.on('click', function(){
187	   // var tag = $(this);
188	    //var tag_item = tag.val();
189	    //console.log(tag_item);
190	    //event.preventDefault();
191	     $('[data-target-item="tags"]:checked').each(function() {
192                tag_item.push($(this).val());
193            });
194            console.log(tag_item);
195            $('[data-filter-target="tags"]').val(tag_item);
196	});
197	
198   $('#cat_id_filter').on('change', function() {
199       this.form.submit();
200   });
201   
202   // Select all links with hashes
203    $('.header .menu li a[href*="#"]')
204      // Remove links that don't actually link to anything
205      .not('[href="#"]')
206      .not('[href="#0"]')
207      .click(function(event) {
208        // On-page links
209        if (
210          location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 
211          && 
212          location.hostname == this.hostname
213        ) {
214          // Figure out element to scroll to
215          var target = $(this.hash);
216          target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
217          // Does a scroll target exist?
218          if (target.length) {
219            // Only prevent default if animation is actually gonna happen
220            event.preventDefault();
221            $('html, body').animate({
222              scrollTop: target.offset().top
223            }, 1000, function() {
224              // Callback after animation
225              // Must change focus!
226              var $target = $(target);
227              $target.focus();
228              if ($target.is(":focus")) { // Checking if the target was focused
229                return false;
230              } else {
231                $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
232                $target.focus(); // Set focus again
233              };
234            });
235          }
236        }
237      });
238      
239      /*Image zoom script*/
240      $(".product-gallery .hic-image-container.slick-active img").jqZoom({
241            selectorWidth: 30,
242            selectorHeight: 30,
243            viewerWidth: 400,
244            viewerHeight: 300
245        });
246        
247      $('.page-element.has-transparent-footer-btn .section-footer .button').wrapInner('<span></span>');
248      //$('.store-info-button.view-map-btn').wrapInner('<span></span>');
249      //$('.section-footer .button').wrapInner('<span></span>');
250      //$('.products .button').wrapInner('<span></span>');
251      //$('.content-box-element:not(\'.has-video-link\') .hic-button-wrap .button').wrapInner('<span></span>');
252      
253      $('.has-hover-animation #toa_gl .hic-box').hover( function () {
254          $('.has-hover-animation #toa_gl .hic-content .hic-icon img').attr('src', 'https://rarefoodsaustralia.com.au/wp-content/uploads/2022/05/TOA_GL_Horizontal_White-Trans.png' );
255      },
256      function(){
257          $('.has-hover-animation #toa_gl .hic-icon img').attr('src', 'https://rarefoodsaustralia.com.au/wp-content/uploads/2022/05/TOA_GL_Horizontal_Black-Trans.png' );
258      });
259      
260      $('.has-hover-animation #oa_roei .hic-box').hover( function () {
261          $('.has-hover-animation #oa_roei .hic-content .hic-icon img').attr('src', 'https://rarefoodsaustralia.com.au/wp-content/uploads/2022/05/TOA_Roei_Horizontal_White-Trans.png' );
262      },
263      function(){
264          $('.has-hover-animation #oa_roei .hic-icon img').attr('src', 'https://rarefoodsaustralia.com.au/wp-content/uploads/2022/05/TOA_Roei_Horizontal_Black-Trans.png' );
265      });
266      
267      if ($(window).width() < 1023) {
268         $('.has-hover-animation #toa_gl .hic-content .hic-icon img').attr('src', 'https://rarefoodsaustralia.com.au/wp-content/uploads/2022/05/TOA_GL_Horizontal_White-Trans.png' );
269         $('.has-hover-animation #oa_roei .hic-content .hic-icon img').attr('src', 'https://rarefoodsaustralia.com.au/wp-content/uploads/2022/05/TOA_Roei_Horizontal_White-Trans.png' );
270         
271      }
272      
273	$('.acc_link_clickable').click( function(){
274	    let catUrl = $(this).data('url');
275	    window.location.href = catUrl;
276	    //console.log(catUrl);
277	});
278	
279})(jQuery);

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.