Skip to content

Commit a7a6809

Browse files
committed
TESTING prefetch (best possible case)
1 parent 6971ada commit a7a6809

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

index.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<head>
55
<title>Organization Chart (js only)</title>
66

7+
8+
79
<!-- Begin META-TAG Section -->
810
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
911
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'"/>
@@ -20,8 +22,6 @@
2022
<!-- End META-TAG Section -->
2123

2224
<!-- Begin LINK Section -->
23-
<link rel="preconnect" href="https://www.netlify.com"/>
24-
<link rel="dns-prefetch" href="https://www.netlify.com"/>
2525
<link href="images/orgchart_192x192.png" rel="apple-touch-icon" type="image/png"/>
2626
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
2727
<link rel="manifest" id="orgchart_manifest" crossorigin="use-credentials" href="manifest.json"/>
@@ -2070,6 +2070,24 @@
20702070
<!-- End STYLESHEET Section -->
20712071

20722072
<!-- Begin JAVASCRIPT Section -->
2073+
<script>
2074+
function prefetchLargeImage()
2075+
{
2076+
let oStartingPerson = null;
2077+
let sUrl = document.location.hash;
2078+
let sPersonId = sUrl.match( /person=([^&]*)/gi );
2079+
if( sPersonId && sPersonId [ 0 ] )
2080+
{
2081+
sPersonId = sPersonId[ 0 ].replace( 'person=', '' );
2082+
if( data[ sPersonId ] )
2083+
{
2084+
oStartingPerson = sPersonId;
2085+
}
2086+
}
2087+
return `photos/${sPersonId}.webp`;
2088+
}
2089+
</script>
2090+
<link rel="preload" href="photos/quincy.acklen.webp" as="image" />
20732091
<script id="serviceworker_for_PWA">
20742092
const PROGRESSIVE_WEB_APP = true; // Default TRUE - set to FALSE is you want to disable the serviceworker / PWA because it can be a pain to develop with PWA mode active
20752093
if( PROGRESSIVE_WEB_APP && 'serviceWorker' in navigator )
@@ -2446,9 +2464,9 @@
24462464
</tr>
24472465
<tr>
24482466
<td colspan="3" class="center" class="center" title="${ person.indirects || '' }">
2449-
${ person.title }!
2467+
${ person.title }
24502468
<span>
2451-
${ person.team ? ( '<br />' + person.team ) : '!!' }!!!
2469+
${ person.team ? ( '<br />' + person.team ) : '' }
24522470
</span>
24532471
</td>
24542472
</tr>

0 commit comments

Comments
 (0)