Set the opening state of the insertion button (in the insert-link
dialog) to disabled, and also disable it whenever the target field
is empty. This makes it unneccessary to show an alert when trying
to insert a blank target so that code is removed.
Bug: T293167
Change-Id: I3541f438fad9b7e0bf23ead2f2e164e84565d254
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
Log on every click (by any means, including accesskey) of the
main editing preview button.
Bug: T290521
Change-Id: I67d821445c5e39034bcb121beccf17a765a311ed
* #wikieditor-toolbar-link-int-text was removed in I17f34a8cbf72b80f3916581867e5828d9b129789
* .wikiEditor-template-dialog-fields was removed in I47119d6cfdde4b40ff5b07be0c7d327b80598142
Change-Id: If669eb3fa8e1401d640c879f808c097682c30f31
The HTML template is no longer required, as all three fields are
now OOUI and so provide their own HTML.
Bug: T289214
Change-Id: Id7e02119f00e30244b8dc2048c1f694500151b25
Added in https://phabricator.wikimedia.org/rSVN56198 in 2009
It seems to have no user-visible effect, and resizing is still working
as expected for the dialogs that use it.
OTOH, this logic is broken, since it doesn't account for elements hidden
via classes or anything other than inline style. For instance, if there
are OOUI text fields inside the dialog, the logic in resize() will add
style="display:inline"
to the empty icon elements, which would then cover part of the input
field.
Bug: T293065
Change-Id: If53937dd9e80835774ef936c5aa19f78c7266ca7
Following-up on I9fb7e66bf925eb9a8260d6245d2a7db54a7a2fec
this converts the link-text field to OOUI.
Bug: T289214
Change-Id: I17f34a8cbf72b80f3916581867e5828d9b129789
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
When adding characters to the WikiEditor toolbar, it's possible to set
titleMsg, but it's not possible to set a free-form string title. This is
rather limiting for personal or site-local scripts which might wish to
use a title tooltip but not be able to set a MediaWiki message.
This commit adds the ability to pass a 'title' field of a character
definition object. If both 'title' and 'titleMsg' are defined, 'titleMsg'
is used.
Bug: T292434
Change-Id: I00775d5e4690c0fd45c20639a122c39dc756135e
This commit adds bidirectional support for prefixed colons in
internal link targets, such as the ones required by links to files
and categories. It automatically adds a colon to links targeting
pages in the File and Category namespaces (as determined by mw.Title)
and allows an optional colon prefix for all internal links after
the optional whitespace.
Bug: T38227
Change-Id: Ie2801c42da4238555ad7c6544a8412610a528597
The var 'module' got renamed to 'm' in
I57b11c6b4c6e67bb38bb67a93b06d6d1d3009933. This patch fixes the
call to it.
Bug: T284716
Change-Id: I57b7a5fd4a8f2fe2fa98ab5fc41c5bd2500f3a67
Adds a hidden field to the edit page form, with JS that will set its
value. Server-side then checks for that value and logs whether it was
correctly set.
Bug: T263505
Change-Id: I8be06385aa6d97e5536cfc252d34297e1c000a32
After looking more closely at the code, I noticed that
dialogaction is set to e.target or this which is a
DOMElement, not a jQuery Object, thus it doesn't have
the trigger method which explains the error.
Follow up to 760f023f2
Bug: T261529
Change-Id: Ie5f58e33ad385f2abae19264bb2c3cd34a721788
This error is generating a large amount of logspam.
Add a check to avoid it, and DRY up.
The issue is caused by line 1182 setting dialogaction to false when
a dialog is closed. Presumably references to this data attribute
remain.
Bug: T261529
Change-Id: Ie75f737980dfcbcc4829def1e5a6894262d73b31
If someone is enrolled the DT a/b test, we want to know about their
editing here as well.
Bug: T273096
Change-Id: If2bb04011c8ca54e8c7ffd073e21bec45e92460c
In some languages, image options like 'alt' or 'thumb' can have
multiple synonyms. They were only handled for English (and were
hard-coded).
Change-Id: Ib03932d3d85a5540bea325f2717da3365756a90e
We were already using it for almost all interactions with the editing
area, except for this code which restores the selection after closing
a dialog.
Bug: T254612
Change-Id: I26d22d9c5d64fe8c861405e65cd4464c349aeac9
Data tables should always include a caption for accessibility reasons.
So add a placeholder caption when using the "insert table" button.
Bug: T252350
Change-Id: I6773e2274007946de516ae34e841f66ad20ebc0c
Using an event introduces a race condition where the extension
adding the listener has to do so before WikiEditor finishes loading.
Change-Id: I5a8dc6f8fd1b1939b5d98307b20ef1fd355cee99