Moving all the templateParser calls to one function
so its easier to see how the template is composed.
The diff of changes to the stories folder highlight
the internal changes which are:
* html-portals replaced with html-sidebar in main template
* new Sidebar template added which outputs to html-sidebar
* Mention of "MainMenu" replaced with better understood "Sidebar"
This is precursory work to adopt templatePartials
Change-Id: I6b2196e39087f818e774d04b2d1b9ab8cb8816a1
Add a Vector-specific user preference to Special:Preferences for
toggling skin version, either Legacy Vector or the latest Vector.
The presentation of the new preference section and the default values
for anonymous, new, and existing accounts are configurable via
$wgVectorShowSkinPreferences, $wgVectorDefaultSkinVersion (to be used by
the feature manager in T244481),
$wgVectorDefaultSkinVersionForExistingAccounts, and
$wgVectorDefaultSkinVersionForNewAccounts. These configurations default
to the fullest experience so that third-party configuration is minimal.
See skin.json for details. The configurations are each tested in
VectorHooksTest.php.
When presentation is enabled, the new preference appears as a checkbox;
enabled is Legacy mode and disable is latest. There are a number of
unfortunate details:
- Showing and hiding a checkbox is supported by OOUI. Showing and hiding
a whole section (Vector skin preferences, in this case) is not so this
additional client JavaScript functionality is added in Core (see
Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377).
- Stylization as a checkbox is wanted. However, the implied storage type
for OOUI checkboxes is a boolean. This is not wanted in the event that
another skin version is added (e.g., '3' or 'alpha'). As a workaround,
the preference is converted from a boolean to a version string ('1' or
'2') on save in Hooks::onPreferencesFormPreSave() and from a version
string to a checkbox enable / disable string ('1' or '0') in
onGetPreferences(). There a number of test cases to help cover these
concerning details.
Documentation for overriding the skin version as a URL query parameter
is provided in anticipation of T244481.
Bug: T242381
Bug: T245793
Depends-On: Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377
Depends-On: Ifc2863fca9cd9efd11ac30c780420e8d89e8cb22
Change-Id: I177dad88fc982170641059b6a4f53fbb38eefad6
1. As MediaWiki documentation says, in order to use AutoloadNamespaces,
we require at MediaWiki 1.31. See
https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#AutoloadNamespaces
2. The most recent obsolete version of MW is v1.30. Bump the required
version to the most recent LTS version, v1.31
Bug: T244481
Change-Id: I735fd64085601376bf1917b2df5a7dbeeb55108f
With complex additions to Vector's codebase like the Desktop Improvement
Program upcoming, it's important that we have a shared, intuitive
language to talk about features and their requirements. Centralising
the registration of features and creating an API satisfies does exactly
this.
This change introduces a greatly-reduced version of Piotr Miazga's
(polishdeveloper, pmiazga) original proposed API and associated
scaffolding classes for feature management in Vector, which itself was
based upon his work in MobileFrontend/MinervaNeue. This is done to
establish a foundation upon which we can build the more sophisticated
parts of Piotr's proposal in a piecemeal basis, thereby minimising risk.
Distinct from Piotr's proposed API is the ability to register sets and
features that are always enabled or disabled.
Additionally:
- A Vector.FeatureManager service is registered but not used
- A list of proposed immediate next steps is included
Bug: T244481
Change-Id: Ie53c41d479eaf15559d5bb00f269774760360bde
doc.wikimedia.org is a helpful resource when iterating on a codebase.
Now that the Desktop Improvements Project is underway, Vector will be
iterated on heavily. Like MobileFrontend, generate documentation with
Doxygen so that it can be published on doc.wikimedia.org.
Note well that:
- The CALL_GRAPH and CALLER_GRAPH statements have been removed as they
were being set to the default value (NO)
- DOT_FONTSIZE was increased from 10 to 12
Bug: T242779
Change-Id: I7cc2eae2cf950293eee0028873bc6f1c89443977
Those messages have been untouched since introduction, but should be
unified. They are put on top of corresponding pages like
https://en.m.wikipedia.org/wiki/MediaWiki:Vector.js
Change-Id: Ib40a38dba553bf10070fedf368ba8ea581d2b4b9
Use same code as in MinervaNeue. For unknown reason, Chrome
decides in 2020 to suddenly show search cancel button.
Change-Id: I5c813a2ea68929c05f5d061d46c027934853dbf8
The renderNavigation function provides an unnecessary level of
abstraction which I'd argue hurts readability of these functions.
Let's remove it.
Change-Id: Iad1c4db606404fecf4d5ae98981df9f05d3f661e
This adds the wmf theme styles to our jsdoc as can be seen on
https://doc.wikimedia.org/Parsoid/master/.
There is a caveat with this though. jsdoc-wmf-theme adds warnings for
unlinked symbols (e.g. 'return {jQuery}') [1] which causes the jsdoc doc
generation to fail since it is set to fail on warnings (we have it
configured with `pedantic: true`).
If we add the jsdoc-wmf-theme, we will need to be stricter about our
symbol usage which could be a good thing or just be tedious and
annoying.
What do you think?
[1] https://github.com/cscott/jsdoc-wmf-theme/blob/master/publish.js#L29
Bug: T239258
Change-Id: Icade62a278d7e685cbda28a8ca26a1b703e64f19
* jsdoc.json was copied from Minerva. The markdown plugin from that
config was removed since there no usages of that in Vector.
* Added latest jsdoc dependency to package.json
* Copied 'jsdoc' task from Minerva into Vector. Revised storybook output
so that multiple docs (storybook + jsdoc) could be in /docs
* Made collapsibleTabs.js JSDoc compliant (This was really the only
thing using jsduck syntax)
* Modified Gruntfile stylelinter to ignore docs folder
Bug: T239258
Change-Id: Id07d591ffe7bf0ac021109051e89b91ffdcf4c78
Although the convention of where to put conventions remains somewhat
contentious, the team's desired conventions for Desktop Improvments have
so far been, for the most part, general and could be useful for any
project our team owns (e.g. MobileFrontend, Minerva, etc).
Therefore, I added/made revisions to the
https://www.mediawiki.org/wiki/Reading/Web/Coding_conventions wiki page
as this seems the be the single source of truth of our team specific
conventions that span across repos.
This commit just links to these changes which follows the same pattern
as Minerva and MobileFrontend.
Additional Changes:
* Added installation section similar to Minerva Skin
Bug: T239269
Change-Id: I41c71fba1228086f1830d8bb0808227b62ebf5cd
Thanks to the dependent change, the print logo is now provided
in core so we can remove the custom Vector ResourceLoader module
ResourceLoaderLessModule is replaced with a ResourceLoaderSkinModule
and gains the features capability replacing the need for
'mediawiki.skinning.interface' making use of the changes added in
6845912bcf1.
Note that for cached HTML both 'mediawiki.skinning.interface'
and skins.vector.styles will be loaded. We can avoid this
by renaming skins.vector.styles if necessary (but I'm not
sure if we'd want to do that)
Bug: T232140
Depends-On: I00899c16c0325f36b671baf17e88c2b5187b3526
Change-Id: I569e0d800e147eabc7852567acd140108613f074
- 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
Use a template variable only for html attributes of the logo
Move static HTML into Navigation.mustache
Change-Id: If37015b9ce4f37e264b6f25956e4d0ca35e8cdff
A resources folder is the defacto-standard across mediawiki repos.
Vector now mirrors those by describing where files served by ResourceLoader
are located.
Change-Id: Ib7d8575112e8afaaa84221a6f30a15b34b51eb24
Vector provides two vector specific hooks:
- VectorAfterToolbox
- VectorBeforeToolbox
Instead of supporting Vector specific stuff we should aim
for a nice global skin api and allow other 3rd party to
extend MediaWiki functionality no matter which skin is currently
on.
Bug: T240062
Change-Id: I245f1316e79f814ba04f4e0a0223d4f0596cf39e
Since only one hook is specified for the BeforePageDisplayMobile hook,
replace the array of hooks with the single hook used.
Change-Id: Ic89a262f3fdba93c3ee10387b3b05137ce9dc4ad
This will allow us to render in Storybook without having issues
with unclosed tags. it also mirrors how html-headelement works
(obscuring the opening of the body and html tags)
Bug: T240062
Bug: T242674
Change-Id: I216a920c68bf3da9de55a75fc53451c68c9cc753
A Portal (or portlet) in the Vector context is a section of the
sidebar menu (e.g. Tools, Languges etc.).
The hook that places content between the portals (or portlets?)
such as `SkinTemplateToolboxEnd` and `otherlanguages` has been
enclosed inside of an output buffer so that any content it
produces can be passed to a template.
Bug: T239248, T240062
Change-Id: I882db161e5462cf88aa48c9cfd91448eb97a4a77