[search] improved button for geolocation
(now an actual button)
This commit is contained in:
@ -7,8 +7,8 @@ addHook('search', function(query) {});
|
||||
|
||||
`query` is an object with the following members:
|
||||
- `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
|
||||
heavy processing unless the user has confirmed the search term
|
||||
- `confirmed` is a boolean indicating if the user has pressed enter after searching. You should not search online or
|
||||
do heavy processing unless the user has confirmed the search term
|
||||
- `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`):
|
||||
|
2
main.js
2
main.js
@ -84,7 +84,7 @@ document.getElementsByTagName('body')[0].innerHTML = ''
|
||||
+ ' <div id="playerstat">t</div>'
|
||||
+ ' <div id="gamestat"> loading global control stats</div>'
|
||||
+ ' <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]"/>'
|
||||
+ ' </div>'
|
||||
+ ' <div id="portaldetails"></div>'
|
||||
|
16
style.css
16
style.css
@ -511,9 +511,19 @@ input[type="search"], input[type="url"] {
|
||||
}
|
||||
#buttongeolocation {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
cursor: pointer;
|
||||
right: 0;
|
||||
top: 0;
|
||||
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 {
|
||||
font-size: 1em;
|
||||
|
Reference in New Issue
Block a user