From 7ef6fbaabc39289ee743811e4a62fedd343b8a8a Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 06:09:09 +0530 Subject: [PATCH 01/10] Fix highlighting for save/hide of inline-edit --- js/sql.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/sql.js b/js/sql.js index 9b5edf99d3..b513ffb288 100644 --- a/js/sql.js +++ b/js/sql.js @@ -441,6 +441,8 @@ $(document).ready(function() { $this_children.text(PMA_messages['strInlineEdit']); var $this_hide = $(this).parent(); $this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor"); + $this_hide.parent().removeClass("hover"); + $this_hide.siblings().removeClass("hover"); var last_column = $this_hide.siblings().length; var txt = []; var blob_index = []; @@ -919,7 +921,9 @@ $(document).ready(function() { } PMA_ajaxShowMessage(data.message); - $this_td.removeClass('inline_edit_active').addClass('inline_edit_anchor'); + $this_td.removeClass('inline_edit_active hover').addClass('inline_edit_anchor'); + $this_td.parent().removeClass('hover') + $this_td.siblings().removeClass('hover'); $input_siblings.each(function() { // Inline edit post has been successful. From 2e2474eb682f72389d90a9e5dbf8da32ec2ce1fe Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 07:52:45 +0530 Subject: [PATCH 02/10] Identify non inline-editable columns based on class 'inline_edit'. --- js/sql.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/sql.js b/js/sql.js index b513ffb288..dda174eedb 100644 --- a/js/sql.js +++ b/js/sql.js @@ -448,7 +448,7 @@ $(document).ready(function() { var blob_index = []; var k = 0; for(var i = 4; i < last_column; i++){ - if($this_hide.siblings("td:eq(" + i + ")").children('a:eq(0)').length ){ + if($this_hide.siblings("td:eq(" + i + ")").hasClass("inline_edit") == false){ blob_index[k] = i; k++; continue; @@ -497,7 +497,7 @@ $(document).ready(function() { var blob_index = []; var k = 0; for( var i = 6; i <= rows + 2; i++){ - if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ") a:eq(0)").length !=0 ){ + if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false){ blob_index[k] = i; k++; continue; From 0068d42f73a1493d2ea05f729b2b7fa0afd80367 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 07:59:29 +0530 Subject: [PATCH 03/10] Optimize. We can do what is being done in two for-loops in one for-loop and avoid unnecessary temporary variables. --- js/sql.js | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/js/sql.js b/js/sql.js index dda174eedb..2f0256a796 100644 --- a/js/sql.js +++ b/js/sql.js @@ -444,26 +444,15 @@ $(document).ready(function() { $this_hide.parent().removeClass("hover"); $this_hide.siblings().removeClass("hover"); var last_column = $this_hide.siblings().length; - var txt = []; - var blob_index = []; - var k = 0; + var txt = ''; for(var i = 4; i < last_column; i++){ if($this_hide.siblings("td:eq(" + i + ")").hasClass("inline_edit") == false){ - blob_index[k] = i; - k++; - continue; - } - txt[i - 4] = $this_hide.siblings("td:eq(" + i + ")").children(' .original_data').html(); - } - k = 0; - for (var i = 4; i < last_column; i++){ - if ( blob_index[k] == i){ - k++; continue; } + txt = $this_hide.siblings("td:eq(" + i + ")").children(' .original_data').html(); if($this_hide.siblings("td:eq(" + i + ")").children().length !=0){ $this_hide.siblings("td:eq(" + i + ")").empty(); - $this_hide.siblings("td:eq(" + i + ")").append(txt[i-4]); + $this_hide.siblings("td:eq(" + i + ")").append(txt); } } $(this).prev().prev().remove(); @@ -471,7 +460,7 @@ $(document).ready(function() { $(this).remove(); }); } else { - var txt=[]; + var txt=''; var rows=$(this).parent().siblings().length;; $(this).append(hide_link); @@ -494,24 +483,13 @@ $(document).ready(function() { $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); } - var blob_index = []; - var k = 0; for( var i = 6; i <= rows + 2; i++){ - if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false){ - blob_index[k] = i; - k++; - continue; - } - txt[i - 6] = $this_row.siblings("tr:eq(" + i + ") td:eq("+pos+") span.original_data").html(); - } - k = 0; - for (var i = 6; i <= rows + 2; i++){ - if(blob_index[k] == i){ - k++; + if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false){ continue; } + txt = $this_row.siblings("tr:eq(" + i + ") td:eq("+pos+") span.original_data").html(); $this_row.siblings("tr:eq("+i+") td:eq("+pos+")").empty(); - $this_row.siblings("tr:eq("+i+") td:eq("+pos+")").append(txt[ i - 6]); + $this_row.siblings("tr:eq("+i+") td:eq("+pos+")").append(txt); } $(this).prev().remove(); $(this).prev().remove(); From ed00eea0a363f463a784a96caf5ddc0a702ea3c1 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 08:09:46 +0530 Subject: [PATCH 04/10] Code formatting. Make the code more readable. --- js/sql.js | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/js/sql.js b/js/sql.js index 2f0256a796..3ebd9a8dad 100644 --- a/js/sql.js +++ b/js/sql.js @@ -423,34 +423,36 @@ $(document).ready(function() { // looping through all columns or rows, to find the required data and then storing it in an array. var $this_children = $(this).children('span.nowrap').children('a').children('span.nowrap'); - if (disp_mode != 'vertical'){ + if (disp_mode != 'vertical') { $this_children.empty(); $this_children.text(PMA_messages['strSave']); } else { - // vertical + // vertical data_vt = $this_children.html(); $this_children.text(PMA_messages['strSave']); } var hide_link = '

' + PMA_messages['strHide'] + ''; - if (disp_mode != 'vertical'){ + if (disp_mode != 'vertical') { $(this).append(hide_link); - $('#table_results tbody tr td a#hide').click(function(){ + $('#table_results tbody tr td a#hide').click(function() { $this_children = $(this).siblings('span.nowrap').children('a').children('span.nowrap'); $this_children.empty(); $this_children.text(PMA_messages['strInlineEdit']); + var $this_hide = $(this).parent(); $this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor"); $this_hide.parent().removeClass("hover"); $this_hide.siblings().removeClass("hover"); + var last_column = $this_hide.siblings().length; var txt = ''; - for(var i = 4; i < last_column; i++){ - if($this_hide.siblings("td:eq(" + i + ")").hasClass("inline_edit") == false){ + for(var i = 4; i < last_column; i++) { + if($this_hide.siblings("td:eq(" + i + ")").hasClass("inline_edit") == false) { continue; } txt = $this_hide.siblings("td:eq(" + i + ")").children(' .original_data').html(); - if($this_hide.siblings("td:eq(" + i + ")").children().length !=0){ + if($this_hide.siblings("td:eq(" + i + ")").children().length != 0) { $this_hide.siblings("td:eq(" + i + ")").empty(); $this_hide.siblings("td:eq(" + i + ")").append(txt); } @@ -458,22 +460,20 @@ $(document).ready(function() { $(this).prev().prev().remove(); $(this).prev().remove(); $(this).remove(); - }); + }); } else { - var txt=''; - var rows=$(this).parent().siblings().length;; + var txt = ''; + var rows = $(this).parent().siblings().length; $(this).append(hide_link); - $('#table_results tbody tr td a#hide').click(function(){ - - var pos=$(this).parent().index(); - var $chg_submit=$(this).parent().children('span.nowrap').children('a').children('span.nowrap'); + $('#table_results tbody tr td a#hide').click(function() { + var pos = $(this).parent().index(); + var $chg_submit = $(this).parent().children('span.nowrap').children('a').children('span.nowrap'); $chg_submit.empty(); $chg_submit.append(data_vt); - - var $this_row=$(this).parent().parent(); - //alert(pos); - if(parseInt(pos)%2==0){ + + var $this_row = $(this).parent().parent(); + if(parseInt(pos) % 2 == 0) { $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active").addClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); @@ -481,21 +481,19 @@ $(document).ready(function() { $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); - } for( var i = 6; i <= rows + 2; i++){ - if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false){ + if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false) { continue; } - txt = $this_row.siblings("tr:eq(" + i + ") td:eq("+pos+") span.original_data").html(); - $this_row.siblings("tr:eq("+i+") td:eq("+pos+")").empty(); - $this_row.siblings("tr:eq("+i+") td:eq("+pos+")").append(txt); + txt = $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ") span.original_data").html(); + $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").empty(); + $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").append(txt); } $(this).prev().remove(); $(this).prev().remove(); $(this).remove(); - - }); + }); } // Initialize some variables From f599afd843befcbe98771d0129bc2bb1405bdb4d Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 08:18:11 +0530 Subject: [PATCH 05/10] Proper indentation. --- js/sql.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/js/sql.js b/js/sql.js index 3ebd9a8dad..1c46c056b1 100644 --- a/js/sql.js +++ b/js/sql.js @@ -467,32 +467,32 @@ $(document).ready(function() { $(this).append(hide_link); $('#table_results tbody tr td a#hide').click(function() { - var pos = $(this).parent().index(); - var $chg_submit = $(this).parent().children('span.nowrap').children('a').children('span.nowrap'); - $chg_submit.empty(); - $chg_submit.append(data_vt); + var pos = $(this).parent().index(); + var $chg_submit = $(this).parent().children('span.nowrap').children('a').children('span.nowrap'); + $chg_submit.empty(); + $chg_submit.append(data_vt); - var $this_row = $(this).parent().parent(); - if(parseInt(pos) % 2 == 0) { - $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active").addClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); + var $this_row = $(this).parent().parent(); + if(parseInt(pos) % 2 == 0) { + $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active").addClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); - $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); - } else { - $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); + $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("odd edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); + } else { + $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); - $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); + $this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_active hover").addClass("even edit_row_anchor row_" + pos + " vpointer vmarker inline_edit_anchor"); + } + for( var i = 6; i <= rows + 2; i++){ + if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false) { + continue; } - for( var i = 6; i <= rows + 2; i++){ - if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false) { - continue; - } - txt = $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ") span.original_data").html(); - $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").empty(); - $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").append(txt); - } - $(this).prev().remove(); - $(this).prev().remove(); - $(this).remove(); + txt = $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ") span.original_data").html(); + $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").empty(); + $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").append(txt); + } + $(this).prev().remove(); + $(this).prev().remove(); + $(this).remove(); }); } From 810779c01d8a54618eebd99d0f5bd89b8dd701ec Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 12 Mar 2011 05:37:40 -0500 Subject: [PATCH 06/10] Typos --- libraries/kanji-encoding.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/kanji-encoding.lib.php b/libraries/kanji-encoding.lib.php index 1f17ef719c..67c8b1cddf 100644 --- a/libraries/kanji-encoding.lib.php +++ b/libraries/kanji-encoding.lib.php @@ -66,7 +66,7 @@ function PMA_change_enc_order() { * 2002/1/4 by Y.Kawada * * @param string the string to convert - * @param string the destinasion encoding code + * @param string the destination encoding code * @param string set 'kana' convert to JIS-X208-kana * * @global string the available encoding codes list @@ -99,7 +99,7 @@ function PMA_kanji_str_conv($str, $enc, $kana) { * 2002/1/4 by Y.Kawada * * @param string the name of the file to convert - * @param string the destinasion encoding code + * @param string the destination encoding code * @param string set 'kana' convert to JIS-X208-kana * * @return string the name of the converted file From 65a72fbeeccaa30c083a0282057f3d1f4ac4db20 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 12 Mar 2011 07:22:05 -0500 Subject: [PATCH 07/10] 3.4.0-beta4 --- Documentation.html | 4 ++-- README | 2 +- libraries/Config.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation.html b/Documentation.html index 3c40382c67..1f2dd71520 100644 --- a/Documentation.html +++ b/Documentation.html @@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - phpMyAdmin 3.4.0-beta4-dev - Documentation + phpMyAdmin 3.4.0-beta4 - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/README b/README index b7d6320856..111ee20da8 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.0-beta4-dev +Version 3.4.0-beta4 A set of PHP-scripts to manage MySQL over the web. diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 0ba6d1a0e1..96c002a3ec 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -96,7 +96,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.4.0-beta4-dev'); + $this->set('PMA_VERSION', '3.4.0-beta4'); /** * @deprecated */ From 09605e2d816117abe4da3cf47336bd692abb1726 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 12 Mar 2011 08:01:26 -0500 Subject: [PATCH 08/10] 3.4.0-rc1-dev --- Documentation.html | 4 ++-- README | 2 +- libraries/Config.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation.html b/Documentation.html index 1f2dd71520..d912e9c150 100644 --- a/Documentation.html +++ b/Documentation.html @@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - phpMyAdmin 3.4.0-beta4 - Documentation + phpMyAdmin 3.4.0-rc1-dev - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/README b/README index 111ee20da8..d848e19810 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.0-beta4 +Version 3.4.0-rc1-dev A set of PHP-scripts to manage MySQL over the web. diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 96c002a3ec..e791e31357 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -96,7 +96,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.4.0-beta4'); + $this->set('PMA_VERSION', '3.4.0-rc1-dev'); /** * @deprecated */ From 653cd113cd25693547b8493caf53089fbfd9a649 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 18:52:14 +0530 Subject: [PATCH 09/10] For binary fields remove only the 'inline_edit' class. --- libraries/display_tbl.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index d47e94df78..ca8ef620fb 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1325,9 +1325,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { // TEXT fields type so we have to ensure it's really a BLOB $field_flags = PMA_DBI_field_flags($dt_result, $i); - // reset $class from $inline_edit_class to just 'data' - // as we can't edit binary data - $class = 'data'; + // remove 'inline_edit' from $class as we can't edit binary data. + $class = str_replace('inline_edit', '', $class); if (stristr($field_flags, 'BINARY')) { if (!isset($row[$i]) || is_null($row[$i])) { From 93339354a2342a8ed19216829a6c5743b5a2256f Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 12 Mar 2011 19:08:03 +0530 Subject: [PATCH 10/10] For geometry fields remove only the 'inline_edit' class. --- libraries/display_tbl.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index ca8ef620fb..ef9e3978de 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1365,9 +1365,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { // g e o m e t r y } elseif ($meta->type == 'geometry') { $geometry_text = PMA_handle_non_printable_contents('GEOMETRY', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta); - // reset $class from $inline_edit_class to 'data' - // as we can't edit geometry data - $class = 'data'; + + // remove 'inline_edit' from $class as we can't edit geometry data. + $class = str_replace('inline_edit', '', $class); $vertical_display['data'][$row_no][$i] = PMA_buildValueDisplay($class, $condition_field, $geometry_text); unset($geometry_text);