1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Generalize JUSH URL rewriting

This commit is contained in:
Jakub Vrana
2013-07-23 18:14:32 -07:00
parent 07ba250939
commit e2ef558e5f

View File

@@ -19,10 +19,17 @@ function bodyLoad(version) {
script.onload = function () {
if (window.jush) { // IE runs in case of an error too
jush.create_links = ' target="_blank" rel="noreferrer"';
jush.urls.sql_sqlset = jush.urls.sql[0] = jush.urls.sqlset[0] = jush.urls.sqlstatus[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
var pgsql = 'http://www.postgresql.org/docs/' + version + '/static/';
jush.urls.pgsql_pgsqlset = jush.urls.pgsql[0] = pgsql + '$key';
jush.urls.pgsqlset[0] = pgsql + 'runtime-config-$key.html#GUC-$1';
for (var key in jush.urls) {
var obj = jush.urls;
if (typeof obj[key] != 'string') {
obj = obj[key];
key = 0;
}
obj[key] = obj[key]
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
;
}
if (window.jushLinks) {
jush.custom_links = jushLinks;
}