This adds support for the new 'element' tool type to be a function
which returns the HTML for the toolbar widget. It means that it's
possible for the element to access the WikiEditor context object.
Bug: T286759
Change-Id: I6af12075b96d480639f2fc0d97333a6142480c02
Logic under LinkTypeField.setIsExternal() wouldn't emit events about
selection changes, at the mean time TitleInputField.setUrlMode() would
call setIsExternal() and handle everything correctly.
setTouched() is moved forward to actually prevent value being overwritten.
Bug: T302196
Bug: T302201
Change-Id: I5662556394a539073ebf0a17743a260a9d8b0c8c
For some reason, even though jQuery UI dialogs know about their
own buttons, they don't know if the buttons are disabled. This
means that it's still possible to submit the dialog when a button
is disabled.
This change (which is mostly whitespace) adds a check in the click
handler to return early if the 'insert link' button is disabled.
It also gives this button a class name, and so simplifies the other
place that refers to the button.
Bug: T298596
Change-Id: I39fea13b1874f851a68cf08243b3e7ccd355d775
Make sure it works on pages which don't trigger DT, such as full-page
wikitext editing.
Bug: T301497
Change-Id: I244381ee9e47bd3119e341cddb42e2ab38add4a8
The alert text is now added as a red message under the form field
for the link target text, and there's no need to have an additional
alert because the dialog's insert-link button can't be clicked
while there's an invalid internal link anyway.
Bug: T298596
Change-Id: Ib536b51baae24a6cfe7a7426d039fdf11c4cb150
In addition to button, toggle, and select, add an element type of
tool which can be used to insert any HTML content.
Bug: T286759
Change-Id: Ia193308a076a7eaa010269ea0dd7b707c774561d
Use jQuery UI's proper button disabling system, rather than trying
to set attributes manually.
Also remove the alert which used to show when trying to insert a
blank link target, as it now has no use. The functionality was
removed in I3541f438fad9b7e0bf23ead2f2e164e84565d254
when the insert-link button was changed to always disable when an invalid
link was being attempted, but the alert was not noticed at that point
(and nor was this disabling bug).
Bug: T298596
Change-Id: I17c454d6ba336abd0b4eeee0d7166fdf81d25734
When closing the alert that appears when a link looks like an
internal URL, the link target text was changed but the radio
button was not. This patch rectifies this.
Bug: T295517
Change-Id: Ie0339f3aac8ccfd118c604602ce638539ff67e03
When the insert-link dialog is opened, a change event is manually
fired in order to get the system in sync. This is not optimum,
but until we refactor jquery.wikiEditor.dialogs.config.js it's
a simple way to do it.
The issue was that this manual event was being given an empty string
as the title value, but it should've been the actual current field
value. The reason it's not the same is that when the dialog is
closed with the cancel button, the state of all the fields is not
reset (this is a long-standing design feature of the dialog).
Bug: T293167
Change-Id: I8e2a0a5169b5d2a6d706623dc0c879469acd9afa