Merge branch 'QA_3_5'

This commit is contained in:
Marc Delisle 2012-02-01 11:43:39 -05:00
commit f9584261dc
4 changed files with 30 additions and 2 deletions

View File

@ -73,6 +73,7 @@ phpMyAdmin - ChangeLog
+ patch #3303195 [interface] Checkbox to have SQL input remain
- patch #3472899 [export] Fixed CSV escape for the export
- patch #3475424 [import] Fixed CSV escape for the import
- bug #3482734 [interface] No warning on syntax error in search form
3.4.11.0 (not yet released)

View File

@ -1150,8 +1150,25 @@ $(document).ready(function(){
new_content += "<input type=\"button\" class=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\">\n";
new_content += "<input type=\"button\" class=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">\n";
$inner_sql.replaceWith(new_content);
// These settings are duplicated from the .ready()function in functions.js
var height = $('#sql_query_edit').css('height');
codemirror_editor = CodeMirror.fromTextArea($('textarea[name="sql_query_edit"]')[0], {
lineNumbers: true,
matchBrackets: true,
indentUnit: 4,
mode: "text/x-mysql",
lineWrapping: true
});
codemirror_editor.getScrollerElement().style.height = height;
codemirror_editor.refresh();
$(".btnSave").click(function(){
var sql_query = $(this).prev().val();
if (codemirror_editor !== undefined) {
var sql_query = codemirror_editor.getValue();
} else {
var sql_query = $(this).prev().val();
}
var $fake_form = $('<form>', {action: 'import.php', method: 'post'})
.append($form.find("input[name=server], input[name=db], input[name=table], input[name=token]").clone())
.append($('<input>', {type: 'hidden', name: 'show_query', value: 1}))

View File

@ -73,7 +73,13 @@ $(document).ready(function() {
PMA_init_slider();
} else {
// error message (zero rows)
$("#sqlqueryresults").html(response['message']);
if (response.message != undefined) {
$("#sqlqueryresults").html(response['message']);
}
// other error (syntax error?)
if (response.error != undefined) {
$("#sqlqueryresults").html(response['error']);
}
}
}) // end $.post()
})

View File

@ -20,6 +20,10 @@ $GLOBALS['js_include'][] = 'tbl_change.js';
// the next one needed because sql.php may do a "goto" to tbl_structure.php
$GLOBALS['js_include'][] = 'tbl_structure.js';
$GLOBALS['js_include'][] = 'gis_data_editor.js';
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
if (isset($_SESSION['profiling'])) {
$GLOBALS['js_include'][] = 'highcharts/highcharts.js';