more opensearch goodness, default input attributes

This commit is contained in:
Rigel Kent 2020-09-14 13:52:39 +02:00
parent b587ca5d08
commit 2bbb0ddc73
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
2 changed files with 5 additions and 4 deletions

View File

@ -10,8 +10,8 @@
Search for your favorite videos and channels on <a href="%{indexedInstancesUrl}" target="_blank">%{instancesCount} PeerTube websites</a> indexed by this server! Search for your favorite videos and channels on <a href="%{indexedInstancesUrl}" target="_blank">%{instancesCount} PeerTube websites</a> indexed by this server!
</h3> </h3>
<div id="search-anchor" class="search-container" v-bind:class="{ 'search-container-small': !searchDone }"> <div id="search-anchor" class="search-container" v-bind:class="{ 'search-container-small': !searchDone }" role="search">
<input v-bind:placeholder="inputPlaceholder" autofocus v-on:keyup.enter="doNewSearch()" type="text" v-model="formSearch" name="search-text" /> <input v-bind:placeholder="inputPlaceholder" autofocus v-on:keyup.enter="doNewSearch()" type="text" v-model="formSearch" name="search-text" autocapitalize="off" autocomplete="off" autocorrect="off" maxlength="1024" />
<button v-on:click="doNewSearch()"> <button v-on:click="doNewSearch()">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">

View File

@ -46,12 +46,13 @@ let indexHTML: string
app.use('/opensearch.xml', async function (req, res) { app.use('/opensearch.xml', async function (req, res) {
return res.send(`<?xml version="1.0" encoding="UTF-8" ?> return res.send(`<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>${CONFIG.SEARCH_INSTANCE.NAME}</ShortName> <ShortName>${CONFIG.SEARCH_INSTANCE.NAME}</ShortName>
<Description>${CONFIG.SEARCH_INSTANCE.DESCRIPTION}</Description> <Description>${CONFIG.SEARCH_INSTANCE.DESCRIPTION}</Description>
<Image height="64" width="64" type="image/png">${url}/img/favicon.png</Image> <Image height="64" width="64" type="image/png">${url}/img/favicon.png</Image>
<Language>*</Language> <Language>*</Language>
<Url type="text/html" rel="results" template="${url}/search?search={searchTerms}"/> <Tags>peertube video</Tags>
<Url type="text/html" method="get" rel="results" template="${url}/search?search={searchTerms}&amp;page={startPage?}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="${url}/opensearch.xml"/> <Url type="application/opensearchdescription+xml" rel="self" template="${url}/opensearch.xml"/>
<Query role="example" searchTerms="peertube"/> <Query role="example" searchTerms="peertube"/>
<SyndicationRight>open</SyndicationRight> <SyndicationRight>open</SyndicationRight>