Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
16c903fc9b
12
import.php
12
import.php
@ -166,6 +166,7 @@ if (!empty($id_bookmark)) {
|
||||
$import_text = PMA_Bookmark_get($db, $id_bookmark);
|
||||
if ($GLOBALS['is_ajax_request'] == true) {
|
||||
$extra_data['sql_query'] = $import_text;
|
||||
$extra_data['action_bookmark'] = $action_bookmark;
|
||||
$message = PMA_Message::success(__('Showing bookmark'));
|
||||
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
|
||||
} else {
|
||||
@ -175,8 +176,15 @@ if (!empty($id_bookmark)) {
|
||||
case 2: // bookmarked query that have to be deleted
|
||||
$import_text = PMA_Bookmark_get($db, $id_bookmark);
|
||||
PMA_Bookmark_delete($db, $id_bookmark);
|
||||
$run_query = false;
|
||||
$error = true; // this is kind of hack to skip processing the query
|
||||
if ($GLOBALS['is_ajax_request'] == true) {
|
||||
$message = PMA_Message::success(__('The bookmark has been deleted.'));
|
||||
$extra_data['action_bookmark'] = $action_bookmark;
|
||||
$extra_data['id_bookmark'] = $id_bookmark;
|
||||
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
|
||||
} else {
|
||||
$run_query = false;
|
||||
$error = true; // this is kind of hack to skip processing the query
|
||||
}
|
||||
break;
|
||||
}
|
||||
} // end bookmarks reading
|
||||
|
||||
14
js/sql.js
14
js/sql.js
@ -217,9 +217,17 @@ $(document).ready(function() {
|
||||
}
|
||||
} else {
|
||||
// button_submit_bookmark
|
||||
$('#sqlquery').text(data.sql_query);
|
||||
// send to codemirror if possible
|
||||
setQuery(data.sql_query);
|
||||
//
|
||||
// view only
|
||||
if ('1' == data.action_bookmark) {
|
||||
$('#sqlquery').text(data.sql_query);
|
||||
// send to codemirror if possible
|
||||
setQuery(data.sql_query);
|
||||
}
|
||||
// delete
|
||||
if ('2' == data.action_bookmark) {
|
||||
$("#id_bookmark option[value='" + data.id_bookmark . "']").remove();
|
||||
}
|
||||
// fade out previous messages, if any
|
||||
$('.success').fadeOut();
|
||||
$('.sqlquery_message').fadeOut();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user