mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-12 09:21:11 +00:00
ad5c127239
* Moves screen variables relating to Header to Header * Adds a Header storybook entry * Moves data-logo from Logo template to Header.mustache * Updates UserLinks to use USER_LINK_PARTIALS * Renames confusing SearchBox story names * Updates package.json to use a static folder. * Use mediawiki.org for sourcing mw-ui-button and mw-ui-icon styles since deploys there come earlier * Removes usages of ID selectors Change-Id: I0e158fa7e62c56a50cfff497d75f0808effd1eed
48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
/**
|
|
* @external SearchData
|
|
*/
|
|
|
|
import searchBoxTemplate from '!!raw-loader!../includes/templates/SearchBox.mustache';
|
|
import Button from '!!raw-loader!../includes/templates/Button.mustache';
|
|
import { htmlUserLanguageAttributes } from './utils';
|
|
|
|
/**
|
|
* @type {SearchData}
|
|
*/
|
|
const searchBoxData = {
|
|
'form-action': '/w/index.php',
|
|
class: 'vector-search-box vector-search-show-thumbnail',
|
|
'html-user-language-attributes': htmlUserLanguageAttributes,
|
|
'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">'
|
|
};
|
|
|
|
/**
|
|
* @type {SearchData}
|
|
*/
|
|
const searchBoxDataWithCollapsing = Object.assign( {}, searchBoxData, {
|
|
class: `${searchBoxData.class} vector-search-box-collapses`,
|
|
'is-collapsible': true,
|
|
'data-collapse-icon': {
|
|
icon: 'wikimedia-search',
|
|
'is-quiet': true,
|
|
class: 'search-toggle',
|
|
href: '/wiki/Special:Search',
|
|
label: 'Search'
|
|
}
|
|
} );
|
|
|
|
const SEARCH_TEMPLATE_PARTIALS = {
|
|
Button
|
|
};
|
|
|
|
export {
|
|
SEARCH_TEMPLATE_PARTIALS,
|
|
searchBoxTemplate,
|
|
searchBoxDataWithCollapsing,
|
|
searchBoxData
|
|
};
|