Skip to content

Commit

Permalink
Add support of H2 2.0+ to source.html and sourceError.html
Browse files Browse the repository at this point in the history
  • Loading branch information
katzyn committed Jan 4, 2022
1 parent 927c830 commit 4bfd6f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions h2/src/docsrc/html/source.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
// <!--

function getPath(build) {
if (build >= 177) {
if (build > 200) {
var b = build + 1;
return 'version-' + Math.floor(b / 100) + '.' + Math.floor(b % 100 / 10) + '.' + build + '/h2';
} else if (build >= 177) {
return 'version-1.4.' + build + '/h2';
} else if (build >= 146 && build != 147) {
return 'version-1.3/version-1.3.' + build + '/h2';
Expand All @@ -36,7 +39,7 @@
} else if (key == 'file') {
file = value;
} else if (key == 'build') {
path = getPath(value);
path = getPath(parseInt(value));
}
}

Expand Down
7 changes: 5 additions & 2 deletions h2/src/docsrc/html/sourceError.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
function getVersion(build) {
if (build == 64) {
return '1.0/version-1.0.' + build;
} else if (build > 200) {
var b = build + 1;
return Math.floor(b / 100) + '.' + Math.floor(b % 100 / 10) + '.' + build;
} else if (build >= 177) {
return '1.4.' + build;
} else if (build >= 146 && build != 147) {
Expand Down Expand Up @@ -84,7 +87,7 @@
} else {
url = 'https://github.com/h2database/h2database/tree/'
if (build && build > 0) {
url += 'version-' + getVersion(build) + '/h2';
url += 'version-' + getVersion(parseInt(build)) + '/h2';
} else {
var tag = 'master/h2';
}
Expand Down Expand Up @@ -114,7 +117,7 @@
hasData = true;
idx = errorCode.indexOf("-");
build = parseInt(errorCode.substring(idx + 1));
get('version').innerHTML = getVersion(build);
get('version').innerHTML = getVersion(parseInt(build));
errorCode = errorCode.substring(0, idx);
while (errorCode.length > 1 && errorCode.charAt(0) == '0') {
errorCode = errorCode.substring(1);
Expand Down

0 comments on commit 4bfd6f0

Please sign in to comment.