aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/mediawiki.action
Commit message (Collapse)AuthorAgeFilesLines
* build: Fix and re-enable eslint rule unicorn/prefer-includesJames D. Forrester2025-03-211-1/+1
| | | | Change-Id: I34bb289e941751ae4722c708511326a2a5431bfc
* resources: Use Codex link styles for file metadata buttonAmmarpad2024-12-121-0/+5
| | | | | Bug: T379453 Change-Id: Id29cf484e96827dee7b7c7a8b0b5c3cf9740a777
* stylelint: Add plugin/no-unsupported-browser-features for our two intended ↵James D. Forrester2024-12-101-0/+2
| | | | | | warnings Change-Id: Ia063aeb4e6709cef09bb67e48d4f1d0dea42efa2
* eslint: Manually enforce prefer-const in all remaining codeEd Sanders2024-10-051-6/+3
| | | | Change-Id: Ic9f254b55d3936f351ba9c7cc3b553544fc63a58
* eslint: Autofix var to let/constEd Sanders2024-09-121-3/+3
| | | | | | | Temporarily disable no-var & prefer-const as resulting errors need to be fixed manually. Change-Id: I6cb62a2c70a4c1fc265a00b1f18af127ac9d5029
* Turn mediawiki.action.view.metadata to LessEbrahim Byagowi2024-09-031-3/+3
| | | | | | And use user-select mixin Change-Id: If27339e595a510cd0d5c84fb9dd4a8c2d3048a2a
* Fix vertical align of collapsibleFooter toggle across skinsEbrahim Byagowi2024-08-301-1/+11
| | | | | | | | | | | | | | | Different skins have different values for <p>'s spacing making toggle arrow hard to vertically align correctly with heading paragraph, this resets it to the symmetric spacing of Vector-2010. Admittedly this isn't that clean solution but the other solution would be more intervention on the PHP and also LivePreview side, turning parseAsBlock() to parse() and taking care of Wikibase which can't be done in rush so let's have a temporarily fix at least for now. Bug: T373658 Change-Id: Ie0d8014d7716b11f04c7b0de782b8ce1d15ff0f7
* Fix collapsibleFooter regressionsEbrahim Byagowi2024-08-262-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This applies two changes, * Uses pseudo-element to avoid DOM manipulation so we don't up double or missing toggle in LivePreview, T373286. * Applies flex to mw-editfooter-toggler instead so whitespaces won't be removed from message paragraph, T373287. But this isn't an ideal solution because, * Codex icons aren't meant to be applied to pseudo-elements and doing so at least breaks the mirror feature of them in RTL, which doesn't matter here as it's taken care here anyway. * There were some margin collapse going on here which with use of display: flex it will go which results in a slightly different spacing, which isn't that different but still different and we insert a toggle icon here anyway so there is a change of placements after DOM ready which with this becomes a little more noticable. However given more serious regressions this perhaps is best we can have for now. Bug: T373286 Bug: T373287 Change-Id: Id195ec4a20f11e12462bfc98362266a7b23dba19
* Merge "Make history marker text visible on dark mode"jenkins-bot2024-08-191-0/+1
|\
| * Make history marker text visible on dark modetheprotonade2024-08-161-0/+1
| | | | | | | | | | | | | | | | | | Keep text color as black on light green background for updated marker on history pages so that it is compatible with night mode Bug: T371183 Change-Id: I0ef0f585c854b4e38993540828b65cfefc13769b
* | Remove use of a deprecated module from collapsibleFooterEbrahim Byagowi2024-08-153-21/+47
|/ | | | | | | | | | | This removes the use of deprecated mediawiki.icon module from mediawiki.action.edit.collapsibleFooter, the only use of the module in MediaWiki core. It also adds a small animation for the toggle icon. Bug: T351681 Change-Id: Ie22ef2a91a57116a6a2deff7a8d938db294ee40c
* Simplify directionality overrides in redirectPage stylesBartosz Dziewoński2024-08-091-6/+2
| | | | | | | Since 0a6efabf8641f48b48a0b205ac6c6d96c336372e this no longer needs to use !important. Change-Id: I93484fa7c5233d0dddf47a5e0c23907e22b6e602
* Remove unused image from redirectPage stylesBartosz Dziewoński2024-08-093-43/+19
| | | | | | | Since 66f3ab254c2ebb528f97e4bb69cf4def9fd258db, there can only be one entry in the list of redirect targets. Change-Id: I4bf9df26ceb5cedd8f0bdfa2b3c531e4b3b4d5b0
* Use CSS Logical with fallback to simplify redirectPage stylesEbrahim Byagowi2024-08-091-8/+4
| | | | | Bug: T371265 Change-Id: Ibc925a92579177429ebea242f6d79027a5c70a8a
* Prevent dark-mode styles from affecting print mediaJdrewniak2024-08-082-8/+11
| | | | | | | | Adds `@media screen` to dark-mode related styles so that they don't affect print media. Bug: T371331 Change-Id: Id4813e1fa4a0ea68150bf8db9d835a543065dcf5
* Merge "File pages: Apply background in dark mode to file pages"jenkins-bot2024-08-051-0/+16
|\
| * File pages: Apply background in dark mode to file pagesJon Robson2024-08-011-0/+16
| | | | | | | | | | Bug: T370074 Change-Id: Iac57281b8c6235f151a4119279ee0074e9113b13
* | More effective use of LESS in redirectPageEbrahim Byagowi2024-08-021-45/+49
|/ | | | | | This should generate the same result. Change-Id: I413b84dba1c371e0970f17b22cc207cdbd86dd02
* Merge "Use ES6 const/let in mediawiki.action.edit.editWarning"jenkins-bot2024-07-081-6/+5
|\
| * Use ES6 const/let in mediawiki.action.edit.editWarningEbrahim Byagowi2024-07-081-6/+5
| | | | | | | | | | | | | | To test this simply open the wiki editor in some page, apply some edit and try to go somewhere else. Change-Id: Iee3c194daddf280784e9a697eedffae61b833f04
* | Merge "Use more modern JS syntax in mediawiki.action.protect"jenkins-bot2024-07-081-21/+19
|\ \
| * | Use more modern JS syntax in mediawiki.action.protectEbrahim Byagowi2024-07-081-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Uses ES6 arrow functions and const/let assignments. It favors JavaScript's map over jQuery's one as the former doesn't tweak this which isn't used by ES6 arrow functions anyway. Change-Id: I133f11479c10de2a5743f626fa6c1eeb1404a778
* | | Merge "Use ES6 const/let in mediawiki.action.edit.preview"jenkins-bot2024-07-081-3/+5
|\ \ \
| * | | Use ES6 const/let in mediawiki.action.edit.previewEbrahim Byagowi2024-07-081-3/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | Also add a 'use strict' just in case. This is used for live edit preview which can be enabled editing section of the preferences. Change-Id: I6a5ac020d84d333605af88a4efb5d19fd79e7b98
* | | Merge "Modernize mediawiki.action.view.metadata.js"jenkins-bot2024-07-081-10/+11
|\ \ \ | |/ / |/| |
| * | Modernize mediawiki.action.view.metadata.jsEbrahim Byagowi2024-07-071-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use ES6 arrows and const/let assignment. Also remove uses of 'this' as incompatiblity with ES6 arrows which leads to easier to reason about the code also. Change-Id: I5acea39281ccc183deeddefa74d1754cfaaefbc7
* | | Drop an extra early return in mediawiki.action.historyEbrahim Byagowi2024-07-081-16/+9
| |/ |/| | | | | | | | | | | | | This shouldn't be needed as iterating over an empty array is no-op anyway. Also 'use strict' and ES6 let/const. Change-Id: I5f1073dbcfcc42d8e10fec191b35d7aca293d104
* | Merge "Modernize JavaScript of mediawiki.action.view.redirect.js"jenkins-bot2024-07-071-4/+6
|\ \
| * | Modernize JavaScript of mediawiki.action.view.redirect.jsEbrahim Byagowi2024-07-071-4/+6
| |/ | | | | | | | | | | Use ES6 and 'use strict', best practices of other JavaScript modules. Change-Id: Ice9ee2184a2be04b23946ac8aa447173d54dd322
* / Modernize JavaScript of mediawiki.action.view.postEditEbrahim Byagowi2024-07-071-10/+8
|/ | | | | | Use ES6 arrow functions and let/const. Change-Id: Iebaffbcea8d7461fba26693a1c6d8105f6246c5f
* Merge "JSDoc: fix some eslint warnings"jenkins-bot2024-07-012-2/+2
|\
| * JSDoc: fix some eslint warningsNovem Linguae2024-07-012-2/+2
| | | | | | | | | | Bug: T356455 Change-Id: Id0296c6bd464a868a9dc9624a5d4b61f5372fb7b
* | Minor reorder of styles in redirectPage.cssEbrahim Byagowi2024-06-281-13/+13
| | | | | | | | | | | | | | | | Factor out duplicated definitions and reorder and move night mode related definitions to a better place. Bug: T368764 Change-Id: Ie0db4a6cf2aff63166dc4ab0307adea5fcb9fe6d
* | i18n: Support night mode redirect icon for RTL wikisEbrahim Byagowi2024-06-261-0/+2
| | | | | | | | | | | | | | | | | | Currently redirect icon will be not visible in RTL wikis as the related style is applied over .mw-content-ltr and this fixes it. Bug: T365088 Change-Id: Ie0cf40f6cf4e15258e2ce605379dff84b782d5ed
* | Replace `.editOptions` colors with Codex tokensJdrewniak2024-06-261-3/+3
|/ | | | | | | | | | Replaces the hardcoded colors in the editor footer (where the "Save changes", "Show preview" buttons are) with Codex tokens. This makes the editor footer more legible in skins that support dark-mode. Bug: T367362 Change-Id: I2f07255d4207896de3fe888b8eb4f37790f28c74
* History page: Use codex variables in history page to fix dark modebwang2024-06-181-1/+1
| | | | | Bug: T367438 Change-Id: I46871c2ca6af7ee42d14e7c3ec042225e67dbe9d
* build: Update stylelint-config-wikimedia to 0.17.2Ed Sanders2024-06-132-1/+2
| | | | Change-Id: I8d68bcae416463ceec6d7b617e38d34c57360698
* ESLint: Enforce prefer-arrow-callback and autofixEd Sanders2024-06-116-35/+27
| | | | Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
* mediawiki.action: Add top margin to resolution info on file pagesVolker E.2024-06-061-0/+2
| | | | | | The text doesn't have to glue directly on the image for whitespace sake. Change-Id: I6880586bdeed2ea861ee5a3c896aea68c2b2bbf6
* Move mediawiki.action.view.redirectPage.css to .lessEd Sanders2024-06-051-0/+0
| | | | | | The file uses LESS features (nesting). Change-Id: Ib117232d5361b6493f7d831166d0fa0535c3984d
* mediawiki.action: Bring metadata table style closer to CodexVolker E.2024-06-041-14/+13
| | | | | | | | | | | | | Also enabling dark mode. The background colors used before were not helping with orientation and were to low-contrast. Following the guidelines we try to remove noise in already data-heavy presentations like tables. Also changing alignment of the table headers for better skim-ability. And using Codex font-size and spacing tokens, latter slightly increased by 1 and 2px horizontally and vertically. Bug: T366311 Change-Id: I6be6badc29e4856314a1f1728e31ab6e0e956555
* Disable non-standard colors in dark modeJon Robson2024-06-041-1/+11
| | | | | | | | | The meta data table on file pages uses non-standardized colors for its table. Neither background color is necessary for rendering the meta data so let's remove it in the night theme. Bug: T357575 Change-Id: Ie5709d3b49cad6bba652e3def0932be94ad15b56
* styles: Settle on .user-select() mixinVolker E.2024-05-311-1/+0
| | | | | | | | | Removing `-ms-user-select` rules as IE 11 is no longer supported. Also using central mediawiki.mixins.less where applicable for simpler future changes. Bug: T365759 Change-Id: I5e1e86704a45134595ec29f91c821a953591cee4
* Fix redirect arrow on dark modeksarabia2024-05-301-0/+23
| | | | | | | | * Updates style rule for redirect arrow * Prepares for dark mode Bug: T365088 Change-Id: I95defada4d3da72e190c289ab808a8c63f5fc597
* Add link to diff in post-edit confirmation messageWaldir Pimenta2024-05-051-6/+8
| | | | | | Co-authored-by: Alberto Leôncio <albertoleoncio@hotmail.com> Bug: T364264 Change-Id: Id71e50d80cef007a5750878ca5da8f8d3667d2af
* Extend live preview API in preparation for use by TemplateSandboxNardog2024-05-031-88/+10
| | | | | | | | | | | | | | | | | | TemplateSandbox's live preview would have to duplicate much of doLivePreview() and showPreviewNotes(), so move them to the reusable API, in addition to allowing more flexibility in the parameters to be passed to the parse API. Refactoring: - Look for the previous preview note *after* removing the previous preview, for efficiency. - handleDiffResponse() is called only if a diff request is sent, so we can safely pass the actual response. Also its doc was bogus. - Spin off getDiffRequest() for nice symmetry with getParseRequest(). - Move style attribute to module CSS. Bug: T136907 Change-Id: If723f40a10019401dc6d021786eec031b7859719
* Edit Recovery: use live diff viewSam Wilson2024-04-111-40/+0
| | | | | | | | | | | | | | | | | | | In order to avoid inconsistencies when discarding Edit Recovery changes when live preview is not enabled, force it to be used when viewing changes from the Edit Recovery notification. As Edit Recovery is a JS-only feature, there is no problem with requiring live preview. This refactors the normal live diff view, to move the construction of the `<div id="wikiDiff">` element into the reusable doPreview() function. That way, neither the normal live diff nor the new Edit Recovery live diff need to create their own #wikiDiff elements (they would only need to do so if they didn't want them in the normal place). Bug: T354494 Change-Id: Ic302ef14175b7cefa4d18ea5bc3ebcd7bd3b3b10
* styles: Use newly-introduced static 'neutral' background tokensVolker E.2024-04-012-2/+4
| | | | | | | | | | | | | Applying new tokens: - @background-color-neutral: #eaecf0; - @background-color-neutral-subtle: #f8f9fa; … instead of static values. Also import skin variables and change files to Less where necessary. Change-Id: I64c9f570fdd36abe5c8d62a98425911ef7b9e6d3
* docs: Migrate hooks to JSDocapaskulin2024-03-151-5/+5
| | | | | Bug: T359280 Change-Id: I4b47aacfb63036e7591a58ac10fc337dce40ede6
* resources: Create mw.widgets.visibleCodePointLimitWithDropdownUmherirrender2024-03-081-19/+3
| | | | | | | | | | | | | Use the new function instead of own filter functions at some places. Also use the colon-seperator message in content language to address the todo from the Resources.php while moving the code. Also add mw.widgets.visibleByteLimitWithDropdown Move the existing code into internal functions as most code is the same Bug: T301651 Change-Id: I2335adcbcfe5d3ce7809ef35b33bbf999518a080