Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion _data/kroxylicious.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# The version number of the latest release
latestRelease: 0.18.0

# The sub-path at which the raw Javadoc files can be found.
javadocRawSubdir: raw
36 changes: 36 additions & 0 deletions _layouts/javadoc-wrapper.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: default
---
<div class="container-fluid p-0">
<iframe id="javadoc-frame"
src="{{ page.raw_path | relative_url }}"
style="width: 100%; height: calc(100vh - 60px); border: none;"
title="Javadoc Content">
</iframe>
</div>

<script>
// This script forces links clicked inside the iframe to
// navigate the PARENT window to the correct Jekyll URI.
const iframe = document.getElementById('javadoc-frame');

iframe.onload = function() {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
const links = iframeDoc.getElementsByTagName('a');

for (let link of links) {
// Only intercept internal relative links
if (link.href && link.getAttribute('href').indexOf('http') !== 0) {
link.onclick = function(e) {
e.preventDefault();
const href = link.getAttribute('href');

// Construct the new URL by removing the '.raw' part of the path
const currentUrl = new URL(window.location.href);
const newUrl = new URL(href, iframe.src);
window.top.location.href = newUrl.href.replace('/{{ site.data.kroxylicious.javadocRawSubdir }}/', '/');
};
}
}
};
</script>
3 changes: 3 additions & 0 deletions _layouts/javadoc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
---
{{ content }}