PageSourceSearch

https://nsng.vinnietortorich.com/wp-content/themes/academy-pro/js/top-banner.js

js vinnietortorich.com collected 2026-09-24 19:07:13 UTC 3,144 bytes, 68 lines download raw bytes

1/* MIT: https://github.com/js-cookie/js-cookie */
2!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f="";for(var s in i)i[s]&&(f+="; "+s,!0!==i[s]&&(f+="="+i[s]));return document.cookie=n+"="+r+f}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u<p.length;u++){var l=p[u].split("="),C=l.slice(1).join("=");'"'===C.charAt(0)&&(C=C.slice(1,-1));try{var g=l[0].replace(d,decodeURIComponent);if(C=o.read?o.read(C,g):o(C,g)||C.replace(d,decodeURIComponent),this.json)try{C=JSON.parse(C)}catch(e){}if(n===g){c=C;break}n||(c[g]=C)}catch(e){}}return c}}return t.set=t,t.get=function(e){return t.call(t,e)},t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))},t.defaults={},t.remove=function(n,o){t(n,"",e(o,{expires:-1}))},t.withConverter=n,t}return n(function(){})});
3
4(function($, Cookies) {
5	var $body = $( 'body' );
6
7	// Alway show top banner in Customizer.
8	$( document ).ready( function() {
9
10		if ( $body.hasClass( 'customizer-preview' ) ) {
11			$body.removeClass( 'top-banner-hidden' );
12			$body.addClass( 'top-banner-visible' );
13			showBanner();
14		}
15
16	});
17
18	// Show if no cookie set.
19	if ( ! Cookies.get( 'top-banner-hidden' ) ) {
20
21		$( document ).ready( function() {
22
23			// Replace body class.
24			if ( $body.hasClass( 'top-banner-hidden' ) ) {
25				$body.removeClass( 'top-banner-hidden' );
26				$body.addClass( 'top-banner-visible' );
27			}
28
29			// Show banner.
30			showBanner();
31
32			// Set cookie when closing.
33			closeBanner();
34		});
35	}
36
37	function showBanner() {
38		$( '.academy-top-banner' ).fadeIn(function() {
39			$(this).children('#academy-top-banner-close').animate({
40				opacity: 1
41			}, 1000);
42
43			bannerheight = $( '.academy-top-banner' ).outerHeight();
44			scrolltop = $( window ).scrollTop();
45
46
47			if( scrolltop > bannerheight ) {
48				$( '.admin-bar' ).css({ "top" : "22px" });
49			}
50
51		});
52	}
53
54	function closeBanner() {
55		$( '#academy-top-banner-close' ).click(function() {
56
57			bannerheight = $( '.academy-top-banner' ).outerHeight();
58
59			$(this).parent().slideUp(function() {
60				$body.removeClass( 'top-banner-visible' );
61				$body.addClass( 'top-banner-hidden' );
62			});
63			Cookies.set( 'top-banner-hidden', 'true', { expires: 7 } );
64
65		});
66	}
67
68})(jQuery, Cookies);

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.