Subject: | auto focus search box on homepage |
The homepage has no features on it other than the search box.
This patch uses javascript to auto-focus the search box, which seems
like the only thing you would want on this page. It only does the index
page.
Subject: | 20090327.intrepid.cpan.mini.webserver.focus.patch |
--- Templates.pm.orig 2009-03-17 13:26:38.000000000 +0000
+++ Templates.pm 2009-03-17 13:31:57.000000000 +0000
@@ -122,7 +122,7 @@
table {
row {
form {
- attr { method => 'get', action => '/search/' };
+ attr { name => 'f', method => 'get', action => '/search/' };
cell {
attr { class => 'searchbar' };
outs_raw
@@ -209,6 +209,7 @@
attr { class => 'span-24' };
show( 'header', 'Index' );
body {
+ attr { onload => 'document.f.q.focus()' };
show('searchbar');
h1 {'Index'};
p {'Welcome to CPAN::Mini::Webserver. Start searching!'};