Moving cursor with Ctrl+arrows works also for row editing.
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -10,12 +10,14 @@ $Source$
|
|||||||
* lang/spanish: update, thanks to Dr. med. Daniel Hinostroza C.
|
* lang/spanish: update, thanks to Dr. med. Daniel Hinostroza C.
|
||||||
|
|
||||||
2003-01-14 Michal Cihar <nijel@users.sourceforge.net>
|
2003-01-14 Michal Cihar <nijel@users.sourceforge.net>
|
||||||
* tbl_properties_structure.php3,libraries/functions.js: Added (un)check
|
* tbl_properties_structure.php3, libraries/functions.js: Added (un)check
|
||||||
all for fields selection.
|
all for fields selection.
|
||||||
* tbl_properties.inc.php3,libraries/functions.js: Merged patch #554439
|
* tbl_properties.inc.php3, libraries/functions.js: Merged patch #554439
|
||||||
(Jumping cursor using keyboard).
|
(Jumping cursor using keyboard).
|
||||||
* tbl_alter.php3: Always include functions.js to allow jumping using
|
* tbl_alter.php3, tbl_addfield.php3, tbl_create.php3: Always include
|
||||||
keyboard.
|
functions.js to allow jumping using keyboard.
|
||||||
|
* tbl_change.php3, libraries/tbl_change.js: Moving cursor with Ctrl+arrows
|
||||||
|
works also for row editing.
|
||||||
|
|
||||||
2002-01-13 Robin Johnson <robbat2@users.sourceforge.net>
|
2002-01-13 Robin Johnson <robbat2@users.sourceforge.net>
|
||||||
* libraries/sqlvalidator.class.php3:
|
* libraries/sqlvalidator.class.php3:
|
||||||
|
@@ -485,10 +485,10 @@ function setSelectOptions(the_form, the_select, do_check)
|
|||||||
* @param object event data
|
* @param object event data
|
||||||
*/
|
*/
|
||||||
function onKeyDownArrowsHandler(e) {
|
function onKeyDownArrowsHandler(e) {
|
||||||
e=e||window.event;
|
e = e||window.event;
|
||||||
var o = (e.srcElement||e.target);
|
var o = (e.srcElement||e.target);
|
||||||
if (!o) return;
|
if (!o) return;
|
||||||
if (o.tagName != "INPUT" && o.tagName != "SELECT") return;
|
if (o.tagName != "TEXTAREA" && o.tagName != "INPUT" && o.tagName != "SELECT") return;
|
||||||
if (!e.ctrlKey) return;
|
if (!e.ctrlKey) return;
|
||||||
if (!o.id) return;
|
if (!o.id) return;
|
||||||
|
|
||||||
@@ -497,16 +497,22 @@ function onKeyDownArrowsHandler(e) {
|
|||||||
|
|
||||||
var x = pos[2], y=pos[1];
|
var x = pos[2], y=pos[1];
|
||||||
|
|
||||||
switch(e.keyCode) {
|
// skip non existent fields
|
||||||
case 38: y--; break; // up
|
for (i=0; i<10; i++)
|
||||||
case 40: y++; break; // down
|
{
|
||||||
case 37: x--; break; // left
|
switch(e.keyCode) {
|
||||||
case 39: x++; break; // right
|
case 38: y--; break; // up
|
||||||
default: return;
|
case 40: y++; break; // down
|
||||||
|
case 37: x--; break; // left
|
||||||
|
case 39: x++; break; // right
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = "field_" + y + "_" + x;
|
||||||
|
var nO = document.getElementById(id);
|
||||||
|
if (nO) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = "field_" + y + "_" + x;
|
|
||||||
var nO = document.getElementById(id);
|
|
||||||
if (!nO) return;
|
if (!nO) return;
|
||||||
nO.focus();
|
nO.focus();
|
||||||
if (nO.tagName != 'SELECT') {
|
if (nO.tagName != 'SELECT') {
|
||||||
|
@@ -58,3 +58,45 @@ function unNullify(urlField)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // end of the 'unNullify()' function
|
} // end of the 'unNullify()' function
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows moving around inputs/select by Ctrl+arrows
|
||||||
|
*
|
||||||
|
* @param object event data
|
||||||
|
*/
|
||||||
|
function onKeyDownArrowsHandler(e) {
|
||||||
|
e = e||window.event;
|
||||||
|
var o = (e.srcElement||e.target);
|
||||||
|
if (!o) return;
|
||||||
|
if (o.tagName != "TEXTAREA" && o.tagName != "INPUT" && o.tagName != "SELECT") return;
|
||||||
|
if (!e.ctrlKey) return;
|
||||||
|
if (!o.id) return;
|
||||||
|
|
||||||
|
var pos = o.id.split("_");
|
||||||
|
if (pos[0] != "field" || typeof pos[2] == "undefined") return;
|
||||||
|
|
||||||
|
var x = pos[2], y=pos[1];
|
||||||
|
|
||||||
|
// skip non existent fields
|
||||||
|
for (i=0; i<10; i++)
|
||||||
|
{
|
||||||
|
switch(e.keyCode) {
|
||||||
|
case 38: y--; break; // up
|
||||||
|
case 40: y++; break; // down
|
||||||
|
case 37: x--; break; // left
|
||||||
|
case 39: x++; break; // right
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = "field_" + y + "_" + x;
|
||||||
|
var nO = document.getElementById(id);
|
||||||
|
if (nO) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nO) return;
|
||||||
|
nO.focus();
|
||||||
|
if (nO.tagName != 'SELECT') {
|
||||||
|
nO.select();
|
||||||
|
}
|
||||||
|
e.returnValue = false;
|
||||||
|
}
|
||||||
|
@@ -140,6 +140,13 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
|
|||||||
// some browsers send wrongly this form to the http server.
|
// some browsers send wrongly this form to the http server.
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<!-- Set on key handler for moving using by Ctrl+arrows -->
|
||||||
|
<script type="text/javascript" language="javascript">
|
||||||
|
<!--
|
||||||
|
document.onkeydown = onKeyDownArrowsHandler;
|
||||||
|
// -->
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Change table properties form -->
|
<!-- Change table properties form -->
|
||||||
<form method="post" action="tbl_replace.php3" name="insertForm">
|
<form method="post" action="tbl_replace.php3" name="insertForm">
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||||
@@ -317,7 +324,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<select name="funcs[<?php echo urlencode($field); ?>]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($fields_cnt + $i + 1); ?>">
|
<select name="funcs[<?php echo urlencode($field); ?>]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($fields_cnt + $i + 1); ?>" id="field_<?php echo $i; ?>_1">
|
||||||
<option></option>
|
<option></option>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -350,6 +357,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
if ($data == 'NULL' && !$first_timestamp) {
|
if ($data == 'NULL' && !$first_timestamp) {
|
||||||
echo ' checked="checked"';
|
echo ' checked="checked"';
|
||||||
}
|
}
|
||||||
|
echo ' id="field_' . $i . '_2"';
|
||||||
$onclick = ' onclick="if (this.checked) {nullify(';
|
$onclick = ' onclick="if (this.checked) {nullify(';
|
||||||
if (strstr($row_table_def['True_Type'], 'enum')) {
|
if (strstr($row_table_def['True_Type'], 'enum')) {
|
||||||
if (strlen($row_table_def['Type']) > 20) {
|
if (strlen($row_table_def['Type']) > 20) {
|
||||||
@@ -380,8 +388,8 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?php echo $backup_field . "\n"; ?>
|
||||||
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="$foreign$" />
|
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="$foreign$" id="field_<?php echo $i; ?>_1" />
|
||||||
<select name="field_<?php echo md5($field); ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>">
|
<select name="field_<?php echo md5($field); ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" id="field_<?php echo $i; ?>_2">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -402,7 +410,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?php echo $backup_field . "\n"; ?>
|
||||||
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"
|
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo $i; ?>_2"
|
||||||
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>"><?php echo $special_chars; ?></textarea>
|
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>"><?php echo $special_chars; ?></textarea>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
@@ -426,7 +434,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
if (strlen($row_table_def['Type']) > 20) {
|
if (strlen($row_table_def['Type']) > 20) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<select name="field_<?php echo md5($field); ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>">
|
<select name="field_<?php echo md5($field); ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" id="field_<?php echo $i; ?>_2">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -460,6 +468,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
&& isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {
|
&& isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {
|
||||||
echo ' checked="checked"';
|
echo ' checked="checked"';
|
||||||
}
|
}
|
||||||
|
echo ' id="field_' . $i . '_2"';
|
||||||
echo 'tabindex="' . ($i + 1) . '" />' . "\n";
|
echo 'tabindex="' . ($i + 1) . '" />' . "\n";
|
||||||
echo ' <label for="radio_field_' . $j . '">' . htmlspecialchars($enum_atom) . '</label>' . "\n";
|
echo ' <label for="radio_field_' . $j . '">' . htmlspecialchars($enum_atom) . '</label>' . "\n";
|
||||||
} // end for
|
} // end for
|
||||||
@@ -487,7 +496,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?php echo $backup_field . "\n"; ?>
|
||||||
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="$set$" />
|
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="$set$" />
|
||||||
<select name="field_<?php echo md5($field); ?>[]" size="<?php echo $size; ?>" multiple="multiple" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" >
|
<select name="field_<?php echo md5($field); ?>[]" size="<?php echo $size; ?>" multiple="multiple" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" id="field_<?php echo $i; ?>_2">
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
$countset = count($set);
|
$countset = count($set);
|
||||||
@@ -523,7 +532,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?php echo $backup_field . "\n"; ?>
|
||||||
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"
|
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo $i; ?>_2"
|
||||||
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" ><?php echo $special_chars; ?></textarea>
|
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" ><?php echo $special_chars; ?></textarea>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
@@ -538,7 +547,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?php echo $backup_field . "\n"; ?>
|
||||||
<input type="text" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" />
|
<input type="text" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" id="field_<?php echo $i; ?>_2" />
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
} // end if...elseif...else
|
} // end if...elseif...else
|
||||||
@@ -563,13 +572,13 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
if ($is_char && isset($cfg['CharEditing']) && ($cfg['CharEditing'] == 'textarea')) {
|
if ($is_char && isset($cfg['CharEditing']) && ($cfg['CharEditing'] == 'textarea')) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['CharTextareaRows']; ?>" cols="<?php echo $cfg['CharTextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"
|
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['CharTextareaRows']; ?>" cols="<?php echo $cfg['CharTextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo $i; ?>_2"
|
||||||
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" ><?php echo $special_chars; ?></textarea>
|
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" ><?php echo $special_chars; ?></textarea>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<input type="text" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" />
|
<input type="text" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>')" tabindex="<?php echo ($i + 1); ?>" id="field_<?php echo $i; ?>_2" />
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
Reference in New Issue
Block a user