Commit graph

32 commits

Author SHA1 Message Date
DannyS712 2984539f42 Refactor how namespaces with subpages are exposed to JavaScript
Instead of using an object mapping namespace ids to if they have
subpages enabled or not, pass an array of the namespaces where
subpages are enabled, reducing the size of the configuration that
gets loaded on all requests. Only requires a minor update to the
JavaScript that uses the value (check for array index instead of
object value).

Bug: T291729
Change-Id: Ia0ecac71721eceed52cc90f39ecc560bdf1b7f9b
2021-10-06 20:11:37 +00:00
MusikAnimal 4fbab29e22 MWInternalLinkAnnotationWidget: show disambiguation pages last
Disambiguation pages are rarely the page users intend to link to,
especially with newbies. By moving the disambig page(s) as the last
result, the user is more likely to pick the page they actually intended
to link to.

Bug: T285510
Depends-On: I2b8545f6dd4849629037f81f48a540748e60da83
Change-Id: Id55a19e7665d8f88559c471de36e5447fb2babb0
2021-07-27 18:36:50 -04:00
Ed Sanders de47496b19 Move MWutils to preinit and rename to parsoid utils
Bring in ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
and ve.resolveUrl, so that the file has no dependencies on VE.

Change-Id: I03bc455d5484a6c51f3fa2397c64936b829fe7e3
2020-03-24 23:13:16 +01:00
Akinwale Alagbe d3292378cc Fix:Internal and External Link annotation widget
Adding the ability to special aria-label for the link annotation widgets
in order to aid accessibility to visually impaired audience

Bug: T245294
Change-Id: I3e1fd4a3e3a951092b5212397acc38b2b89a23c2
2020-02-24 16:40:19 -08:00
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
jenkins-bot 7f7cf6ce79 Merge "MWInternalLinkAnnotationWidget: adjust the input for relative links to subpages" 2019-09-20 11:23:40 +00:00
Ed Sanders 3b09a0719c Link inspector: Turn off 'addQueryInput'
The double result creates more confusion that it clears up,
and now that the query input is always used for text insertion
it is less of an issue that we don't have a case-exact match
in the results list.

Bug: T230819
Change-Id: I58cbe740fa7d0327aadd5dd111161bb7087a4ddb
2019-08-27 12:17:44 +01:00
Bartosz Dziewoński 7ac972d408 ve.ui.MWInternalLinkAnnotationWidget: Remove 'maxlength' to fix pasting URLs
Bug: T228240
Change-Id: I1f1be3a0893bdf8b7f9d07301ed01673eda8327d
2019-07-29 22:07:51 +02:00
Niklas Laxström ea66017b4b Remove non-existing showRedlink from ve.ui.MWInternalLinkAnnotationWidget
It was removed in 3e31a31 in 2016.

Change-Id: Ib7383a4ff585258a98d6795487e912597b41900e
2019-07-10 12:18:48 +02:00
Ed Sanders d4bd5d14c8 Fix link normalization when opening inspector
Move fix for I92ffc19eab4e to getInsertionData as getTextFromAnnotation
is also used when populating internal link search field.

Bug: T226645
Change-Id: I60806932b00a742dae52651fb7931caf07413361
2019-06-26 16:16:17 +01:00
Ed Sanders 1168db2370 Link inspector: Pass new 'showInterwikis' option to title widget
Bug: T222831
Change-Id: I28a8c8cbb90f9917301bafa877e0ae66970816e7
2019-05-08 13:48:24 -05:00
David Lynch 4c68fe654e MWInternalLinkAnnotationWidget: adjust the input for relative links to subpages
If in an appropriate namespace, automatically add the name of the current page
to the beginning of internal links that start with a /. Same behavior as
wikitext link-parsing, essentially, just made explicit in the UI.

Bug: T110413
Change-Id: Idf9dc3fafab0e9c809eaf6c523c80da57577bb61
2019-05-02 11:59:05 -05:00
Timo Tijhof ef36f4b0a1 Move usePageImages/usePageDescriptions from page conf to site conf
These do not vary by user or page, and can thus be loaded asynchronously
via the startup module, rather than blocking rendering and fetching
of modules on all pages.

In a future change, it might be better to go a step further and bundle
these with a module so that they only load as-needed instead of still
on all page views, but this should be an improvement nonetheless.

Change-Id: Icae3712ac5546a90bc7ffd787b0f3285dff6a26f
2019-04-17 00:10:27 +01:00
James D. Forrester 3c293ea00c doc: Bump copyright year for 2019
Change-Id: I8991b97c980d4149f53eb5601036220ef3c0c440
2019-01-01 13:24:23 +00:00
Ed Sanders 478b0bcbb9 Create getters for localised APIs (getContentApi/getLocalApi)
Pass through the current document when available, otherwise
assume the current surface's document.

Also add a getter for getPageName, so that can vary based
on the target document.

Bug: T193856
Change-Id: Ifdc951fdc6a43b924d102e3fcd7e59e52023757b
2018-05-05 14:32:55 +01:00
Ed Sanders b54f427078 Remove unused overrides in internal link annotation inspector
Removes an unused call to mw.util.getUrl.

