diff --git a/ChangeLog b/ChangeLog index f1694a5bb..c0655baee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,7 @@ $Id$ + patch #2967320 [designer] Colored relations based on the primary key, thanks to GreenRover - greenrover - [core] Provide way for vendors to easily change paths to config files. ++ patch #2979922, rfe #2804874 [interface] Add inline query editing, thanks to Muhammd Adnan. 3.3.2.0 (not yet released) - patch #2969449 [core] Name for MERGE engine varies depending on the diff --git a/js/functions.js b/js/functions.js index 302b131c0..a42439e5f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1654,3 +1654,25 @@ function changeMIMEType(db, table, reference, mime_type) var chgRequest = new Request({ method: 'post', url: mime_chg_url, data: params, evalScripts: true }); chgRequest.send(); } +// Jquery Coding for inline editing SQL_QUERY +$(document).ready(function(){ + var $oldText,$db,$table,$token,$sql_query; + $oldText=$(".syntax").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(); + +$(".syntax").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+""); + }); + + $("#btnDiscard").live("click",function(){ + $(".sql").html(""+$oldText+""); + }); +}); \ No newline at end of file diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 80ec1da1c..6edbd5557 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1270,7 +1270,8 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view if (! empty($refresh_link)) { PMA_profilingCheckbox($sql_query); } - echo $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; + $inline_edit=""; + echo $inline_edit . $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; echo ''; } echo '
' . "\n"; diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index 7fafa1537..33c9015cb 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -981,7 +981,11 @@ textarea#sqlquery { width: 100%; /* height: 100%; */ } - +textarea#sql_query_edit{ +height:7em; +width: 95%; +display:block; +} div#queryboxcontainer div#bookmarkoptions { margin-top: 0.5em; } diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index b550fab37..4d649b40c 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -929,7 +929,11 @@ textarea#sqlquery { width: 100%; /* height: 100%; */ } - +textarea#sql_query_edit{ +height:7em; +width: 95%; +display:block; +} div#queryboxcontainer div#bookmarkoptions { margin-top: 0.5em; }