PageSourceSearch

https://kansaswritingworkshop.com/_static/??-eJx1zUEOgzAMBMAPNViVE…TgC09qOfoaGXy+RcesSSeu/0vP+GKd+6odhPACzfkDh

js kansaswritingworkshop.com collected 2026-09-26 18:54:53 UTC 10,320 bytes, 148 lines download raw bytes

1/* global subscriptionData */
2document.addEventListener( 'DOMContentLoaded', function () {
3	const modal = document.getElementsByClassName( 'jetpack-subscription-modal' )[ 0 ];
4
5	if ( ! modal ) {
6		return;
7	}
8
9	const close = document.getElementsByClassName( 'jetpack-subscription-modal__close' )[ 0 ];
10
11	let redirectUrl = '';
12	let hasLoaded = false;
13
14	function reloadOnCloseSubscriptionModal( customUrl ) {
15		const destinationUrl = customUrl ? new URL( customUrl ) : new URL( redirectUrl );
16
17		// Prevent redirect to external sites.
18		if ( destinationUrl.hostname !== window.location.hostname ) {
19			return;
20		}
21
22		try {
23			localStorage.setItem(
24				'jetpack-subscription-modal-on-comment-scroll-to',
25				destinationUrl.hash
26			);
27		} catch {
28			// Ok if we can't set it.
29		}
30
31		// Add cache-busting parameter
32		destinationUrl.searchParams.set( '_ctn', Date.now() );
33		window.location.href = destinationUrl.toString();
34	}
35
36	function JetpackSubscriptionModalOnCommentMessageListener( event ) {
37		let message = event && event.data;
38		if ( typeof message === 'string' ) {
39			try {
40				message = JSON.parse( message );
41			} catch {
42				return;
43			}
44		}
45
46		const type = message && message.type;
47		const data = message && message.data;
48
49		if ( type !== 'subscriptionModalShow' || typeof data.url === 'undefined' ) {
50			return;
51		}
52
53		if ( subscriptionData.homeUrl !== event.origin ) {
54			return;
55		}
56
57		if ( data.email ) {
58			const emailInput = document.querySelector(
59				'.jetpack-subscription-modal__modal-content input[type="email"]'
60			);
61			if ( ! emailInput ) {
62				reloadOnCloseSubscriptionModal( data.url );
63				return;
64			}
65
66			const appSource = document.querySelector(
67				'.jetpack-subscription-modal__modal-content input[name="app_source"]'
68			);
69			if ( ! appSource ) {
70				reloadOnCloseSubscriptionModal( data.url );
71				return;
72			}
73
74			emailInput.value = data.email;
75			if ( data.is_logged_in ) {
76				emailInput.setAttribute( 'readonly', 'readonly' );
77				appSource.value = 'atomic-subscription-modal-li';
78			}
79		}
80
81		if ( ! hasLoaded ) {
82			try {
83				const storedCount = parseInt(
84					sessionStorage.getItem( 'jetpack-subscription-modal-shown-count' )
85				);
86				const showCount = ( isNaN( storedCount ) ? 0 : storedCount ) + 1;
87				sessionStorage.setItem( 'jetpack-subscription-modal-shown-count', showCount );
88
89				if ( showCount > 5 ) {
90					new Image().src =
91						document.location.protocol +
92						'//pixel.wp.com/g.gif?v=wpcom-no-pv&x_jetpack-subscribe-modal-comm=hidden_views_limit&r=' +
93						Math.random();
94
95					reloadOnCloseSubscriptionModal( data.url );
96					return;
97				}
98			} catch {
99				// Ignore any errors.
100			}
101
102			new Image().src =
103				document.location.protocol +
104				'//pixel.wp.com/g.gif?v=wpcom-no-pv&x_jetpack-subscribe-modal-comm=showed&r=' +
105				Math.random();
106
107			modal.classList.toggle( 'open' );
108			hasLoaded = true;
109			redirectUrl = data.url;
110		}
111	}
112
113	window.addEventListener( 'message', JetpackSubscriptionModalOnCommentMessageListener );
114
115	if ( close ) {
116		close.onclick = function ( event ) {
117			event.preventDefault();
118			modal.classList.toggle( 'open' );
119			reloadOnCloseSubscriptionModal();
120		};
121	}
122
123	window.onclick = function ( event ) {
124		if ( event.target === modal ) {
125			modal.style.display = 'none';
126			reloadOnCloseSubscriptionModal();
127		}
128	};
129
130	window.addEventListener( 'load', () => {
131		// Scroll to the last comment.
132		const subscriptionScroll = localStorage.getItem(
133			'jetpack-subscription-modal-on-comment-scroll-to'
134		);
135
136		if ( subscriptionScroll ) {
137			window.location.hash = subscriptionScroll;
138			localStorage.removeItem( 'jetpack-subscription-modal-on-comment-scroll-to' );
139
140			const comment = document.querySelector( subscriptionScroll );
141			if ( comment ) {
142				comment.scrollIntoView( { block: 'center', behavior: 'smooth' } );
143			}
144		}
145	} );
146} );
147;
148(()=>{var e=[],t=!1,n=2e3,i=[],o=new Promise(e=>{"loading"!==document.readyState?e():window.addEventListener("DOMContentLoaded",()=>e())});function s(e,t){if("string"==typeof e)try{e=JSON.parse(e)}catch{return}if(t&&"function"==typeof t.postMessage)try{t.postMessage(JSON.stringify({type:"likesMessage",data:e}),"*")}catch{}}function r(){const t=[];document.querySelectorAll("div.jetpack-likes-widget-unloaded").forEach(n=>{if(!(e.indexOf(n.id)>-1)&&d(n)){e.push(n.id);var i,o=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(n.id);o&&5===o.length&&(i={blog_id:o[2],width:n.width},"post"===o[1]?i.post_id=o[3]:"comment"===o[1]&&(i.comment_id=o[3]),i.obj_id=o[4],t.push(i))}}),t.length>0&&s({event:"initialBatch",requests:t},window.frames["likes-master"])}function a(){const e=document.querySelector("#likes-other-gravatars");if(e){e.style.display="none",e.setAttribute("aria-hidden","true");const t=e.__resizeHandler;t&&(window.removeEventListener("resize",t),delete e.__resizeHandler)}}function l(){var e;if(!t)return s({event:"queryMasterReady"},window.frames["likes-master"]),void setTimeout(l,500);!function(){for(let e=i.length-1;e>=0;e--){const t=i[e];if(!d(t)){const n=t&&t.parentElement&&t.parentElement.parentElement;n.classList.remove("jetpack-likes-widget-loaded"),n.classList.remove("jetpack-likes-widget-loading"),n.classList.add("jetpack-likes-widget-unloaded");const o=n.querySelector(".likes-widget-placeholder");o&&(o.style.display=""),i.splice(e,1),t.remove()}}}(),function(){if(!g)return;document.querySelectorAll("div.jetpack-likes-widget-unloaded").forEach(e
148=>g.observe(e))}();var n=[...document.querySelectorAll("div.jetpack-likes-widget-unloaded")].filter(e=>d(e));n.length>0&&r();for(var o=0,a=n.length;o<=a-1;o++)(e=n[o].id)&&c(e)}function c(e){if(void 0===e)return;const t=document.querySelector("#"+e);t.querySelectorAll("iframe").forEach(e=>e.remove());const n=t.querySelector(".likes-widget-placeholder");if(n&&n.classList.contains("post-likes-widget-placeholder")){const e=document.createElement("iframe");e.classList.add("post-likes-widget","jetpack-likes-widget"),e.name=t.dataset.name,e.src=t.dataset.src,e.height="55px",e.width="100%",e.frameBorder="0",e.scrolling="no",e.title=t.dataset.title,n.after(e)}if(n.classList.contains("comment-likes-widget-placeholder")){const e=document.createElement("iframe");e.class="comment-likes-widget-frame jetpack-likes-widget-frame",e.name=t.dataset.name,e.src=t.dataset.src,e.height="18px",e.width="100%",e.frameBorder="0",e.scrolling="no",t.querySelector(".comment-like-feedback").after(e),i.push(e)}t.classList.remove("jetpack-likes-widget-unloaded"),t.classList.add("jetpack-likes-widget-loading"),t.querySelector("iframe").addEventListener("load",e=>{t.contains(e.target)&&(s({event:"loadLikeWidget",name:e.target.name,width:e.target.width},window.frames["likes-master"]),n&&(n.style.display="none"),t.classList.remove("jetpack-likes-widget-loading"),t.classList.add("jetpack-likes-widget-loaded"))})}function d(e){const t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t+n>=0&&i<=window.innerHeight+n}window.addEventListener("message",function(e){let n=e&&e.data;if("string"==typeof n)try{n=JSON.parse(n)}catch{return}const i=n&&n.type,l=n&&n.data;if("likesMessage"!==i||void 0===l.event)return;if("https://widgets.wp.com"===e.origin)switch(l.event){case"masterReady":o.then(()=>{t=!0;const e={event:"injectStyles"},n=document.querySelector(".sd-text-color"),i=document.querySelector(".sd-link-color"),o=n&&getComputedStyle(n)||{},a=i&&getComputedStyle(i)||{};document.body.classList.contains("single")&&s({event:"reblogsEnabled"},window.frames["likes-master"]),e.textStyles={color:o.color,fontFamily:o["font-family"],fontSize:o["font-size"],direction:o.direction,fontWeight:o["font-weight"],fontStyle:o["font-style"],textDecoration:o["text-decoration"]},e.linkStyles={color:a.color,fontFamily:a["font-family"],fontSize:a["font-size"],textDecoration:a["text-decoration"],fontWeight:a["font-weight"],fontStyle:a["font-style"]},s(e,window.frames["likes-master"]),r()});break;case"showLikeWidget":case"showCommentLikeWidget":break;case"killCommentLikes":document.querySelectorAll(".jetpack-comment-likes-widget-wrapper").forEach(e=>e.remove());break;case"clickReblogFlair":wpcom_reblog&&"function"==typeof wpcom_reblog.toggle_reblog_box_flair&&wpcom_reblog.toggle_reblog_box_flair(l.obj_id);break;case"hideOtherGravatars":a();break;case"showOtherGravatars":{const e=document.querySelector("#likes-other-gravatars");if(!e)break;const t=e.querySelector("ul");e.style.display="none",t.innerHTML="",e.querySelectorAll(".likes-text span").forEach(e=>e.textContent=l.totalLikesLabel),(l.likers||[]).forEach(async(e,n)=>{if("http"!==e.profile_URL.substr(0,4))return;const i=document.createElement("li");t.append(i);const o=encodeURI(e.profile_URL),r=encodeURI(e.avatar_URL);i.innerHTML=`<a href="${o}" rel="nofollow" target="_parent" class="wpl-liker">\n\t\t\t\t\t\t<img src="${r}"\n\t\t\t\t\t\t\talt=""\n\t\t\t\t\t\t\tstyle="width: 28px; height: 28px;" />\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</a>`,i.classList.add(e.css_class),i.querySelector("img").alt=l.avatarAltTitle.replace("%s",e.name),i.querySelector("span").innerText=e.name,n===l.likers.length-1&&i.addEventListener("keydown",e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),a(),s({event:"focusLikesCount",parent:l.parent},window.frames["likes-master"]))})});const n=function(){const t="rtl"===getComputedStyle(e).direction,n=document.querySelector(`*[name='${l.parent}']`),i=n.getBoundingClientRect(),o=n.ownerDocument.defaultView,s=i.top+o.pageYOffset,r=i.left+o.pageXOffset;let a;if(e.style.top=s+l.position.top-1+"px",t){const t=l&&l.likers?Math.min(l.likers.length,5):0;a=r+l.position.left+24*t+4,e.style.transform="translateX(-100%)"}else a=r+l.position.left;e.style.left=a+"px",e.style.left="-9999px",e.style.display="block";const c=e.offsetWidth;a+c>o.innerWidth&&(a=i.right-c),e.style.left=a+"px",e.setAttribute("aria-hidden","false")};n(),e.focus();const i=function(e,t){var n;return function(){var i=this,o=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}},o=i(n,100);e.__resizeHandler=o,window.addEventListener("resize",o),e.focus()}}}),document.addEventListener("click",a);var f,m,u,p=(f=250,m=l,function(){clearTimeout(u),u=setTimeout(m,f)}),g="function"==typeof IntersectionObserver?new IntersectionObserver(p,{rootMargin:"2000px",threshold:[0,1]}):null;l(),window.addEventListener("scroll",p,!0)})();;

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.