From 659e72b692d9e5ad1b583f3a2b3c438e1611902f Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Wed, 23 Oct 2024 23:19:47 +0200 Subject: [PATCH] MariaDB: Fix several links to documentation pages --- adminer/include/editing.inc.php | 2 +- adminer/static/editing.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index e5d8fb54..f4f56998 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -621,7 +621,7 @@ function doc_link(array $paths, $text = "?") { ]; 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'])); } diff --git a/adminer/static/editing.js b/adminer/static/editing.js index 244458ee..75d0ac97 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -16,17 +16,22 @@ function bodyLoad(version, maria) { if (maria) { for (var i = 1; i < obj.length; i++) { obj[i] = obj[i] - .replace(/\.html/, '/') - .replace(/-type-syntax/, '-data-types') + .replace('.html', '/') + .replace('-type-syntax', '-data-types') .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 - .replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL + + obj[key] = (maria ? obj[key].replace('dev.mysql.com/doc/mysql/en/', 'mariadb.com/kb/en/') : obj[key]) // MariaDB + .replace('/doc/mysql/', '/doc/refman/' + version) // MySQL + .replace('/docs/current/', '/docs/' + version) // PostgreSQL ; } }