PageSourceSearch

https://www.tellflg.com/wp-content/themes/spk/js/custom.js

js tellflg.com collected 2026-10-09 23:09:41 UTC 8,285 bytes, 199 lines download raw bytes

1// to enable the enqueue of this optional JS file, 
2// you'll have to uncomment a row in the functions.php file
3// just read the comments in there mate
4
5console.log("Custom js file loaded");
6
7//add here your own js code. Vanilla JS welcome.
8
9jQuery('body').on('click', '#donationsubmit', function (e) {
10
11    jQuery('#cform-form-msg').removeClass('alert-success');
12    jQuery('#cform-form-msg').removeClass('alert-danger');
13    jQuery('#donationsubmit').attr('disabled', 'disabled');
14    jQuery('#donationform #ajax-loader-donationform').css('display', 'block');
15    jQuery.ajax({
16        type: "POST",
17        url: "/wp-content/themes/spk/send-donations-form.php",
18        data: jQuery("#donationform").serialize(),
19        dataType: "json",
20        success: function (data) {
21            if ('success' == data.result)
22            {
23                console.log(data.msg);
24                jQuery('#cform-form-msg').css('visibility', 'visible').hide().fadeIn().removeClass('hidden').addClass('alert-success');
25                jQuery('#cform-form-msg').html(data.msg);
26                jQuery('#donationsubmit').removeAttr('disabled');
27                jQuery('#ajax-loader-cform').css('display', 'none');
28                jQuery('html,body').animate({
29                    scrollTop: jQuery("#cform-form-msg").offset().top - 20},
30                        'slow');
31                 window.setTimeout(function () {
32                    window.location.href = "/thank-you"
33                }, 1000)
34
35            }
36
37            if ('error' == data.result)
38            {
39                jQuery('#cform-form-msg').css('visibility', 'visible').hide().fadeIn().removeClass('hidden').addClass('alert-danger');
40                jQuery('#cform-form-msg').html(data.msg[0]);
41                jQuery('#donationsubmit').removeAttr('disabled');
42                jQuery('#ajax-loader-cform').css('display', 'none');
43                jQuery('html,body').animate({
44                    scrollTop: $("#cform-form-msg").offset().top - 20},
45                        'slow');
46            }
47
48        }
49    });
50    return false;
51});
52
53/*-----------------------Desktop menu--------------------------*/
54$('body').on('click', '.redriect-link a', function (e) {
55    var get_link = $(this).attr('href');
56     window.location.href = get_link;
57});
58
59/*-----------------------Responsive menu--------------------------*/
60$(document).ready(function ($) {
61$(".res-menu .menu-item-has-children ul").hide();
62$('.res-menu .menu-item-has-children').append('<span>▼</span>');
63$('.res-menu .menu-item-has-children > span').click(function(e) {
64e.preventDefault();     
65$(this).parent().find(' > ul').toggle('ul');
66console.log($(this).parent());
67     return false;
68});
69 });
70
71
72 /*..............Make Link Un Clickable if Empty..............*/
73 $("a").each(function () {
74    if ($(this).attr('href') === '') {
75        $(this).removeAttr("href");
76    } else {
77        $(this).show();
78    }
79});
80
81/*......................Blog Category Drop down Js.....................*/
82$(document).ready(function ($) {
83$('body').on('change', '#cat', function (e) {
84    var CheckID = $(this).val();
85    if (CheckID == "-1") {
86        window.location.href = "/blog"
87        return false
88    } else {
89        $(this).closest('form').trigger('submit');
90    }
91});
92});
93/*..............Youtube..............*/
94$(function () {
95    $(".youtube").each(function () {
96        $(this).append($('<div/>', { 'class': 'play' }));
97        $(document).delegate('#' + this.id, 'click', function () {
98            var iframe_url = "https://www.youtube.com/embed/" + this.id + "?rel=0&autoplay=1";
99            if ($(this).data('params'))
100                iframe_url += '&' + $(this).data('params');
101            var iframe = $('<iframe/>', { 'frameborder': '0', 'src': iframe_url, 'width': $(this).width(), 'height': $(this).height() })
102            $(this).replaceWith(iframe);
103        });
104    });
105});
106
107/*..............Vimeo..............*/
108$(function () {
109    $(".vimeo").each(function () {
110        $(this).append($('<div/>', { 'class': 'vimeoplay' }));
111        $(document).delegate('#' + this.id, 'click', function () {
112            var iframe_url = "//player.vimeo.com/video/" + this.id + "/?autoplay=1";
113            if ($(this).data('params'))
114                iframe_url += '&' + $(this).data('params');
115            var iframe = $('<iframe/>', { 'frameborder': '0', 'src': iframe_url, 'width': $(this).width(), 'height': $(this).height() })
116            $(this).replaceWith(iframe);
117        });
118    });
119});
120
121/*............................Map Mouse Event............................*/
122$('.mapMarker iframe').addClass('scrolloff'); // set the pointer events to none on doc ready
123$('.mapMarker').on('click', function () {
124    $('.mapMarker iframe').removeClass('scrolloff'); // set the pointer events true on click
125});
126$(".mapMarker").mouseleave(function () {
127    $('.mapMarker iframe').addClass('scrolloff'); // set the pointer events to none when mouse leaves the map area
128});
129$(function ($) {
130    $('#my-fast-map a').on('click', function (e) {
131        e.preventDefault();
132        map = $(this).parent();
133        iframe_src = map.data('iframe-src');
134        iframe_width = map.data('iframe-width');
135        iframe_height = map.data('iframe-height');
136        map.html('<iframe src="' + iframe_src + '" width="' + iframe_width + '" height="' + iframe_height + '" allowfullscreen></iframe>');
137        return false;
138    });
139});
140
141   /** =====================================
142  *   Search Box
143  * =====================================**/
144         $('.search-box a').on('click', function(e) {
145            e.preventDefault();
146            $('.top-search-input-wrap').addClass('show');
147          });
148          $(".top-search-input-wrap .top-search-overlay, .top-search-input-wrap .close-icon").on('click', function(){
149            $('.top-search-input-wrap').removeClass('show');
150          });
151
152
153          document.addEventListener("DOMContentLoaded", function (e) {
154          jQuery('body').on('click', '#cformsubmitdirect', function (e) {
155
156            jQuery('#cform-form-msg').removeClass('alert-success');
157            jQuery('#cform-form-msg').removeClass('alert-danger');
158            jQuery('#cformsubmitdirect').attr('disabled', 'disabled');
159            jQuery('#cformDirect #ajax-loader-cform').css('display', 'block');
160            console.log("test");
161            jQuery.ajax({
162                type: "POST",
163                url: "/wp-content/themes/spk/send-cform-direct.php",
164                data: jQuery("#cformDirect").serialize(),
165                dataType: "json",
166                success: function (data) {
167                    if ('success' == data.result)
168                    {
169                        jQuery('#cform-form-msg').css('visibility', 'visible').hide().fadeIn().removeClass('hidden').addClass('alert-success');
170                        jQuery('#cform-form-msg').html(data.msg);
171                        jQuery('.popup-form').html(data.msg[0]);
172    //                    document.getElementById('book-download-link-popup' + data.downloadnumber).click();
173                        jQuery('#cformsubmitdirect').removeAttr('disabled');
174                        jQuery('#ajax-loader-cform').css('display', 'none');
175    //                    jQuery('html,body').animate({
176    //                        scrollTop: jQuery("#cform-form-msg").offset().top},
177    //                    'slow');
178                        window.setTimeout(function () {
179                             window.location.href = "/thank-you"
180                        }, 1000)
181    
182                    }
183    
184                    if ('error' == data.result)
185                    {
186                        jQuery('#cform-form-msg').css('visibility', 'visible').hide().fadeIn().removeClass('hidden').addClass('alert-danger');
187                        jQuery('#cform-form-msg').html(data.msg[0]);
188                        jQuery('#cformsubmitdirect').removeAttr('disabled');
189                        jQuery('#ajax-loader-cform').css('display', 'none');
190                        jQuery('html,body').animate({
191                            scrollTop: $("#cform-form-msg").offset().top - 20},
192                        'slow');
193                    }
194    
195                }
196            });
197            return false;
198        });
199    });

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.