aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/jquery
Commit message (Collapse)AuthorAgeFilesLines
* build: Fix and re-enable eslint rule unicorn/prefer-includesJames D. Forrester2025-03-212-3/+3
| | | | Change-Id: I34bb289e941751ae4722c708511326a2a5431bfc
* build: Updating npm dependencieslibraryupgrader2024-12-101-1/+2
| | | | | | | | | | | | | | | | | | | * grunt-stylelint: 0.20.0 → 0.20.1 * body-parser: 1.19.2 → 1.20.3 * https://github.com/advisories/GHSA-qwcr-r2fm-qrc7 * micromatch: 4.0.7 → 4.0.8 * https://github.com/advisories/GHSA-952p-6rrq-rcjv * socket.io: 4.6.1 → 4.8.0 * https://github.com/advisories/GHSA-25hc-qcg6-38wj Additional changes: * Also sorted "composer fix" command to run phpcbf last. Manual changes: * A number of semi-random adjustments to declaration-no-important over-rides until stylelint passes. Eurgh. Change-Id: Icbac4f46a91d6e8c19afcaa5eccbf08763bcd653
* eslint: Manually enforce prefer-const in all remaining codeEd Sanders2024-10-052-10/+9
| | | | Change-Id: Ic9f254b55d3936f351ba9c7cc3b553544fc63a58
* eslint: Manually fix remaining no-var warningsEd Sanders2024-09-121-2/+3
| | | | Change-Id: I909e59288cea9afd1f832180eabbc375f505ed41
* eslint: Autofix var to let/constEd Sanders2024-09-123-73/+73
| | | | | | | Temporarily disable no-var & prefer-const as resulting errors need to be fixed manually. Change-Id: I6cb62a2c70a4c1fc265a00b1f18af127ac9d5029
* Merge "Use a more modern JS syntax in jquery.confirmable"jenkins-bot2024-09-031-12/+10
|\
| * Use a more modern JS syntax in jquery.confirmableEbrahim Byagowi2024-09-031-12/+10
| | | | | | | | Change-Id: I911dd0f3f6531f5ab60234c69313b3970c33a5d6
* | Use const/let in jquery.highlightTextEbrahim Byagowi2024-09-031-10/+10
|/ | | | Change-Id: I16cb587e9f1712f1ed9fd729961a6ec04d17258c
* Merge "Use Less in jquery.suggestions"jenkins-bot2024-08-182-76/+78
|\
| * Use Less in jquery.suggestionsEbrahim Byagowi2024-08-172-76/+78
| | | | | | | | Change-Id: Ifaddd8496236775964dee26df810dee2a9d770a3
* | Use Less in jquery.confirmableEbrahim Byagowi2024-08-172-30/+32
|/ | | | Change-Id: I043c804744d1dd7be886a32cd90144b314dc1e49
* Merge "JSDoc: fix some eslint warnings"jenkins-bot2024-07-011-0/+1
|\
| * JSDoc: fix some eslint warningsNovem Linguae2024-07-011-0/+1
| | | | | | | | | | Bug: T356455 Change-Id: Id0296c6bd464a868a9dc9624a5d4b61f5372fb7b
* | makeCollapsible: Use Codex link mixin cdx-mixin-link-baseJon Robson2024-06-271-9/+1
|/ | | | | | | @color-link is not a Codex design token Bug: T368498 Change-Id: I91aa8b1ac3114da1a0fd3dd4c2c5d9a35d115796
* jQuery.textSelection: Option values of `undefined` revert to defaultsEd Sanders2024-06-211-0/+7
| | | | | Bug: T368102 Change-Id: Ie9bf594620344a4a451dae5bef91c0f2a6aca6da
* Merge "docs: Document jQuery plugins with modules"jenkins-bot2024-06-151-85/+91
|\
| * docs: Document jQuery plugins with modulesapaskulin2024-06-151-85/+91
| | | | | | | | | | | | | | | | | | * Moves jQuery plugins from a namespace to individual module pages to be more clear about installation requirements. * Removes jQueryPlugins namespace from types and landing pages Bug: T353357 Change-Id: I5634f2e4e759dafb618aecf6361a2bcb7ba1f829
* | build: Update stylelint-config-wikimedia to 0.17.2Ed Sanders2024-06-132-2/+1
| | | | | | | | Change-Id: I8d68bcae416463ceec6d7b617e38d34c57360698
* | ESLint: Enforce prefer-arrow-callback and autofixEd Sanders2024-06-112-17/+17
| | | | | | | | Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
* | build: Update eslint-config-wikimedia to 0.28.1 and autofixEd Sanders2024-06-113-9/+10
|/ | | | | | | Also remove temporary explicit dependency on eslint-plugin-vue introduced in Ibd616750f046a. Change-Id: Ic6330fcb116e99d5827b4877e094e3073e2b7b72
* Merge "textSelection: Stop initializing default methods on each call"jenkins-bot2024-06-041-382/+370
|\
| * textSelection: Stop initializing default methods on each callNardog2024-05-301-382/+370
| | | | | | | | | | | | | | | | And document the whole script as a module, re-surfacing the private but accessible methods in JSDoc. Bug: T358290 Change-Id: Icc9f4d54aaf15e6fa32c777f4a363e2d7ced1fb4
* | styles: Settle on .user-select() mixinVolker E.2024-05-311-4/+2
|/ | | | | | | | | 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
* Merge "docs: Document jQuery plugins with modules"jenkins-bot2024-05-243-20/+26
|\
| * docs: Document jQuery plugins with modulesapaskulin2024-05-243-20/+26
| | | | | | | | | | | | | | | | Moves jQuery plugins from a namespace to individual module pages to be more clear about installation requirements. Bug: T353357 Change-Id: I07f6d07202d9525bb9c6a2e7c403a53bfcfb9aa7
* | jquery.makeCollapsible: fallback to original collapsibleSportzpikachu2024-05-221-0/+4
|/ | | | | | | | | | | | 610b9ac91c4b changed the behaviour of jquery.makeCollapsible to check if the toggle is inside the original collapsible. If not, it searches up the DOM tree to find a .mw-collapsible element. However, this new behaviour causes jquery.makeCollapsible to do nothing if the toggle link has been moved outside of the collapsible but not in the children of the collapsible. Add a fallback that uses the original collapsible in case one could not be found. Bug: T364712 Change-Id: I6ace62acccdbdd1fbc6307f2090d68f601477a6c
* Reduce FOUC/reflows when using .mw-collapsible-toggle-placeholderBartosz Dziewoński2024-04-161-0/+13
| | | | | | | | | | | | | | | | | | | | Improve the CSS that temporarily shows non-clickable toggles for collapsible elements (until the JS runs and adds the real toggles) to support toggle placeholders (.mw-collapsible-toggle-placeholder) and premade toggles (.mw-collapsible-toggle). We can do this decently these days using the `:has()` selector, available in the most recent versions of all browsers. Note that this is not intended to handle every case, especially with nested collapsibles, as that's still impossible in just CSS. This can be tested using a copy of the advanced demo page: https://mediawiki.org/wiki/Manual:Collapsible_elements/Demo/Advanced by looking at the "Pre-made toggle" and "Custom toggle link placement" examples. Change-Id: I91fd19bb71f7104dbe856c0a1a43b70c6e6c44fd
* jquery.makeCollapsible: Make toggle buttons work inside cloned contentjwbth2024-04-161-1/+10
| | | | | | | | | | | Collapsible elements may be cloned, e.g. for use in reference popups (see T362561). In this case they should keep their functionality. This patch adds an instruction that makes sure the button element is inside the collapsible element (which it should be when no custom togglers are used, if my understanding is correct). If not, it looks for the closest `.mw-collapsible` element up in the DOM tree. If I understand correctly, the first `actionHandler` declaration relates to the case when no custom togglers is used, so changing it won't affect the behavior with custom togglers which would require a different approach. Bug: T362561 Change-Id: I1f8f1108a17246f16f89599025cb128ede307161
* Merge "docs: Add methods to JSDoc"jenkins-bot2024-04-051-6/+6
|\
| * docs: Add methods to JSDocapaskulin2024-04-031-6/+6
| | | | | | | | | | | | | | Adds methods and details that were included in JSDuck Bug: T360237 Change-Id: Idf7218b8818cada273abedd80f50a54cf2770ed7
* | docs: Fix JSDoc syntaxapaskulin2024-03-261-1/+1
|/ | | | | | | | Various fixes for typos, punctuation, examples, and links Bug: T360241 Bug: T360475 Change-Id: Ib1061b1cd008b947071dde9900d87fd9e0c9d32c
* docs: Migrate hooks to JSDocapaskulin2024-03-151-2/+2
| | | | | Bug: T359280 Change-Id: I4b47aacfb63036e7591a58ac10fc337dce40ede6
* docs: Migrate @mixins tags to JSDocapaskulin2024-03-052-2/+2
| | | | | Bug: T357811 Change-Id: I2f7d9d79ffcb7aafbec4d9fbb0e4e2fe78d515bb
* 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
* Documentation: Move to exclude listJon Robson2024-01-162-2/+2
| | | | | | | | | * Generate documentation for all files in resources/src * Include all files documented in phase 3 as not having public APIs. Add @ignore tag to documentation that shows up in published document. Bug: T352308 Change-Id: I5d643d815ffa2f578d12bb9ca70e26558a442c32
* Document jQuery pluginsJon Robson2024-01-085-17/+37
| | | | | Bug: T352308 Change-Id: Id3a0ec3d71e4e2966baf46f43652001c3b00674a
* Fix unanchored regex in jquery.highlightText.jsthiemowmde2023-12-041-1/+1
| | | | | | | | | | | | | | This was searching for a substring, which doesn't make sense in this context. This line of code is typically not doing anything because <style> and <script> tags typically don't have children anyway. But this is technically not forbidden. It's still a good idea to have this check just to be sure. This bug exists at least since 2010. Change-Id: I4a18514168b9f3668487e2c95d477cad377b0be7
* jquery.makeCollapsible: Refactor misleading docNardog2023-11-261-1/+1
| | | | | | | | The hook fires once per element with the mw-collapsible class. This came up while reviewing I4a33323. Change-Id: I559ab1dcf1eafac474272969622b5cea234e09bd
* makeCollapsible: Convert bi-state string to booleanEd Sanders2023-10-211-10/+6
| | | | Change-Id: I12d89f5b581520cd3d9648637dc6002498866853
* jquery.makeCollapsible: Make default toggle styles easier to changeBartosz Dziewoński2023-09-041-6/+9
| | | | | | | | | | The default styles are applied to .mw-collapsible-toggle-default instead of .mw-collapsible-toggle. That class can be removed by a gadget to restyle the toggles. Follow-up to 9137566ab1db644d1e6f11816f307e8a8ff7446b. Change-Id: I639211df061720bed6248899b560d8527f286dc3
* jquery.textSelection: Avoid insertText for >100 lines in Chrome/SafariEd Sanders2023-08-221-1/+10
| | | | | Bug: T343795 Change-Id: Ie2f9fa2dd354917460c9e9329bd2fa79de8a16b2
* jquery.textSelection: Refactor execInsertText for legibilityEd Sanders2023-08-221-18/+10
| | | | Change-Id: I7370288718ba7956b3a02946bfc3bf3b7a67aa3e
* build: Fix or suppress eslint/stylelint warningsUmherirrender2023-08-061-0/+2
| | | | Change-Id: If37e9b9d998660749402c173898eebd3da6ec105
* Revert "jquery.makeCollapsible: Use `unset: all` on buttons"Gergő Tisza2023-06-141-3/+11
| | | | | | | | | | This reverts commit 05281ad7260985dc3e735216e6195a5f15c1afde. Reason for revert: per T338927#8929826 Bug: T333357 Bug: T338927 Change-Id: I777c03a88284a76a598eb2e14e66a6be21a5dc25
* jquery.makeCollapsible: Use `unset: all` on buttonstacsipacsi2023-06-111-11/+3
| | | | | | | | | | | | | | | | Instead of trying to unset individual properties, just unset everything: the appearance of the button should resemble the appearance of a <span>, and <span>s appear exactly how the defaults appear. Most notably, the previous code unsetting individual properties didn’t unset the foreground color, which caused it to use the browser default color instead of the inherited color. Also remove `-ms-user-select`, because it’s used only by Internet Explorer and Edge Legacy, neither of which get JavaScript anymore (this stylesheet is loaded only when JS is available). Bug: T333357 Change-Id: Iac1fcb9a9beb0536e3848ae98b110cc6192bb178
* Update eslint-config-wikimedia to 0.25.0Ed Sanders2023-05-051-0/+3
| | | | Change-Id: I70d4e311d369bd160e0cb9411d1b074e22104006
* jquery.makeCollapsible: Fix double activation when pressing SpaceBartosz Dziewoński2023-04-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since change I06acf7dc19fba13e23d2594f8a41cbc58f973939 we're using <button> elements instead of <a> elements for the default toggles. I noticed that they are now activated twice when pressing Space. This happens because if we don't call preventDefault() in a keydown handler, and the event target is a <button> and the pressed key is Space, then browsers will run the button's activation behavior, which is to fire a fake 'click' event. We end up handling both the real 'keypress' and the fake 'click'. (Good luck finding a spec, any spec, that states this clearly. I could only find vague hints about element activation behavior.) The recommended way to avoid these problems is to only handle 'click' events, and not 'keypress' or 'keydown', since keyboard interactions will fire 'click' through this activation behavior as well. However, we also support custom toggles, which are elements that may not have activation behaviors, so we can't do that in this code. Instead, we can switch from 'keypress' events to 'keydown' events. Despite subtle differences they work the same for our use case, and let us cancel the activation behavior by calling preventDefault(). Change-Id: I50463860a7eb44b182b3196c8e0d629d86cdef21
* jquery.makeCollapsible: Use <button> instead of <a>, but styled like a linkBartosz Dziewoński2023-04-132-7/+35
| | | | | Bug: T333357 Change-Id: I06acf7dc19fba13e23d2594f8a41cbc58f973939
* jquery.makeCollapsible: support toggle placeholderLucas Werkmeister2023-03-211-5/+13
| | | | | | | | | | | | Previously, makeCollapsible users could either accept the default placement of the toggle button, or supply their own button anywhere in the DOM and be fully responsible for it (contents, events, etc.). This change adds a third option: specify the position in the DOM using a placeholder element, but still let jQuery.makeCollapsible populate the button to look just like a default button. Bug: T329167 Change-Id: Ic2c222f139e56b4bd8c12490646d213fd9d25337
* build: Uprade stylelint-config-wikimedia from 0.13.1 to 0.14.0James D. Forrester2023-03-162-8/+8
| | | | Change-Id: Ia66b47d707453b4204a52e3ad62c52be60cc1c86