Commit graph

13 commits

Author SHA1 Message Date
Umherirrender cb8fc5c8c1 Replace empty() with falsy check
empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)

Change-Id: I84ced7c17157b322f858640362e1013e37773d43
2023-10-22 11:45:42 +02:00
Lucas Werkmeister ca9ba6cc65 SECURITY: Properly escape vector-toc-toggle-button-label
CVE-2023-PENDING

The line param can contain some markup (since headings can contain
markup), so make that a raw param.

Bug: T340217
Change-Id: I9295a8e0f9f00b62d5206f6d7e40bb657f43651a
2023-09-29 09:08:57 -04:00
bwang 6f13caa775 Remove VectorTableOfContentsBeginning flag
Bug: T334969
Change-Id: I9e931b7cdc443e73a41c92f5368f81b35285437e
2023-05-08 22:25:03 +00:00
Moh'd Khier Abualruz 098811f200 Adjust table of collapsing auto-collapse algorithm for articles with few top level sections
Bug: T333021
Change-Id: I9eef0fc0715f5f1917c205b7b7987b0ed76f31a2
2023-04-04 10:35:12 +02:00
ksarabia 74addde337 [WIP] Removes the TOC class in body and adds in html
Adds new constants for TOC and registers feature.

Bug: T325032
Change-Id: I5e0f5f3a6d186b245bdbc98c2bb9e4cc17a03fdb
2023-02-28 17:21:16 -06:00
Moh'd Khier Abualruz fbfd887e80 Table of contents subsection toggle buttons missing label
- Reassign the edit sections array to tocData array

Bug: T328682
Change-Id: I5c0829f5361f0246fe9bc76688901b1cfb8d1486
2023-02-15 17:47:17 +01:00
bwang 0032b7b970 Remove VectorComponentTableOfContentsContainer in favor of directly using VectorComponentPinnableContainer,
- Remove all TOC components from markup when TOC isnt available
- Ensure TOC components have a consistent naming convention

Follow-up: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
Change-Id: I63519b5e5392b9eb546876e7eea060b9a6c147dc
2023-01-16 17:20:03 -06:00
Jon Robson 853ed72cd6 Table of contents elements should not be rendered where none available
Follow up to  0c0ce631ee

Bug: T319355
Change-Id: I6b01a7dfef8f2cd124e090e25f63bd41579d9c08
2023-01-12 22:47:15 +00:00
Jon Robson 0c0ce631ee Components: Model table of contents in title bar.
Bug: T320927
Change-Id: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
2023-01-11 15:42:23 -08:00
bwang 3ad3d70745 Rename VectorComponentPinnedContainer to VectorComponentPinnableContainer to match template files
Bug: T317900
Change-Id: I557fbef46fd1ea5984ded7f1a067cc43656e7076
2022-12-15 22:46:46 +00:00
bwang 97de09dcba Refactor page tools, main menu, and TOC components
- 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
2022-12-15 14:23:25 -08:00
Jon Robson c10ef66e6e Refactor: PageTools composes several different components
* Introduce Dropdownmenu, PinnableElement and PinnedContainer components

Additional changes:
* Drops unused has-multiple-menus
* Update TableOfContents to use PinnedContainer and PinnableElement

Bug: T317900
Change-Id: I0a740f8543831e266f2b1b874b40e44c8241d4cb
2022-12-12 22:17:24 +00:00
Jon Robson dba4fa6265 Setup placeholder components to guide future development
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
2022-12-07 18:58:06 +00:00