Commit graph

14558 commits

Author SHA1 Message Date
thiemowmde e867a49a69 Consolidate minor code duplications in DiffPage
Change-Id: I4969616c75cf201dde1094715ccbb796a92c1d92
2024-05-24 15:45:20 +02:00
Ed Sanders cb657e0bdf ESLint: Re-enable prefer-const and fix
Change-Id: I9dbc12335016a326f00bf5b9a960551f828c685d
2024-05-21 17:50:12 +01:00
Ed Sanders dbc696124f ESLint: Enforce no-var and autofix
Temporarily disable prefer-const as this requires
manual fixing.

Change-Id: I477b69a57e8d33535c6fc71dba196a8605780725
2024-05-21 17:40:52 +01:00
jenkins-bot cec87f4ba1 Merge "Use codex tokens for .mw-editsection-bracket" 2024-05-16 15:54:15 +00:00
jenkins-bot 22e6758092 Merge "tests: Adopt QUnit.test.each() and native async-await in a few places" 2024-05-16 11:32:29 +00:00
Sohom 22d25a48d2 Use codex tokens for .mw-editsection-bracket
Bug: T365089
Change-Id: I21ab4016dd38811501684867a41c3de3b9a342df
2024-05-16 00:54:42 -04:00
Novem Linguae 3d96eedbee eslint: remove redundant ruleset wikimedia/jsdoc
The ruleset wikimedia/client-es6 already contains
the ruleset wikimedia/jsdoc. So wikimedia/jsdoc
doesn't need to be declared.

Bug: T365047
Change-Id: Ibc13c9bf4bbbe36d5c8296372f59cc13a0c0940b
2024-05-15 18:38:53 +00:00
Ed Sanders 2615070b42 Convert function to arrow function to fix context
Bug: T364783
Change-Id: I02100e193554fa359b7be2c52d1ee67f63734a2d
2024-05-13 22:31:00 +01:00
jenkins-bot 6f307830af Merge "ArticleTarget: Fix return of getVisualDiffGeneratorPromise" 2024-05-10 20:34:01 +00:00
Ed Sanders b247c70a22 ArticleTarget: Fix return of getVisualDiffGeneratorPromise
The promise is supposed to return a function that can be used
to lazily generate the visual diff, not the visual diff itself.
This was broken when switching to arrow functions.

Bug: T364635
Change-Id: Ifa971333aa22af346bb62d031dc20afc8979992c
2024-05-10 20:09:09 +00:00
jenkins-bot bd1c1593a7 Merge "Fixes incorrect transition from searched image preview to upload panel" 2024-05-10 14:06:04 +00:00
Zoë 220088e13e Fixes incorrect transition from searched image preview to upload panel
This line was introduced by If59979f.

This action is only invoked from the 'safe' action when the dialog mode
is 'info' - uploads are under 'upload-info' instead - so I believe we
shouldn't end up here from an upload and whatever condition this was
guarding against is no longer a concern.

Bug: T362015
Change-Id: I6a6551eab3fb698a6ae781be4623b48e4b4c7edb
2024-05-10 10:57:11 +01:00
jenkins-bot f95f6768fc Merge "Disable eslint security regexp warnings" 2024-05-09 16:33:35 +00:00
Ed Sanders 1980827aec Use arrow callbacks in other modules
Change-Id: Ib07720923de6657ae55ac29a07c5cc85b088a70d
2024-05-09 10:33:44 +01:00
Ed Sanders a5de8d5653 Convert local functions to arrow functions and remove this bindings
Change-Id: I7987de8737103a1fc568944496c4d707dde60bc3
2024-05-09 10:33:44 +01:00
Bartosz Dziewoński 12613a6ad0 Disable eslint security regexp warnings
They generate a lot of false positives in this extension.

Since this is client-side code, the worst that could happen is a
browser tab hanging, not any real security issues.

Change-Id: I177cfa7e57a6b7b528d558d2cba076e85fd0271f
2024-05-07 20:54:42 +02:00
Amir E. Aharoni 3ab0128bfd Parse a message correctly
Follow-up to
I2495fe32c2d540be50450d715b049173f2f8727d

Done with the help of Matma Rex at Wikimedia Hackathon 2024.

