91c25bc253
The opt-out link was missing a tooltip which is important for accessibility and to help people gain more context as to what it does. Bug: T250093 Change-Id: Ie6cbaf5c941615d1662700415b8f1823987a563d
67 lines
1.7 KiB
JavaScript
67 lines
1.7 KiB
JavaScript
import sidebarTemplate from '!!raw-loader!../includes/templates/Sidebar.mustache';
|
|
import portalTemplate from '!!raw-loader!../includes/templates/Portal.mustache';
|
|
import { PORTALS } from './Portal.stories.data';
|
|
|
|
const HTML_LOGO_ATTRIBUTES = `class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"`;
|
|
const SIDEBAR_BEFORE_OUTPUT_HOOKINFO = `Beware: Portals can be added, removed or reordered using
|
|
SidebarBeforeOutput hook as in this example.`;
|
|
|
|
export { sidebarTemplate };
|
|
|
|
export const SIDEBAR_TEMPLATE_PARTIALS = {
|
|
Portal: portalTemplate
|
|
};
|
|
|
|
export const SIDEBAR_DATA = {
|
|
withNoPortals: {
|
|
'has-logo': true,
|
|
'array-portals-rest': [],
|
|
'html-logo-attributes': HTML_LOGO_ATTRIBUTES
|
|
},
|
|
withPortalsAndOptOut: {
|
|
'has-logo': false,
|
|
'array-portals-first': PORTALS.navigation,
|
|
'data-emphasized-sidebar-action': {
|
|
href: '#',
|
|
text: 'Switch to old look',
|
|
title: 'Change your settings to go back to the old look of the skin (legacy Vector)'
|
|
},
|
|
'array-portals-rest': [
|
|
PORTALS.toolbox,
|
|
PORTALS.otherProjects,
|
|
PORTALS.langlinks
|
|
],
|
|
'html-logo-attributes': HTML_LOGO_ATTRIBUTES
|
|
},
|
|
withPortals: {
|
|
'has-logo': true,
|
|
'array-portals-first': PORTALS.navigation,
|
|
'array-portals-rest': [
|
|
PORTALS.toolbox,
|
|
PORTALS.otherProjects,
|
|
PORTALS.langlinks
|
|
],
|
|
'html-logo-attributes': HTML_LOGO_ATTRIBUTES
|
|
},
|
|
withoutLogo: {
|
|
'has-logo': false,
|
|
'array-portals-first': PORTALS.navigation,
|
|
'array-portals-rest': [
|
|
PORTALS.toolbox,
|
|
PORTALS.otherProjects,
|
|
PORTALS.langlinks
|
|
]
|
|
},
|
|
thirdParty: {
|
|
'has-logo': true,
|
|
'array-portals-rest': [
|
|
PORTALS.toolbox,
|
|
PORTALS.navigation,
|
|
{
|
|
'html-portal-content': SIDEBAR_BEFORE_OUTPUT_HOOKINFO
|
|
}
|
|
],
|
|
'html-logo-attributes': HTML_LOGO_ATTRIBUTES
|
|
}
|
|
};
|