source.html 1.3 KB
Newer Older
1
<!--
2 3
Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
and the EPL 1.0 (http://h2database.com/html/license.html).
4 5
Initial Developer: H2 Group
-->
6 7
<html><head>
</head>
8
<body>
9 10
<script type="text/javascript">
// <!--
Thomas Mueller's avatar
Thomas Mueller committed
11

12
function getPath(build) {
13 14
    if (build >= 177) {
        return 'version-1.4.' + build + '/h2';
Thomas Mueller's avatar
Thomas Mueller committed
15
    } else if (build >= 146 && build != 147) {
16
        return 'version-1.3/version-1.3.' + build + '/h2';
Thomas Mueller's avatar
Thomas Mueller committed
17
    } else if (build >= 120) {
18
        return 'version-1.2/version-1.2.' + build + '/h2';
Thomas Mueller's avatar
Thomas Mueller committed
19
    } else if (build >= 100) {
20
        return 'version-1.1/version-1.1.' + build + '/h2';
21
    } else if (build == 64) {
22
        return 'version-1.0/version-1.0.64';
23
    } else {
24
        return 'version-1.0/version-1.0.' + build + '/h2';
25
    }
Thomas Mueller's avatar
Thomas Mueller committed
26 27 28 29
}

var line = 0, file = '';
var params = location.search.substring(1).split('&');
30
var path = 'master/h2';
Thomas Mueller's avatar
Thomas Mueller committed
31 32 33 34 35 36 37 38
for (var i = 0; i<params.length; i++) {
    var k = params[i].split('=');
    var key = k[0], value = k[1];
    if (key == 'line') {
        line = value;
    } else if (key == 'file') {
        file = value;
    } else if (key == 'build') {
39
        path = getPath(value);
Thomas Mueller's avatar
Thomas Mueller committed
40 41 42
    }
}

43 44 45 46 47 48
var url = 'https://github.com/h2database/h2database/blob/' + path + '/src/main/' + file;
if (line > 0 && file !== '') {
    url += '#L' + line;
}
window.location.replace(url);

49
// -->
50
</script>
51 52
</body>
</html>