Bug: T361103
Change-Id: Ica328233cb6172277e66d2341cfb53f87f8aff67
2024-05-07 12:06:37 +00:00
jenkins-bot 6bdd8e21a3 Merge "Fix displaying of "<Invalid>" when an language code isn't found" 2024-05-04 14:48:12 +00:00
jenkins-bot 8f75500ef7 Merge "Fix media dialog layout." 2024-05-03 23:23:17 +00:00
Ed Sanders acd075a4d7 Fix displaying of "<Invalid>" when an language code isn't found
Bug: T361109
Depends-On: I1e85a9d41c017fc3e3897b8b69177f342c5a43ef
Change-Id: I2ef072c3265fa9477ca2be539a7084454a8d8cae
2024-05-03 17:38:14 +01:00
Ed Sanders eb757c4c9f Remove unnecessary context binding when using arrow functions
Change-Id: Ie25e90aeb0519b1e0f793348b27d4d4a6b686698
2024-05-03 12:47:47 +01:00
jenkins-bot 8a35d3cf83 Merge "JSDoc: {Mixed} -> {any}" 2024-05-02 18:20:12 +00:00
Zoë f0cef27552 Fix media dialog layout.
Restored a selector lost in Ic9fad12f

Bug: T363992
Change-Id: I68b3052665db6ad09c594debbc593b11b7edebff
2024-05-02 18:59:29 +01:00
Ed Sanders 29e42695e4 Follow-up Ifdb15ea9: Restore deleted 'new' keyword
Change-Id: I6cd6a617ae63347df1a2b7de111cac6860950cf3
2024-05-02 12:28:51 +01:00
Ed Sanders 673dea4852 JSDoc: {Mixed} -> {any}
Change-Id: I457475a9c436c40a384675027c052294e6b1305d
2024-05-02 10:39:25 +01:00
Timo Tijhof 6cbedbf9d2 tests: Adopt QUnit.test.each() and native async-await in a few places
* Remove need for manual hacking of sub groups via "msg" strings
  carefully prepended to every assertion.

* Improve CI details, by reporting the specific case that failed,
  and local dev via ability to re-run each case, and reporting names
  directly in the HTML Reporter and CLI summary.

* Reduce need for assert.async() and tracking of callbacks, especially
  to improve failure details in case of Promise rejection.
  Current logic was likely to cause a confusing timeout instead of a
  clear failure if the promise ends up rejected.

  QUnit propagates these as part of awaiting and asserting the test
  closure's promise value (as async fn) automatically.

  This approach also avoids the pitfal of a falsely passing test
  when an assertion inside a done() handler was never reached.

* Use modern for-of where possible to remove need for closures and
  arrow functions. Thus reducing complexity of test code, where
  complexity should be kept lowest to avoid false confidence.

* Use plain for-in instead of overly complex Object.keys().forEach().

