diff --git a/js/functions.js b/js/functions.js index b6f024913b..543a1d7284 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1355,8 +1355,7 @@ AJAX.registerOnload('functions.js', function () { var $form = $(this).prev('form'); var sql_query = $form.find("input[name='sql_query']").val(); - var $inner_sql = $(this).parent().prev().find('.inner_sql'); - var $sql_highlight = $(this).parent().prev().find('.sql-highlight'); + var $inner_sql = $(this).parent().prev().find('code.sql'); var old_text = $inner_sql.html(); var new_content = "\n"; @@ -1369,7 +1368,6 @@ AJAX.registerOnload('functions.js', function () { } $editor_area.html(new_content); $inner_sql.hide(); - $sql_highlight.hide(); bindCodeMirrorToInlineEditor(); return false; @@ -1392,8 +1390,7 @@ AJAX.registerOnload('functions.js', function () { }); $("input#sql_query_edit_discard").live('click', function () { - $('div#inline_editor_outer') - .siblings('.sql-highlight').show(); + $('div#inline_editor_outer').siblings('code.sql').show(); $('div#inline_editor_outer').remove(); }); @@ -3423,7 +3420,13 @@ function PMA_slidingMessage(msg, $obj) .children() .remove(); $obj - .append('
') + .append('' . PMA_Util::formatSql($row[$i]) . '';
+ $row[$i] = PMA_Util::formatSql($row[$i]);
include_once $this->transformation_info[strtolower($this->__get('db'))][strtolower($this->__get('table'))][strtolower($meta->name)][0];
$transformation_plugin = new $this->transformation_info
[strtolower($this->__get('db'))]
diff --git a/libraries/Util.class.php b/libraries/Util.class.php
index 6b7f51a4d6..590534b42d 100644
--- a/libraries/Util.class.php
+++ b/libraries/Util.class.php
@@ -408,9 +408,9 @@ class PMA_Util
$cfg['MaxCharactersInDisplayedSQL']
) . '[...]';
}
- return '' . "\n"
+ return '' . "\n"
. htmlspecialchars($sql_query) . "\n"
- . '';
+ . '';
} // end of the "formatSql()" function
/**
@@ -1279,7 +1279,7 @@ class PMA_Util
if (! empty($GLOBALS['validatequery'])) {
$retval .= '';
+ $retval .= '';
}
if ($query_too_big) {
$retval .= $shortened_query_base;
@@ -1291,11 +1291,7 @@ class PMA_Util
if (! empty($GLOBALS['show_as_php'])) {
$retval .= '";';
}
- if (! empty($GLOBALS['validatequery'])) {
- $retval .= '';
- } else {
- $retval .= '';
- }
+ $retval .= '' . "\n"
+ '' . "\n"
. 'SELECT 1 < 2' . "\n"
- . '',
+ . '',
PMA_Util::formatSql('SELECT 1 < 2')
);
}
@@ -31,9 +31,9 @@ class PMA_FormatSql_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 6;
$this->assertEquals(
- '' . "\n"
+ '' . "\n"
. 'SELECT[...]' . "\n"
- . '',
+ . '',
PMA_Util::formatSql('SELECT 1 < 2', true)
);
}
diff --git a/themes/original/css/common.css.php b/themes/original/css/common.css.php
index 1639dc7613..8de05a9fff 100644
--- a/themes/original/css/common.css.php
+++ b/themes/original/css/common.css.php
@@ -1327,7 +1327,7 @@ div.sqlvalidate {
overflow: auto;
}
-#result_query code.sql,
+#result_query div.sqlOuter,
div.sqlvalidate {
border: solid 1px;
border-top: 0;
diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php
index 7c3c985f54..a14b002021 100644
--- a/themes/pmahomme/css/common.css.php
+++ b/themes/pmahomme/css/common.css.php
@@ -1689,7 +1689,11 @@ div.sqlvalidate {
overflow: auto;
}
-#result_query code.sql,
+#result_query div.sqlOuter {
+ background: ;
+ padding: 1em;
+}
+
#PMA_slidingMessage code.sql,
div.sqlvalidate {
background: ;