1/** 2 * @package Helix Ultimate Framework 3 * @author JoomShaper https://www.joomshaper.com 4 * @copyright Copyright (c) 2010 - 2021 JoomShaper 5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later 6 */ 7 8/** 9 * Move the progress bar 10 */ 11function move() { 12 var elem = document.getElementById('line-load'); 13 var width = 1; 14 var id = setInterval(frame, 10); 15 function frame() { 16 if (width >= 100) { 17 clearInterval(id); 18 } else { 19 width++; 20 elem.style.width = width + '%'; 21 } 22 } 23} 24 25jQuery(function ($) { 26 // go to top 27 function ScrollBackTop() { 28 $(window).scroll(function () { 29 ($(this).scrollTop() > 300) ? $('.back__top').addClass('visible'): $('.back__top').removeClass('visible'); 30 }); 31 } 32 ScrollBackTop(); 33 34 //mega menu 35 $('.sp-menu-full').each(function () { 36 $(this).parent().addClass('menu-justify'); 37 }); 38 $(document).on('click', '.offcanvas-inner .uk-nav-parent-icon', function (event) { 39 event.preventDefault(); 40 $(this).closest('.menu-parent').toggleClass('menu-parent-open').find('>.menu-child').slideToggle(400); 41 }); 42 43 // Tooltip 44 const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"], .hasTooltip')); 45 tooltipTriggerList.map(function (tooltipTriggerEl) { 46 return new bootstrap.Tooltip(tooltipTriggerEl,{ 47 html: true 48 }); 49 }); 50 51 // Popover 52 const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"], .hasPopover')); 53 popoverTriggerList.map(function (popoverTriggerEl) { 54 return new bootstrap.Popover(popoverTriggerEl); 55 }); 56 57 // Article Ajax voting 58 $('.article-ratings .rating-star').on('click', function (event) { 59 event.preventDefault(); 60 var $parent = $(this).closest('.article-ratings'); 61 62 var request = { 63 option: 'com_ajax', 64 template: template, 65 action: 'rating', 66 rating: $(this).data('number'), 67 article_id: $parent.data('id'), 68 format: 'json', 69 }; 70 71 $.ajax({ 72 type: 'POST', 73 data: request, 74 beforeSend: function () { 75 $parent.find('.fa-spinner').show(); 76 }, 77 success: function (response) { 78 var data = $.parseJSON(response); 79 $parent.find('.ratings-count').text(data.message); 80 $parent.find('.fa-spinner').hide(); 81 82 if (data.status) { 83 $parent.find('.rating-symbol').html(data.ratings); 84 } 85 86 setTimeout(function () { 87 $parent.find('.ratings-count').text('(' + data.rating_count + ')'); 88 }, 3000); 89 }, 90 }); 91 }); 92 // Search modal focus 93 $('.tm-header .uk-search-toggle').on('click', function (event) { 94 event.preventDefault(); 95 $('.modal-finder .uk-search-input').prop('autofocus', true); 96 }); 97 // Cookie consent 98 $('.js-accept').on('click', function (event) { 99 event.preventDefault(); 100 101 var date = new Date(); 102 date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000)); 103 var expires = "; expires=" + date.toGMTString(); 104 document.cookie = "cookieAllowed=true" + expires + "; path=/"; 105 }); 106 107 $('.btn-group label:not(.active)').click(function () { 108 var label = $(this); 109 var input = $('#' + label.attr('for')); 110 111 if (!input.prop('checked')) { 112 label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); 113 if (input.val() === '') { 114 label.addClass('active btn-primary'); 115 } else if (input.val() == 0) { 116 label.addClass('active btn-danger'); 117 } else { 118 label.addClass('active btn-success'); 119 } 120 input.prop('checked', true); 121 input.trigger('change'); 122 } 123 var parent = $(this).parents('#attrib-helix_ultimate_blog_options'); 124 if (parent) { 125 showCategoryItems(parent, input.val()); 126 } 127 }); 128 $('.btn-group input[checked=checked]').each(function () { 129 if ($(this).val() == '') { 130 $('label[for=' + $(this).attr('id') + ']').addClass('active btn btn-primary'); 131 } else if ($(this).val() == 0) { 132 $('label[for=' + $(this).attr('id') + ']').addClass('active btn btn-danger'); 133 } else { 134 $('label[for=' + $(this).attr('id') + ']').addClass('active btn btn-success'); 135 } 136 var parent = $(this).parents('#attrib-helix_ultimate_blog_options'); 137 if (parent) { 138 parent.find('*[data-showon]').each(function () { 139 $(this).hide(); 140 }); 141 } 142 }); 143 144 function showCategoryItems(parent, value) { 145 var controlGroup = parent.find('*[data-showon]'); 146 147 controlGroup.each(function () { 148 var data = $(this).attr('data-showon'); 149 data = typeof data !== 'undefined' ? JSON.parse(data) : []; 150 if (data.length > 0) { 151 if (typeof data[0].values !== 'undefined' && data[0].values.includes(value)) { 152 $(this).slideDown(); 153 } else { 154 $(this).hide(); 155 } 156 } 157 }); 158 } 159 160 $(window).on('scroll', function () { 161 var scrollBar = $('.sp-reading-progress-bar'); 162 if (scrollBar.length > 0) { 163 var s = $(window).scrollTop(), 164 d = $(document).height(), 165 c = $(window).height(); 166 var scrollPercent = (s / (d - c)) * 100; 167 const position = scrollBar.data('position'); 168 scrollBar.css({ width: `${scrollPercent}%` }); 169 } 170 }); 171});
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.