1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-23 22:52:51 +02:00

Support Shift+click in server export

This commit is contained in:
Jakub Vrana
2018-02-08 09:47:15 +01:00
parent 6e2f681faa
commit fb2d34f739
2 changed files with 16 additions and 2 deletions

View File

@@ -165,6 +165,7 @@ echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style,
<table cellspacing="0"> <table cellspacing="0">
<?php <?php
echo script("qsl('table').onclick = dumpClick;");
$prefixes = array(); $prefixes = array();
if (DB != "") { if (DB != "") {
$checked = ($TABLE != "" ? "" : " checked"); $checked = ($TABLE != "" ? "" : " checked");
@@ -178,11 +179,11 @@ if (DB != "") {
foreach ($tables_list as $name => $type) { foreach ($tables_list as $name => $type) {
$prefix = preg_replace('~_.*~', '', $name); $prefix = preg_replace('~_.*~', '', $name);
$checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name $checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick.call(this, event); formUncheck('check-tables');", "block"); $print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "formUncheck('check-tables');", "block");
if ($type !== null && !preg_match('~table~i', $type)) { if ($type !== null && !preg_match('~table~i', $type)) {
$views .= "$print\n"; $views .= "$print\n";
} else { } else {
echo "$print<td align='right'><label class='block'><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "checkboxClick.call(this, event); formUncheck('check-data');") . "</label>\n"; echo "$print<td align='right'><label class='block'><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "formUncheck('check-data');") . "</label>\n";
} }
$prefixes[$prefix]++; $prefixes[$prefix]++;
} }

View File

@@ -404,6 +404,19 @@ function partitionNameChange() {
/** Uncheck 'all' checkbox
* @param MouseEvent
* @this HTMLTableElement
*/
function dumpClick(event) {
var el = parentTag(getTarget(event), 'label');
if (el) {
checkboxClick.call(el.firstChild, event);
}
}
/** Add row for foreign key /** Add row for foreign key
* @this HTMLSelectElement * @this HTMLSelectElement
*/ */