HHH-11984 - Add support for navigating between different doc versions

This commit is contained in:
Vlad Mihalcea 2017-09-13 18:03:39 +03:00
parent 61932bbeb7
commit bd4908449f
6 changed files with 57 additions and 30 deletions

View File

@ -1,7 +1,4 @@
@import url("hibernate-fonts.css");
@import url("hibernate-layout.css");
@import url("asciidoctor.css");
@import url("jstree-style.css");
@import url("32px.png");
@import url("40px.png");
@import url("throbber.gif");
@import url("jstree-style.css");

View File

@ -407,7 +407,7 @@
}
.jstree-default .jstree-node,
.jstree-default .jstree-icon {
background-image: url("32px.png");
background-image: url("../images/jstree/32px.png");
}
.jstree-default .jstree-node {
background-position: -292px -4px;
@ -512,13 +512,13 @@
background-position: 0 0;
}
.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl {
background: url("throbber.gif") center center no-repeat;
background: url("../images/jstree/throbber.gif") center center no-repeat;
}
.jstree-default .jstree-file {
background: url("32px.png") -100px -68px no-repeat;
background: url("../images/jstree/32px.png") -100px -68px no-repeat;
}
.jstree-default .jstree-folder {
background: url("32px.png") -260px -4px no-repeat;
background: url("../images/jstree/32px.png") -260px -4px no-repeat;
}
.jstree-default > .jstree-container-ul > .jstree-node {
margin-left: 0;
@ -530,7 +530,7 @@
}
#jstree-dnd.jstree-default .jstree-ok,
#jstree-dnd.jstree-default .jstree-er {
background-image: url("32px.png");
background-image: url("../images/jstree/32px.png");
background-repeat: no-repeat;
background-color: transparent;
}
@ -591,7 +591,7 @@
}
.jstree-default-small .jstree-node,
.jstree-default-small .jstree-icon {
background-image: url("32px.png");
background-image: url("../images/jstree/32px.png");
}
.jstree-default-small .jstree-node {
background-position: -295px -7px;
@ -699,13 +699,13 @@
background-position: 0 0;
}
.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl {
background: url("throbber.gif") center center no-repeat;
background: url("../images/jstree/throbber.gif") center center no-repeat;
}
.jstree-default-small .jstree-file {
background: url("32px.png") -103px -71px no-repeat;
background: url("../images/jstree/32px.png") -103px -71px no-repeat;
}
.jstree-default-small .jstree-folder {
background: url("32px.png") -263px -7px no-repeat;
background: url("../images/jstree/32px.png") -263px -7px no-repeat;
}
.jstree-default-small > .jstree-container-ul > .jstree-node {
margin-left: 0;
@ -717,7 +717,7 @@
}
#jstree-dnd.jstree-default-small .jstree-ok,
#jstree-dnd.jstree-default-small .jstree-er {
background-image: url("32px.png");
background-image: url("../images/jstree/32px.png");
background-repeat: no-repeat;
background-color: transparent;
}
@ -778,7 +778,7 @@
}
.jstree-default-large .jstree-node,
.jstree-default-large .jstree-icon {
background-image: url("32px.png");
background-image: url("../images/jstree/32px.png");
}
.jstree-default-large .jstree-node {
background-position: -288px 0px;
@ -883,13 +883,13 @@
background-position: 0 0;
}
.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl {
background: url("throbber.gif") center center no-repeat;
background: url("../images/jstree/throbber.gif") center center no-repeat;
}
.jstree-default-large .jstree-file {
background: url("32px.png") -96px -64px no-repeat;
background: url("../images/jstree/32px.png") -96px -64px no-repeat;
}
.jstree-default-large .jstree-folder {
background: url("32px.png") -256px 0px no-repeat;
background: url("../images/jstree/32px.png") -256px 0px no-repeat;
}
.jstree-default-large > .jstree-container-ul > .jstree-node {
margin-left: 0;
@ -901,7 +901,7 @@
}
#jstree-dnd.jstree-default-large .jstree-ok,
#jstree-dnd.jstree-default-large .jstree-er {
background-image: url("32px.png");
background-image: url("../images/jstree/32px.png");
background-repeat: no-repeat;
background-color: transparent;
}
@ -947,12 +947,12 @@
height: 40px;
}
#jstree-dnd.jstree-dnd-responsive > .jstree-ok {
background-image: url("40px.png");
background-image: url("../images/jstree/40px.png");
background-position: 0 -200px;
background-size: 120px 240px;
}
#jstree-dnd.jstree-dnd-responsive > .jstree-er {
background-image: url("40px.png");
background-image: url("../images/jstree/40px.png");
background-position: -40px -200px;
background-size: 120px 240px;
}
@ -971,7 +971,7 @@
*/
}
.jstree-default-responsive .jstree-icon {
background-image: url("40px.png");
background-image: url("../images/jstree/40px.png");
}
.jstree-default-responsive .jstree-node,
.jstree-default-responsive .jstree-leaf > .jstree-ocl {
@ -1075,7 +1075,7 @@
.jstree-default-responsive .jstree-node > .jstree-ocl,
.jstree-default-responsive .jstree-themeicon,
.jstree-default-responsive .jstree-checkbox {
background-image: url("40px.png");
background-image: url("../images/jstree/40px.png");
background-size: 120px 240px;
}
.jstree-default-responsive .jstree-node {
@ -1097,11 +1097,11 @@
background-position: 0 0;
}
.jstree-default-responsive .jstree-file {
background: url("40px.png") 0 -160px no-repeat;
background: url("../images/jstree/40px.png") 0 -160px no-repeat;
background-size: 120px 240px;
}
.jstree-default-responsive .jstree-folder {
background: url("40px.png") -40px -40px no-repeat;
background: url("../images/jstree/40px.png") -40px -40px no-repeat;
background-size: 120px 240px;
}
.jstree-default-responsive > .jstree-container-ul > .jstree-node {

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,12 +1,42 @@
var versions = {
'current' : '/current/userguide/html_single/Hibernate_User_Guide.html',
'5.2' : '/5.2/userguide/html_single/Hibernate_User_Guide.html',
'5.1' : '/5.1/userguide/html_single/Hibernate_User_Guide.html',
'5.0' : '/5.0/userguide/html_single/Hibernate_User_Guide.html',
'4.3' : '/4.3/manual/en-US/html_single/',
'4.2' : '/4.2/manual/en-US/html_single/',
'4.1' : '/4.1/manual/en-US/html_single/',
'4.0' : '/4.0/manual/en-US/html_single/',
'3.6' : '/3.6/reference/en-US/html_single/',
'3.5' : '/3.5/reference/en-US/html_single/',
'3.3' : '/3.3/reference/en-US/html_single/',
'3.2' : '/3.2/reference/en/html_single/'
};
$(document).ready(function() {
$('#toctitle').before('<select id="vchooser"></select>');
$('#vchooser').append('<option>Choose version</option>');
for(var version in versions) {
var path = 'http://docs.jboss.org/hibernate/orm' + versions[version];
$('#vchooser').append('<option value="' + path + '" ' + '>' + version + '</option>');
};
$('#vchooser').change(function(e) {
if (this.value !== '')
window.location.href = this.value;
});
$('ul.sectlevel1').wrap('<div id="toctree"></div>');
$('#toctree').jstree({
"core" : {
"themes" : {"variant" : "small", "icons" : false}
},
"plugins" : [ "search", "state", "wholerow" ] })
.on("activate_node.jstree", function (e, data) { location.href = data.node.a_attr.href; });
"core" : {
"themes" : {"variant" : "small", "icons" : false}
},
"plugins" : [ "search", "state", "wholerow" ]
})
.on("activate_node.jstree", function (e, data) { location.href = data.node.a_attr.href; });
$('#toctree').before('<input placeholder="&#xf002; Search" id="tocsearch" type="text">');
var searchTimeout = false;
$('#tocsearch').keyup(function () {