diff --git a/js/functions.js b/js/functions.js index 1c1dddbf80..cae7ed42df 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1205,11 +1205,8 @@ function changeMIMEType(db, table, reference, mime_type) */ $(document).ready(function(){ $(".inline_edit_sql").live('click', function(){ - var server = $(this).prev().find("input[name='server']").val(); - var db = $(this).prev().find("input[name='db']").val(); - var table = $(this).prev().find("input[name='table']").val(); - var token = $(this).prev().find("input[name='token']").val(); - var sql_query = $(this).prev().find("input[name='sql_query']").val(); + var $form = $(this).prev(); + var sql_query = $form.find("input[name='sql_query']").val(); var $inner_sql = $(this).parent().prev().find('.inner_sql'); var old_text = $inner_sql.html(); @@ -1217,22 +1214,16 @@ $(document).ready(function(){ new_content += "\n"; new_content += "\n"; $inner_sql.replaceWith(new_content); - $(".btnSave").each(function(){ - $(this).click(function(){ - sql_query = $(this).prev().val(); - window.location.replace("import.php" - + "?server=" + encodeURIComponent(server) - + "&db=" + encodeURIComponent(db) - + "&table=" + encodeURIComponent(table) - + "&sql_query=" + encodeURIComponent(sql_query) - + "&show_query=1" - + "&token=" + token); - }); + $(".btnSave").click(function(){ + var sql_query = $(this).prev().val(); + var $fake_form = $('