Change-Id: I3988311b7160af628ea4ceeafcfdc3cc0a7a3774
2018-05-05 14:32:55 +01:00
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00
Ed Sanders 738d3aff47 Use original title or normalized title when inserting link text
Original title will preserve the case of what the user entered
into the inspector. Noramlized title will remove any unwanted
leading colons from file/category links.

Bug: T118408
Bug: T124410
Bug: T160977
Change-Id: I92ffc19eab4eead0d124e84afc1e5a0a3e535867
2017-03-24 22:16:31 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders 4d1f8b5928 Pass excludeCurrentPage option to TitleSearchWidget in link inspector
Logically depends on Ieade9d0ff for the actual functionality.

Bug: T147050
Change-Id: I2cc4fc170398c80d7f0103772bc56666685b8baf
2016-09-30 15:41:08 -04:00
David Lynch ef7652fdfc Move internal-link detection into the InternalLinkAnnotationWidget
If internal link detection is in the LinkAnnotationInspector, it falls down
when a valid URL which isn't also a valid page title (e.g. percent-encoded
titles) is pasted into the input. This is fixed by moving the detection to the
input's change handler before any validation can occur.

Bug: T119431
Change-Id: I1eb2040dd918fdcc22c28594b5cbad835cf384a8
2016-07-15 13:51:35 -05:00
Ed Sanders 7f31507e12 Link inspector: make height consistent
Make the DOM order sensible so we don't have to
use SearchWidget's position:absolute hacks.

Bug: T129173
Change-Id: I3517e0e0cfe2ab0eee4bed7390e41710d3140eb0
2016-03-08 10:26:31 +00:00
James D. Forrester ada58df361 build: Bump file copyright notices for 2016
Change-Id: I3c618c196e504a80ca297a4132a17f1977a24fb7
2016-01-03 14:57:25 -08:00
Ed Sanders 4943127cde Link inspector: Show redlink in suggestions
This feature was accidentally dropped when the widget was moved to core.

Change-Id: I302b4b001f1db64b023dae73e36c85e491617e92
2015-10-14 17:24:53 +01:00
Ed Sanders f814ea719b MWLinkAnnotationInspector: Use TitleSearchWidget instead of TitleInputWidget
Depends on I335bd912d in MediaWiki core.

Bug: T101169
Change-Id: I2932c9df5444d1363af5af9b438bb905ed298148
2015-09-27 14:03:52 +01:00
Ed Sanders 48a07e0bdc Use new internal link builder
Bug: T64816
Change-Id: I9ec857eef948028e65eb5e8bf21707f5f5bfd9c0
2015-08-25 16:39:32 +01:00
James D. Forrester f5c6f61163 build: Enable jscs rule 'requireSpacesInsideBrackets' and make pass
Change-Id: I846d36c15e1b1f810d2ef7fd422f8412790bcb0f
2015-08-19 10:33:02 -07:00
jenkins-bot de8afeb833 Merge "MWInternalLinkAnnotationWidget: Force 'Open' button to use full path" 2015-07-02 22:39:21 +00:00
Ed Sanders 52cb066dc7 Use new MediaWiki core TitleInputWidget
All link input/title input functionality has been moved to core, so
we can replace the link widget, redirect widget and template search
widget with it.

Depends on Ib463e60cad96 in MediaWiki core.

Change-Id: I452f3b86ead403307072cf904f0553c9771f4300
2015-06-24 17:06:00 -07:00
Alex Monk c0de5f2f51 MWInternalLinkAnnotationWidget: Force 'Open' button to use full path
Instead of just assuming we're in /wiki/. That might be OK for VE core
and external links, but not for internal MW links.

Bug: T85619
Change-Id: I53d7fed63a66e3c72d4c8fd66cd1f85fb10a2e55
2015-06-23 22:26:10 +00:00
Ed Sanders e9384ad9ac Update VE core submodule to master (83d45d1)
New changes:
9d162ce Restore the selection to a sensible place when closing FindAndReplace
57229ac Only apply annotations if 'done' is clicked
bfb17ee Always show cancel button on annotation inspectors
91672cf Disable 'done'/'insert' button when input invalid
aef9cbd Only create annotations from text input if it is valid
a384b96 [BREAKING CHANGE] Make getTextFromAnnotation/getAnnotationFromText static
fa09ab7 Scroll table selection into view when it changes

Local changes:
Make getTextFromAnnotation/getAnnotationFromText static

Change-Id: Id3c2a1efb1f327fa6d5b93d57d90bb5bb8ee88f8
2015-06-02 00:47:13 +00:00
Ed Sanders ff9bf1fcb3 Update VE core submodule to master (2c0224d)
New changes:
68959f2 Localisation updates from https://translatewiki.net.
2c0224d [BREAKING CHANGE] Link widget refactor
f81eefa [BREAKING CHANGE] Rename LinkInspector to LinkAnnotationInspector

Local changes:
Adjust for link inspector refactor

Create separate widgets for internal and external link
annotations. Remove annotation specific logic from link
target input widget.

Change-Id: I054c3fe7ac9c61fbc3302471abd58cab89fed5a4
2015-05-08 09:56:11 +01:00