Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ed97d2806c
@ -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 = "<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">" + sql_query + "</textarea>\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('<div style="display: none;">' + msg + '</div>')
|
||||
.append('<div>' + msg + '</div>');
|
||||
// highlight any sql before taking height;
|
||||
PMA_highlightSQL($obj);
|
||||
$obj.find('div')
|
||||
.first()
|
||||
.hide();
|
||||
$obj
|
||||
.animate({
|
||||
height: $obj.find('div').first().height()
|
||||
})
|
||||
@ -3434,12 +3437,15 @@ function PMA_slidingMessage(msg, $obj)
|
||||
} else {
|
||||
// Object does not already have a message
|
||||
// inside it, so we simply slide it down
|
||||
$obj.width('100%')
|
||||
.html('<div>' + msg + '</div>');
|
||||
// highlight any sql before taking height;
|
||||
PMA_highlightSQL($obj);
|
||||
var h = $obj
|
||||
.width('100%')
|
||||
.html('<div style="display: none;">' + msg + '</div>')
|
||||
.find('div')
|
||||
.first()
|
||||
.height();
|
||||
.find('div')
|
||||
.first()
|
||||
.hide()
|
||||
.height();
|
||||
$obj
|
||||
.find('div')
|
||||
.first()
|
||||
|
||||
@ -2831,7 +2831,7 @@ class PMA_DisplayResults
|
||||
if ($this->_isNeedToSyntaxHighlight($meta->name)
|
||||
&& (trim($row[$i]) != '')
|
||||
) {
|
||||
$row[$i] = '<code class="sql">' . PMA_Util::formatSql($row[$i]) . '</code>';
|
||||
$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'))]
|
||||
|
||||
@ -408,9 +408,9 @@ class PMA_Util
|
||||
$cfg['MaxCharactersInDisplayedSQL']
|
||||
) . '[...]';
|
||||
}
|
||||
return '<span class="inner_sql"><pre>' . "\n"
|
||||
return '<code class="sql"><pre>' . "\n"
|
||||
. htmlspecialchars($sql_query) . "\n"
|
||||
. '</pre></span>';
|
||||
. '</pre></code>';
|
||||
} // end of the "formatSql()" function
|
||||
|
||||
/**
|
||||
@ -1279,7 +1279,7 @@ class PMA_Util
|
||||
if (! empty($GLOBALS['validatequery'])) {
|
||||
$retval .= '<div class="sqlvalidate">';
|
||||
} else {
|
||||
$retval .= '<code class="sql">';
|
||||
$retval .= '<div class="sqlOuter">';
|
||||
}
|
||||
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 .= '</div>';
|
||||
} else {
|
||||
$retval .= '</code>';
|
||||
}
|
||||
$retval .= '</div>';
|
||||
|
||||
$retval .= '<div class="tools">';
|
||||
$retval .= '<form action="sql.php" method="post">';
|
||||
|
||||
@ -44,7 +44,7 @@ abstract class SQLTransformationsPlugin extends TransformationsPlugin
|
||||
public function applyTransformation($buffer, $options = array(), $meta = '')
|
||||
{
|
||||
// see PMA_highlightSQL()
|
||||
$result = '<code class="sql"><pre>' . $buffer . '</pre></code>';
|
||||
$result = PMA_Util::formatSql($buffer);
|
||||
// Need to clear error state not to break subsequent queries display.
|
||||
PMA_SQP_resetError();
|
||||
return $result;
|
||||
|
||||
@ -1374,12 +1374,7 @@ function PMA_RTN_handleExecute()
|
||||
if ($outcome) {
|
||||
|
||||
// Pass the SQL queries through the "pretty printer"
|
||||
$output = '<code class="sql" style="margin-bottom: 1em;">';
|
||||
$output .= PMA_SQP_format(
|
||||
PMA_SQP_parse(implode($queries)),
|
||||
'text'
|
||||
);
|
||||
$output .= '</code>';
|
||||
$output = PMA_Util::formatSql(implode($queries, "\n"));
|
||||
|
||||
// Display results
|
||||
$output .= "<fieldset><legend>";
|
||||
|
||||
@ -225,14 +225,6 @@ function PMA_getAllLogItemInfo($result, $dontlimitchars)
|
||||
$html = "";
|
||||
$odd_row = true;
|
||||
while ($value = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
$len_info = $GLOBALS['PMA_String']->strlen($value['Info']);
|
||||
$len_limitChars = $GLOBALS['cfg']['LimitChars'];
|
||||
if (! $dontlimitchars && $len_info > $len_limitChars) {
|
||||
$value['Info'] = $GLOBALS['PMA_String']->substr(
|
||||
$value['Info'], 0, $GLOBALS['cfg']['LimitChars']
|
||||
) . '...';
|
||||
}
|
||||
|
||||
$html .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">'
|
||||
. '<td> ' . $value['Log_name'] . ' </td>'
|
||||
. '<td class="right"> ' . $value['Pos'] . ' </td>'
|
||||
@ -242,9 +234,8 @@ function PMA_getAllLogItemInfo($result, $dontlimitchars)
|
||||
. (isset($value['Orig_log_pos'])
|
||||
? $value['Orig_log_pos'] : $value['End_log_pos'])
|
||||
. ' </td>'
|
||||
. '<td><code class="sql"><pre> ' . htmlspecialchars($value['Info'])
|
||||
. ' </pre></code></td>'
|
||||
. '</tr>';
|
||||
. '<td> ' . PMA_Util::formatSql($value['Info'], ! $dontlimitchars)
|
||||
. ' </td></tr>';
|
||||
|
||||
$odd_row = !$odd_row;
|
||||
}
|
||||
|
||||
@ -533,15 +533,7 @@ function PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql)
|
||||
if (empty($process['Info'])) {
|
||||
$retval .= '---';
|
||||
} else {
|
||||
$cfg_maxDisplaySQL = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'];
|
||||
if (! $show_full_sql && strlen($process['Info']) > $cfg_maxDisplaySQL) {
|
||||
$info = substr($process['Info'], 0, $cfg_maxDisplaySQL);
|
||||
$retval .= htmlspecialchars($info) . '[...]';
|
||||
} else {
|
||||
$retval .= '<code class="sql"><pre>'
|
||||
. $process['Info']
|
||||
. '</pre></code>';
|
||||
}
|
||||
$retval .= PMA_Util::formatSql($process['Info'], ! $show_full_sql);
|
||||
}
|
||||
$retval .= '</td>';
|
||||
$retval .= '</tr>';
|
||||
|
||||
@ -2297,12 +2297,6 @@ function PMA_SQP_format(
|
||||
$html_line_break = '<br />';
|
||||
break;
|
||||
} // end switch
|
||||
// inner_sql is a span that exists for all cases, except query_only
|
||||
// to make possible a replacement
|
||||
// for inline editing
|
||||
if ($mode!='query_only') {
|
||||
$str .= '<span class="inner_sql">';
|
||||
}
|
||||
$indent = 0;
|
||||
$bracketlevel = 0;
|
||||
$functionlevel = 0;
|
||||
@ -2739,10 +2733,6 @@ function PMA_SQP_format(
|
||||
$indent--;
|
||||
$str .= ($mode != 'query_only' ? '</div>' : ' ');
|
||||
}
|
||||
if ($mode!='query_only') {
|
||||
// close inner_sql span
|
||||
$str .= '</span>';
|
||||
}
|
||||
|
||||
return $str;
|
||||
} // end of the "PMA_SQP_format()" function
|
||||
|
||||
@ -19,9 +19,9 @@ class PMA_FormatSql_Test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
$this->assertEquals(
|
||||
'<span class="inner_sql"><pre>' . "\n"
|
||||
'<code class="sql"><pre>' . "\n"
|
||||
. 'SELECT 1 < 2' . "\n"
|
||||
. '</pre></span>',
|
||||
. '</pre></code>',
|
||||
PMA_Util::formatSql('SELECT 1 < 2')
|
||||
);
|
||||
}
|
||||
@ -31,9 +31,9 @@ class PMA_FormatSql_Test extends PHPUnit_Framework_TestCase
|
||||
$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 6;
|
||||
|
||||
$this->assertEquals(
|
||||
'<span class="inner_sql"><pre>' . "\n"
|
||||
'<code class="sql"><pre>' . "\n"
|
||||
. 'SELECT[...]' . "\n"
|
||||
. '</pre></span>',
|
||||
. '</pre></code>',
|
||||
PMA_Util::formatSql('SELECT 1 < 2', true)
|
||||
);
|
||||
}
|
||||
|
||||
@ -1327,7 +1327,7 @@ div.sqlvalidate {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#result_query code.sql,
|
||||
#result_query div.sqlOuter,
|
||||
div.sqlvalidate {
|
||||
border: <?php echo $GLOBALS['cfg']['MainColor']; ?> solid 1px;
|
||||
border-top: 0;
|
||||
|
||||
@ -1689,7 +1689,11 @@ div.sqlvalidate {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#result_query code.sql,
|
||||
#result_query div.sqlOuter {
|
||||
background: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
#PMA_slidingMessage code.sql,
|
||||
div.sqlvalidate {
|
||||
background: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user