PageSourceSearch

https://thepointofsale.com/plugins/embed.js?footer=false&ping=false

js thepointofsale.com collected 2026-09-24 08:51:49 UTC 10,991 bytes, 353 lines download raw bytes

1var tpos = {domain: 'thepointofsale.com', embedded: false, events: {close: document.createEvent('Event'), items: document.createEvent('Event'), open: document.createEvent('Event'), signin: document.createEvent('Event'), signout: document.createEvent('Event')}, items: 0, locale: {"ticket":"ticket","tickets":"tickets"}, user: {}};
2function cartSuccess() { parent.window.postMessage({ trigger: 'tpos:confirmation' }, '*');  }
3tpos.events.close.initEvent('tpos:close', true, true);
4tpos.events.items.initEvent('tpos:update', true, true);
5tpos.events.open.initEvent('tpos:open', true, true);
6tpos.events.signin.initEvent('tpos:user:signin', true, true);
7tpos.events.signout.initEvent('tpos:user:signout', true, true);
8
9if (!location.origin) location.origin = location.protocol+'//'+location.hostname+(location.port?':'+location.port:'');
10tpos_init();
11
12function tpos_add(e) {
13	var query = tpos_data_query();
14	if (e.hasAttribute('data-tpos-lang')) {
15		query.lang = e.getAttribute('data-tpos-lang');
16	}
17	if (e.hasAttribute('data-tpos-color')) {
18		query.color = e.getAttribute('data-tpos-color');
19	}
20	if (e.hasAttribute('data-tpos-scheme')) {
21		query.scheme = e.getAttribute('data-tpos-scheme');
22	}
23	if (e.hasAttribute('data-tpos-group')) {
24		query.group = e.getAttribute('data-tpos-group');
25		if (e.hasAttribute('data-tpos-group-date')) {
26			query.date = e.getAttribute('data-tpos-group-date');
27		}
28		if (e.hasAttribute('data-tpos-group-display')) {
29			query.display = e.getAttribute('data-tpos-group-display');
30		}
31	} else {
32		if (e.hasAttribute('data-tpos-event')) query.event = e.getAttribute('data-tpos-event');
33		if (e.hasAttribute('data-tpos-token')) query.token = e.getAttribute('data-tpos-token');
34		if (e.hasAttribute('data-tpos-rates')) query.rates = e.getAttribute('data-tpos-rates');
35	}
36	if (tpos.embedded) {
37		browseTo('/plugins/embed/redirect?'+tpos_params(query));
38	} else {
39		tpos_dialog('https://'+tpos.domain+'/plugins/embed/redirect?'+tpos_params(query));
40	}
41}
42
43function tpos_add_class(e,c) {
44	if (e.classList) {
45		e.classList.add(c);
46	} else {
47		var classes = e.className.split(' ');
48		if (classes.indexOf(c) === -1) e.className += ' '+c;
49	}
50}
51
52function tpos_append(p,n,a,h) {
53	var e = document.createElement(n);
54	if (a) {
55		for (var x in a) {
56			e[x] = a[x];
57		}
58	}
59	if (h) e.innerHTML = h;
60	p.appendChild(e);
61}
62
63function tpos_cart() {
64	var query = tpos_data_query();
65	tpos_dialog('https://'+tpos.domain+'/cart?'+tpos_params(query));
66}
67
68function tpos_closest_class(e,c) {
69	while (e != null && e != document) {
70		if (e.classList) {
71			if (e.classList.contains(c)) return e;
72		} else {
73			var classes = e.className.split(' ');
74			if (classes.indexOf(c) === -1) return e;
75		}
76		e = e.parentNode;
77	}
78	return false;
79}
80
81function tpos_data_delete(k) {
82	var data = tpos_data_get();
83	if (typeof data[k] != 'undefined') {
84		delete data[k];
85	}
86	if (typeof localStorage == 'object' && localStorage !== null) {
87		localStorage.tpos = JSON.stringify(data);
88	}
89}
90
91function tpos_data_get(n) {
92	if (typeof localStorage == 'object' && localStorage !== null && typeof localStorage.tpos == 'string') {
93		var data = JSON.parse(localStorage.tpos);
94		if (typeof data == 'object' && data !== null) return n ? (typeof data[n] != 'undefined' ? data[n] : null) : data;
95	}
96	return n ? null : {};
97}
98
99function tpos_data_query() {
100	var query = tpos_data_get();
101	query.iframe = 'tpos-window';
102	query.embed = 1;
103	query.modal = 1;
104	query.origin = location.origin;
105	query.path = location.pathname+location.search;
106	query.lang = 'en';
107	query.release = '6aad4433';
108	return query;
109}
110
111function tpos_data_set(o) {
112	var data = tpos_data_get();
113	for (var x in o) {
114		data[x] = o[x];
115	}
116	if (typeof localStorage == 'object' && localStorage !== null) {
117		localStorage.tpos = JSON.stringify(data);
118	}
119}
120
121function tpos_dialog(u) {
122	if (tpos_get_element('tpos-layer')) tpos_remove(tpos_get_element('tpos-layer'));
123	tpos_append(document.body,'div',{id:"tpos-layer",className:"tpos-scheme-light"},'<div id="tpos-dialog" class="tpos-loading" data-max-height="200"><iframe id="tpos-window" src="'+u+'" frameborder="0" allowfullscreen></iframe></div>');
124	tpos_fade_in(tpos_get_element('tpos-layer'),'block');
125	tpos_add_class(document.getElementsByTagName('BODY')[0],'tpos-dialog-open');
126	window.dispatchEvent(tpos.events.open);
127}
128
129function tpos_dialog_close() {
130	tpos_remove_class(document.getElementsByTagName('BODY')[0],'tpos-dialog-open');
131	tpos_fade_out(tpos_get_element('tpos-layer'));
132	window.dispatchEvent(tpos.events.close);
133	return;
134}
135
136function tpos_dialog_resize(h) {
137	var dialog = tpos_get_element('tpos-dialog');
138	if (!dialog) return;
139	var v = window.innerHeight;
140	if (typeof h == 'number') {
141		dialog.setAttribute('data-max-height',h);
142	}
143	if (typeof h != 'number') {
144		h = dialog.getAttribute('data-max-height');
145	}
146	h = Math.min(h,v-100);
147	tpos_set_dialog_height(dialog, h);
148}
149
150function tpos_fade_in(e, display) {
151	e.style.opacity = 0;
152	e.style.display = display || "block";
153	(function tpos_fade() {
154		var val = parseFloat(e.style.opacity);
155		if (!((val += .1) > 1)) {
156			e.style.opacity = val;
157			requestAnimationFrame(tpos_fade);
158		}
159	})();
160}
161
162function tpos_fade_out(e) {
163	e.style.opacity = 1;
164	var tpos_fade_out_interval = setInterval(tpos_fade_out_anim, 10, e);
165	function tpos_fade_out_anim(e) {
166		if (Math.round(e.style.opacity*10) > 1) {
167			e.style.opacity -= .1;
168		} else {
169			tpos_fade_out_anim_stop();
170			return;
171		}
172	}
173	function tpos_fade_out_anim_stop() {
174		clearInterval(tpos_fade_out_interval);
175		tpos_remove(tpos_get_element('tpos-layer'));
176		return;
177	}
178}
179
180function tpos_get_element(e) {
181	if (document.getElementById(e) != null) {
182		return document.getElementById(e);
183	} else {
184		return null;
185	}
186}
187
188function tpos_init() {
189	tpos.items = tpos_data_get('items');
190	tpos.embedded = tpos.domain == location.hostname && (' ' + document.documentElement.className + ' ').indexOf(' embed ') > -1;
191	tpos_append(document.getElementsByTagName('head')[0],'link',{rel:"stylesheet",href:"https://cdn.thepointofsale.com/releases/6aad4433/plugins/embed/embed.css"});
192	tpos_data_set({"session":"69qt3nsjm2ke04rnk70ln3fb9q"});
193	if (document.referrer && (document.referrer.indexOf(location.origin) == -1)) {
194		tpos_data_set({"ref":document.referrer});
195	}
196	if (window.addEventListener) {
197		window.addEventListener('message',tpos_message_handler);
198		window.addEventListener('resize',tpos_dialog_resize);
199		window.addEventListener('click',function(e){var tpos_btn=tpos_closest_class(e.target,'tpos-add-to-cart');if(tpos_btn){tpos_add(tpos_btn);e.preventDefault();}});
200	} else if (window.attachEvent) {
201		window.attachEvent('onmessage',tpos_message_handler);
202		window.attachEvent('onresize',tpos_dialog_resize);
203		window.attachEvent('onclick',function(e){var tpos_btn=tpos_closest_class(e.target,'tpos-add-to-cart');if(tpos_btn){tpos_add(tpos_btn);e.preventDefault();}});
204	}
205}
206
207function tpos_items(n) {
208	if (tpos.items != n) {
209		tpos.items = n;
210		tpos_data_set({"items":tpos.items});
211		window.dispatchEvent(tpos.events.items);
212	}
213}
214
215function tpos_message_handler(e) {
216	if (e.origin == 'https://'+tpos.domain) {
217		var msg = e.data;
218		if (typeof msg == 'string') msg = JSON.parse(msg);
219		if (typeof msg.subject != 'undefined') {
220			switch (msg.subject) {
221				case 'close':
222					tpos_dialog_close();
223					break;
224				case 'items':
225					tpos_items(msg.items);
226					break;
227				case 'redirect':
228					if (msg.url) location = msg.url;
229					break;
230				case 'resize':
231					tpos_dialog_resize(msg.height);
232					break;
233				case 'session':
234					tpos_post_message(msg.iframe,{subject:'session',id:'69qt3nsjm2ke04rnk70ln3fb9q'});
235					break;
236			}
237		}
238	}
239}
240
241function tpos_oauth(oauth_token,mode) {
242	var query = tpos_data_query();
243	query.oauth_token = oauth_token;
244	if (mode) query.mode = mode;
245	tpos_dialog('https://'+tpos.domain+'/oauth?'+tpos_params(query));
246}
247
248function tpos_params(query) {
249	var params = Object.keys(query).map(function(k) {
250		return encodeURIComponent(k)+'='+encodeURIComponent(query[k])
251	}).join('&');
252	if (typeof ga == 'function' && typeof ga.getAll == 'function') {
253		var trackers = ga.getAll(), linkers = [];
254		for (var x in trackers) {
255			var linker = trackers[x].get('linkerParam');
256			if (linker && linkers.indexOf(linker) == -1) {
257				linkers.push(linker);
258			}
259		}
260		if (linkers.length) {
261			params += '&'+linkers.join('&')
262		}
263	}
264	return params;
265}
266
267var tpos_post_message_strings = false;
268try{window.postMessage({toString:function(){tpos_post_message_strings=true;}},'*');}catch(e){}
269function tpos_post_message(iframe,message) {
270	if (tpos_post_message_strings) message = JSON.stringify(message);
271	document.getElementById(iframe).contentWindow.postMessage(message,'https://'+tpos.domain);
272}
273
274function tpos_remove(e) {
275		if (e && e.parentNode) e.parentNode.removeChild(e);
276}
277
278function tpos_remove_class(e,c) {
279	if (e.classList) {
280		e.classList.remove(c);
281	} else {
282		var classes = e.className.split(' '), index = classes.indexOf(c);
283		if (index > -1) e.className = classes.splice(index, 1).join(' ');
284	}
285}
286
287function tpos_set_dialog_height(e,maxHeight) {
288	var heightStart = e.offsetHeight;
289	var topPosStart = parseInt(e.style.top);
290	var timeStart = Date.now();
291	var timeEnd = timeStart+250;
292	var tpos_set_dialog_height_interval = setInterval(tpos_set_dialog_height_anim,10);
293	function tpos_set_dialog_height_anim() {
294		if (Date.now() >= timeEnd) {
295			e.style.height = maxHeight+'px';
296			tpos_set_dialog_height_anim_stop();
297		} else {
298			var progress = (Date.now()-timeStart)/(timeEnd-timeStart);
299			var height = heightStart+((maxHeight-heightStart)*progress);
300			e.style.height = height+'px';
301		}
302	}
303	function tpos_set_dialog_height_anim_stop() {
304		clearInterval(tpos_set_dialog_height_interval);
305	}
306}
307
308function tpos_slide_down(e) {
309	if (e != null) {
310		var bottomStart = !e.offsetHeight;
311		var timeStart = Date.now();
312		var timeEnd = timeStart+250;
313		var maxBottom = 0;
314		var tpos_slide_down_interval = setInterval(tpos_slide_down_anim,10);
315		function tpos_slide_down_anim() {
316			if (Date.now() >= timeEnd) {
317				e.style.display = 'block';
318				tpos_slide_down_anim_stop();
319			} else {
320				var progress = (Date.now()-timeStart)/(timeEnd-timeStart);
321				var bottomPos = maxBottom-(bottomStart*progress);
322				e.style.bottom = bottomPos+'px';
323			}
324		}
325		 function tpos_slide_down_anim_stop() {
326		 	clearInterval(tpos_slide_down_interval);
327		}
328	}
329}
330
331function tpos_slide_up(e) {
332	if (e != null) {
333		var bottomStart = parseInt(e.style.bottom);
334		var timeStart = Date.now();
335		var timeEnd = timeStart+250;
336		var maxBottom = -(e.offsetHeight);
337		var tpos_slide_up_interval = setInterval(tpos_slide_up_anim,10);
338		function tpos_slide_up_anim() {
339			if (Date.now() >= timeEnd) {
340				e.style.display = 'none';
341				tpos_remove(e);
342				tpos_slide_up_anim_stop();
343			} else {
344				var progress = (Date.now()-timeStart)/(timeEnd-timeStart);
345				var bottomPos = bottomStart+(maxBottom*progress);
346				e.style.bottom = bottomPos+'px';
347			}
348		}
349		function tpos_slide_up_anim_stop() {
350		 	clearInterval(tpos_slide_up_interval);
351		}
352	}
353}

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.