aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/mediawiki.diff
Commit message (Collapse)AuthorAgeFilesLines
* eslint: Manually enforce prefer-const in all remaining codeEd Sanders2024-10-051-9/+8
| | | | Change-Id: Ic9f254b55d3936f351ba9c7cc3b553544fc63a58
* eslint: Autofix var to let/constEd Sanders2024-09-122-5/+5
| | | | | | | Temporarily disable no-var & prefer-const as resulting errors need to be fixed manually. Change-Id: I6cb62a2c70a4c1fc265a00b1f18af127ac9d5029
* ESLint: Enforce prefer-arrow-callback and autofixEd Sanders2024-06-112-4/+4
| | | | Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
* Do not load oojs-ui on pages without diffsJon Robson2024-04-032-7/+13
| | | | | | | | mediawiki.diff is a utility module and loaded on other pages to the diff page, so can impact performance budget for article pages. Bug: T361672 Change-Id: I606d64ee47a4d0928ea1378eb842bcb325a20b64
* docs: Migrate hooks to JSDocapaskulin2024-03-151-4/+4
| | | | | Bug: T359280 Change-Id: I4b47aacfb63036e7591a58ac10fc337dce40ede6
* docs: Format descriptionsapaskulin2024-02-051-1/+1
| | | | | | | | Make sure all JSDoc descriptions end with a period in order to populate the summary field in the theme. Bug: T352308 Change-Id: I787b9c8a59b5e981b78a24f2b380c190eec6a21d
* Clicking added or deleted content in diff shows tooltip.Jon Robson2024-01-292-0/+56
| | | | | Bug: T353479 Change-Id: I0574a8b62c816d37c4c93d0ffc5a8f2063dd9b2a
* Fix inline/table format mixed togglinghmonroy2023-10-021-13/+19
| | | | | | | | | | | * Update logic so that the inline and table format are toggled when the switch is enabled. * Set inline format and table format elements so that toggling is controlled and we avoid mixed diff content. Bug: T345836 Bug: T346213 Bug: T346299 Bug: T346220 Change-Id: Ib88836f13cdb5cd2344e3ba12f6c942baa0fc1f1
* Diffs: Toogle diff type container after api request is doneDayllan Maza2023-09-221-9/+22
| | | | | | | | | | * inlineToggleSwitch handler now toggles containers only if the both diff-types are pressent * if an api request is needed, the done callback will toggle diff containers according to the switch state Bug: T346208 Change-Id: Icaa27d7ffa2b069beee15240f36b9409a7c7ebcc
* Infuse the inline diff toggle's layout to fix accessibilityBartosz DziewoƄski2023-09-161-3/+4
| | | | | | | | | | Infusing just the toggle widget, without the layout wrapping it, causes them to get disconnected, which breaks some accessibility features, including lack of "aria-labelledby" and no support for activating the toggle by clicking on its label. Bug: T346132 Change-Id: I227f47d4e6c25e19b4c02a16c287fc481efc2bf4
* DiffToggleSwitch: use PHP ToggleSwitchWidgethmonroy2023-09-012-58/+9
| | | | | | | | Add logic that renders the new OOUI/ToggleSwitchWidget (just added to OOUI) in PHP for the inline switch. This will provide no-JS support, and will get rid of the flash when loading the page for JS users. Bug: T341955 Change-Id: Ifc8104937cd23e9b85208b7f283db238a0e6849d
* Add an API-only user preference for diff typeTim Starling2023-07-251-5/+45
| | | | | | | | | | | | | | | | | | | * Add an API-only user preference for diff type * Retain query parameter stickiness but fix it so that the diff-type from user preferences does not leak into the query string. So the no-JS control continues to work. If a no-JS user has the inline preference set, respect it on the initial load, but add an explicit diff-type=table to the query string of the table link so that the preference can be overridden. * Get the diff type from the initial state of the no-JS button. Infuse the widget to access the active property using the OOUI public API. * For a logged-in user, when the JS toggle is clicked, fetch the new diff body and update the user preference. * For an anonymous user, when the JS toggle is clicked, update the prev/next links to include the correct diff-type query parameter. Bug: T336713 Change-Id: Ie409d79ac8222dfa6ec8fd170b76be088be80b3a
* Switch back to oo-ui-element-hidden from mw-diff-element-hiddenSam Wilson2023-06-261-5/+5
| | | | | | | | | Using the OOUI class name is an established pattern outside of OOUI widgets, so it's easier to stick with it for the diff page hiding and showing (switching to and from inline/table diffs, etc.). Bug: T324759 Change-Id: I805b6b71d8e137eaa3e000b15455557df42af838
* diff: Add inline format switch when Wikidiff2 is installedhmonroy2023-06-262-0/+162
| | | | | | | | | | | | | | | | | | Add a switch that allows toggling between inline and two-column format when Wikidiff2 is installed. Inline toggle should also support no-JS toggling The legend should toggle when switching from table to inline after the first load. Introduced a temporary feature flag to show this inline toggle so that we can merge and easily continue the improvements. It will be removed when ready for production. Bug: T336712 Bug: T330229 Change-Id: Ie6a48e495f2bb299d8b984e7c40363d534c7915b
* diff: Rename diff resource module directorySam Wilson2023-06-111-0/+67
Follows-up I0cb5f10254af780 (9ef58c1d0b60) which created a new module called "mediawiki.diff" but accidentally added its files to an existing directory for a different module called "mediawiki.diff.styles". The directory was now used by two different modules, fix this by moving the files of the "mediawiki.diff" module to its own directory in following with T193826. Change-Id: I6b57e3efa9bd45f0693c443b74dcf62312feac0b