[search] improved button for geolocation

(now an actual button)
This commit is contained in:
fkloft
2016-08-26 17:42:54 +02:00
parent a18664cdb8
commit 43adcbeee9
3 changed files with 16 additions and 6 deletions

View File

@ -8,7 +8,7 @@ addHook('search', function(query) {});
`query` is an object with the following members: `query` is an object with the following members:
- `term` is the term for which the user has searched - `term` is the term for which the user has searched
- `confirmed` is a boolean indicating if the user has pressed enter after searching. You should not search online or - `confirmed` is a boolean indicating if the user has pressed enter after searching. You should not search online or
heavy processing unless the user has confirmed the search term do heavy processing unless the user has confirmed the search term
- `addResult(result)` can be called to add a result to the query. - `addResult(result)` can be called to add a result to the query.
`result` may have the following members (`title` is required, as well as one of `position` and `bounds`): `result` may have the following members (`title` is required, as well as one of `position` and `bounds`):

View File

@ -84,7 +84,7 @@ document.getElementsByTagName('body')[0].innerHTML = ''
+ ' <div id="playerstat">t</div>' + ' <div id="playerstat">t</div>'
+ ' <div id="gamestat">&nbsp;loading global control stats</div>' + ' <div id="gamestat">&nbsp;loading global control stats</div>'
+ ' <div id="searchwrapper">' + ' <div id="searchwrapper">'
+ ' <img src="@@INCLUDEIMAGE:images/current-location.png@@"/ title="Current Location" id="buttongeolocation">' + ' <button title="Current location" id="buttongeolocation"><img src="@@INCLUDEIMAGE:images/current-location.png@@" alt="Current location"/></button>'
+ ' <input id="search" placeholder="Search location…" type="search" accesskey="f" title="Search for a place [f]"/>' + ' <input id="search" placeholder="Search location…" type="search" accesskey="f" title="Search for a place [f]"/>'
+ ' </div>' + ' </div>'
+ ' <div id="portaldetails"></div>' + ' <div id="portaldetails"></div>'

View File

@ -511,9 +511,19 @@ input[type="search"], input[type="url"] {
} }
#buttongeolocation { #buttongeolocation {
position: absolute; position: absolute;
top: 2px; right: 0;
right: 2px; top: 0;
cursor: pointer; margin: 0;
border: 0 none transparent;
padding: 0 2px 0 0;
height: 100%;
background-color: transparent;
}
#buttongeolocation:focus {
outline: 1px dotted #ffce00;
}
#buttongeolocation img {
display: block;
} }
#searchwrapper h3 { #searchwrapper h3 {
font-size: 1em; font-size: 1em;