PageSourceSearch

https://www.swhd.org/wp-content/themes/onepress-child/assets/theme.js?ver=7.1.2

js swhd.org collected 2026-10-02 04:57:48 UTC 21,390 bytes, 878 lines download raw bytes

1var onepressIsMobile = {
2	Android: function() {
3		return navigator.userAgent.match(/Android/i);
4	},
5	BlackBerry: function() {
6		return navigator.userAgent.match(/BlackBerry/i);
7	},
8	iOS: function() {
9		return navigator.userAgent.match(/iPhone|iPad|iPod/i);
10	},
11	Opera: function() {
12		return navigator.userAgent.match(/Opera Mini/i);
13	},
14	Windows: function() {
15		return navigator.userAgent.match(/IEMobile/i);
16	},
17	any: function() {
18		return (
19			onepressIsMobile.Android() ||
20			onepressIsMobile.BlackBerry() ||
21			onepressIsMobile.iOS() ||
22			onepressIsMobile.Opera() ||
23			onepressIsMobile.Windows()
24		);
25	}
26};
27function setCookie(cname, cvalue, exdays) {
28  const d = new Date();
29  d.setTime(d.getTime() + (exdays*24*60*60*1000));
30  let expires = "expires="+ d.toUTCString();
31  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
32}
33function getCookie(cname) {
34  let name = cname + "=";
35  let decodedCookie = decodeURIComponent(document.cookie);
36  let ca = decodedCookie.split(';');
37  for(let i = 0; i <ca.length; i++) {
38    let c = ca[i];
39    while (c.charAt(0) == ' ') {
40      c = c.substring(1);
41    }
42    if (c.indexOf(name) == 0) {
43      return c.substring(name.length, c.length);
44    }
45  }
46  return "";
47}
48function preload_images(images, complete_callback) {
49	if (onepress_js_settings.hero_disable_preload) {
50		if (complete_callback) {
51			complete_callback();
52		}
53	} else {
54		var id = "_img_loading_" + new Date().getTime();
55		jQuery("body").append('<div id="' + id + '"></div>');
56		jQuery.each(images, function(index, src) {
57			var img = jQuery("<img>");
58			img.attr("alt", "");
59			img.attr("class", "image__preload");
60			img.css("display", "none");
61			img.attr("src", src);
62			jQuery("#" + id).append(img);
63		});
64
65		jQuery("#" + id).imagesLoaded(function() {
66			if (complete_callback) {
67				complete_callback();
68			}
69			setTimeout(function() {
70				jQuery("#" + id).remove();
71			}, 5000);
72		});
73	}
74}
75
76function _to_number(string) {
77	if (typeof string === "number") {
78		return string;
79	}
80	var n = string.match(/\d+$/);
81	if (n) {
82		return parseFloat(n[0]);
83	} else {
84		return 0;
85	}
86}
87
88function _to_bool(v) {
89	if (typeof v === "boolean") {
90		return v;
91	}
92
93	if (typeof v === "number") {
94		return v === 0 ? false : true;
95	}
96
97	if (typeof v === "string") {
98		if (v === "true" || v === "1") {
99			return true;
100		} else {
101			return false;
102		}
103	}
104
105	return false;
106}
107
108/**
109 * skip-link-focus-fix.js
110 *
111 * Helps with accessibility for keyboard only users.
112 *
113 * Learn more: https://github.com/Automattic/OnePress/pull/136
114 */
115(function() {
116	var is_webkit = navigator.userAgent.toLowerCase().indexOf("webkit") > -1,
117		is_opera = navigator.userAgent.toLowerCase().indexOf("opera") > -1,
118		is_ie = navigator.userAgent.toLowerCase().indexOf("msie") > -1;
119
120	if (
121		(is_webkit || is_opera || is_ie) &&
122		document.getElementById &&
123		window.addEventListener
124	) {
125		window.addEventListener(
126			"hashchange",
127			function() {
128				var id = location.hash.substring(1),
129					element;
130
131				if (!/^[A-z0-9_-]+$/.test(id)) {
132					return;
133				}
134
135				element = document.getElementById(id);
136
137				if (element) {
138					if (
139						!/^(?:a|select|input|button|textarea)$/i.test(
140							element.tagName
141						)
142					) {
143						element.tabIndex = -1;
144					}
145
146					element.focus();
147				}
148			},
149			false
150		);
151	}
152})();
153
154(function() {
155	if (onepressIsMobile.any()) {
156		/**
157		 * https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
158		 */
159		// First we get the viewport height and we multiple it by 1% to get a value for a vh unit
160		let vh = window.innerHeight * 0.01;
161		let vw = window.innerWidth * 0.01;
162		// Then we set the value in the --vh, --vw custom property to the root of the document
163		document.documentElement.style.setProperty("--vh", vh + "px");
164		document.documentElement.style.setProperty("--vw", vw + "px");
165		window.addEventListener("resize", function() {
166			let vh = window.innerHeight * 0.01;
167			let vw = window.innerWidth * 0.01;
168			document.documentElement.style.setProperty("--vh", vh + "px");
169			document.documentElement.style.setProperty("--vw", vw + "px");
170		});
171	}
172})();
173
174/**
175 * Sticky header when scroll.
176 */
177jQuery(document).ready(function($) {
178	var $window = $(window);
179	var $document = $(document);
180
181	var getAdminBarHeight = function() {
182		var h = 0;
183		if ($("#wpadminbar").length) {
184			if ($("#wpadminbar").css("position") == "fixed") {
185				h = $("#wpadminbar").height();
186			}
187		}
188		return h;
189	};
190
191	var stickyHeaders = (function() {
192		var $stickies;
193		var lastScrollTop = 0;
194
195		var setData = function(stickies, addWrap) {
196			var top = 0;
197
198			if (typeof addWrap === "undefined") {
199				addWrap = true;
200			}
201			$stickies = stickies.each(function() {
202				var $thisSticky = $(this);
203				var p = $thisSticky.parent();
204				if (!p.hasClass("followWrap")) {
205					if (addWrap) {
206						$thisSticky.wrap('<div class="followWrap" />');
207					}
208				}
209				$thisSticky.parent().removeAttr("style");
210				$('.followWrap').height($('#masthead')[0].offsetHeight);
211			});
212		};
213
214		var load = function(stickies) {
215			if (
216				typeof stickies === "object" &&
217				stickies instanceof jQuery &&
218				stickies.length > 0
219			) {
220				setData(stickies);
221				$window.scroll(function() {
222					_whenScrolling();
223				});
224
225				$window.resize(function() {
226					setData(stickies, false);
227					stickies.each(function() {
228						$(this)
229							.removeClass("fixed")
230							.removeAttr("style");
231					});
232					_whenScrolling();
233				});
234
235				$document.on("hero_ready", function() {
236					$(".followWrap").removeAttr("style");
237					setTimeout(function() {
238						$(".followWrap").removeAttr("style");
239						setData(stickies, false);
240						_whenScrolling();
241					}, 500);
242				});
243			}
244		};
245
246		var _whenScrolling = function() {
247			var top = 0;
248			top = getAdminBarHeight();
249
250			var scrollTop = $window.scrollTop();
251
252			$stickies.each(function(i) {
253				var $thisSticky = $(this),
254					$stickyPosition = $thisSticky.parent().offset().top;
255				if (scrollTop === 0) {
256					$thisSticky.addClass("no-scroll");
257				}
258				if ($stickyPosition - top <= scrollTop) {
259					if (scrollTop > 0) {
260						$thisSticky.removeClass("no-scroll");
261					}
262					$thisSticky.addClass("header-fixed");
263					$thisSticky.css("top", top);
264				} else {
265					$thisSticky
266						.removeClass("header-fixed")
267						.removeAttr("style")
268						.addClass("no-scroll");
269				}
270			});
271		};
272
273		return {
274			load: load
275		};
276	})();
277	stickyHeaders.load($("#masthead.is-sticky"));
278	// When Header Panel rendered by customizer
279	$document.on("header_view_changed", function() {
280		stickyHeaders.load($("#masthead.is-sticky"));
281	});
282
283	/*
284	 * Nav Menu & element actions
285	 *
286	 * Smooth scroll for navigation and other elements
287	 */
288	var mobile_max_width = 1140; // Media max width for mobile
289	var main_navigation = jQuery(".main-navigation .onepress-menu");
290	var stite_header = $(".site-header");
291    var header = document.getElementById("masthead");
292    if ( header ) {
293        var noSticky = header.classList.contains("no-sticky");
294    }
295
296
297	var setNavTop = function() {
298		var offset = header.getBoundingClientRect();
299		var top = offset.x + offset.height - 1;
300		main_navigation.css({
301			top: top
302		});
303	};
304
305	/**
306	 * Get mobile navigation height.
307	 *
308	 * @return number
309	 */
310	var getNavHeight = function(fitWindow) {
311		if (typeof fitWindow === "undefined") {
312			fitWindow = true;
313		}
314		if (fitWindow) {
315			var offset = header.getBoundingClientRect();
316			var h = $(window).height() - (offset.x + offset.height) + 1;
317			return h;
318		} else {
319			main_navigation.css("height", "auto");
320			var navOffset = main_navigation[0].getBoundingClientRect();
321			main_navigation.css("height", 0);
322			return navOffset.height;
323		}
324	};
325
326	/**
327	 * Initialise Menu Toggle
328	 *
329	 * @since 0.0.1
330	 * @since 2.2.1
331	 */
332	$document.on("click", "#nav-toggle", function(event) {
333		event.preventDefault();
334		jQuery("#nav-toggle").toggleClass("nav-is-visible");
335		jQuery(".header-widget").toggleClass("header-widget-mobile");
336		main_navigation.stop();
337		// Open menu mobile.
338		if (!main_navigation.hasClass("onepress-menu-mobile")) {
339			main_navigation.addClass("onepress-menu-mobile");
340			$("body").addClass("onepress-menu-mobile-opening");
341			setNavTop();
342			var h = getNavHeight(!noSticky);
343			if( isNaN( h ) ) { // when IE 11 & Edge return h is NaN.
344				h = $(window).height();
345			}
346			main_navigation.animate(
347				{
348					height: h
349				},
350				300,
351				function() {
352					// Animation complete.
353					if (noSticky) {
354						main_navigation.css({
355							"min-height": h,
356							height: "auto"
357						});
358					}
359				}
360			);
361		} else {
362			main_navigation.css( { height: main_navigation.height(), 'min-height': 0, overflow: 'hidden' } );
363			setTimeout( function(){
364				main_navigation.animate(
365					{
366						height: 0
367					},
368					300,
369					function() {
370						main_navigation.removeAttr("style");
371						main_navigation.removeClass("onepress-menu-mobile");
372						$("body").removeClass("onepress-menu-mobile-opening");
373					}
374				);
375			}, 40 );
376		}
377	});
378
379	/**
380	 * Fix nav height when touch move on mobile.
381	 *
382	 * @since 2.2.1
383	 */
384	if (!noSticky && onepressIsMobile.any()) {
385		$(document).on("scroll", function() {
386			if (main_navigation.hasClass("onepress-menu-mobile")) {
387				var newViewportHeight = Math.max(
388					document.documentElement.clientHeight,
389					window.innerHeight || 0
390				);
391				var offset = header.getBoundingClientRect();
392				var top = offset.x + offset.height - 1;
393				var h = newViewportHeight - top + 1;
394				main_navigation.css({
395					height: h,
396					top: top
397				});
398			}
399		});
400	}
401
402	$(window).resize(function() {
403		if (
404			main_navigation.hasClass("onepress-menu-mobile") &&
405			$(window).width() <= mobile_max_width
406		) {
407			if ( ! noSticky) {
408				main_navigation.css({
409					height: getNavHeight(),
410					overflow: "auto"
411				});
412			}
413		} else {
414			main_navigation.removeAttr("style");
415			main_navigation.removeClass("onepress-menu-mobile");
416			jQuery("#nav-toggle").removeClass("nav-is-visible");
417		}
418	});
419
420	jQuery(
421		".onepress-menu li.menu-item-has-children, .onepress-menu li.page_item_has_children"
422	).each(function() {
423		jQuery(this).prepend(
424			'<div class="nav-toggle-subarrow"><i class="fa fa-angle-down"></i></div>'
425		);
426	});
427
428	$document.on(
429		"click",
430		".nav-toggle-subarrow, .nav-toggle-subarrow .nav-toggle-subarrow",
431		function() {
432			jQuery(this)
433				.parent()
434				.toggleClass("nav-toggle-dropdown");
435		}
436	);
437
438	// Get the header height and wpadminbar height if enable.
439	var h;
440	window.current_nav_item = false;
441	if (onepress_js_settings.onepress_disable_sticky_header != "1") {
442		h = jQuery("#wpadminbar").height() + jQuery(".site-header").height();
443	} else {
444		h = jQuery("#wpadminbar").height();
445	}
446
447	// Navigation click to section.
448	// jQuery('#site-navigation li a[href*="#"]').on("click", function(
449	// 	event
450	// ) {
451  //   if (hash && this.href.slice(0, -hash.length-1) == location.href.slice(0, -location.hash.length-1)) {
452  //     event.preventDefault();
453  // 		// if in mobile mod
454  // 		if (jQuery(".onepress-menu").hasClass("onepress-menu-mobile")) {
455  // 			jQuery("#nav-toggle").trigger("click");
456  // 		}
457  // 		smoothScroll(jQuery(this.hash));
458  //   }
459	// });
460
461	function setNavActive(currentNode) {
462		if (currentNode) {
463			currentNode = currentNode.replace("#", "");
464			if (currentNode)
465				jQuery("#site-navigation li").removeClass(
466					"onepress-current-item"
467				);
468			if (currentNode) {
469				jQuery("#site-navigation li")
470					.find('a[href$="#' + currentNode + '"]')
471					.parent()
472					.addClass("onepress-current-item");
473			}
474		}
475	}
476
477	function inViewPort($element, offset_top) {
478		if (!offset_top) {
479			offset_top = 0;
480		}
481		var view_port_top = jQuery(window).scrollTop();
482		if ($("#wpadminbar").length > 0) {
483			view_port_top -= $("#wpadminbar").outerHeight() - 1;
484			offset_top += $("#wpadminbar").outerHeight() - 1;
485		}
486		var view_port_h = $("body").outerHeight();
487
488		var el_top = $element.offset().top;
489		var eh_h = $element.height();
490		var el_bot = el_top + eh_h;
491		var view_port_bot = view_port_top + view_port_h;
492
493		var all_height = $("body")[0].scrollHeight;
494		var max_top = all_height - view_port_h;
495
496		var in_view_port = false;
497		// If scroll maximum
498		if (view_port_top >= max_top) {
499			if (
500				(el_top < view_port_top && el_top > view_port_bot) ||
501				(el_top > view_port_top && el_bot < view_port_top)
502			) {
503				in_view_port = true;
504			}
505		} else {
506			if (el_top <= view_port_top + offset_top) {
507				//if ( eh_bot > view_port_top &&  eh_bot < view_port_bot ) {
508				if (el_bot > view_port_top) {
509					in_view_port = true;
510				}
511			}
512		}
513		return in_view_port;
514	}
515
516	// Add active class to menu when scroll to active section.
517	var _scroll_top = $window.scrollTop();
518	jQuery(window).scroll(function() {
519		var currentNode = null;
520
521		if (!window.current_nav_item) {
522			var current_top = $window.scrollTop();
523			var adminBarHeight = jQuery("#wpadminbar").length > 0 ? jQuery("#wpadminbar").height() : 0;
524			if (onepress_js_settings.onepress_disable_sticky_header != "1") {
525				h = adminBarHeight + jQuery(".site-header").height();
526			} else {
527				h = adminBarHeight;
528			}
529
530			if (_scroll_top < current_top) {
531				jQuery("section").each(function(index) {
532					var section = jQuery(this);
533					var currentId = section.attr("id") || "";
534
535					var in_vp = inViewPort(section, h + 10);
536					if (in_vp) {
537						currentNode = currentId;
538					}
539				});
540			} else {
541				var ns = jQuery("section").length;
542				for (var i = ns - 1; i >= 0; i--) {
543					var section = jQuery("section").eq(i);
544					var currentId = section.attr("id") || "";
545					var in_vp = inViewPort(section, h + 10);
546					if (in_vp) {
547						currentNode = currentId;
548					}
549				}
550			}
551			_scroll_top = current_top;
552		} else {
553			currentNode = window.current_nav_item.replace("#", "");
554		}
555
556		setNavActive(currentNode);
557	});
558
559	// Move to the right section on page load.
560	// jQuery(window).on("load", function() {
561	// 	var urlCurrent = location.hash;
562	// 	if (jQuery(urlCurrent).length > 0) {
563	// 		smoothScroll(urlCurrent);
564	// 	}
565	// });
566
567	// Other scroll to elements
568	jQuery(
569		'.hero-slideshow-wrapper a[href*="#"]:not([href="#"]), .parallax-content a[href*="#"]:not([href="#"]), .back-to-top'
570	).on("click", function(event) {
571		event.preventDefault();
572		smoothScroll(jQuery(this.hash));
573	});
574
575	// Smooth scroll animation
576	function smoothScroll(element) {
577		if (element.length <= 0) {
578			return false;
579		}
580		jQuery("html, body").animate(
581			{
582				scrollTop: jQuery(element).offset().top - h + "px"
583			},
584			{
585				duration: 800,
586				easing: "swing",
587				complete: function() {
588					window.current_nav_item = false;
589				}
590			}
591		);
592	}
593
594	if (onepress_js_settings.is_home) {
595		// custom-logo-link
596		jQuery(".site-branding .site-brand-inner").on("click", function(e) {
597			e.preventDefault();
598			jQuery("html, body").animate(
599				{
600					scrollTop: "0px"
601				},
602				{
603					duration: 300,
604					easing: "swing"
605				}
606			);
607		});
608	}
609
610	if (onepressIsMobile.any()) {
611		jQuery("body")
612			.addClass("body-mobile")
613			.removeClass("body-desktop");
614	} else {
615		jQuery("body")
616			.addClass("body-desktop")
617			.removeClass("body-mobile");
618	}
619
620	/**
621	 * Reveal Animations When Scrolling
622	 */
623	if (onepress_js_settings.onepress_disable_animation != "1") {
624		var wow = new WOW({
625			offset: 50,
626			mobile: false,
627			live: false
628		});
629		wow.init();
630	}
631
632
633	$document.on("header_view_changed", function() {
634		text_rotator();
635	});
636
637
638	/**
639	 * Video lightbox
640	 */
641
642	if ($.fn.lightGallery) {
643		$(".videolightbox-popup").lightGallery({});
644	}
645
646
647	/**
648	 * Center vertical align for navigation.
649	 */
650	if (onepress_js_settings.onepress_vertical_align_menu == "1") {
651		var header_height = jQuery(".site-header").height();
652		jQuery(".site-header .onepress-menu").css(
653			"line-height",
654			header_height + "px"
655		);
656	}
657
658	/**
659	 * Section: Hero Full Screen Slideshow
660	 */
661	function hero_full_screen(no_trigger) {
662		if ($(".hero-slideshow-fullscreen").length > 0) {
663			var wh = $window.height();
664			var top = getAdminBarHeight();
665			var $header = jQuery("#masthead");
666			var is_transparent = $header.hasClass("is-t");
667			var headerH;
668			if (is_transparent) {
669				headerH = 0;
670			} else {
671				headerH = $header.height();
672			}
673			headerH += top;
674			jQuery(".hero-slideshow-fullscreen").css(
675				"height",
676				wh - headerH + 1 + "px"
677			);
678			if (typeof no_trigger === "undefined" || !no_trigger) {
679				$document.trigger("hero_ready");
680			}
681		}
682	}
683
684	$window.on("resize", function() {
685		hero_full_screen();
686	});
687	hero_full_screen();
688
689	$document.on("header_view_changed", function() {
690		hero_full_screen();
691	});
692
693	$document.on("hero_ready", function() {
694		hero_full_screen(true);
695	});
696
697	/**
698	 * Hero sliders
699	 */
700	var heroSliders = function() {
701		if ($("#parallax-hero").length <= 0) {
702			jQuery(".hero-slideshow-wrapper").each(function() {
703				var hero = $(this);
704				if (hero.hasClass("video-hero")) {
705					return;
706				}
707				var images = hero.data("images") || false;
708				if (typeof images == "string") {
709					images = jQuery.parseJSON(images);
710				}
711
712				if (images) {
713					preload_images(images, function() {
714						hero.backstretch(images, {
715							fade: _to_number(onepress_js_settings.hero_fade),
716							duration: _to_number(
717								onepress_js_settings.hero_duration
718							)
719						});
720						//
721						hero.addClass("loaded");
722						hero.removeClass("loading");
723						setTimeout(function() {
724							hero.find(".slider-spinner").remove();
725						}, 600);
726					});
727				} else {
728					hero.addClass("loaded");
729					hero.removeClass("loading");
730					hero.find(".slider-spinner").remove();
731				}
732			});
733		}
734	};
735	heroSliders();
736
737	$document.on("header_view_changed", function() {
738		heroSliders();
739	});
740
741	$(".section-parallax, .parallax-hero").bind("inview", function(
742		event,
743		visible
744	) {
745		if (visible == true) {
746		} else {
747		}
748	});
749
750	var lastScrollTop = 0;
751	// Parallax effect
752	function parrallaxHeight() {
753		$(".section-parallax ").each(function() {
754			var $el = $(this);
755			$(".parallax-bg", $el).height("");
756			var w = $el.width();
757			var h = $el.height();
758			if (h <= 0) {
759				h = 500;
760			}
761			h = h * 1.5;
762			$(".parallax-bg", $el).height(h);
763		});
764	}
765
766	function parallaxPosition(direction) {
767		var scrollTop = $(window).scrollTop();
768		//var top = $( window ).scrollTop();
769		var wh = $(window).height();
770		var ww = $(window).width();
771		$(".section-parallax, .parallax-hero").each(function() {
772			var $el = $(this);
773			var pl = $(".parallax-bg", $el);
774
775			var w = $el.width();
776			var h = $el.height();
777			var img = $("img", pl);
778
779			if (img.length) {
780				var imageNaturalWidth = img.prop("naturalWidth");
781				var imageNaturalHeight = img.prop("naturalHeight");
782
783				var containerHeight = h > 0 ? h : 500;
784				var imgHeight = img.height();
785				var parallaxDist = imgHeight - containerHeight;
786				var top = $el.offset().top;
787				var windowHeight = window.innerHeight;
788				var windowBottom = scrollTop + windowHeight;
789				var percentScrolled =
790					(windowBottom - top) / (containerHeight + windowHeight);
791
792				var parallaxTop = parallaxDist * percentScrolled;
793				var l;
794				var max_width = imageNaturalWidth;
795
796				if (imageNaturalWidth > w) {
797				} else {
798					max_width = ww;
799				}
800
801				if (
802					max_width > ww * 2 &&
803					imageNaturalHeight > containerHeight * 2
804				) {
805					max_width = max_width - ww;
806				}
807
808				l = (max_width - ww) / 2;
809				if (l < 0) {
810					l = 0;
811				}
812
813				img.css({
814					top: "-" + parallaxTop + "px",
815					left: "-" + l + "px",
816					//maxWidth: ww+'px'
817					maxWidth: max_width + "px"
818				});
819			} else {
820				//var sh = $el.height();
821				var r = 0.3;
822				if (wh > w) {
823					r = 0.3;
824				} else {
825					r = 0.6;
826				}
827
828				$(".parallax-bg", $el).addClass("no-img");
829
830				var is_inview = $el.data("inview");
831				if (is_inview) {
832					var offsetTop = $el.offset().top;
833					var diff, bgTop;
834					diff = scrollTop - offsetTop;
835					bgTop = diff * r;
836					$(".parallax-bg", $el).css(
837						"background-position",
838						"50% " + bgTop + "px"
839					);
840				}
841			}
842		});
843	}
844
845	$(window).scroll(function(e) {
846		var top = $(window).scrollTop();
847		var direction = "";
848		if (top > lastScrollTop) {
849			direction = "down";
850		} else {
851			direction = "up";
852		}
853		lastScrollTop = top;
854		parallaxPosition();
855	});
856
857	parallaxPosition();
858	$(window).resize(function() {
859		parallaxPosition();
860	});
861
862	$(".section-parallax").each(function() {
863		var hero = $(this);
864		var bg = true;
865		if (hero.find("img").length > 0) {
866			bg = false;
867		}
868		$(".parallax-bg", hero)
869			.imagesLoaded({ background: bg }, function() {})
870			.fail(function(instance) {});
871	});
872
873	// Trigger when site load
874	setTimeout(function() {
875		$(window).trigger("scroll");
876	}, 500);
877
878});

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.