Skip to content

Commit

Permalink
Merge pull request #3811 from OpenLiberty/javadocs_frameless_staging
Browse files Browse the repository at this point in the history
Fixed redirect of jakartee10
  • Loading branch information
SteveSamJacob19 authored Jul 23, 2024
2 parents 704e14a + ea1fd76 commit d495eaa
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions src/main/content/_assets/js/javadoc-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ $(function () {
window.top.location.href.includes('/docs/modules/reference/microprofile-')
) {
var jd = window.top.location.href;
var version = jd.substring(
jd.indexOf('microprofile-') + 13,
jd.indexOf('microprofile-') + 16
);
jd = jd.substring(jd.indexOf('microprofile-') + 25);
var ver_start_index= jd.indexOf('microprofile-') + 13;
var ver_string = jd.substring(ver_start_index); // To obtain the last index of version
var ver_end_index = ver_string.indexOf('-');
if(ver_end_index !== -1 ){
var version = ver_string.substring(
0,
ver_end_index
);
var add_index = version.length - 3;
jd = jd.substring(jd.indexOf('microprofile-') + add_index + 25);
}
else{
version = null;
}
javadocRedirect('microprofile-',version,jd);
} else if (
window.top.location.href.includes('/docs/modules/reference/liberty-javaee')
Expand All @@ -23,11 +32,20 @@ $(function () {
window.top.location.href.includes('/docs/modules/reference/liberty-jakartaee')
) {
var jd = window.top.location.href;
var version = jd.substring(
jd.indexOf('liberty-jakartaee') + 17,
jd.indexOf('liberty-jakartaee') + 20
);
jd = jd.substring(jd.indexOf('liberty-jakartaee') + 29);
var ver_start_index= jd.indexOf('liberty-jakartaee') + 17;
var ver_string = jd.substring(ver_start_index); // To obtain the last index of version
var ver_end_index = ver_string.indexOf('-');
if(ver_end_index !== -1 ){
var version = ver_string.substring(
0,
ver_end_index
);
var add_index = version.length - 3;
jd = jd.substring(jd.indexOf('liberty-jakartaee') + add_index + 29);
}
else{
version = null;
}
javadocRedirect('liberty-jakartaee',version,jd);
}
});
Expand All @@ -46,8 +64,7 @@ function javadocRedirect(api,version,jd) {
window.top.location.hostname +
port +
'/docs/latest/reference/javadoc/'+ api +
version +
(pack ? '-javadoc.html?path='+api+version+'-javadoc/'+jd: '-javadoc.html');
version + (pack ? '-javadoc.html?path='+api+version+'-javadoc/'+jd: '-javadoc.html');
}
else{
window.top.location.href =
Expand Down

0 comments on commit d495eaa

Please sign in to comment.