Use CSS to decide whether to show the button or not. This retains the
existing logic for hiding the button on any page where the action is not
view.
Bug: T327795
Change-Id: If74246418f87c871c01cb7b2b62f6c59263bf976
Move feature classes to HTML element - this is significant
for anonymous as placing the classes on the body tag breaks
the browser's ability to parse the article concurrently
with the stylesheet download, because inline scripts
are spec'ed to be able to see document.styleSheets.
Changes:
* Feature classes are moved from BODY tag to HTML tag
* For now disable localStorage storage until we've worked out
the storage mechanism in core.
Bug: T321498
Change-Id: Id5afe2c60dc0067e7c74433eda5cd7858f54b0d7
In production this is always true, so remove feature flag.
Retain A/B testing code in case it is still needed.
Bug: T324799
Change-Id: Ia2057eb69d0a8d3e6e51acb5729a4399fb17a18b
- Remove all TOC components from markup when TOC isnt available
- Ensure TOC components have a consistent naming convention
Follow-up: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
Change-Id: I63519b5e5392b9eb546876e7eea060b9a6c147dc
Extra:
- Reactivated active list element, This still does not work if the current active gets edited.
- Removed pinning event reattach as we do not replace teh full element anymore.
Known Issues:
- Collapse/Expand not working
Bug: T326839
Change-Id: I2ce251f5312659b827ac2941d789248473bb0ef5
$wgContentNamespaces is default to only contain the main namespace,
we should check whether the page is a talk page instead.
Also use the term "subject page" to align with existing functions
of Title and NamespaceInfo.
Bug: T316559
Bug: T326788
Change-Id: I873283195d5c503818b2056c87c25ecc77d2915a
* updateDropdownMenuData is removed. Although it was running
inside legacy Vector, it didn't do anything as legacy Vector has
no concept of collapsible items or icons.
* updateLinkData is no longer used.
Also:
Document where other methods are being used.
Bug: T320927
Change-Id: I5b40075db91b1d0f20c21bd7cf858fdfcff96538
complete the migration to components.
Changes:
* shouldHideLanguages only used inside SkinVector22 so abstract method
and legacy implementation removed.
* Move isLanguagesInContent method to SkinVector22, updating one usage
in SkinVectorLegacy which is always falsey (languages are always portals
in legacy Vector)
* Remove unused isLanguagesInContentAt method from SkinVectorLegacy
and move getLanguagesCached, isULSExtensionEnabled,
canHaveLanguages, isLanguagesInContentAt to SkinVector22
* runOnSkinTemplateNavigationHooks copied to both Vector skins
* isResponsive moved to Vector22. In Legacy Vector it has no
real use since legacy Vector has no responsive styles.
* SkinVector class now (empty), is removed.
Bug: T319355
Change-Id: Ib5df956cecb841b7c97264975d137af32e5da4ab
Simplify the user links component
Introduce MenuListItem and IconLink components.
HTML changes:
* Logout, login and account links are now wrapped in a ul and li tag
instead of a DIV for consistent with other menus (this occurs due
to use of MenuContents). Code reviewer can see tests
for an understanding of how the template data and markup has changed.
VISUAL CHANGE:
* Increased margins in user links menu relating to change from DIV to
UL / LI tags.
Bug: T320927
Change-Id: Ia24be48105e1ff85da227883abb5dddb3d54388d
Pages that are not supported in other languages should not display the
ULS when the language button is clicked. Instead, a simple message
explaining that the page contents are supported in other languages
should be displayed inside the dropdown. Additionally, the language
button should be modified for these non-content pages, to non include
any label and be quiet instead of progressive.
This patch implements these specifications by appropriately modifying
the mustache templates and the underlying skin classes.
Bug: T316559
Change-Id: I37d8e61a1287b31d1a304d2a955f532b9b8fa505
* Don't hide language button
This code can be removed now T287206 is resolved.
Also simplify legacy logic - as the language menu
is always a portlet there.
Additional changes:
* Create LanguageButtonDropdown component to distinguish
this code from the LanguageButton in the sticky header.
* Fixes a style in LanguageButtonDropdown.less which wasn't
accounting for multiple vector-menu-content classes
Bug: T320927
Bug: T325017
Change-Id: Ic331684c384c5d57b60b098f23485e44fb75fb8f
Using PinnableElement in the TOC allows us to reuse styles associated with all PinnableElements, and helps ensure consistency between page tools and the TOC. This is something that would probably need to be done for T324505 anyway
Rather than updating PinnableElement to accept a class prop, I chose to rename '.sidebar-toc' to '.vector-toc', making the TOC's naming conventions consistent with the rest of Vector.
"sidebar" doesn't make sense anymore anyway, as the TOC can be in multiple locations and it's best to avoid the "sidebar" term
Bug: T324877
Change-Id: I5b9228380f5c4674ef424d33127a5cb4010822da
- Generalize spacing for pinnable header and menu items under PinnableHeader.less and PinnableElement.less
- Impacts main menu, page tools & personal tools
Bug: T324877
Change-Id: I4042e5c1957d64797f21146f687ef960721299ce
It's used by click tracking so marking with inline comment that
we need to be careful if we plan to remove it in our current
refactoring.
Change-Id: I6aee01363d2d150844e61fb27ab584c8ee78c4ae
Test ServiceWiring.php using tests copied from CentralAuth. Because
phpunit does not support marking a file as covered, the file is
marked as ignored for code coverage. However, these tests do not
fully cover the single service as these tests only verify that the
call to the service does not result in an error.
Change-Id: I6100d242aa61975cab7c44b35616cb2b19762cbf
- Register new feature for main menu pinned
- Update UserPreferenceRequirement to optionally handle default config values
- Add nav landmarks for the main menu
Bug: T317900
Change-Id: I8fc6e0a79a1155d68afb9e33e5101a2a160dc4e5
- Rename data-portlets-main-menu to data-main-menu
- Rename MainMenuContents.mustache to MainMenu
- Replace usage of .vector-main-menu-contents in favor of .vector-main-menu
- Add classes to PinnableContainer
- Use PinnableContainer and PinnableElement in main menu
- Remove MainMenuDropdown.less
Bug: T317900
Change-Id: I59b3acd3d56cd5761e5978607634dfb9a88f60e3
This allows '.vector-main-menu' to correspond to MainMenu.mustache, and 'vector-page-tools' with PageTools.mustache
Bug: T317900
Change-Id: I65c0d7cffbdf1cf9e59cde0c0fc4dca788e799de
- getTocData is moved into VectorComponentTableOfContents and it's test file
The following changes were made to the main menu, toc and page tools PHP components
- Avoid passing in $skin to the constructor
- Handle isPinned logic inside the component
- Add a public ID constant to the components
- Dropdown data for each feature use the same naming convention
Bug: T317900
Change-Id: I77a617a6c1d93bccd3b6e59353299f5534624e53
Uses all of the changes from Jon's patch in 866503 to move all of the sidebar
menus after and including the tools menu into the page tools component. The rest
of the menus remain in the main menu.
Additionally:
* Per T317898#8468437, the "Tools" label should be "General". It was also
assumed from the prototype that the "More" label should become "Actions"
Bug: T317898
Change-Id: Ic9c1586febd8ebfff4a17285e6bd59cee509bd34
The UnpinnedContainer and PinnedContainer are versions of the
same component but with different states. Recognize them by
organizing them in the same subfolder. Update all existing usages.
Bug: T317900
Change-Id: I2c25937190997764fa23e0b581be5538ba4d06de
While removing this we also noticed that we check the value of
isMainPage. This doesn't seem like a good idea as most main pages
do not have a table of contents, so it seems like adding
unnecessary complexity for a state that doesn't exist in practice.
The existing code path also doesn't work as it adds a table of contents
unstyled to the page.
Bug: T324874
Change-Id: Idaeff6ace5912ea74ed9d335526027c4690ac8fa
Follow-up to c1ebfd58, when removing the toolbox menu from
the sidebar, calls current() on the value of array_splice()
in order to return the actual toolbox menu data,
instead of an array containing that data.
Bug: T318434
Change-Id: I79fd0f98cb1491dec0810408ad91c7a855cea9cf
* Leverage the infrastructure around feature management to handle the page tools
pinning and persistence
* Make pinnableHeader.js leverage features.js if the data-feature-name attribute
is set
* Sets tests/.eslintrc.json ecmaVersion to 2018 to enable destructuring in test
files.
* Adds a isPinned helper method to pinnableElement
* Add a logged in requirement so that the pinned feature is disabled for
anon users.
Bug: T322051
Change-Id: Ib86282216882fa94e37b7088a3f4bd0c1bcf6cd4
Our previous use of unset was leaving an undefined index of 0 in
the array of portlet links.
Use array_splice instead so we update keys.
This removes the "phantom" main menu that is displaying in the
main menu when the print menu is enabled.
Bug: T318434
Change-Id: I59d9f00636a6302a679599a2b829cd107980a1e3
This is an incomplete styling of the menu.
This should be enough to start an initial design
review and unblock other work on the dropdown.
Out of scope for this patch:
- Pinning (being done in T317900)
- Design (will be done in follow up)
This should cause no visual regressions in Pixel.
Bug: T317899
Change-Id: Id7b47cc16fc8cf93d406687198ba37acf7a9cf24
As we build out these components further we should be encouraging using
the component system rather than the SkinVector function calls.
This allows us a way to gradually move code over as needed.
Bug: T322089
Change-Id: I7b38ae5b6fe2aa42759ae482e7647a26fcedfc38
- The collapsible ToC absolute positioning solution has been preserved to be used on no-js mobile resolutions
- The collapsible ToC grid based positioning solution has been removed
- ToC styles have been refactored and organzied
This patch involves HTML changes. In order to avoid additional complexity, this patch disables the collapsible ToC feature for users above the mobile viewport with cached HTML. The ToC continues to be automatically collapsed on mobile viewports for cached HTML users.
This patch results in 9 expected visual changes. In order to see them you need to take the following steps:
1. Run `./pixel.js reference`
2. Checkout the following PR in pixel https://github.com/wikimedia/pixel/pull/149
3. Run ./pixel.js test -c 859143
It should look like this: https://jmp.sh/ZVQqDZw7
Bug: T318013
Change-Id: Iea0d73005b91589c58ae38a3a640fa90c18a860d
Currently unused in template.
When used as a subcomponent, adds unnecessary classes
due to how Mustache cascades template properties.
Change-Id: I907e2e7af67e021461f9f831850db4b39b818586
- Creates a new skin component called PageTools which
is responsible for populating the new Page Tools menu.
- Removes the toolbox menu from the sidebar and places
it in the Page Tools menu.
Bug: T318434
Change-Id: I9d552afab834193a4905d729eadecf71dda52cd2
Generalize LimitedWidthRequirement into a more reusable
UserPreferenceRequirement that can be used by both the limited width feature and
the persistent pinning feature (and possibly others in the future).
* Removes existing logic that checks whether the option is not null. Given that
skin.json sets the default [1], presumably this isn't needed.
* Adds unit test
[1] 65af26a258/skin.json (L163)
Bug: T322051
Change-Id: I7f228cf81a65b2eb22dbe94d2384b6c9f6da91f2
This patch involves cached HTML changes
- Replace '-content-container' id with '-unpinned-container'
- Replace '-content' id with '-pinnable-element'
- Rename pinnableHeader.js to pinnableElement.js
- Replace PinnableDropdownContents.mustache with PinnableElement/Open.mustache and Close
- Add PinnedContainer/Open & Close and UnpinnedContainer/Open & Close
- Rename .vector-dropdown-content to .vector-pinnable-element
- Add new PinnableElement.less stylesheet
Bug: T318013
Change-Id: I85aec387f87126a17e760fd9fd10e10572ff3152
The PageTools template is currently only being used when page
tools is disabled which is super confusing. Rectify that immediately.
Follow up to I220d0a477b3f05b278bd2cec7dd601c7b3b17c6f
Change-Id: I4a984b959b764386133934c81e625dfde19d023b
The Dropdown component should be considered the dropdown folder going
forward. This should be distinguished as a different component that
composes the Dropdown component
Since the template itself is rather simple it seems preferable to have
duplicate templates that describe the actual component (PageTools,
VariantsDropdown and LanguageButton)
MenuDropdown is renamed Dropdown and styles that don't correspond to the
Dropdown component are moved to the relevant components.
MenuContents mustache template (future component) is added to DRY up
several of the new templates.
Bug: T320927
Change-Id: I220d0a477b3f05b278bd2cec7dd601c7b3b17c6f
[Visual Changes in this patch]
This patch introduces changes to whitespace inside the Mustache template
which corresponds to an HTML change, resulting
33 minor changes in pixel, the spacing of the ToC label shifts by
1 pixel
- Remove page tools feature flag from TOC
- Remove usage of .vector-toc-collapsed and .vector-toc-not-collapsed
- Remove now unused `moveToc()`
- Update jest tests to use PinnableHeader
Bug: T318013
Change-Id: I82f23e69b0249c844af9e45fec342217a0755893
It should be possible to style the language alert without impacting the opt in
action.
Bug: T317899
Change-Id: Ifea7d476099ab3a09da20522380664b9ad5eceb3
Makes the dropdown styles compatible with the pinned state of the
menu so that both states can share the same styles.
- New vector-menu-heading mixin shared between main menu headings
and dropdown headings.
- New @font-size-dropdown variable so font-size is consistent in
dropdown and pinned state.
- Ensure hidden 'more' menu works in both pinned and dropdown state.
- Removes extra <ul><li> from PinnableDropdownContents.mustache, as the
child Menu template already contain <ul><li> elements.
Bug: T318434
Change-Id: Ie1a56d8584c1dc3f20c6643ff4cfc740be4007fa
This patch results in an expected visual change for the main menu button when the flag is on
When comparing with master with the flag off, this patch will still show a 1px difference for the main menu button, as well as user menu and language button. These are not introduced by this patch and are due to the flush classes taking into account the 1px border
Change-Id: Id46bc939338d5bbcc3459ab502e1cf8b8f2020b2
Causes 20 visual progressions regardless of visual next flag, the ToC moves 1px when in the sidebar
Follow up to If3aed0ac401b0abc80c3ad52806eb85b33d43f06
Bug: T321504
Change-Id: I4b3ec90d8e79791a1bf17ba02c9f9d722499bec8