1/** 2 * @package Helix Ultimate Framework 3 * @author JoomShaper https://www.joomshaper.com 4 * @copyright Copyright (c) 2010 - 2018 JoomShaper 5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later 6*/ 7 8jQuery(function ($) { 9 10 // Stikcy Header 11 if ($('body').hasClass('sticky-header')) { 12 var header = $('#sp-header'); 13 14 if($('#sp-header').length) { 15 var headerHeight = header.outerHeight(); 16 var stickyHeaderTop = header.offset().top; 17 var stickyHeader = function () { 18 var scrollTop = $(window).scrollTop(); 19 if (scrollTop > stickyHeaderTop) { 20 header.addClass('header-sticky'); 21 } else { 22 if (header.hasClass('header-sticky')) { 23 header.removeClass('header-sticky'); 24 } 25 } 26 }; 27 stickyHeader(); 28 $(window).scroll(function () { 29 stickyHeader(); 30 }); 31 } 32 33 if ($('body').hasClass('layout-boxed')) { 34 var windowWidth = header.parent().outerWidth(); 35 header.css({"max-width": windowWidth, "left": "auto"}); 36 } 37 } 38 39 // go to top 40 $(window).scroll(function () { 41 if ($(this).scrollTop() > 100) { 42 $('.sp-scroll-up').fadeIn(); 43 } else { 44 $('.sp-scroll-up').fadeOut(400); 45 } 46 }); 47 48 $('.sp-scroll-up').click(function () { 49 $("html, body").animate({ 50 scrollTop: 0 51 }, 600); 52 return false; 53 }); 54 55 // Preloader 56 $(window).on('load', function () { 57 $('.sp-preloader').fadeOut(500, function() { 58 $(this).remove(); 59 }); 60 }); 61 62 //mega menu 63 $('.sp-megamenu-wrapper').parent().parent().css('position', 'static').parent().css('position', 'relative'); 64 $('.sp-menu-full').each(function () { 65 $(this).parent().addClass('menu-justify'); 66 }); 67 68 // Offcanvs 69 $('#offcanvas-toggler').on('click', function (event) { 70 event.preventDefault(); 71 $('.offcanvas-init').addClass('offcanvas-active'); 72 }); 73 74 $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) { 75 event.preventDefault(); 76 $('.offcanvas-init').removeClass('offcanvas-active'); 77 }); 78 79 $(document).on('click', '.offcanvas-inner .menu-toggler', function(event){ 80 event.preventDefault(); 81 $(this).closest('.menu-parent').toggleClass('menu-parent-open').find('>.menu-child').slideToggle(400); 82 }); 83 84 //Tooltip 85 $('[data-toggle="tooltip"]').tooltip(); 86 87 // Article Ajax voting 88 $('.article-ratings .rating-star').on('click', function (event) { 89 event.preventDefault(); 90 var $parent = $(this).closest('.article-ratings'); 91 92 var request = { 93 'option': 'com_ajax', 94 'template': template, 95 'action': 'rating', 96 'rating': $(this).data('number'), 97 'article_id': $parent.data('id'), 98 'format': 'json' 99 }; 100 101 $.ajax({
102 type: 'POST', 103 data: request, 104 beforeSend: function () { 105 $parent.find('.fa-spinner').show(); 106 }, 107 success: function (response) { 108 var data = $.parseJSON(response); 109 $parent.find('.ratings-count').text(data.message); 110 $parent.find('.fa-spinner').hide(); 111 112 if(data.status) 113 { 114 $parent.find('.rating-symbol').html(data.ratings) 115 } 116 117 setTimeout(function(){ 118 $parent.find('.ratings-count').text('(' + data.rating_count + ')') 119 }, 3000); 120 } 121 }); 122 }); 123 124 // Cookie consent 125 $('.sp-cookie-allow').on('click', function(event) { 126 event.preventDefault(); 127 128 var date = new Date(); 129 date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000)); 130 var expires = "; expires=" + date.toGMTString(); 131 document.cookie = "spcookie_status=ok" + expires + "; path=/"; 132 133 $(this).closest('.sp-cookie-consent').fadeOut(); 134 }); 135 136 //Template related JS 137 $('.sppb-addon-articles .sppb-article-introtext').each(function(){ 138 let introText = $(this).find('p'); 139 $(this).html(introText); 140 }) 141 142 if($('.main-login-page').length>0){ 143 $('input.validate-username').attr('placeholder', "Username") 144 $('input.validate-password').attr('placeholder', "Password") 145 } 146 if ($('#member-registration').length>0){ 147 $('#jform_name').attr('placeholder', 'Full Name') 148 $('#jform_username').attr('placeholder', 'Username') 149 $('#jform_password1').attr('placeholder', 'Password') 150 $('#jform_password2').attr('placeholder', 'Password Again') 151 $('#jform_email1').attr('placeholder', 'Email') 152 $('#jform_email2').attr('placeholder', 'Email Again') 153 } 154 if ($("ul.pagination").length>0){ 155 $('.page-link.previous').closest('.page-item').addClass('previous'); 156 $('.page-link.next').closest('.page-item').addClass('next'); 157 } 158 // Select 159 if ($(".my-select").length > 0) { 160 $(document).on('click', function (e) { 161 var selector = $('.my-select'); 162 if (!selector.is(e.target) && selector.has(e.target).length === 0) { 163 selector.find('ul').slideUp(); 164 } 165 }); 166 167 $('select.my-select').each(function (event) { 168 $(this).hide(); 169 var $self = $(this); 170 var spselect = '<div class="my-select">'; 171 spselect += '<div class="my-select-result">'; 172 spselect += '<span class="my-select-text">' + $self.find('option:selected').text() + '</span>'; 173 spselect += ' <i class="fa fa-caret-down"></i>'; 174 spselect += '</div>'; 175 spselect += '<ul class="my-select-dropdown">'; 176 177 $self.children().each(function (event) { 178 if ($self.val() == $(this).val()) { 179 spselect += '<li class="active" data-val="' + $(this).val() + '">' + $(this).text() + '</li>'; 180 } else { 181 spselect += '<li data-val="' + $(this).val() + '">' + $(this).text() + '</li>'; 182 } 183 }); 184 185 spselect += '</ul>'; 186 spselect += '</div>'; 187 $(this).after($(spselect)); 188 }); 189 190 $(document).on('click', '.my-select', function (event) { 191 $('.my-select').not(this).find('ul').slideUp(); 192 $(this).find('ul').slideToggle(); 193 }); 194 195 $(document).on('click', '.my-select ul li', function (event) { 196 var $select = $(this).closest('.my-select').prev('select'); 197 $(this).parent().prev('.my-select-result').find('span').html($(this).text()); 198 $(this).parent().find('.active').removeClass('active'); 199 $(this).addClass('active'); 200 $select.val($(this).data('val')); 201 $select.change(); 202 }); 203 } 204 // End Select 205});
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.