File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ layout: default
3+ ---
4+ < div class ="container-fluid p-0 ">
5+ < iframe id ="javadoc-frame "
6+ src ="{{ page.raw_path | relative_url }} "
7+ style ="width: 100%; height: calc(100vh - 60px); border: none; "
8+ title ="Javadoc Content ">
9+ </ iframe >
10+ </ div >
11+
12+ < script >
13+ // This script forces links clicked inside the iframe to
14+ // navigate the PARENT window to the correct Jekyll URI.
15+ const iframe = document . getElementById ( 'javadoc-frame' ) ;
16+
17+ iframe . onload = function ( ) {
18+ const iframeDoc = iframe . contentDocument || iframe . contentWindow . document ;
19+ const links = iframeDoc . getElementsByTagName ( 'a' ) ;
20+
21+ for ( let link of links ) {
22+ // Only intercept internal relative links
23+ if ( link . href && link . getAttribute ( 'href' ) . indexOf ( 'http' ) !== 0 ) {
24+ link . onclick = function ( e ) {
25+ e . preventDefault ( ) ;
26+ const href = link . getAttribute ( 'href' ) ;
27+
28+ // Construct the new URL by removing the '.raw' part of the path
29+ const currentUrl = new URL ( window . location . href ) ;
30+ const newUrl = new URL ( href , iframe . src ) ;
31+ window . top . location . href = newUrl . href . replace ( '/{{ RAW_SUBDIR }}/' , '/' ) ;
32+ } ;
33+ }
34+ }
35+ } ;
36+ </ script >
Original file line number Diff line number Diff line change 1+ ---
2+ ---
3+ {{ content }}
You can’t perform that action at this time.
0 commit comments