Merge remote branch 'origin/master'

This commit is contained in:
Pootle server
2010-10-08 20:40:11 +02:00
2 changed files with 24 additions and 19 deletions

View File

@@ -1722,23 +1722,23 @@ function changeMIMEType(db, table, reference, mime_type)
* Jquery Coding for inline editing SQL_QUERY * Jquery Coding for inline editing SQL_QUERY
*/ */
$(document).ready(function(){ $(document).ready(function(){
var $oldText,$db,$table,$token,$sql_query; var oldText,db,table,token,sql_query;
$oldText=$(".inner_sql").html(); oldText=$(".inner_sql").html();
$("#inline_edit").click(function(){ $("#inline_edit").click(function(){
$db=$("input[name='db']").val(); db=$("input[name='db']").val();
$table=$("input[name='table']").val(); table=$("input[name='table']").val();
$token=$("input[name='token']").val(); token=$("input[name='token']").val();
$sql_query=$("input[name='sql_query']").val(); sql_query=$("input[name='sql_query']").val();
$(".inner_sql").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ $sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">"); $(".inner_sql").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">");
return false; return false;
}); });
$("#btnSave").live("click",function(){ $("#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(){ $("#btnDiscard").live("click",function(){
$(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">"+$oldText+"</span></span>"); $(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">" + oldText + "</span></span>");
}); });
$('.sqlbutton').click(function(evt){ $('.sqlbutton').click(function(evt){

View File

@@ -1232,18 +1232,23 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
echo '</form>'; echo '</form>';
} }
// 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 // see in js/functions.js the jQuery code attached to id inline_edit
// document.write conflicts with jQuery, hence used $().append() // document.write conflicts with jQuery, hence used $().append()
$inline_edit = "<script type=\"text/javascript\">\n" . echo "<script type=\"text/javascript\">\n" .
"//<![CDATA[\n" . "//<![CDATA[\n" .
"$('.tools').append('[<a href=\"#\" title=\"" . "$('.tools').append('[<a href=\"#\" title=\"" .
PMA_escapeJsString(__('Inline edit of this query')) . PMA_escapeJsString(__('Inline edit of this query')) .
"\" id=\"inline_edit\">" . "\" id=\"inline_edit\">" .
PMA_escapeJsString(__('Inline')) . PMA_escapeJsString(__('Inline')) .
"</a>]');\n" . "</a>]');\n" .
"//]]>\n" . "//]]>\n" .
"</script>"; "</script>";
echo $inline_edit . $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; }
echo $edit_link . $explain_link . $php_link . $refresh_link . $validate_link;
echo '</div>'; echo '</div>';
} }
echo '</div><br />' . "\n"; echo '</div><br />' . "\n";