PageSourceSearch

https://kostoday.com/templates/ts_news247/js/main.js

js kostoday.com collected 2026-09-26 01:20:03 UTC 10,011 bytes, 296 lines download raw bytes

1/**
2 * @package Helix3 Framework
3 * @author JoomShaper http://www.joomshaper.com
4 * @copyright Copyright (c) 2010 - 2016 JoomShaper
5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
6 */
7
8jQuery(function ($) {
9
10    // ************    START Helix 1.4 JS    ************** //
11    // **************************************************** //
12
13    //Default
14    if (typeof sp_offanimation === 'undefined' || sp_offanimation === '') {
15        sp_offanimation = 'default';
16    }
17
18    if (sp_offanimation == 'default') {
19        $('#offcanvas-toggler').on('click', function (event) {
20            event.preventDefault();
21            $('.off-canvas-menu-init').addClass('offcanvas');
22        });
23
24        $('<div class="offcanvas-overlay"></div>').insertBefore('.offcanvas-menu');
25        $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
26            event.preventDefault();
27            $('.off-canvas-menu-init').removeClass('offcanvas');
28        });
29    }
30
31    // Slide Top Menu
32    if (sp_offanimation == 'slidetop') {
33        $('#offcanvas-toggler').on('click', function (event) {
34            event.preventDefault();
35            $('.off-canvas-menu-init').addClass('slide-top-menu');
36        });
37
38        $('<div class="offcanvas-overlay"></div>').insertBefore('.offcanvas-menu');
39        $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
40            event.preventDefault();
41            $('.off-canvas-menu-init').removeClass('slide-top-menu');
42        });
43    }
44
45    //Full Screen
46    if (sp_offanimation == 'fullscreen') {
47        $('#offcanvas-toggler').on('click', function (event) {
48            event.preventDefault();
49            $('.off-canvas-menu-init').addClass('full-screen-off-canvas');
50        });
51        $(document).ready(function () {
52            $('.off-canvas-menu-init').addClass('full-screen');
53        });
54        $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
55            event.preventDefault();
56            $('.off-canvas-menu-init').removeClass('full-screen-off-canvas');
57        });
58    }
59
60    //Full screen from top
61    if (sp_offanimation == 'fullScreen-top') {
62        $('#offcanvas-toggler').on('click', function (event) {
63            event.preventDefault();
64            $('.off-canvas-menu-init').addClass('full-screen-off-canvas-ftop');
65        });
66        $(document).ready(function () {
67            $('.off-canvas-menu-init').addClass('full-screen-ftop');
68        });
69        $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
70            event.preventDefault();
71            $('.off-canvas-menu-init').removeClass('full-screen-off-canvas-ftop');
72        });
73    }
74
75    //Dark with plus
76    if (sp_offanimation == 'drarkplus') {
77        $('#offcanvas-toggler').on('click', function (event) {
78            event.preventDefault();
79            $('.off-canvas-menu-init').addClass('new-look-off-canvas');
80        });
81        $('<div class="offcanvas-overlay"></div>').insertBefore('.offcanvas-menu');
82        $(document).ready(function () {
83            $('.off-canvas-menu-init').addClass('new-look');
84        });
85        $('.close-offcanvas,.offcanvas-overlay').on('click', function (event) {
86            event.preventDefault();
87            $('.off-canvas-menu-init').removeClass('new-look-off-canvas');
88        });
89    }
90
91    // if sticky header
92    if ($("body.sticky-header").length > 0) {
93        var fixedSection = $('#sp-header');
94        // sticky nav
95        var headerHeight = fixedSection.outerHeight();
96        var stickyNavTop = fixedSection.offset().top;
97        fixedSection.addClass('animated');
98        fixedSection.before('<div class="nav-placeholder"></div>');
99        $('.nav-placeholder').height('inherit');
100        //add class
101        fixedSection.addClass('menu-fixed-out');
102        var stickyNav = function () {
103            var scrollTop = $(window).scrollTop();
104            if (scrollTop > stickyNavTop) {
105                fixedSection.removeClass('menu-fixed-out').addClass('menu-fixed');
106                $('.nav-placeholder').height(headerHeight);
107            } else {
108                if (fixedSection.hasClass('menu-fixed')) {
109                    fixedSection.removeClass('menu-fixed').addClass('menu-fixed-out');
110                    $('.nav-placeholder').height('inherit');
111                }
112            }
113        };
114        stickyNav();
115        $(window).scroll(function () {
116            stickyNav();
117        });
118    }
119    // go to top
120    if (typeof sp_gotop === 'undefined') {
121        sp_gotop = '';
122    }
123
124    if (sp_gotop) {
125        // go to top
126        $(window).scroll(function () {
127            if ($(this).scrollTop() > 100) {
128                $('.scrollup').fadeIn();
129            } else {
130                $('.scrollup').fadeOut(400);
131            }
132        });
133
134        $('.scrollup').click(function () {
135            $("html, body").animate({
136                scrollTop: 0
137            }, 600);
138            return false;
139        });
140    } // has go to top
141
142    // Preloader
143    if (typeof sp_preloader === 'undefined') {
144        sp_preloader = '';
145    }
146
147    if (sp_preloader) {
148        $(window).on('load', function () {
149            if ($('.sp-loader-with-logo').length > 0) {
150                move();
151            }
152            setTimeout(function () {
153                $('.sp-pre-loader').fadeOut();
154            }, 1000);
155        });
156    } // has preloader
157    //preloader Function
158    function move() {
159        var elem = document.getElementById("line-load");
160        var width = 1;
161        var id = setInterval(frame, 10);
162        function frame() {
163            if (width >= 100) {
164                clearInterval(id);
165            } else {
166                width++;
167                elem.style.width = width + '%';
168            }
169        }
170    }
171    // ************    END:: Helix 1.4 JS    ************** //
172    // **************************************************** //
173
174    // **************   START Mega SCRIPT   *************** //
175    // **************************************************** //
176
177    //mega menu
178    $('.sp-megamenu-wrapper').parent().parent().css('position', 'static').parent().css('position', 'relative');
179    $('.sp-menu-full').each(function () {
180        $(this).parent().addClass('menu-justify');
181    });
182
183    // boxlayout
184    if ($("body.layout-boxed").length > 0) {
185        var windowWidth = $('#sp-header').parent().outerWidth();
186        $("#sp-header").css({"max-width": windowWidth, "left": "auto"});
187    }
188
189    // **************   END:: Mega SCRIPT   *************** //
190    // **************************************************** //
191
192    // **************  START Others SCRIPT  *************** //
193    // **************************************************** //
194
195    /*Tooltip
196    $('[data-toggle="tooltip"]').tooltip(); */
197
198    $('.menu-search-icon').on('click', function () {
199         $('.menu-search-form').fadeIn(500);
200    });
201
202     $('.search-close').on('click', function(){
203              $('.menu-search-form').fadeOut(500);
204     });
205
206    // Article Ajax voting
207    $(document).on('click', '.sp-rating .star', function (event) {
208        event.preventDefault();
209
210        var data = {
211            'action': 'voting',
212            'user_rating': $(this).data('number'),
213            'id': $(this).closest('.post_rating').attr('id')
214        };
215
216        var request = {
217            'option': 'com_ajax',
218            'plugin': 'helix3',
219            'data': data,
220            'format': 'json'
221        };
222
223        $.ajax({
224            type: 'POST',
225            data: request,
226            beforeSend: function () {
227                $('.post_rating .ajax-loader').show();
228            },
229            success: function (response) {
230                var data = $.parseJSON(response.data);
231
232                $('.post_rating .ajax-loader').hide();
233
234                if (data.status == 'invalid') {
235                    $('.post_rating .voting-result').text('You have already rated this entry!').fadeIn('fast');
236                } else if (data.status == 'false') {
237                    $('.post_rating .voting-result').text('Somethings wrong here, try again!').fadeIn('fast');
238                } else if (data.status == 'true') {
239                    var rate = data.action;
240                    $('.voting-symbol').find('.star').each(function (i) {
241                        if (i < rate) {
242                            $(".star").eq(-(i + 1)).addClass('active');
243                        }
244                    });
245
246                    $('.post_rating .voting-result').text('Thank You!').fadeIn('fast');
247                }
248
249            },
250            error: function () {
251                $('.post_rating .ajax-loader').hide();
252                $('.post_rating .voting-result').text('Failed to rate, try again!').fadeIn('fast');
253            }
254        });
255    });
256
257    // Reviews
258    jQuery(window).load(function() {
259        jQuery('.gk-review-sum-value').each(function(i, sum) {      
260            if(
261                !jQuery(sum).parent().hasClass('gk-content-title') &&
262                !jQuery(sum).parent().hasClass('gk-review-sum')
263            ) {
264                var circle = new ProgressBar.Circle(sum, {
265                    color: '#07c958',
266                    strokeWidth: 4,
267                    trailWidth: 4,
268                    duration: 1500,
269                    easing: 'easeInOut'
270                });
271                
272                circle.animate(jQuery(sum).attr('data-final'));
273            }
274        });
275    });
276
277    //Bootstrap Carousel fixed
278    var carousel = jQuery('.carousel');
279        if(carousel){
280         window.addEvent('domready', function(){
281          if (typeof jQuery != 'undefined' && typeof MooTools != 'undefined' ) {
282           Element.implement({
283            slide: function(how, mode){
284             return this;
285            }
286           });
287          }
288         });
289    }
290
291
292
293    // **************  END:: Others SCRIPT  *************** //
294    // **************************************************** //
295
296});

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.