Fix autofocus of input fields

This commit is contained in:
James Mills
2021-02-02 16:39:12 +10:00
parent f47e9ba765
commit e34e331101
3 changed files with 67 additions and 65 deletions

View File

@@ -1,38 +1,38 @@
{{define "content"}} {{define "content"}}
<article class="grid"> <article class="grid">
<div> <div>
<hgroup> <hgroup>
<h2>Add site</h2> <h2>Add site</h2>
<h3>Add a new site to be indexed</h3> <h3>Add a new site to be indexed</h3>
</hgroup> </hgroup>
<form action="/add" method="POST"> <form action="/add" method="POST">
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
<input type="url" name="url" placeholder="Website's URL" aria-label="URL" autocomplete="url" required> <input type="url" name="url" placeholder="Website's URL" aria-label="URL" autocomplete="url" autofocus required>
<button type="submit" class="primary"> <button type="submit" class="primary">
<i class="icss-plus"></i> <i class="icss-plus"></i>
Add Add
</button> </button>
</form> </form>
</div> </div>
<div> <div>
<hgroup> <hgroup>
<h2>How to add new sites</h2> <h2>How to add new sites</h2>
</hgroup> </hgroup>
<p> <p>
Spyda relies on users to contribute and add websites or URLs to be Spyda relies on users to contribute and add websites or URLs to be
considered for crawling and indexing. Without this there is no way considered for crawling and indexing. Without this there is no way
to increase the number of website indexed and crawled by Spyda. to increase the number of website indexed and crawled by Spyda.
</p> </p>
<p> <p>
To add a website to Spyda's crawler for consideration, just enter the To add a website to Spyda's crawler for consideration, just enter the
website's address or URl in the box and click "Add". Spyda will then website's address or URl in the box and click "Add". Spyda will then
start to crawl the website, index it and it will become available for start to crawl the website, index it and it will become available for
future search queries. future search queries.
</p> </p>
<p> <p>
If you are the author or maintainer of a website that you wish <b>NOT</b> If you are the author or maintainer of a website that you wish <b>NOT</b>
to be indexed by Spyda, please contact <a href="/support">support</a>. to be indexed by Spyda, please contact <a href="/support">support</a>.
</p> </p>
</div> </div>
</article> </article>
{{end}} {{end}}

View File

@@ -1,11 +1,11 @@
{{define "content"}} {{define "content"}}
<div class="container"> <div class="container">
<form action="/search" method="GET"> <form action="/search" method="GET">
<input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}"> <input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}" autofocus required>
<button id="go" type="submit"> <button id="go" type="submit">
<i class="icss-search"></i> <i class="icss-search"></i>
Go! Go!
</button> </button>
</form> </form>
</div> </div>
{{end}} {{end}}

View File

@@ -1,23 +1,25 @@
{{define "content"}} {{define "content"}}
<div class="container"> <div class="container">
<form action="/search" method="GET"> <form action="/search" method="GET">
<input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}"> <input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}" autofocus required>
<button id="go" type="submit"> <button id="go" type="submit">
<i class="icss-search"></i> <i class="icss-search"></i>
Go! Go!
</button> </button>
</form> </form>
</div> </div>
<article class="container"> <article class="container">
{{ with $.Results }} {{ with $.Results }}
<ol> <ol>
{{ range . }} {{ range . }}
<li><a href="{{ .URL }}">{{ .Title }}</a><p{{ if .Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p><p class="small"><a href="{{ .URL }}">{{ .URL }}</a> {{ .Length }} <a href="/cache?id={{ .ID }}">View cached</a></p> <li><a href="{{ .URL }}">{{ .Title }}</a>
<p{{ if .Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p>
<p class="small"><a href="{{ .URL }}">{{ .URL }}</a> {{ .Length }} <a href="/cache?id={{ .ID }}">View cached</a></p>
{{ end }} {{ end }}
</ol> </ol>
<p>If your page appears here and you do not want it to, please contact <a href="/support">Support</a>.</p> <p>If your page appears here and you do not want it to, please contact <a href="/support">Support</a>.</p>
{{ else }} {{ else }}
<p>No search results</p> <p>No search results</p>
{{ end }} {{ end }}
</article> </article>
{{end}} {{end}}