1/** 2 * 3 * -------------------------------------------------------------------- 4 * 5 * Template : Neoton - News Magazine WordPress Theme 6 * Author : backtheme 7 * Author URI : https://backtheme.tech/ 8 * Version : 4.1.1 9 * 10 * -------------------------------------------------------------------- 11 * 12 **/ 13 14(function ($) { 15 "use strict"; 16 // sticky menu 17 var header = $(".menu-sticky"); 18 var win = $(window); 19 20 win.on("scroll", function () { 21 var scroll = win.scrollTop(); 22 if (scroll < 50) { 23 header.removeClass("sticky"); 24 } else { 25 header.addClass("sticky"); 26 } 27 }); 28 29 $(".widget_nav_menu li a") 30 .filter(function () { 31 return $.trim($(this).html()) == ""; 32 }) 33 .hide(); 34 35 // Slider init 36 $(".back-slider-carousel").slick({ 37 centerPadding: "0px", 38 slidesToShow: 1, 39 slidesToScroll: 1, 40 adaptiveHeight: true, 41 }); 42 43 $(".back__topber__slider").slick({ 44 dots: false, 45 infinite: true, 46 speed: 500, 47 slidesToShow: 1, 48 slidesToScroll: 1, 49 vertical: true, 50 verticalSwiping: true, 51 autoplay: true, 52 autoplaySpeed: 2000, 53 arrows: false, 54 responsive: [ 55 { 56 breakpoint: 600, 57 settings: { 58 slidesToShow: 1, 59 slidesToScroll: 1, 60 }, 61 }, 62 { 63 breakpoint: 400, 64 settings: { 65 arrows: false, 66 slidesToShow: 1, 67 slidesToScroll: 1, 68 }, 69 }, 70 ], 71 }); 72 73 $(".back__related_post").slick({ 74 dots: false, 75 infinite: true, 76 speed: 500, 77 slidesToShow: 3, 78 slidesToScroll: 1, 79 autoplay: true, 80 autoplaySpeed: 2000, 81 arrows: false, 82 responsive: [ 83 { 84 breakpoint: 600, 85 settings: { 86 slidesToShow: 2, 87 slidesToScroll: 1, 88 }, 89 }, 90 { 91 breakpoint: 400, 92 settings: { 93 arrows: false, 94 slidesToShow: 1, 95 slidesToScroll: 1, 96 }, 97 }, 98 ], 99 }); 100 // collapse hidden 101 $(function () { 102 var navMain = $(".navbar-collapse"); // avoid dependency on #id 103 // when you have dropdown inside navbar 104 navMain.on("click", "a:not([data-toggle])", null, function () { 105 navMain.collapse("hide"); 106 }); 107 }); 108 109 // video 110 if ($(".player").length) { 111 $(".player").YTPlayer(); 112 } 113 114 $(".menu-area .navbar ul > li.menu-item-has-children").hover( 115 function () { 116 $(this).addClass("back-min"); 117 }, 118 function () { 119 $(this).removeClass("back-min"); 120 } 121 ); 122 123 $(".showcase-item").hover(function () { 124 $(this).toggleClass("hover"); 125 }); 126 127 //Dark & Light jQuery 128 129 var back_light = $(".back-dark-light"); 130 if (back_light.length) { 131 var toggle = document.getElementById("back-data-toggle"); 132 var storedTheme = 133 localStorage.getItem("theme") || 134 (window.matchMedia("(prefers-color-scheme: dark)").matches 135 ? "dark" 136 : "light"); 137 if (storedTheme) 138 document.documentElement.setAttribute("data-theme", storedTheme); 139 toggle.onclick = function () { 140 var currentTheme = document.documentElement.getAttribute("data-theme"); 141 var targetTheme = "light"; 142 143 if (currentTheme === "light") { 144 targetTheme = "dark"; 145 } 146 document.documentElement.setAttribute("data-theme", targetTheme); 147 localStorage.setItem("theme", targetTheme); 148 }; 149 } 150 151 //search 152 153 $(".sticky_search").on("click", function (event) { 154 $(".sticky_form").slideToggle("show"); 155 $(".sticky_form input").focus(); 156 }); 157 158 $(".sticky_search").on("click", function () { 159 $("body").removeClass("search-active").removeClass("search-close"); 160 if ($(this).hasClass("close-full")) { 161 $("body").addClass("search-close"); 162 } else { 163 $("body").addClass("search-active"); 164 } 165 return false; 166 }); 167 168 $(".sticky_form_search").on("click", function () { 169 $("body, html") 170 .removeClass("back-search-active") 171 .removeClass("back-search-close"); 172 if ($(this).hasClass("close-search")) { 173 $("body, html").addClass("back-search-close"); 174 } else { 175 $("body, html").addClass("back-search-active"); 176 } 177 return false;
178 }); 179 180 $("#back-header ul > li.classic").hover( 181 function () { 182 $("body").addClass("mega-classic"); 183 }, 184 function () { 185 $("body.mega-classic").removeClass("mega-classic"); 186 } 187 ); 188 189 $(document).ready(function () { 190 function resizeNav() { 191 $(".back-menu-ofcanvas").css({ height: window.innerHeight }); 192 var radius = Math.sqrt( 193 Math.pow(window.innerHeight, 2) + Math.pow(window.innerWidth, 2) 194 ); 195 var diameter = radius * 2; 196 $(".off-nav-layer").width(diameter); 197 $(".off-nav-layer").height(diameter); 198 $(".off-nav-layer").css({ 199 "margin-top": -radius, 200 "margin-left": -radius, 201 }); 202 } 203 $(".menu-button, .close-button, .offwrap, .back-offcanvas").on( 204 "click", 205 function () { 206 $(".nav-toggle, .back-menu-ofcanvas, .close-button, body").toggleClass( 207 "back-offcanvas-open" 208 ); 209 } 210 ); 211 $(window).resize(resizeNav); 212 resizeNav(); 213 }); 214 215 $(".menu li a").on("click", function () { 216 $(".back-nav-container").removeClass("nav-active-menu-container"); 217 }); 218 219 $(".menu li a").on("click", function () { 220 $(".back-menu-wrap-offcanvas").removeClass("back-offcanvas-open"); 221 $("body").removeClass("back-offcanvas-open"); 222 }); 223 224 $(function () { 225 $("ul.children").addClass("sub-menu"); 226 }); 227 228 $(".back-products-grid .product-btn .button").addClass( 229 "glyph-icon flaticon-shopping-bag" 230 ); 231 232 //Videos popup jQuery activation code 233 if ($(".popup-videos").length) { 234 $(".popup-videos").magnificPopup({ 235 disableOn: 10, 236 type: "iframe", 237 mainClass: "mfp-fade", 238 removalDelay: 160, 239 preloader: false, 240 fixedContentPos: false, 241 }); 242 } 243 244 // collapse hidden 245 $(function () { 246 var navMain = $(".navbar-collapse"); // avoid dependency on #id 247 // "a:not([data-toggle])" - to avoid issues caused 248 // when you have dropdown inside navbar 249 navMain.on("click", "a:not([data-toggle])", null, function () { 250 navMain.collapse("hide"); 251 }); 252 }); 253 254 //CountDown Timer 255 var CountTimer = $(".CountDownTimer"); 256 if (CountTimer.length) { 257 $(".CountDownTimer").TimeCircles({ 258 fg_width: 0.03, 259 bg_width: 0.8, 260 circle_bg_color: "#ffffff", 261 circle_fg_color: "#ffffff", 262 time: { 263 Days: { 264 text: countdown_data.day_text, 265 color: "#fff", 266 }, 267 Hours: { 268 text: countdown_data.hour_text, 269 color: "#fff", 270 }, 271 Minutes: { 272 text: countdown_data.sec_text, 273 color: "#fff", 274 }, 275 Seconds: { 276 text: countdown_data.min_text, 277 color: "#fff", 278 }, 279 }, 280 }); 281 } 282 283 //Select box wrap css 284 $(".mptt-shortcode-wrapper .mptt-navigation-select").wrap( 285 "<div class='mptt-select'></div>" 286 ); 287 $(".menu-area .navbar ul > li.mega > ul.sub-menu").wrapInner( 288 "<div class='container flex-mega'></div>" 289 ); 290 $(".menu-area .navbar ul > li.mega > ul.sub-menu li") 291 .first() 292 .addClass("first-li-item"); 293 294 if ($("div").hasClass("openingfoot")) { 295 $("body").addClass("openingfootwrap"); 296 } 297 298 if ($("div").hasClass("menu-sticky")) { 299 $("body").addClass("back-on-sticky"); 300 } 301 302 // Sticky Sidebar 303 if ($(".sticky-sidebar").length) { 304 $(".contents-sticky, .sticky-sidebar").theiaStickySidebar({ 305 additionalMarginTop: 160, 306 additionalMarginBottom: 20, 307 }); 308 } 309 310 if ($(".back__scroll__yes").length) { 311 $(".back__scroll__yes").niceScroll(".back__scroll__yes .row", { 312 boxzoom: true, 313 cursorcolor: "#0088CB", 314 cursoropacitymax: 4, 315 cursorwidth: "4px", 316 cursorborder: "4px solid #0088CB", 317 cursorborderradius: "4px", 318 }); 319 } 320 321 //preloader 322 $(window).on("load", function () { 323 $("#back__preloader").delay(400).fadeOut(200); 324 }); 325 326 // scrollTop init 327 var win = $(window); 328 var totop = $("#scrollUp"); 329 win.on("scroll", function () { 330 if (win.scrollTop() > 150) { 331 totop.fadeIn(); 332 } else { 333 totop.fadeOut(); 334 } 335 }); 336 totop.on("click", function () { 337 $("html,body").animate( 338 { 339 scrollTop: 0, 340 }, 341 500 342 ); 343 }); 344 345 $(function () { 346 $("ul.children").addClass("sub-menu"); 347 }); 348 349 $(".comment-body, .comment-respond").wrap("<div class='comment-full'></div>"); 350 $(".back-heading .description p:empty").remove(); 351 352 //woocommerce quantity style 353 if (!String.prototype.getDecimals) { 354 String.prototype.getDecimals = function () { 355 var num = this, 356 match = ("" + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); 357 if (!match) { 358 return 0; 359 } 360 return Math.max( 361 0, 362 (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0) 363 ); 364 }; 365 } 366 // Quantity "plus" and "minus" buttons 367 $(document.body).on("click", ".plus, .minus", function () { 368 var $qty = $(this).closest(".quantity").find(".qty"), 369 currentVal = parseFloat($qty.val()), 370 max = parseFloat($qty.attr("max")), 371 min = parseFloat($qty.attr("min")), 372 step = $qty.attr("step"); 373 374 // Format values 375 if (!currentVal || currentVal === "" || currentVal === "NaN") 376 currentVal = 0; 377 if (max === "" || max === "NaN") max = ""; 378 if (min === "" || min === "NaN") min = 0; 379 if ( 380 step === "any" || 381 step === "" || 382 step === undefined || 383 parseFloat(step) === "NaN" 384 ) 385 step = 1; 386 387 // Change the value 388 if ($(this).is(".plus")) { 389 if (max && currentVal >= max) { 390 $qty.val(max); 391 } else { 392 $qty.val((currentVal + parseFloat(step)).toFixed(step.getDecimals())); 393 } 394 } else { 395 if (min && currentVal <= min) { 396 $qty.val(min); 397 } else if (currentVal > 0) { 398 $qty.val((currentVal - parseFloat(step)).toFixed(step.getDecimals())); 399 } 400 } 401 // Trigger change event 402 $qty.trigger("change"); 403 }); 404})(jQuery);
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.