mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-05 14:22:56 +00:00
ea2bcd44f2
- Update package.json with the new dependencies. - A script storybook.sh pulls down CSS and LESS imports from external dependencies. This copies the approach taken in Popups and MobileFrontend. - Icons from external repos are maintained within the repo in SVG-only form. Using load.php modules is also possible, but will pull down other unnecessary icons and break if any of these modules are changed. Decided that we should manually maintain these for the time being given there are only 3 icons. - Several LESS files now import the variables file. I think it's useful for stories to only import the CSS they use as this encourages us to modularise our CSS. Before these imports were not necessary as they inherit imports from index.less. This will have no impact on the bundle size as the LESS compiler silently discards duplicate imports - stories/utils.js provides a useful placeholder function for generalising our hook entry points. Bug: T242674 Change-Id: I722e84d2fb57653a2f96142dc3e5248043261746
68 lines
2.5 KiB
JavaScript
68 lines
2.5 KiB
JavaScript
import mustache from 'mustache';
|
|
import vectorMenu from '!!raw-loader!../includes/templates/VectorMenu.mustache';
|
|
import '../resources/skins.vector.styles/navigation.less';
|
|
import '../.storybook/common.less';
|
|
import { htmluserlangattributes } from './utils';
|
|
|
|
export default {
|
|
title: 'Menu'
|
|
};
|
|
|
|
export const more = () => mustache.render( vectorMenu, {
|
|
'empty-portlet': '',
|
|
'msg-label': 'More',
|
|
'menu-id': 'p-cactions',
|
|
'menu-label-id': 'p-cactions-label',
|
|
'html-userlangattributes': htmluserlangattributes,
|
|
'html-items': `<li id="ca-delete">
|
|
<a href="/w/index.php?title=Main_Page&action=delete"
|
|
title="Delete this page [⌃⌥d]" accesskey="d">Delete</a>
|
|
</li>
|
|
<li id="ca-move">
|
|
<a href="/w/index.php/Special:MovePage/Main_Page"
|
|
title="Move this page [⌃⌥m]" accesskey="m">Move</a>
|
|
</li>
|
|
<li id="ca-protect">
|
|
<a href="/w/index.php?title=Main_Page&action=protect"
|
|
title="Protect this page [⌃⌥=]" accesskey="=">Protect</a>
|
|
</li>`
|
|
} );
|
|
|
|
export const variants = () => mustache.render( vectorMenu, {
|
|
'msg-label': '新加坡简体',
|
|
'menu-id': 'p-variants',
|
|
'menu-label-id': 'p-variants-label',
|
|
'html-userlangattributes': htmluserlangattributes,
|
|
'html-items': `<li id="ca-varlang-0">
|
|
<a href="/zh/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh" lang="zh">不转换</a></li>
|
|
<li id="ca-varlang-1">
|
|
<a href="/zh-hans/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hans" lang="zh-Hans">简体</a>
|
|
</li>
|
|
<li id="ca-varlang-2">
|
|
<a href="/zh-hant/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hant" lang="zh-Hant">繁體</a>
|
|
</li>
|
|
<li id="ca-varlang-3">
|
|
<a href="/zh-cn/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hans-CN" lang="zh-Hans-CN">大陆简体</a>
|
|
</li>
|
|
<li id="ca-varlang-4">
|
|
<a href="/zh-hk/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hant-HK" lang="zh-Hant-HK">香港繁體</a>
|
|
</li>
|
|
<li id="ca-varlang-5">
|
|
<a href="/zh-mo/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hant-MO" lang="zh-Hant-MO">澳門繁體</a>
|
|
</li>
|
|
<li id="ca-varlang-7" class="selected">
|
|
<a href="/zh-sg/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hans-SG" lang="zh-Hans-SG">新加坡简体</a>
|
|
</li>
|
|
<li id="ca-varlang-8">
|
|
<a href="/zh-tw/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
|
|
hreflang="zh-Hant-TW" lang="zh-Hant-TW">臺灣正體</a>
|
|
</li>`
|
|
} );
|