Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't edit for Ctrl+click on link

  • Loading branch information...
commit 697034f329abce27cd9a3b5dd14e40091fab427b 1 parent cb1d7d4
@vrana authored
Showing with 8 additions and 3 deletions.
  1. +1 −1  adminer/select.inc.php
  2. +7 −2 adminer/static/functions.js
View
2  adminer/select.inc.php
@@ -403,7 +403,7 @@
$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)
);
}
}
View
9 adminer/static/functions.js
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.