Merge remote branch 'origin/master'
This commit is contained in:
@@ -1722,23 +1722,23 @@ function changeMIMEType(db, table, reference, mime_type)
|
||||
* Jquery Coding for inline editing SQL_QUERY
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
var $oldText,$db,$table,$token,$sql_query;
|
||||
$oldText=$(".inner_sql").html();
|
||||
var oldText,db,table,token,sql_query;
|
||||
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();
|
||||
$(".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'] + "\">");
|
||||
db=$("input[name='db']").val();
|
||||
table=$("input[name='table']").val();
|
||||
token=$("input[name='token']").val();
|
||||
sql_query=$("input[name='sql_query']").val();
|
||||
$(".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;
|
||||
});
|
||||
|
||||
$("#btnSave").live("click",function(){
|
||||
window.location.replace("import.php?db="+$db+"&table="+$table+"&sql_query="+$("#sql_query_edit").val()+"&show_query=1&token="+$token+"");
|
||||
window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + $("#sql_query_edit").val()+"&show_query=1&token=" + token + "");
|
||||
});
|
||||
|
||||
$("#btnDiscard").live("click",function(){
|
||||
$(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">"+$oldText+"</span></span>");
|
||||
$(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">" + oldText + "</span></span>");
|
||||
});
|
||||
|
||||
$('.sqlbutton').click(function(evt){
|
||||
|
@@ -1232,18 +1232,23 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
// in the tools div, only display the Inline link when not in ajax
|
||||
// mode because 1) it currently does not work and 2) we would
|
||||
// have two similar mechanisms on the page for the same goal
|
||||
if ($GLOBALS['is_ajax_request'] === false) {
|
||||
// see in js/functions.js the jQuery code attached to id inline_edit
|
||||
// document.write conflicts with jQuery, hence used $().append()
|
||||
$inline_edit = "<script type=\"text/javascript\">\n" .
|
||||
"//<![CDATA[\n" .
|
||||
"$('.tools').append('[<a href=\"#\" title=\"" .
|
||||
PMA_escapeJsString(__('Inline edit of this query')) .
|
||||
"\" id=\"inline_edit\">" .
|
||||
PMA_escapeJsString(__('Inline')) .
|
||||
"</a>]');\n" .
|
||||
"//]]>\n" .
|
||||
"</script>";
|
||||
echo $inline_edit . $edit_link . $explain_link . $php_link . $refresh_link . $validate_link;
|
||||
echo "<script type=\"text/javascript\">\n" .
|
||||
"//<![CDATA[\n" .
|
||||
"$('.tools').append('[<a href=\"#\" title=\"" .
|
||||
PMA_escapeJsString(__('Inline edit of this query')) .
|
||||
"\" id=\"inline_edit\">" .
|
||||
PMA_escapeJsString(__('Inline')) .
|
||||
"</a>]');\n" .
|
||||
"//]]>\n" .
|
||||
"</script>";
|
||||
}
|
||||
echo $edit_link . $explain_link . $php_link . $refresh_link . $validate_link;
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div><br />' . "\n";
|
||||
|
Reference in New Issue
Block a user