[aur-dev] [PATCH] autofocus on search input
When loading the home page, it would be quite convenient for the search input box to receive focus. Other possible enhancements: - set the search input box's tabindex to the lowest value - implement a JS-based keyboard shortcut mechanism bound to '/', and upon pressing key '/', the search input box receives focus. --- web/html/home.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/html/home.php b/web/html/home.php index 475370b..90abeac 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -130,7 +130,7 @@ html_header( __("Home") ); <fieldset> <label for="pkgsearch-field"><?= __('Package Search') ?>:</label> <input type="hidden" name="O" value="0" /> - <input id="pkgsearch-field" type="text" name="K" size="30" value="<?php if (isset($_REQUEST["K"])) { print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); } ?>" maxlength="35" /> + <input id="pkgsearch-field" type="text" name="K" size="30" value="<?php if (isset($_REQUEST["K"])) { print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); } ?>" maxlength="35" autofocus="" /> </fieldset> </form> </div> -- 2.6.4
On Thu, 21 Jan 2016 at 22:34:11, Juan M. Uys wrote:
When loading the home page, it would be quite convenient for the search input box to receive focus.
Sounds good.
Other possible enhancements: - set the search input box's tabindex to the lowest value - implement a JS-based keyboard shortcut mechanism bound to '/', and upon pressing key '/', the search input box receives focus.
This part does not belong in the commit message...
--- web/html/home.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/html/home.php b/web/html/home.php index 475370b..90abeac 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -130,7 +130,7 @@ html_header( __("Home") ); <fieldset> <label for="pkgsearch-field"><?= __('Package Search') ?>:</label> <input type="hidden" name="O" value="0" /> - <input id="pkgsearch-field" type="text" name="K" size="30" value="<?php if (isset($_REQUEST["K"])) { print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); } ?>" maxlength="35" /> + <input id="pkgsearch-field" type="text" name="K" size="30" value="<?php if (isset($_REQUEST["K"])) { print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); } ?>" maxlength="35" autofocus="" /> [...]
On the package search page, we use autofocus="autofocus" instead of using an empty value. I don't think it makes a difference but maybe we should use autofocus="autofocus" here as well for consistency. Thanks!
It's also missing a sign-off. Mark Weiman
Shall we add "requires sign-off" to https://github.com/lfos/aurweb/blob/master/doc/CodingGuidelines ? On Fri, 22 Jan 2016, 23:51 Mark Weiman <mark.weiman@markzz.com> wrote:
It's also missing a sign-off.
Mark Weiman
On Sat, 23 Jan 2016 at 01:29:38, Juan M Uys wrote:
Shall we add "requires sign-off" to https://github.com/lfos/aurweb/blob/master/doc/CodingGuidelines ? [...]
Yes, we probably should... :)
participants (4)
-
Juan M Uys
-
Juan M. Uys
-
Lukas Fleischer
-
Mark Weiman