Code formatting to improve readability.

This commit is contained in:
Madhura Jayaratne
2011-04-10 20:33:17 +05:30
parent 5d147c25af
commit 63dd25baac

View File

@@ -800,15 +800,16 @@ $(document).ready(function() {
var need_to_post = false; var need_to_post = false;
var new_clause=''; var new_clause = '';
var prev_index=-1; var prev_index = -1;
$input_siblings.each(function() { $input_siblings.each(function() {
/** @lends jQuery */ /** @lends jQuery */
/** /**
* @var this_field Object referring to this field (<td>) * @var this_field Object referring to this field (<td>)
*/ */
var $this_field = $(this); var $this_field = $(this);
/** /**
* @var field_name String containing the name of this field. * @var field_name String containing the name of this field.
* @see getFieldName() * @see getFieldName()
@@ -861,7 +862,7 @@ $(document).ready(function() {
} }
} }
if(where_clause.indexOf(field_name) > prev_index){ if(where_clause.indexOf(field_name) > prev_index){
new_clause += '`'+window.parent.table+'`.'+'`' + field_name + "` = '"+this_field_params[field_name].replace(/'/g,"''")+"'"+' AND '; new_clause += '`' + window.parent.table + '`.' + '`' + field_name + "` = '" + this_field_params[field_name].replace(/'/g,"''") + "'" + ' AND ';
} }
if (this_field_params[field_name] != $this_field.data('original_data')) { if (this_field_params[field_name] != $this_field.data('original_data')) {
sql_query += ' `' + field_name + "`='" + this_field_params[field_name].replace(/'/g, "''") + "' , "; sql_query += ' `' + field_name + "`='" + this_field_params[field_name].replace(/'/g, "''") + "' , ";
@@ -876,8 +877,8 @@ $(document).ready(function() {
//Remove the last ',' appended in the above loop //Remove the last ',' appended in the above loop
sql_query = sql_query.replace(/,\s$/, ''); sql_query = sql_query.replace(/,\s$/, '');
new_clause=new_clause.substring(0,new_clause.length-5); new_clause = new_clause.substring(0, new_clause.length-5);
new_clause=PMA_urlencode(new_clause); new_clause = PMA_urlencode(new_clause);
sql_query += ' WHERE ' + PMA_urldecode(where_clause); sql_query += ' WHERE ' + PMA_urldecode(where_clause);
/** /**
* @var rel_fields_list String, url encoded representation of {@link relations_fields} * @var rel_fields_list String, url encoded representation of {@link relations_fields}
@@ -890,8 +891,8 @@ $(document).ready(function() {
var transform_fields_list = $.param(transform_fields); var transform_fields_list = $.param(transform_fields);
// if inline_edit is successful, we need to go back to default view // if inline_edit is successful, we need to go back to default view
var $del_hide=$(this).parent(); var $del_hide = $(this).parent();
var $chg_submit=$(this); var $chg_submit = $(this);
if (need_to_post) { if (need_to_post) {
// Make the Ajax post after setting all parameters // Make the Ajax post after setting all parameters
@@ -917,10 +918,10 @@ $(document).ready(function() {
if(data.success == true) { if(data.success == true) {
PMA_ajaxShowMessage(data.message); PMA_ajaxShowMessage(data.message);
if(disp_mode == 'vertical') { if(disp_mode == 'vertical') {
$this_td.parents('tbody').find('tr').find('.where_clause:nth('+this_td_index+')').attr('value',new_clause); $this_td.parents('tbody').find('tr').find('.where_clause:nth(' + this_td_index + ')').attr('value', new_clause);
} }
else { else {
$this_td.parent('tr').find('.where_clause').attr('value',new_clause); $this_td.parent('tr').find('.where_clause').attr('value', new_clause);
} }
// remove possible previous feedback message // remove possible previous feedback message
$('#result_query').remove(); $('#result_query').remove();