1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 08:06:59 +02:00

MariaDB: Fix several links to documentation pages

This commit is contained in:
Peter Knut
2024-10-23 23:19:47 +02:00
committed by Jakub Vrana
parent d8217d6ee2
commit 81530227c2
2 changed files with 12 additions and 7 deletions

View File

@@ -547,7 +547,7 @@ function doc_link($paths, $text = "<sup>?</sup>") {
'oracle' => "https://www.oracle.com/pls/topic/lookup?ctx=db" . preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s', '\1\2', $server_info) . "&id=", 'oracle' => "https://www.oracle.com/pls/topic/lookup?ctx=db" . preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s', '\1\2', $server_info) . "&id=",
); );
if (preg_match('~MariaDB~', $server_info)) { if (preg_match('~MariaDB~', $server_info)) {
$urls['sql'] = "https://mariadb.com/kb/en/library/"; $urls['sql'] = "https://mariadb.com/kb/en/";
$paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql'])); $paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql']));
} }
return ($paths[$jush] ? "<a href='" . h($urls[$jush] . $paths[$jush]) . "'" . target_blank() . ">$text</a>" : ""); return ($paths[$jush] ? "<a href='" . h($urls[$jush] . $paths[$jush]) . "'" . target_blank() . ">$text</a>" : "");

View File

@@ -16,17 +16,22 @@ function bodyLoad(version, maria) {
if (maria) { if (maria) {
for (var i = 1; i < obj.length; i++) { for (var i = 1; i < obj.length; i++) {
obj[i] = obj[i] obj[i] = obj[i]
.replace(/\.html/, '/') .replace('.html', '/')
.replace(/-type-syntax/, '-data-types') .replace('-type-syntax', '-data-types')
.replace(/numeric-(data-types)/, '$1-$&') .replace(/numeric-(data-types)/, '$1-$&')
.replace(/#statvar_.*/, '#$$1') .replace(/replication-options-(master|binary-log)\//, 'replication-and-binary-log-system-variables/')
.replace('server-options/', 'server-system-variables/')
.replace('innodb-parameters/', 'innodb-system-variables/')
.replace(/#(statvar|sysvar|option_mysqld)_(.*)/, '#$2')
.replace(/#sysvar_(.*)/, '#$1')
; ;
} }
} }
} }
obj[key] = (maria ? obj[key].replace(/dev\.mysql\.com\/doc\/mysql\/en\//, 'mariadb.com/kb/en/library/') : obj[key]) // MariaDB
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL obj[key] = (maria ? obj[key].replace('dev.mysql.com/doc/mysql/en/', 'mariadb.com/kb/en/') : obj[key]) // MariaDB
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL .replace('/doc/mysql/', '/doc/refman/' + version) // MySQL
.replace('/docs/current/', '/docs/' + version) // PostgreSQL
; ;
} }
} }