You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2016/09/25 23:35:31 UTC
incubator-juneau-website git commit: Enhance webpage to allow
bookmarking of individual pages.
Repository: incubator-juneau-website
Updated Branches:
refs/heads/asf-site 081b41e6a -> 158bd64d9
Enhance webpage to allow bookmarking of individual pages.
Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/commit/158bd64d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/tree/158bd64d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/diff/158bd64d
Branch: refs/heads/asf-site
Commit: 158bd64d9b80177291069f140ad7ffe8613f1b0a
Parents: 081b41e
Author: jamesbognar <ja...@gmail.com>
Authored: Sun Sep 25 19:35:27 2016 -0400
Committer: jamesbognar <ja...@gmail.com>
Committed: Sun Sep 25 19:35:27 2016 -0400
----------------------------------------------------------------------
content/index.html | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/158bd64d/content/index.html
----------------------------------------------------------------------
diff --git a/content/index.html b/content/index.html
index f3dd6e1..35d9bb2 100644
--- a/content/index.html
+++ b/content/index.html
@@ -55,12 +55,17 @@
<script>
var selectedNode;
+
function select(node) {
if (selectedNode)
selectedNode.classList.remove("selected");
node.classList.add("selected");
selectedNode = node;
+ var buff = document.getElementById("buff");
+ buff.src = node.id + ".html";
+ history.pushState(null, null, "#" + node.id + ".html");
}
+
// Load results from IFrame into this document.
function loadResults(buff) {
var doc = buff.contentDocument || buff.contentWindow.document;
@@ -74,8 +79,14 @@
var availableHeight = window.innerHeight - header.clientHeight - footer.clientHeight - 40;
article.style.minHeight = availableHeight + 'px';
}
+
window.onload = function() {
- document.getElementById('about').click();
+ var hash = window.location.hash;
+ if (hash == null || hash.length == 0) {
+ hash = "#about.html";
+ }
+ var id = hash.substring(1, hash.length - 5);
+ document.getElementById(id).click();
}
</script>
</head>
@@ -90,12 +101,12 @@
<nav>
<ul>
- <li><a id='about' href="about.html" target="buff" onclick="select(this)">About</a></li>
- <li><a href="documentation.html" target="buff" onclick="select(this)">Documentation</a></li>
- <li><a href="downloads.html" target="buff" onclick="select(this)">Downloads</a></li>
- <li><a href="sourceCode.html" target="buff" onclick="select(this)">Source Code</a></li>
- <li><a href="issueTracking.html" target="buff" onclick="select(this)">Issue Tracking</a></li>
- <li><a href="community.html" target="buff" onclick="select(this)">Community</a></li>
+ <li><a id='about' onclick="select(this)">About</a></li>
+ <li><a id='documentation' onclick="select(this)">Documentation</a></li>
+ <li><a id='downloads' onclick="select(this)">Downloads</a></li>
+ <li><a id='sourceCode' onclick="select(this)">Source Code</a></li>
+ <li><a id='issueTracking' onclick="select(this)">Issue Tracking</a></li>
+ <li><a id='community' onclick="select(this)">Community</a></li>
</ul>
</nav>
@@ -120,6 +131,6 @@
</footer>
</div>
-<iframe name='buff' style='display:none' onload="parent.loadResults(this)"></iframe>
+<iframe id='buff' style='display:none' onload="parent.loadResults(this)"></iframe>
</body>
</html>