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