we should not prefix a js variable name with dollar sign unless it is a jQuery object

This commit is contained in:
Marc Delisle
2010-10-08 12:53:06 -04:00
parent 7d9a0f439b
commit 8eec123dd8

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){