Change-Id: I934a266e75e64371081f104cfb867fb2c282c84a
2024-05-01 19:01:19 +01:00
jenkins-bot a85e1f44e4 Merge "Use forEach loops for cases" 2024-05-01 15:22:39 +00:00
Ed Sanders 4db99d7a27 Use more arrow functions
Change-Id: Ifdb15ea9e5ca606e02ddaf822bfd6397c3ce639e
2024-05-01 14:11:55 +01:00
Ed Sanders 33db46e6fa Use arrow callbacks with OO.ui.Process
Change-Id: I9bf32a382ffc2c0f1915f70bd8909668722cfb16
2024-05-01 14:11:55 +01:00
Ed Sanders e3659d4846 Prefer arrow callbacks
Change-Id: Ia05b27f7c71c33580ffd0718e3bbc673dd8b3d63
2024-05-01 14:11:54 +01:00
Ed Sanders c360e550de Fix incorrect uses of context
Change-Id: Ib8b2dd12db567e9373b633c5c7a0b2990c638d97
2024-05-01 14:10:32 +01:00
Ed Sanders e382d3af0a Use forEach loops for cases
Change-Id: Ica8773f54572bd90d4ee1ecde43254331fd2e313
2024-05-01 14:02:29 +01:00
Ed Sanders 41cce182fe docs: Escape __magicwords__ to avoid bold formatting by markdown
Change-Id: Ic4660b12091429dd3f34d241b326350049a0019a
2024-04-30 22:32:03 +01:00
jenkins-bot 5c929ab457 Merge "Rename isModified to isSaveable and deprecate the old name." 2024-04-30 17:14:58 +00:00
jenkins-bot 3fec1cf55c Merge "Confirm abort if saving would make a change to the underlying document" 2024-04-30 17:14:47 +00:00
jenkins-bot ff6ea23256 Merge "Remove unused files" 2024-04-30 16:48:50 +00:00
Zoë 2df1b00f18 Rename isModified to isSaveable and deprecate the old name.
Bug: T334513
Change-Id: I9f639dae88787774cf362c15cd134d50bd73abee
2024-04-30 16:43:01 +01:00
Zoë a6f826e989 Confirm abort if saving would make a change to the underlying document
Bug: T334513
Change-Id: Ia8935b5b1acb87a351fd02d07f72875e4d7a005c
2024-04-30 16:20:45 +01:00
Ed Sanders 8093aa43c1 JSDoc: Update jsdoc-wmf-theme to 1.0.0
Change-Id: Ibca8da2015bdbcc08817c9852c5cda7c72e07b38
2024-04-30 12:32:58 +01:00
Ed Sanders 373538d206 JSDoc: Add namespaces
Change-Id: Id9a5e2633667786d3bd1c900893007f0ec71a8a5
2024-04-30 12:24:10 +01:00
Ed Sanders 97955431aa JSDoc: Fix some more documentation warnings
Change-Id: Ib5cf7fd8a544d45274935e77b6c64f868e25ac85
2024-04-30 12:00:19 +01:00
Ed Sanders afbed7c5b3 JSDoc: Fix event documentation and complex return types
Change-Id: I5dbce39294a34a999303ccfec88261d8c92b17ca
2024-04-29 19:14:26 +01:00
Ed Sanders fd122da6fd JSDoc: @mixins -> @mixes
Change-Id: Ic06b8e058b387f8d683db6273f689694cf416ce6
2024-04-29 18:51:41 +01:00
Bartosz Dziewoński 95edc6010e Remove unused files
Accidentally added in d42a0772bb.
I noticed when one of them appeared in Codesearch results.

Change-Id: I06e3a8802314b6547267293b3d4236a2272fbfce
2024-04-29 18:52:36 +02:00
James D. Forrester b518e55ef9 docs: Replace JSDuck with JSDoc (and pull-through VE with said change)
This is not great, but it's a start (and unblocks other pull-throughs).

New changes:
c401efc98 build: Replace jsduck with jsdoc for documentation
16ba162a0 JSDoc: @mixins -> @mixes
9e0a1f53b JSDoc: Fix complex return types
449b6cc0f Prefer arrow function callbacks
1539af2c8 Remove 'this' bindings in arrow functions
b760f3b14 Use arrow functions in OO.ui.Process steps
57c24109e Use arrow functions in jQuery callbacks
9622ccef9 Convert some remaining functions callbacks to arrow functions
f6c885021 Remove useless local variable
1cd800020 Clear branch node cache when rebuilding tree

Bug: T250843
Bug: T363329
Change-Id: I0f4878ca84b95e3f388b358b943f105637e455f9
2024-04-29 16:16:50 +01:00
jenkins-bot 18bda66e98 Merge "Drop support for ES5" 2024-04-18 15:20:31 +00:00
Ed Sanders 906380212a Drop support for ES5
This was done to VE-core last year in Iedfac56c1.

Change-Id: Ic439cfafc772136cabec10b0b3bb6aaa51e28b91
2024-04-18 15:09:49 +01:00
Ed Sanders a913f2fc5c Fix selector for TemplateStyles exclusion
The <style> tags can also have data-mw-deduplicate instead
of just data-mw.

Bug: T298147
Change-Id: I63adf1f9bda3f299bba846cd65338a6f0d6c4288
2024-04-17 14:19:12 +01:00
Ed Sanders 58f56c0418 Delete MWConfirmationDialog
Despite its generic name, this class exists just for the
template dialog and does 3 things:

1. Provides generic accept/reject override messages
2. Provides a new function signature when the prompt
   and success callback are passed
3. Focuses the delete button

(1) and (2) can be provided by a local helper function.
(3) should be implemented upstream, although given this
was done to prevent users taking destructive actions
accidentally I'm not sure why this should be overridden
here.

Change-Id: Id5aa018310eded7a3552a182d19ca16b040abcbd
2024-04-16 14:46:23 +01:00
jenkins-bot 2d8b8f8c84 Merge "Revert "[DNM] Add …-toolbar-open class after toolbarSetupDeferred resolved"" 2024-04-05 08:39:40 +00:00