From 8eec123dd8f45a45b7324ba0e89b0da0e688badd Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 8 Oct 2010 12:53:06 -0400 Subject: [PATCH 1/2] we should not prefix a js variable name with dollar sign unless it is a jQuery object --- js/functions.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/functions.js b/js/functions.js index 03cf18690..57bbd882c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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(""); + 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(""); 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(""+$oldText+""); + $(".sql").html("" + oldText + ""); }); $('.sqlbutton').click(function(evt){ From b5cd7e69ea4d29ad6b7a8e12bbc8fdec9966b72f Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 8 Oct 2010 13:21:27 -0400 Subject: [PATCH 2/2] inline edit (in tools) and ajax mode --- libraries/common.lib.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index b1da1de11..104af09cd 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1232,18 +1232,23 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view echo ''; } + // 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 = ""; - echo $inline_edit . $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; + echo ""; + } + echo $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; echo ''; } echo '
' . "\n";