Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-09-20 20:40:11 +02:00
commit 16c903fc9b
2 changed files with 21 additions and 5 deletions

View File

@ -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

View File

@ -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();