]> git.joonet.de Git - adminer.git/commitdiff
MariaDB: Links to documentation in syntax highlighting
authorJakub Vrana <jakub@vrana.cz>
Thu, 8 Feb 2018 22:47:16 +0000 (23:47 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 8 Feb 2018 22:47:16 +0000 (23:47 +0100)
adminer/include/adminer.inc.php
adminer/static/editing.js
externals/jush

index a234cf3c54ee7a4c1621d5bb64621b094833b44a..68dad1e46afe2770a567a4c39294b079f8aacfce 100644 (file)
@@ -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
                        }
index 8f4c4b139cd94fabf817efb3ea138f0dfc373557..694dd76ece499da38e704b1f8d2b205ea96d7d09 100644 (file)
@@ -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
                                ;
index b1801c40d9cf4d68b7d1c8085f4f95c26c0c6a9e..275c9cc888608f36895e3926c16e8d2e2dab0a1c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b1801c40d9cf4d68b7d1c8085f4f95c26c0c6a9e
+Subproject commit 275c9cc888608f36895e3926c16e8d2e2dab0a1c