diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2004-12-12 21:25:06 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2004-12-12 21:25:06 +0000 |
commit | be4b8e72a6f02f924301aefdfdf73e775827c0bf (patch) | |
tree | ba7940590f5de4e8b690530cdf7263b46998e482 /usr/local | |
parent | b4ff3ccd3b34441747000ac42f5c266aefe4106c (diff) | |
download | pfsense-be4b8e72a6f02f924301aefdfdf73e775827c0bf.zip pfsense-be4b8e72a6f02f924301aefdfdf73e775827c0bf.tar.gz |
* Automatically focus to command box and filename box
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/edit.php | 11 | ||||
-rwxr-xr-x | usr/local/www/exec.php | 15 |
2 files changed, 18 insertions, 8 deletions
diff --git a/usr/local/www/edit.php b/usr/local/www/edit.php index 6a4197b..095c297 100755 --- a/usr/local/www/edit.php +++ b/usr/local/www/edit.php @@ -131,7 +131,10 @@ pre { --> </style> </head> -<body> +<script language="Javascript"> +function sf() { document.forms[0].savetopath.focus(); } +</script> +<body onLoad="sf();"> <p><span class="pgtitle"><?=$Title ?></span> <?php if ($ulmsg) echo "<p><strong>" . $ulmsg . "</strong></p>\n"; ?> @@ -139,7 +142,7 @@ pre { <table> <tr> <td> - Save/Load from path: <input size="42" name="savetopath" value="<?php echo $_POST['savetopath']; ?>"> | + Save/Load from path: <input size="42" id="savetopath" name="savetopath" value="<?php echo $_POST['savetopath']; ?>"> | Rows: <input size="3" name="rows" value="<? echo $rows; ?>"> | Cols: <input size="3" name="cols" value="<? echo $cols; ?>"> | <input name="submit" type="submit" class="button" id="Load" value="Load"> | <input name="submit" type="submit" class="button" id="Save" value="Save"> @@ -157,3 +160,7 @@ pre { </body> </html> + +<script language="Javascript"> +sf(); +</script>
\ No newline at end of file diff --git a/usr/local/www/exec.php b/usr/local/www/exec.php index 8f47fc5..03a9b2b 100755 --- a/usr/local/www/exec.php +++ b/usr/local/www/exec.php @@ -5,9 +5,9 @@ if (($_POST['submit'] == "Download") && file_exists($_POST['dlPath'])) { $fd = fopen($_POST['dlPath'], "rb"); header("Content-Type: application/octet-stream"); header("Content-Length: " . filesize($_POST['dlPath'])); - header("Content-Disposition: attachment; filename=\"" . + header("Content-Disposition: attachment; filename=\"" . trim(htmlentities(basename($_POST['dlPath']))) . "\""); - + fpassthru($fd); exit; } else if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { @@ -24,7 +24,7 @@ if (($_POST['submit'] == "Download") && file_exists($_POST['dlPath'])) { /* Exec+ v1.02-000 - Copyright 2001-2003, All rights reserved Created by technologEase (http://www.technologEase.com). - + (modified for m0n0wall by Manuel Kasper <mk@neon1.net>) */ @@ -79,7 +79,7 @@ if (isBlank( $_POST['txtRecallBuffer'] )) { // Functions to extend String class. function str_encode() { return escape( this ) } function str_decode() { return unescape( this ) } - + // Extend string class to include encode() and decode() functions. String.prototype.encode = str_encode String.prototype.decode = str_decode @@ -95,7 +95,7 @@ if (isBlank( $_POST['txtRecallBuffer'] )) { if (!isBlank(form.txtCommand.value)) { // If this command is repeat of last command, then do not store command. if (form.txtCommand.value.encode() == arrRecallBuffer[arrRecallBuffer.length-1]) { return true } - + // Stuff encoded command string into the recall buffer. if (isBlank(form.txtRecallBuffer.value)) form.txtRecallBuffer.value = form.txtCommand.value.encode(); @@ -205,7 +205,7 @@ if (!isBlank($_POST['txtCommand'])) { <table> <tr> <td class="label" align="right">Command:</td> - <td class="type"><input name="txtCommand" type="text" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>"></td> + <td class="type"><input id="txtCommand" name="txtCommand" type="text" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>"></td> </tr> <tr> <td valign="top"> </td> @@ -236,5 +236,8 @@ if (!isBlank($_POST['txtCommand'])) { </tr> </table> </form> +<script language="Javascript"> +document.forms[0].txtCommand.focus(); +</script> </body> </html> |