2020-06-08 22:14:37 +00:00
/ * *
* @ external SearchData
* /
2020-02-17 19:49:43 +00:00
import searchBoxTemplate from '!!raw-loader!../includes/templates/SearchBox.mustache' ;
2021-09-03 19:00:45 +00:00
import Button from '!!raw-loader!../includes/templates/Button.mustache' ;
2020-07-14 21:40:28 +00:00
import { htmlUserLanguageAttributes } from './utils' ;
2020-02-17 19:49:43 +00:00
2020-05-29 19:07:55 +00:00
/ * *
2020-06-08 22:14:37 +00:00
* @ type { SearchData }
2020-05-29 19:07:55 +00:00
* /
2021-07-22 17:27:33 +00:00
const legacySearchBoxData = {
2020-05-29 19:07:55 +00:00
'form-action' : '/w/index.php' ,
2021-06-02 22:57:43 +00:00
class : 'vector-search-box vector-search-show-thumbnail' ,
2020-07-14 21:40:28 +00:00
'html-user-language-attributes' : htmlUserLanguageAttributes ,
2020-05-29 19:07:55 +00:00
'msg-search' : 'Search' ,
'html-input' : '<input type="search" name="search" placeholder="Search Wikipedia" title="Search Wikipedia [⌃⌥f]" accesskey="f" id="searchInput" autocomplete="off">' ,
'page-title' : 'Special:Search' ,
'html-button-search-fallback' : '<input type="submit" name="fulltext" value="Search" title="Search pages for this text" id="mw-searchButton" class="searchButton mw-fallbackSearchButton"/>' ,
'html-button-search' : '<input type="submit" name="go" value="Go" title="Go to a page with this exact name if it exists" id="searchButton" class="searchButton">'
2020-02-17 19:49:43 +00:00
} ;
2021-07-22 17:27:33 +00:00
/ * *
* @ type { SearchData }
* /
const searchBoxData = Object . assign ( { } , legacySearchBoxData , {
class : 'vector-search-box vector-search-show-thumbnail vector-search-box-collapses' ,
'is-collapsible' : true ,
2021-09-03 19:00:45 +00:00
'data-collapse-icon' : {
icon : 'wikimedia-search' ,
'is-quiet' : true ,
class : 'search-toggle' ,
href : '/wiki/Special:Search' ,
label : 'Search'
}
2021-07-22 17:27:33 +00:00
} ) ;
2021-09-03 19:00:45 +00:00
const SEARCH _TEMPLATE _PARTIALS = {
Button
} ;
2021-07-22 17:27:33 +00:00
export {
2021-09-03 19:00:45 +00:00
SEARCH _TEMPLATE _PARTIALS ,
2021-07-22 17:27:33 +00:00
searchBoxTemplate ,
legacySearchBoxData ,
searchBoxData
} ;