Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better implementation of rfe #3488185 using a jQuery UI dialog

  • Loading branch information...
commit 9a5ced626a10a0fed66dbd0059eebcd68acb85e7 1 parent 5fedf1a
Jo Michael authored
View
11 Documentation.html
@@ -4488,6 +4488,17 @@ <h4 id="faq6_32">
instructions on how to use can be viewed by clicking the 'How to use?' link located just above
the plot.</p>
+<h4 id="faq6_33">
+ <a href="#faq6_33">6.33 When browsing a table, how can I copy a column name?</a></h4>
+
+ <p>Selecting the name of the column within the browse table header cell for copying is difficult,
+ as the columns support reordering by dragging the header cells as well as sorting by clicking on
+ the linked column name.<br/><br/>
+
+ To copy a column name, double-click on the empty area next to the column name,
+ when the tooltip tells you to do so. This will show you an input box with the column name.
+ You may right-click the column name within this input box to copy it to your clipboard.</p>
+
<h3 id="faqproject">phpMyAdmin project</h3>
<h4 id="faq7_1">
View
31 js/makegrid.js
@@ -40,6 +40,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
reorderHint: '', // string, hint for column reordering
sortHint: '', // string, hint for column sorting
markHint: '', // string, hint for column marking
+ copyHint: '', // string, hint for copy column name
colVisibHint: '', // string, hint for column visibility drop-down
showReorderHint: false,
showSortHint: false,
@@ -441,6 +442,8 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
text += text.length > 0 ? '<br />' : '';
text += g.colVisibHint;
}
+ text += text.length > 0 ? '<br />' : '';
+ text += g.copyHint;
// hide the hint if no text and the event is mouseenter
if (g.qtip) {
@@ -1428,18 +1431,21 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.showReorderHint = false;
})
.dblclick(function(e) {
- if ($(this).find("input").length) {
- $(this).find("span").hide().end().find("input").show().focus().select();
- }
- else {
- var $input = $("<input/>")
- .val($(this).find("span").text())
- .blur(function (e) {
- $(this).hide().parent().find("span").show();
- });
- $(this).append($input).find("span").hide();
- $input.focus().select();
- }
+ e.preventDefault();
+ $("<div/>")
+ .prop("title", PMA_messages["strColNameCopyTitle"])
+ .addClass("modal-copy")
+ .text(PMA_messages["strColNameCopyText"])
+ .append(
+ $("<input/>")
+ .prop("readonly", true)
+ .val($(this).data("column"))
+ )
+ .dialog({
+ resizable: false,
+ modal: true
+ })
+ .find("input").focus().select();
});
// restore column order when the restore button is clicked
$('.restore_column').click(function() {
@@ -1685,6 +1691,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
// assign the hints
g.sortHint = PMA_messages['strSortHint'];
g.markHint = PMA_messages['strColMarkHint'];
+ g.copyHint = PMA_messages['strColNameCopyHint'];
// assign common hidden inputs
var $common_hidden_inputs = $('.common_hidden_inputs');
View
3  js/messages.php
@@ -345,11 +345,14 @@
$js_messages['strColOrderHint'] = __('Drag to reorder');
$js_messages['strSortHint'] = __('Click to sort');
$js_messages['strColMarkHint'] = __('Click to mark/unmark');
+$js_messages['strColNameCopyHint'] = __('Double-click to copy column name');
$js_messages['strColVisibHint'] = __('Click the drop-down arrow<br />to toggle column\'s visibility');
$js_messages['strShowAllCol'] = __('Show all');
$js_messages['strAlertNonUnique'] = __('This table does not contain a unique column. Features related to the grid edit, checkbox, Edit, Copy and Delete links may not work after saving.');
$js_messages['strGridEditFeatureHint'] = __('You can also edit most columns<br />by clicking directly on their content.');
$js_messages['strGoToLink'] = __('Go to link');
+$js_messages['strColNameCopyTitle'] = __('Copy column name');
+$js_messages['strColNameCopyText'] = __('Right-click the column name to copy it to your clipboard.');
/* password generation */
$js_messages['strGeneratePassword'] = __('Generate password');
View
9 libraries/display_tbl.lib.php
@@ -1039,12 +1039,13 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo ' vbottom';
}
- echo '">' . $order_link . $comments . '</th>';
+ echo '" data-column="' . htmlspecialchars($fields_meta[$i]->name) . '">'
+ . $order_link . $comments . '</th>';
}
$vertical_display['desc'][] = ' <th '
. 'class="draggable'
. ($condition_field ? ' condition' : '')
- . '">' . "\n"
+ . '" data-column="' . htmlspecialchars($fields_meta[$i]->name) . '">' . "\n"
. $order_link . $comments . ' </th>' . "\n";
} // end if (2.1)
@@ -1072,7 +1073,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
) {
echo ' style="direction: ltr; writing-mode: tb-rl;"';
}
- echo '>';
+ echo ' data-column="' . htmlspecialchars($fields_meta[$i]->name) . '">';
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'fake'
) {
@@ -1085,7 +1086,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$vertical_display['desc'][] = ' <th '
. 'class="draggable'
. ($condition_field ? ' condition"' : '')
- . '">' . "\n"
+ . '" data-column="' . htmlspecialchars($fields_meta[$i]->name) . '">' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
. $comments . ' </th>';
} // end else (2.2)
View
23 themes/original/css/theme_right.css.php
@@ -2328,27 +2328,18 @@
position: static;
}
-.pma_table th.draggable {
- position: relative;
-}
-
-.pma_table th.draggable input {
- font-weight: inherit;
- position: absolute;
- top: -.2em;
- left: 0;
- width: 100%;
- background: transparent;
- border: 0;
- outline: none;
- text-align: center;
-}
-
.pma_table th.draggable span, .pma_table tbody td span {
display: block;
overflow: hidden;
}
+.modal-copy input {
+ display: block;
+ width: 100%;
+ margin-top: 1.5em;
+ padding: .3em 0;
+}
+
.cRsz {
position: absolute;
}
View
22 themes/pmahomme/css/theme_right.css.php
@@ -2847,27 +2847,19 @@
position: static;
}
-.pma_table th.draggable {
- position: relative;
-}
-
-.pma_table th.draggable input {
- font-weight: inherit;
- position: absolute;
- top: 0;
- left: .2em;
- width: 100%;
- background: transparent;
- border: 0;
- outline: none;
-}
-
.pma_table th.draggable span,
.pma_table tbody td span {
display: block;
overflow: hidden;
}
+.modal-copy input {
+ display: block;
+ width: 100%;
+ margin-top: 1.5em;
+ padding: .3em 0;
+}
+
.cRsz {
position: absolute;
}
Please sign in to comment.
Something went wrong with that request. Please try again.