mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 01:24:17 +02:00
Don't edit for Ctrl+click on link
This commit is contained in:
@@ -403,7 +403,7 @@ if (!$columns) {
|
||||
$text = ereg('text|lob', $field["type"]);
|
||||
echo (($_GET["modify"] && $editable) || $value !== null
|
||||
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
|
||||
: "<td id='$id' onclick=\"" . ($editable ? "selectClick(this, event" . ($long ? ", 2" : ($text ? ", 1" : "")) . ")" : "if (event.ctrlKey) alert('" . h(lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
|
||||
: "<td id='$id' onclick=\"selectClick(this, event, " . ($long ? 2 : ($text ? 1 : 0)) . ($editable ? "" : ", '" . h(lang('Use edit link to modify this value.')) . "'") . ");\">" . $adminer->selectVal($val, $link, $field)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -412,11 +412,16 @@ function ajaxSetHtml(url) {
|
||||
* @param HTMLElement
|
||||
* @param MouseEvent
|
||||
* @param number display textarea instead of input, 2 - load long text
|
||||
* @param string warning to display
|
||||
*/
|
||||
function selectClick(td, event, text) {
|
||||
if (!event.ctrlKey || /input|textarea/i.test(td.firstChild.tagName)) {
|
||||
function selectClick(td, event, text, warning) {
|
||||
var target = event.target || event.srcElement;
|
||||
if (!event.ctrlKey || /input|textarea/i.test(td.firstChild.tagName) || /^a$/i.test(target.tagName)) {
|
||||
return;
|
||||
}
|
||||
if (warning) {
|
||||
return alert(warning);
|
||||
}
|
||||
var original = td.innerHTML;
|
||||
text = text || /\n/.test(original);
|
||||
var input = document.createElement(text ? 'textarea' : 'input');
|
||||
|
Reference in New Issue
Block a user