PageSourceSearch

https://unherd.com/wp-content/plugins/coeditor-connector/public/js/coeditor-connector-public.js?ver=1.0.19

js unherd.com collected 2026-09-24 08:28:57 UTC 2,845 bytes, 98 lines download raw bytes

1(function( $ ) {
2	'use strict';
3
4	$(document).ready(function() {
5		// (function(src){
6		// 	var a=document.createElement("script");
7		// 	a.type="text/javascript";
8		// 	a.async=true;
9		// 	a.src=src;
10		// 	var b=document.getElementsByTagName("script")[0];
11		// 	b.parentNode.insertBefore(a,b)
12		// })("https://sandbox.tinypass.com/xbuilder/experience/load?aid=i85i5YZ0su");
13
14		console.log('Start Piano Int Code');
15
16		tp = window.tp || [];
17
18		// Set premium tag when viewing premium posts.
19		if (
20			document.body.classList.contains("post-premium") ||
21			document.querySelector(".post-premium")
22		) {
23			tp.push(["setTags", ["post-premium"]]);
24			console.log('action premium content');
25		}
26
27		// Piano config + single tp.init() run in coeditor-connector-script.js
28
29		//Temp: Specific to Briefing site
30		// if(document.querySelectorAll("#briefingAccount").length > 0){
31		// 	// Add your login/logout UI logic
32		// 	tp.push(["init", function() {
33		// 		var accountContainer = document.getElementById('briefingAccount');
34		// 		if (tp.user.isUserValid()) {
35		// 		// User is logged in => show Logout button
36		// 		accountContainer.innerHTML = '<button id="logoutBtn">Logout</button>';
37		// 		document.getElementById('logoutBtn').addEventListener('click', function() {
38		// 			tp.pianoId.logout();
39		// 			window.location.reload();
40		// 		});
41		// 		} else {
42		// 		// User is not logged in => show Login button
43		// 		accountContainer.innerHTML = '<button id="loginBtn">Login</button>';
44		// 		document.getElementById('loginBtn').addEventListener('click', function() {
45		// 			tp.pianoId.show({ screen: 'login' });
46		// 		});
47		// 		}
48		// 	}]);
49		// }
50
51		console.log('init Piano');
52
53		if (window.tp && typeof tp.experience === 'object' && typeof tp.pianoId === 'object') {
54			console.log('Piano integration loaded.');
55		} else {
56			console.error('Piano integration not loaded properly.');
57		}
58
59		[].forEach.call(document.querySelectorAll('.coeditor-login, .coeditor-login a'), function (el) {
60			el.addEventListener('click', function (evt) {
61				evt.preventDefault();
62				evt.stopPropagation();
63	
64				// Legacy Piano Code
65				// tp.pianoId.show({ screen: 'login' });
66
67				tp.user.showLogin();
68			}, false);
69		});
70	
71		[].forEach.call(document.querySelectorAll('.coeditor-register, .coeditor-register a'), function (el) {
72			el.addEventListener('click', function (evt) {
73				evt.preventDefault();
74				evt.stopPropagation();
75	
76				tp.pianoId.show({
77					screen: 'register',
78					loggedIn: function (data) {
79	
80					}
81				});
82			}, false);
83		});
84	
85		[].forEach.call(document.querySelectorAll('.coeditor-logout, .coeditor-logout a'), function (el) {
86			el.addEventListener('click', function (evt) {
87				evt.preventDefault();
88				evt.stopPropagation();
89	
90				tp.user.logout(function () {
91					location.reload();
92				});
93			});
94		});
95
96	});
97
98})( 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.