mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 00:54:08 +02:00
MariaDB: Links to documentation in syntax highlighting
This commit is contained in:
@@ -960,8 +960,9 @@ class Adminer {
|
||||
echo "jushLinks.$val = jushLinks.$jush;\n";
|
||||
}
|
||||
}
|
||||
$server_info = $connection->server_info;
|
||||
?>
|
||||
bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $connection->server_info) : ""); ?>');
|
||||
bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $server_info) : ""); ?>'<?php echo (preg_match('~MariaDB~', $server_info) ? ", true" : ""); ?>);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
@@ -2,8 +2,9 @@
|
||||
|
||||
/** Load syntax highlighting
|
||||
* @param string first three characters of database system version
|
||||
* @param [boolean]
|
||||
*/
|
||||
function bodyLoad(version) {
|
||||
function bodyLoad(version, maria) {
|
||||
if (window.jush) {
|
||||
jush.create_links = ' target="_blank" rel="noreferrer noopener"';
|
||||
if (version) {
|
||||
@@ -12,8 +13,14 @@ function bodyLoad(version) {
|
||||
if (typeof obj[key] != 'string') {
|
||||
obj = obj[key];
|
||||
key = 0;
|
||||
if (maria) {
|
||||
for (var i = 1; i < obj.length; i++) {
|
||||
obj[i] = obj[i].replace(/\.html/, '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
obj[key] = obj[key]
|
||||
.replace(/dev\.mysql\.com\/doc\/mysql\/en\//, (maria ? 'mariadb.com/kb/en/library/' : '$&')) // MariaDB
|
||||
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL
|
||||
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
|
||||
;
|
||||
|
2
externals/jush
vendored
2
externals/jush
vendored
Submodule externals/jush updated: b1801c40d9...275c9cc888
Reference in New Issue
Block a user