make inline editing work for all cases of fmtType
This commit is contained in:
@@ -1703,13 +1703,13 @@ function changeMIMEType(db, table, reference, mime_type)
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
var $oldText,$db,$table,$token,$sql_query;
|
||||
$oldText=$(".syntax").html();
|
||||
$oldText=$(".inner_sql").html();
|
||||
$("#inline_edit").click(function(){
|
||||
$db=$("input[name='db']").val();
|
||||
$table=$("input[name='table']").val();
|
||||
$token=$("input[name='token']").val();
|
||||
$sql_query=$("input[name='sql_query']").val();
|
||||
$(".syntax").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ $sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">");
|
||||
$(".inner_sql").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ $sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">");
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1718,7 +1718,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
$("#btnDiscard").live("click",function(){
|
||||
$(".sql").html("<span class=\"syntax\">"+$oldText+"</span>");
|
||||
$(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">"+$oldText+"</span></span>");
|
||||
});
|
||||
|
||||
$('.sqlbutton').click(function(evt){
|
||||
|
@@ -320,7 +320,7 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
|
||||
switch ($cfg['SQP']['fmtType']) {
|
||||
case 'none':
|
||||
if ($unparsed_sql != '') {
|
||||
$formatted_sql = "<pre>\n" . PMA_SQP_formatNone(array('raw' => $unparsed_sql)) . "\n</pre>";
|
||||
$formatted_sql = '<span class="inner_sql"><pre>' . "\n" . PMA_SQP_formatNone(array('raw' => $unparsed_sql)) . "\n" . '</pre></span>';
|
||||
} else {
|
||||
$formatted_sql = PMA_SQP_formatNone($parsed_sql);
|
||||
}
|
||||
|
@@ -2092,6 +2092,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
$docu = TRUE;
|
||||
break;
|
||||
} // end switch
|
||||
// inner_sql is a span that exists for all cases
|
||||
// of $cfg['SQP']['fmtType'] to make possible a replacement
|
||||
// for inline editing
|
||||
$str .= '<span class="inner_sql">';
|
||||
$close_docu_link = false;
|
||||
$indent = 0;
|
||||
$bracketlevel = 0;
|
||||
@@ -2578,7 +2582,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
$str .= '</a>';
|
||||
$close_docu_link = false;
|
||||
}
|
||||
// close inner_sql span
|
||||
$str .= '</span>';
|
||||
if ($mode=='color') {
|
||||
// close syntax span
|
||||
$str .= '</span>';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user