]> git.joonet.de Git - adminer.git/commitdiff
Highlighting only inside <code>
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Nov 2010 16:17:46 +0000 (17:17 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Nov 2010 16:17:46 +0000 (17:17 +0100)
adminer/include/adminer.inc.php
adminer/sql.inc.php
adminer/static/editing.js
adminer/static/functions.js

index b9bb39cb35de8b71f14a1161bda94b6a62dd044c..804f595822714867d78b85bcbaee8437a7cdba01 100644 (file)
@@ -398,7 +398,7 @@ document.getElementById('username').focus();
                        ? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
                        : $query
                ); //! respect $_GET["ns"]
-               return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$jush'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
+               return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
        }
        
        /** Functions displayed in edit form
index c4f745749bab4ebed96f5b155cf6c3f7a7bce858..2664156734e437f5c8d54e6c752f0323f6274981 100644 (file)
@@ -59,7 +59,7 @@ if (!$error && $_POST) {
                                                $empty = false;
                                                $q = substr($query, 0, $match[0][1]);
                                                $commands++;
-                                               echo "<pre class='jush-$jush' id='sql-$commands'>" . shorten_utf8(trim($q), 1000) . "</pre>\n";
+                                               echo "<pre id='sql-$commands'><code class='jush-$jush'>" . shorten_utf8(trim($q), 1000) . "</code></pre>\n";
                                                ob_flush();
                                                flush(); // can take a long time - show the running query
                                                $start = explode(" ", microtime()); // microtime(true) is available since PHP 5
index 95e452f5bc3cd092f2d8fd9f691196c8e8eac362..4ac8f4938e5403d21d4df28bdf23e7c433504020 100644 (file)
@@ -22,8 +22,7 @@ function bodyLoad(version, protocol) {
                        if (window.jushLinks) {
                                jush.custom_links = jushLinks;
                        }
-                       jush.highlight_tag('pre', 0);
-                       jush.highlight_tag('code');
+                       jush.highlight_tag('code', 0);
                }
        };
        script.onreadystatechange = function () {
index dd161f235158e120c30439c37f665223829316ac..97c2b3546702d83471e7d3089dc9859e993f92d6 100644 (file)
@@ -223,8 +223,7 @@ function ajaxSend(url, data) {
                        clearTimeout(ajaxTimeout);
                        setHtml('main', text);
                        if (window.jush) {
-                               jush.highlight_tag('code');
-                               jush.highlight_tag('pre', 0);
+                               jush.highlight_tag('code', 0);
                        }
                }
        }, data);