PageSourceSearch

https://reasonfunding.com/asset/js/customblockjs.php

js reasonfunding.com collected 2026-09-27 05:12:12 UTC 12,648 bytes, 412 lines download raw bytes

1// Same height fix
2$(function() {
3    try{ $('.navMob-height').matchHeight(); }catch(err){  }
4    try{ $('.same-height').matchHeight(); }catch(err){  }
5    try{ $('.block-same-height').matchHeight(); }catch(err){  }
6    try{ $('.img-same-height').matchHeight(); }catch(err){  }
7    try{ $('.p-same-height').matchHeight(); }catch(err){  }
8    try{ $('.h-same-height').matchHeight(); }catch(err){  }
9});
10
11// Hide if empty
12//$('a.hide_if_empty[href="#"]').parent().remove();
13
14$('.hide_if_not_empty:empty').each(function() {
15    $(this).parent().toggleClass('hidden');
16});
17
18// Set image as container background
19$(".custom-object-fit").each(function () {
20    var $container = $(this),
21    imgUrl = $container.find("img").prop("src");
22    if (imgUrl) {
23        $container.css("backgroundImage", 'url(' + imgUrl + ')');
24    }
25});
26
27// Set preview description to x number of characters
28$( '.preview100' ).each(function( index ) {
29    if ($(this).text().length > 100){
30        $(this).text($(this).text().substring(0,100) + ' \u2026');
31    }
32});
33$( '.preview125' ).each(function( index ) {
34    if ($(this).text().length > 125){
35        $(this).text($(this).text().substring(0,125) + ' \u2026');
36    }
37});
38$( '.preview150' ).each(function( index ) {
39    if ($(this).text().length > 150){
40        $(this).text($(this).text().substring(0,150) + ' \u2026');
41    }
42});
43$( '.preview175' ).each(function( index ) {
44    if ($(this).text().length > 175){
45        $(this).text($(this).text().substring(0,175) + ' \u2026');
46    }
47});
48$( '.previewDesc' ).each(function( index ) {
49    if ($(this).text().length > 175){
50        $(this).text($(this).text().substring(0,175) + ' \u2026');
51    }
52});
53$( '.preview200' ).each(function( index ) {
54    if ($(this).text().length > 200){
55        $(this).text($(this).text().substring(0,200) + ' \u2026');
56    }
57});
58$( '.preview225' ).each(function( index ) {
59    if ($(this).text().length > 225){
60        $(this).text($(this).text().substring(0,225) + ' \u2026');
61    }
62});
63$( '.preview250' ).each(function( index ) {
64    if ($(this).text().length > 250){
65        $(this).text($(this).text().substring(0,250) + ' \u2026');
66    }
67});
68$( '.preview500' ).each(function( index ) {
69    if ($(this).text().length > 500){
70        $(this).text($(this).text().substring(0,500) + ' \u2026');
71    }
72});
73$( '.preview750' ).each(function( index ) {
74    if ($(this).text().length > 750){
75        $(this).text($(this).text().substring(0,750) + ' \u2026');
76    }
77});
78$( '.preview1000' ).each(function( index ) {
79    if ($(this).text().length > 1000){
80        $(this).text($(this).text().substring(0,1000) + ' \u2026');
81    }
82});
83
84// Remove whitespace
85$('.remove-white-space').contents().filter(function(){
86    return this.nodeType == 3;
87}).remove();
88
89// Replace hyphen with space in string
90$( ".replaceHyphen" ).each(function( index ) {
91    var value = $(this).text();
92    $(this).text(value.replace(/\-/g, " "));
93});
94
95// Cookie Policy
96$(document).ready(function(){
97    //document.cookie = "cookie_policy_check=; expires=Thu, 01 Jan 1970 00:00:00 UTC; ";
98    $(".cookie_policy_accept").click(function(){
99        var d = new Date();
100        var cname='cookie_policy_check';
101        var cvalue='cookie_policy_check_set';
102        d.setFullYear(d.getFullYear() + 1);
103        var expires = "expires="+ d.toUTCString();
104        document.cookie = cname + "=" + cvalue + ";" + expires + ";";
105        $("div.cookie_policy_message").fadeOut('slow');
106    });
107    /// Add attribute aria-hidden in invisible captcha's textarea
108    var interval_for_captcha = window.setInterval(myCallback_captcha, 50);
109    function myCallback_captcha() {
110        var textAreaCheckCaptcha = document.getElementsByClassName('g-recaptcha-response');
111        if (textAreaCheckCaptcha.length > 0) {
112            $(textAreaCheckCaptcha).attr('aria-hidden', 'true');
113            clearInterval(interval_for_captcha);
114        }
115    }
116});
117
118// Skip to Content
119$('.skipToContent').focus(function(){
120    $('.skipVisible').removeClass('skipHidden');
121});
122$('.skipToContent').focusout(function(){
123    $('.skipVisible').addClass('skipHidden');
124});
125
126// Off Canvas
127function openDIYOC() {
128    $('.diy-oc-wrapper').addClass('active');
129    $('.diy-oc-wrap').addClass('active').focus().attr('tabindex', 0 );
130};
131
132function closeDIYOC() {
133    $('.diy-oc-wrapper').removeClass('active');
134    $('.diy-oc-wrap').removeClass('active').attr('tabindex', -1 );
135};
136
137$(function() {
138    $('#diy-oc-nav a[href$="/' + location.pathname.split("/")[1] + '"]').addClass('active');
139});
140
141// Anchor Links
142function url_has_vars() {
143  var curPath = window.location.pathname;
144  if (curPath != "/"){
145    return true;
146  }
147  return false;
148}
149
150$(document).ready(function(){
151  if (url_has_vars()){
152    $('a.anchor').each(function () {
153      var _href = $(this).attr("href"); 
154      console.log(_href);
155      $(this).attr("href", window.location.protocol + '//' + window.location.hostname + _href);
156    });
157  }
158});
159
160$( "ul#main-menu a.anchor" ).click(function(e) {
161console.log('Console Log 1');    
162if ($(window).width() < 991) {
163       $( ".main-menu-btn-icon" ).trigger( "click" );
164    }
165    $('a.anchor').on('click', function(e) {
166console.log('Console Log 2');
167        if (!url_has_vars()){
168            e.preventDefault();
169            var navHeight = 0;
170            console.log($(this).attr('href'));
171            try{
172                if($('.navbar-fixed-top:visible').length > 0){
173                    var navHeight = $('.navbar-fixed-top:visible').height();
174                }
175            }catch(err){
176                //Fail silently
177            }
178            console.log(navHeight);
179            if(($(this).attr('href') != '#contact')) {
180                $('html, body').animate({
181                    scrollTop: $($(this).attr('href')).offset().top - navHeight,
182                },
183                500,
184                'linear'
185                );
186            }
187        }
188    });
189});
190
191$('a.diy-anchor').on('click', function(e) {
192    e.preventDefault();
193    var navHeight = 0;
194    console.log($(this).attr('href'));
195    try{
196        if($('.navbar-fixed-top:visible').length > 0){
197            var navHeight = $('.navbar-fixed-top:visible').height();
198        }
199    }catch(err){
200        //Fail silently             
201    }
202    console.log(navHeight);
203    if(($(this).attr('href') != '#contact')) {
204        $('html, body').animate({
205            scrollTop: $($(this).attr('href')).offset().top - navHeight,
206        },
207        500,
208        'linear'
209        );
210    }
211});
212
213// Fix Nav
214function fixNav(){
215    if ($('nav.navbar-fixed-top').hasClass('transparent-bg')) {
216        $('body').css('marginTop', '0px');
217        return;
218    }
219    var navHeight = $('nav.navbar-fixed-top').height();
220    var myMarginTop = parseInt( $("body").css("marginTop") );
221    if (myMarginTop != navHeight){
222        $('body').css('marginTop', navHeight);
223    }
224}
225$(document).ready(fixNav);
226$(window).resize(fixNav);
227
228// TRANSPARENT HEADER
229var navHeightTrans = $('nav.diy-nav').height();
230var is_root = location.pathname == "/";
231$('header').next().addClass('transHeaderFix');
232
233if ($(window).scrollTop() === 0) {
234  $('nav.transHeader').addClass('transparent-bg');
235}
236
237$('body').bind('DOMSubtreeModified', function(event) {
238  $('body').triggerHandler('bind');
239  event.preventDefault();
240  try{
241    if($('.navbar-fixed-top.transparent-bg:visible').length > 0){
242      $(':not(.videoCont).transHeaderFix').css('padding-top', navHeightTrans + 'px');
243      $('body').css('margin-top', '0px');
244    } else {
245      if($('.diy-nav-scroll.transparent-bg:visible').length > 0){
246        $(':not(.videoCont).transHeaderFix').css('margin-top', navHeightTrans + 'px');
247        $('body').css('margin-top', '0px');
248      }
249    }
250  }catch(err){
251  }
252});
253
254$(window).scroll(function() {    
255  var scroll = $(window).scrollTop();
256  if ( $('nav').hasClass("transHeader")) {
257    if (scroll >= 1) {
258      $("nav.transHeader").removeClass("transparent-bg");
259      $('body').css('margin-top', '0px');
260    } else {
261      $("nav.transHeader").addClass("transparent-bg");
262    }
263    fixNav();
264  }
265});
266
267if (is_root) {
268  
269  if ($(window).scrollTop() === 0) {
270    $('nav.transHeaderHome').addClass('transparent-bg');
271  }
272  
273  $('body').bind('DOMSubtreeModified', function(event) {
274    $('body').triggerHandler('bind');
275    event.preventDefault();
276    try{
277      if($('.navbar-fixed-top.transparent-bg:visible').length > 0){
278        $(':not(.videoCont).transHeaderFix').css('padding-top', navHeightTrans + 'px');
279        $('body').css('margin-top', '0px');
280      } else {
281        if($('.diy-nav-scroll.transparent-bg:visible').length > 0){
282          $(':not(.videoCont).transHeaderFix').css('margin-top', navHeightTrans + 'px');
283          $('body').css('margin-top', '0px');
284        }
285      }
286    }catch(err){
287    }
288  });
289  
290  $(window).scroll(function() {    
291    var scroll = $(window).scrollTop();
292    if ( $('nav').hasClass("transHeaderHome")) {
293      if (scroll >= 1) {
294        $("nav.transHeaderHome").removeClass("transparent-bg");
295        $('body').css('margin-top', '0px');
296      } else {
297        $("nav.transHeaderHome").addClass("transparent-bg");
298      }
299      fixNav();
300    }
301  });
302}
303
304// Hamburger Menu
305var $hamburger = $(".hamburger:not(.diy-custom)");
306$hamburger.on("click", function(e) {
307    $hamburger.toggleClass("is-active");
308    // Do something else, like open/close menu
309});
310// HEADER - DEFAULT
311  
312  $(".nav-brand").each(function () {
313    var $container = $(this),
314      imgUrl = $container.find("img").prop("src");
315    if (imgUrl) {
316      $container.css("backgroundImage", 'url(' + imgUrl + ')').addClass("custom-object-fit");
317    }
318  });
319  
320  $(function() {
321    $('#main-menu').smartmenus({
322      mainMenuSubOffsetX: -1,
323      mainMenuSubOffsetY: 4,
324      subMenusSubOffsetX: 6,
325      subMenusSubOffsetY: -6
326    });
327  });
328
329  // SmartMenus
330  $('input#main-menu-state').focus(function() {
331    $('label[for="' + this.id + '"]').addClass('labelfocus');
332  }).blur(function() {
333    $('label[for="' + this.id + '"]').removeClass('labelfocus');
334  });
335
336  // SmartMenus mobile menu toggle button
337  $(function() {
338    var $mainMenuState = $('#main-menu-state');
339    if ($mainMenuState.length) {
340      // animate mobile menu
341      $mainMenuState.change(function(e) {
342        var $menu = $('#main-menu');
343        if (this.checked) {
344          $menu.hide().slideDown(250, function() { $menu.css('display', ''); });
345        } else {
346          $menu.show().slideUp(250, function() { $menu.css('display', ''); });
347        }
348      });
349      // hide mobile menu beforeunload
350      $(window).bind('beforeunload unload', function() {
351        if ($mainMenuState[0].checked) {
352          $mainMenuState[0].click();
353        }
354      });
355    }
356  });
357
358  function searchForm() {
359    $('#searchForm').toggleClass('closed');	
360  }
361
362  function closeForm() {
363    $('#searchForm').toggleClass('closed');	
364  }
365
366  $(document).ready(function() {
367    //option A
368    $("#searchBtn").click(function(e){  		  		
369      $('#animated-gif').show();
370      $("#search_text").html('Searching...');
371      $("form#this_search").submit();  		
372    });
373    $('#this_search').keypress(function(e){
374      if(e.which == 13){//Enter key pressed
375        $('#searchBtn').click();//Trigger search button click event
376      }
377    });
378  });// POSTS SLIDER 3
379
380  $('.diy-posts-slider-2 .posts-slider-3').owlCarousel({
381    loop: false,
382    animateOut: 'fadeOut',
383    margin: 30,
384    nav: true,
385    navText: ["<i class='fa fa-chevron-left fa-2x'><span class='sr-only'>Previous Slide</span></i>", "<i class='fa fa-chevron-right fa-2x'><span class='sr-only'>Next Slide</span></i>"],
386    responsiveClass: true,
387    responsive: {
388      0: {
389        items: 1
390      },
391      768: {
392        items: 2
393      },
394      992: {
395        items: 3
396      }
397    }
398  });
399
400  $( '.diy-posts-slider-2  .posts-slider-3 .previewDesc' ).each(function( index ) {  		
401    if ($(this).text().length > 175){  
402      $(this).text($(this).text().substring(0,175) + ' \u2026');
403    }
404  });
405
406  $(".diy-posts-slider-2 .posts-slider-3 .img-container").each(function () {
407    var $container = $(this),
408      imgUrl = $container.find("img").prop("src");
409    if (imgUrl) {
410      $container.css("backgroundImage", 'url(' + imgUrl + ')').addClass("custom-object-fit");
411    }
412  });

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.