PageSourceSearch

https://www.ntsb.gov/SiteAssets/scripts/ntsb.js

js ntsb.gov collected 2026-10-01 08:44:44 UTC 2,952 bytes, 74 lines download raw bytes

1function FixYouTubeEmbeds() {
2    $("iframe[src*='youtube.com/embed']").each(function () {
3        if ($(this).attr('referrerpolicy') == undefined) {
4            $(this).attr('referrerpolicy', 'strict-origin-when-cross-origin');
5            $(this).attr('src', $(this).attr('src'));
6        }
7    });
8}
9
10function HideMediaContactInfo() {
11	
12	// Hide Chief of Media Relations
13	var comr = $("#contentBox").find("p.title:contains('Chief of Media Relations')");
14	comr.next().remove();
15	comr.remove();
16	
17	// Hide Public Affiars Officers
18	var pao = $("#contentBox").find("p.title:contains('Public Affairs Officers and Portfolios')");
19	if (urlContainsPath("/news/events/")) {
20		pao.parent().parent().remove();
21	} else if (urlContainsPath("/news/press-releases/")) {
22		pao.parent().remove();	
23	}
24}
25
26function InitializeBanner(text) {
27	// Create the html as a constant value for insertion
28	const surveryHtml = `<div class="FormFooter Close bg-warning">
29		<div class="FormFooter-Container">
30			<div class="FormFooter-Text">
31				` + text + `
32			</div>
33			<div class="FormFooter-Buttons">
34				<div class="FormFooter-Button-Close"><i class="fas fa-window-close"> Close</i></div>
35			</div>
36		</div>
37	</div>`;
38	// Append the html to the bottom of the container, below the footer
39	$('#s4-bodyContainer').append(surveryHtml);
40	// Attach the close button behavior after it has been added
41	$(".FormFooter-Button-Close").click(() => {
42		$(".FormFooter").addClass("Close");
43	});
44}
45
46function urlContainsPath(path) {
47    const currentUrl = window.location.pathname.toLowerCase();
48    const targetPath = path.toLowerCase();
49
50    return currentUrl.indexOf(targetPath) !== -1;
51}
52
53function runAfterDelay(callback, delay = 1000) {
54    setTimeout(callback, delay);
55}
56
57$(window).on("load", () => {
58    runAfterDelay(FixYouTubeEmbeds);
59	// If current page is Events or Newsroom...
60	if (urlContainsPath("/news/events/") || urlContainsPath("/news/press-releases/")) {
61		// Hide the elements
62		HideMediaContactInfo();
63	}
64	
65	// Initialize the Banners
66	if (urlContainsPath("/about/organization/MS/Pages/office_ms.aspx")) {
67		InitializeBanner('The Office of Marine Safety Data Dashboard has launched: a new interactive dashboard that summarizes and visualizes NTSB marine casualty investigation data. See <a href="/safety/Pages/Marine-Safety-Data-Dashboard.aspx">Marine Safety Data Dashboard</a>.');
68	}
69	if (urlContainsPath("/Pages/monthly.aspx")) {
70		InitializeBanner('<div><strong>We are upgrading the Monthly Aviation List Page</strong></div><div>An enhanced Monthly Aviation Lists page will be available on September 17, 2026.  Access aviation accident information through streamlined and intuitive features such as multiple ways to view the data, interactive accident map, and filters.</div>');
71	}
72	// Set the Banner to appear after a delayInMS
73	runAfterDelay(() => { $(".FormFooter").removeClass("Close") });
74});

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.