Commit graph

17 commits

Author SHA1 Message Date
Ed Sanders 79151572ae Remove unnecessary local context variables
Change-Id: Ia8e9d9b750f3d9cc1ab9859afe0cb5c6084058df
2024-11-15 12:47:27 +00:00
Ed Sanders 796d82a7ab ESLint: Enforce no-var and autofix
Change-Id: I6f2a1e11acdcdb70902357316b504f903abe8bca
2024-11-15 11:08:22 +00:00
Ed Sanders 5fc902bd9c ESLint: Update to ES6 and autofix
Change-Id: I38afd9a3340ca9a85e7204978cae00b48513f5ca
2024-11-15 11:07:55 +00:00
thiemowmde 918aa229b5 JSDoc: convert @cfg to @param
Bug: T307415
Change-Id: I6a13002daa97dd7a7f19edcbb73105da08423223
2024-05-28 10:21:21 +02:00
Ed Sanders e02c689cdd Fix remaining uses of 'parent'->'super'
Bug: T120821
Change-Id: Ie3b14562b045cee98ffb241e604b5b234cafd699
2023-11-02 17:11:24 +00:00
Volker E 58e69d97b9 styles: Replace 'mediawiki.ui/variables' call with skin variables
Replacing 'mediawiki.ui/variables.less' @import with
new skin-aware 'mediawiki.skin.variables.less' standard.
Also
- replacing several static values with new Codex design token featuring
  skin variables.
- reinstate static values only on resizeable drag bar. This is not a
  standardized component yet and will be revisited with further Codex
  component definitions in future.
Bump required MediaWiki core version to v1.41.0.

Bug: T319381
Bug: T332541
Change-Id: I323561894ddf23aa89f51439fc9df2b7642eaca5
2023-03-27 11:26:24 -07:00
Sam Wilson 9921163d54 Add JSDoc configuration and test
Bug: T307415
Change-Id: I770677608b5d2e4532528467d1c4141019dd01e4
2022-05-03 15:28:02 +08:00
Sam Wilson 6cd0094581 Fix return value of TitleInputWidget.looksLikeExternalLink()
This method is supposed to return a boolean.

Change-Id: Id8fd80879770b6eeb5fcfce00eab4f124a8c1a56
2022-04-20 14:47:03 +08:00
Thiemo Kreuz dbb6583bbb Streamline smaller pieces of JavaScript code
The main idea is to make the code shorter and easier to read.

One notable change is to use .test() for boolean tests instead of the
actual .match() function.

Change-Id: Ic43442b75f839906b644d4586c907601f4d5d521
2022-03-04 09:22:07 +00:00
Timo Tijhof 90e6ccaced Remove unused jquery.wikiEditor.html file
Has sat there since the first commit in 2010 (r73055), but not used.
I imagine it was was a design prototype at some point.

Also fix a few minor eslint warnings about line length, and remove the
one-off "ext-" prefix and capitilised "WikiEditor" CSS class name that
the rest of the repo doesn't use.

Change-Id: Id0eeb456fffdb490a6a86974288e57099e53ce71
2022-03-03 15:27:18 +00:00
Ed Sanders 7fea791042 build: Update eslint-config-wikimedia to 0.21.0
Change-Id: I87bca80d107c965296af74e16961cd855d72b806
2022-02-07 17:27:27 +00:00
Sam Wilson b296fc3578 Move insert-link mode constants to a better location
Also capitalize them and don't keep them in an array.

The data values for the radio buttons are also removed, because
they're not used for anything.

This is a follow-up to Ie40e8bdebe6f1330fc75ea1861f120e51ad58224.

Bug: T293168
Change-Id: I2f6de07f6f82e9e59ab67c771fcd60a68ad577dc
2021-12-07 16:39:11 +08:00
Sam Wilson d96435cd18 Prevent external links from showing as invalid
* When the link target text is changed, only change the URL mode if the user
  hasn't explicitely set the type (internal/external).
* Improve the conditions for the display of the 'external' and 'exists'
  link-target messages.
* Validate the link target (i.e. show messages) not only when the text is
  changed but also when the target type radio is changed.
* Rename the TitleInputWidget.isExternalLink() method to
  looksLikeExternalLink(), to make its purpose clearer.

Bug: T293168
Change-Id: Ie40e8bdebe6f1330fc75ea1861f120e51ad58224
2021-12-06 15:24:04 +08:00
Sam Wilson a70bd3876e Fix bug when target looks like internal link
Refactor the code for selecting the first match, so it can also
be called from the look-like button method — this will be changed
once the whole link-inserter dialog is OOUI.

Bug: T295517
Change-Id: I56b289dbf07707b0391b263464bdfd6307142574
2021-11-17 09:27:34 +08:00
Sam Wilson 0b14ae0666 Change insert-link radio buttons to OOUI
Add new OOUI field for the link-type radio buttons in the
insert-link dialog.

Bug: T289214
Change-Id: Idf80c533e5a17de3e9a57051c0608524b6d45098
2021-10-12 13:01:26 +08:00
Sam Wilson e3e9ebb6cb Change the (insert-link) title field to OOUI
Following-up on I9fb7e66bf925eb9a8260d6245d2a7db54a7a2fec
this converts the link-text field to OOUI.

Bug: T289214
Change-Id: I17f34a8cbf72b80f3916581867e5828d9b129789
2021-10-11 14:45:02 +00:00
Sam Wilson 6384498d75 Switch to OOUI TitleInputWidget for the link-inserter
In order to get a better look-up experience (images, description,
redirects, and disambigutation pages listed last), swich from
a custom title-autocomplete input (that used jquery.suggestions)
to OOUI's standard one (which is used in a bunch of other places
in MediaWiki).

This means a fair bit of code can be deleted from
jquery.wikiEditor.dialogs.config.js, and some of it moved to
the new OOUI classes.

This patch aims to be the minimum required, and so leaves a few
things for subsequent patches (such as converting the other parts
of the insert-link dialog to OOUI).

Bug: T289214
Change-Id: I9fb7e66bf925eb9a8260d6245d2a7db54a7a2fec
2021-10-08 12:43:55 +00:00