[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_1RC1-1400-g8590dc5
Madhura Jayaratne
madhuracj at users.sourceforge.net
Tue May 17 18:52:16 CEST 2011
The branch, master has been updated
via 8590dc5a7f206b04512041e2fdf5701643f498ef (commit)
via b091f91f92060b4911120ae3a8fc8d82364c9eb8 (commit)
from f1ed2782a749f3b43a47ddb30b59867f431e53a8 (commit)
- Log -----------------------------------------------------------------
commit 8590dc5a7f206b04512041e2fdf5701643f498ef
Merge: f1ed2782a749f3b43a47ddb30b59867f431e53a8 b091f91f92060b4911120ae3a8fc8d82364c9eb8
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date: Tue May 17 22:20:54 2011 +0530
Merge branch 'QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
js/functions.js | 2 +-
js/messages.php | 1 +
js/sql.js | 127 +++++++++++++++++++++++++--------------
themes/original/img/b_close.png | Bin 0 -> 250 bytes
themes/original/img/b_save.png | Bin 0 -> 603 bytes
themes/pmahomme/img/b_close.png | Bin 0 -> 250 bytes
7 files changed, 84 insertions(+), 47 deletions(-)
create mode 100644 themes/original/img/b_close.png
create mode 100644 themes/original/img/b_save.png
create mode 100644 themes/pmahomme/img/b_close.png
diff --git a/ChangeLog b/ChangeLog
index c107110..0462842 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
- bug #3285929 [privileges] Revert temporary fix
- bug #3302872 [synchronize] Synchronize and user name
- bug #3302733 [core] Some browsers report an insecure https connection
+- bug #3301249 [interface] Iconic table operations does not remove inline edit label
3.4.0.0 (2011-05-11)
+ rfe #2890226 [view] Enable VIEW rename
diff --git a/js/functions.js b/js/functions.js
index 570f578..a5118df 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -610,7 +610,7 @@ $(document).ready(function() {
*/
$('tr.odd:not(.noclick), tr.even:not(.noclick)').live('click',function(e) {
// do not trigger when clicked on anchor
- if ($(e.target).is('a, a *')) {
+ if ($(e.target).is('a, img, a *')) {
return;
}
// XXX: FF fires two click events for <label> (label and checkbox), so we need to handle this differently
diff --git a/js/messages.php b/js/messages.php
index 8af89c8..a710260 100644
--- a/js/messages.php
+++ b/js/messages.php
@@ -93,6 +93,7 @@ $js_messages['strImportCSV'] = __('Note: If the file contains multiple tables, t
$js_messages['strHideQueryBox'] = __('Hide query box');
$js_messages['strShowQueryBox'] = __('Show query box');
$js_messages['strInlineEdit'] = __('Inline Edit');
+$js_messages['strEdit'] = __('Edit');
$js_messages['strSave'] = __('Save');
$js_messages['strHide'] = __('Hide');
diff --git a/js/sql.js b/js/sql.js
index 1872e12..13fade0 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -7,13 +7,14 @@
*
*/
+var $data_a;
+
/**
* decode a string URL_encoded
*
* @param string str
* @return string the URL-decoded string
*/
-var data_vt;
function PMA_urldecode(str) {
return decodeURIComponent(str.replace(/\+/g, '%20'));
}
@@ -81,10 +82,16 @@ function appendInlineAnchor() {
$cloned_tr.find('td')
.addClass('inline_edit_anchor')
- .find('a').attr('href', '#')
- .find('span')
- .text(' ' + PMA_messages['strInlineEdit'])
- .prepend($img_object);
+ .find('a').attr('href', '#');
+ var $edit_span = $cloned_tr.find('span:contains("' + PMA_messages['strEdit'] + '")');
+ var $span = $cloned_tr.find('a').find('span');
+ if ($edit_span.length > 0) {
+ $span.text(' ' + PMA_messages['strInlineEdit']);
+ $span.prepend($img_object);
+ } else {
+ $span.text('');
+ $span.append($img_object);
+ }
$cloned_tr.insertAfter($this_tr);
});
@@ -109,14 +116,16 @@ function appendInlineAnchor() {
if ($img_object.length != 0) {
var img_src = $img_object.attr('src').replace(/b_edit/,'b_inline_edit');
$img_object.attr('src', img_src);
- $cloned_anchor
- .find('a').attr('href', '#')
- .find('span')
- .text(' ' + PMA_messages['strInlineEdit']);
- $cloned_anchor
- .find('span')
- .first()
- .prepend($img_object);
+ $cloned_anchor.find('a').attr('href', '#');
+ var $edit_span = $cloned_anchor.find('span:contains("' + PMA_messages['strEdit'] + '")');
+ var $span = $cloned_anchor.find('a').find('span');
+ if ($edit_span.length > 0) {
+ $span.text(' ' + PMA_messages['strInlineEdit']);
+ $span.prepend($img_object);
+ } else {
+ $span.text('');
+ $span.append($img_object);
+ }
} else {
// Only text is displayed. See $cfg['PropertiesIconic']
$cloned_anchor.find('a').attr('href', '#');
@@ -447,24 +456,58 @@ $(document).ready(function() {
// Looping through all columns or rows, to find the required data and then storing it in an array.
var $this_children = $edit_td.children('span.nowrap').children('a').children('span.nowrap');
- if (disp_mode != 'vertical') {
+ // Keep the original data preserved.
+ $data_a = $edit_td.children('span.nowrap').children('a').clone();
+
+ // Change the inline edit to save.
+ var $img_object = $this_children.find('img');
+
+ // If texts are displayed. See $cfg['PropertiesIconic']
+ if ($this_children.parent('a').find('span:contains("' + PMA_messages['strInlineEdit'] + '")').length > 0) {
+ $this_children.text(' ' + PMA_messages['strSave']);
+ } else {
$this_children.empty();
- $this_children.text(PMA_messages['strSave']);
+ }
+
+ // If icons are displayed. See $cfg['PropertiesIconic']
+ if ($img_object.length > 0) {
+ $img_object.attr('title', PMA_messages['strSave']);
+ var img_src = $img_object.attr('src').replace(/b_inline_edit/,'b_save');
+ $img_object.attr('src', img_src);
+ $this_children.prepend($img_object);
+ }
+
+ // Clone the save link and change it to create the hide link.
+ var $hide_a = $edit_td.children('span.nowrap').children('a').clone().attr('id', 'hide');
+ var $hide_span = $hide_a.find('span');
+ var $img_object = $hide_a.find('span img');
+
+ // If texts are displayed. See $cfg['PropertiesIconic']
+ if ($hide_a.find('span:contains("' + PMA_messages['strSave'] + '")').length > 0) {
+ $hide_span.text(' ' + PMA_messages['strHide']);
} else {
- // vertical
- data_vt = $this_children.html();
- $this_children.text(PMA_messages['strSave']);
+ $hide_span.empty();
+ }
+
+ // If icons are displayed. See $cfg['PropertiesIconic']
+ if ($img_object.length > 0) {
+ $img_object.attr('title', PMA_messages['strHide']);
+ var img_src = $img_object.attr('src').replace(/b_save/,'b_close');
+ $img_object.attr('src', img_src);
+ $hide_span.prepend($img_object);
}
- var hide_link = '<br /><br /><a id="hide">' + PMA_messages['strHide'] + '</a>';
+ // Add hide icon and/or text.
+ $edit_td.children('span.nowrap').append($('<br /><br />')).append($hide_a);
+
if (disp_mode != 'vertical') {
- $edit_td.append(hide_link);
- $('#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']);
+ $('#table_results tbody tr td span a#hide').click(function() {
+ var $this_hide = $(this).parents('td');
+
+ var $this_span = $this_hide.find('span');
+ $this_span.find('a, br').remove();
+ $this_span.append($data_a.clone());
- var $this_hide = $(this).parent();
$this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor");
$this_hide.parent().removeClass("hover noclick");
$this_hide.siblings().removeClass("hover");
@@ -489,14 +532,15 @@ $(document).ready(function() {
var txt = '';
var rows = $edit_td.parent().siblings().length;
- $edit_td.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);
+ $('#table_results tbody tr td span a#hide').click(function() {
+ var $hide_a = $(this);
+ var pos = $hide_a.parents('td').index();
+
+ var $this_span = $hide_a.parent();
+ $this_span.find('a, br').remove();
+ $this_span.append($data_a.clone());
- var $this_row = $(this).parents('tr');
+ var $this_row = $this_span.parents('tr');
// changing inline_edit_active to inline_edit_anchor
$this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("inline_edit_active").addClass("inline_edit_anchor");
@@ -962,19 +1006,10 @@ $(document).ready(function() {
*/
function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode) {
- // deleting the hide button
- // remove <br><br><a> tags
- for ( var i = 0; i <= 2; i++) {
- $del_hide.next().remove();
- }
- if(disp_mode != 'vertical'){
- $chg_submit.empty();
- $chg_submit.html('<span class="nowrap"></span>');
- $chg_submit.children('span.nowrap').text(PMA_messages['strInlineEdit']);
- } else {
- $chg_submit.children('span.nowrap').empty();
- $chg_submit.children('span.nowrap').append(data_vt);
- }
+ // deleting the hide button. remove <br><br><a> tags
+ $del_hide.find('a, br').remove();
+ // append inline edit button.
+ $del_hide.append($data_a.clone());
// changing inline_edit_active to inline_edit_anchor
$this_td.removeClass('inline_edit_active').addClass('inline_edit_anchor');
@@ -984,7 +1019,7 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
if(disp_mode != 'vertical') {
$this_td.parent('tr').removeClass('hover').find('td').removeClass('hover');
} else {
- $this_td.parents('tbody').find('tr').find('td:eq(' + $this_td.index() + ')').removeClass('marked');
+ $this_td.parents('tbody').find('tr').find('td:eq(' + $this_td.index() + ')').removeClass('marked hover');
}
$input_siblings.each(function() {
diff --git a/themes/original/img/b_close.png b/themes/original/img/b_close.png
new file mode 100644
index 0000000..8ad396e
Binary files /dev/null and b/themes/original/img/b_close.png differ
diff --git a/themes/original/img/b_save.png b/themes/original/img/b_save.png
new file mode 100644
index 0000000..7c8d475
Binary files /dev/null and b/themes/original/img/b_save.png differ
diff --git a/themes/pmahomme/img/b_close.png b/themes/pmahomme/img/b_close.png
new file mode 100644
index 0000000..8ad396e
Binary files /dev/null and b/themes/pmahomme/img/b_close.png differ
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list