Commit graph

83 commits

Author SHA1 Message Date
Ed Sanders d1dc65cfd5 Remove unused deprecated module "jquery.throttle-debounce"
Change-Id: I76a43af8d67768622e6cc0e0d3a059027a5a232f
2022-02-22 01:08:45 +00:00
Reedy 51c3fe42bd Swap to AutoloadNamespaces
Change-Id: I4eb121b4e81b4ec4833ce0bea81ae041abbdacc9
Follows-Up: I0be9b88accafce97f7e9b7524ec740fb576fa11c
2022-02-06 13:55:54 +00:00
Ed Sanders b4f144057e Tag WikiEditor edits with a hidden tag
Bug: T249038
Change-Id: Ia4267bc430ba0f12cce496ebf6f8c1773ae355a6
2021-12-07 23:30:27 +00:00
Sam Wilson 79a0d3040e Disable link-insert button if target is empty
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
2021-11-26 12:45:48 +08:00
Fomafix 0d4d037968 Use HookHandlers, implement hook interfaces and inject services
The static function WikiEditorHooks::editPageShowEditFormInitial is
kept for compatibility because there are usages in other extensions.

Change-Id: I7ba9f56fd3d00d575696f00f9f1c868fa7ad223b
2021-11-25 19:12:16 +00:00
Fomafix 4da6f5b3b5 Use namespace MediaWiki\Extension\WikiEditor in PHP
Change-Id: I0be9b88accafce97f7e9b7524ec740fb576fa11c
2021-11-20 09:30:11 +00:00
Sam Wilson 3f275059df Add logging for non-live previews
This isn't strictly WikiEditor business, but other logging is done
here, and soon real-time previewing will be built in WikiEditor,
so it makes sense to keep all the logging for the different types
of preview together.

Bug: T290521
Change-Id: If42697e43c1bec95d743244d0acf96c47df8b681
2021-11-18 08:24:37 +08:00
Sam Wilson 60be1db1d1 Remove template for insert-link dialog
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
2021-10-13 10:03:44 +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
Bartosz Dziewoński edbdc7f9e6 Add runes to special characters
Depends-On: I6c736563068a83f56990729ac6ef3be6c8a0f621
Change-Id: Ia5c43f5973ab512cc5f9e674063d47833eb9a6fc
2021-08-17 18:19:32 +02:00
Umherirrender 54af531265 Remove suggest param from opensearch api request
Deprecated in 1.35 (Iec572012de171d02871b8dc3207d2b34d17bf9ef)

Change-Id: Ic9cca2ff6f7372a64a216c65c408454dc2dc7cbb
2021-04-28 19:49:50 +02:00
Ammar Abdulhamid ab287ade14 Allow specifying alt-text in File dialog
* Also add expandable help message to explain the alt text field

Bug: T260006
Change-Id: If16ff742d7a8dee4917884e73e9c95bf76350773
2021-01-22 21:37:17 +01:00
jenkins-bot 38cc6f1f3f Merge "Add caption when inserting table" 2020-06-17 11:55:00 +00:00
jenkins-bot b2f709e5ff Merge "Replace use of old $wgVersion constant with MW_VERSION" 2020-05-13 22:16:53 +00:00
James D. Forrester 4551332586 Replace use of old $wgVersion constant with MW_VERSION
Change-Id: I31e524694ca2e7399b235b89aeeb779a4d13811d
2020-05-13 15:02:38 -07:00
Reedy 9ff90afde4 Convert to manifest_version 2
Bug: T252470
Change-Id: I8e58023cb044c9000325a275d0ae7e2f44142414
2020-05-12 02:12:31 +01:00
pcoombe a822d1c197 Add caption when inserting table
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
2020-05-11 11:09:23 +01:00
Ed Sanders 8e9d306510 Create a toolbarReady hook for attaching toolbar tools
Using an event introduces a race condition where the extension
adding the listener has to do so before WikiEditor finishes loading.

Change-Id: I5a8dc6f8fd1b1939b5d98307b20ef1fd355cee99
2020-04-21 15:28:40 +01:00
Fomafix 47a7e21216 Lazy load the modules for the upload dialog
This reduces the initial loaded modules.

Also add the dependency on module 'oojs-ui-widgets' because
jquery.wikiEditor.toolbar.js uses OO.ui.ToggleButtonWidget.

Change-Id: I03d0f73fb77bb389dd4e5ad2aa15b3ff5a97e5f5
2020-03-03 06:25:51 +01:00
Ed Sanders 0df5223a20 Use WikimediaUI toolbar styling in Vector
Bug: T223155
Change-Id: I4730a78836e8db0b4116f09e07929d8b883c9fa4
2020-02-10 14:44:06 -08:00
Ed Sanders ef38bdfe2f Align toolbar styling with Apex
Also separate out Apex-specific styling into a separate file.

The current toolbar is already supposed to be aligned with Apex
so the visual changes here are minimal.

Bug: T223155
Change-Id: I7a0a21809018e0094d50992054523d20be3c5473
2020-02-04 17:16:37 -08:00
Derk-Jan Hartman 4906ff1c8c Remove usage of EditPageBeforeEditToolbar
As noted by Jack Phoenix in I07b0e0e030217d74f06bb2b6fc278bd2e28e34b5
the core toolbar has not been present since 1.32 and this hook is
therefore rather pointless.

Change-Id: Ibcf4400237dbf3b195e2bc6a8efee9f1b1527e6d
2020-01-25 17:18:42 +01:00
Timo Tijhof f1fdd893bb Remove use of jquery.ui module aliases
Bug: T219604
Change-Id: I33f4c65de2f4f615c69989d763cf8edcd8ea8f8e
2019-10-19 20:56:24 +01:00
jenkins-bot 9a25fc5557 Merge "Remove use of jquery.tabIndex (take 2)" 2019-10-16 21:49:54 +00:00
jenkins-bot 540785f413 Merge "Revert "Remove use of jquery.tabIndex in jquery.wikiEditor.dialogs.js"" 2019-10-16 21:12:05 +00:00
Timo Tijhof b505eaed24 Remove use of jquery.tabIndex (take 2)
This was used for setting incremental tabindex attributes
on the <button> elements of the "Find and replace" dialog
as opened from the "Advanced" toolbar section. I was unable to
find a difference in behaviour with and without this code running.

Both with and without this, when tabbing from the first input
field in the dialog, the buttons are in the tab order after
the input fields (matching the visual rendering). Unclear
what this was doing.

This re-applies commit 81b08daa48, which was reverted (5f356b1a),
because I forgot to remove the calls in  dialogs.config.js.

Bug: T234581
Bug: T235701
Change-Id: Ic51074c3d2b2e9b9b050c9f42862519a3e78af16
2019-10-16 22:03:29 +01:00
Jforrester 5f356b1aca Revert "Remove use of jquery.tabIndex in jquery.wikiEditor.dialogs.js"
This reverts commit 81b08daa48.

Bug: T235701
Change-Id: Iaad63b755aba5654ce6d684d4a5a88f732a6e797
2019-10-16 20:59:38 +00:00
jenkins-bot c5b154e599 Merge "Remove use of jquery.tabIndex in jquery.wikiEditor.dialogs.js" 2019-10-12 02:13:30 +00:00
Timo Tijhof 81b08daa48 Remove use of jquery.tabIndex in jquery.wikiEditor.dialogs.js
This was used for setting incremental tabindex attributes
on the <button> elements of the "Find and replace" dialog
as opened from the "Advanced" toolbar section.

I was unable to find a difference in behaviour with and without
this code running.

Both with and without this, when tabbing from the first input
field in the dialog, the buttons are in the tab order after
the input fields (matching the visual rendering). Unclear
what this was doing.

Bug: T234581
Change-Id: I5de97733091d0e123913f272b00784205d69267f
2019-10-11 22:51:20 +01:00
Timo Tijhof 7e5b71b04e mediawiki.RegExp (deprecated) -> mediawiki.util
Bug: T218339
Change-Id: Idd56fbd34648eeb42434848119b118375562cd14
2019-09-09 17:55:24 +00:00
Roan Kattouw d23d096281 Convert ext.wikiEditor module to packageFiles
This allows us to bundle the wgWikiEditorMagicWords and
mw.msg.wikiEditor(?!) config vars that were previously exported globally
in the startup module.

This code is old and crufty, so this is a somewhat minimal conversion:
* Use require() for jquery.wikiEditor.{dialogs,toolbar}.config.js,
  and for jquery.wikiEditor.{dialogs,toolbar}.js
* Don't attempt to convert jquery.wikiEditor.js to something
  require-based, instead just run it and let it set the $.wikiEditor and
  $.fn.wikiEditor globals
* Consolidate ext.wikiEditor.{dialogs,toolbars}.js into
   ext.wikiEditor.js

Bug: T222828
Change-Id: Ia75d685cbde786e8fceb6db36f2436b2beea1499
2019-08-05 22:24:56 +00:00
Fomafix 3a306ff7fb Use lightweight mw.util.getParamValue() instead of mw.Uri()
Change-Id: I27eea6544a7dfe503d0cac1e24228eca9834ca95
2019-07-17 17:41:23 +02:00
jenkins-bot 7c75285577 Merge "Search: Add option to search whole words" 2019-05-19 18:21:54 +00:00
Derk-Jan Hartman f501cdc9c6 Search: Add option to search whole words
Bug: T24478
Change-Id: Idb47ac392b0f8b1425053c6916db8f25c11c9762
2019-05-15 22:03:54 +02:00
Timo Tijhof 14db0b965a Remove unused 'wgWikiEditorEnabledModules' var
This is an internal variable that hasn't been used since 2017
with commit be36244c70. It was kept for back-compat with
regards to caching, which as churned long since.

Bug: T219342
Change-Id: I7c71956e34c1d4312037f9a8d26f81125ab82577
2019-03-29 02:02:52 +00:00
James D. Forrester ebe89e3c7d Replace use of deprecated ResourceLoaderTestModules hook
Use the new extension.json attribute instead.

Bug: T214211
Change-Id: I79c45c6923fd19f6f9f068492b3bd6548161dd04
Depends-On: I27ecebe27d7aaebe6d1317bc5eaea9cca368b45d
2019-02-13 15:24:38 -08:00
Timo Tijhof 5d873f27ab Remove deprecated ext.wikiEditor module aliases
Follows-up T165112, which most the WikiEditor code into a single
module bundle (given they were only ever loaded together).

It left behind some aliases for back-compat to allow for user
migration. Once we've checked with mwgrep and get satisfactory
results, we should finally remove these to lighten the startup
registry.

Bug: T165112
Bug: T202154
Change-Id: I207ebc0f9f9c2beb81f4dfe726f090ee900a1c57
2019-01-18 18:24:44 -08:00
Ed Sanders d1675f275c Use mw.Title.wantSignaturesNamespace
This bumps the extension to requiring the 1.33.x releases of MediaWiki,
which are currently in alpha.

Change-Id: I55f77294d271c81f510ce54181a24435b840d3d2
Depends-On: Ib2faa22c429096d545ddb829a6b4025427ad6071
2018-11-27 09:46:52 -08:00
Derk-Jan Hartman 0089645a46 LinkDialog: Switch to jquery.throttle-debounce plugin
Change-Id: Iebca0398d6bc2939a0904c4cd23395d3207cfea5
2018-11-17 12:07:39 +00:00
Ed Sanders f1c0cbc70f Make jQuery.async loop synchronous
Bug: T209699
Change-Id: I61b6bd2f428144d746ccfbaf6269d64926a9c4d7
2018-11-16 12:56:55 +00:00
James D. Forrester 57499f670e Mark some messages as raw HTML
Bug: T200997
Change-Id: Ifb56bf9cd1952da6eede4e52f19a029f0bc09feb
2018-09-05 14:48:24 -07:00
jenkins-bot f31e9527b2 Merge "Toolbar: Add a new 'toggle' tool type; declare as v0.5.2" 2018-08-17 19:08:42 +00:00
Derk-Jan Hartman bfbc794c5b Toolbar: Add a new 'toggle' tool type; declare as v0.5.2
A new toggle tooltype which makes use of ToggleButtonWidget in order
to provide proper accessibility for all buttons that require on/off
state

Bug: T198781
Change-Id: I8b7fd41571a48fa4f6560790d94bb966972e740f
2018-08-17 11:19:32 -07:00
James D. Forrester 3af0239cb5 Update usage of 'book' OOUI icon to use from 'editing-citation' pack
This moved in OOUI 0.27.0, which was merged into MediaWiki 1.32.0+ in
fc88eea; the old alias is about to be removed from OOUI, so this will
stop it breaking.

Bug: T194104
Depends-On: I2acf232fd172d176b305d65d88db5b7bbfe34b88
Depends-On: I8a0426fc288a499e40f02f1da7a9f1b09e6dbd5f
Change-Id: I1a1409de15559bd614f7d351cdc1df0753b9df5d
2018-08-14 20:26:35 +00:00
Kunal Mehta 6eee7fd08b Set extension type to editor
Change-Id: Ie15520d059eca7b25247f97a6f687f6059783213
2018-04-13 22:07:50 -07:00
Ed Sanders 72e48c26e0 Convert remaining tools to OOUI
Replaces the insert and advanced-insert groups, which
are currently multi-colour icons.

Drops the button-sprite + offset mode, according to
mwgrep there are no other users of this.

Bug: T191031
Bug: T143508
Change-Id: I7032f98908a591ea5c9d3dbbb7616e2c10bbfc80
2018-04-11 15:50:23 +01:00
Ed Sanders 335f189460 Use OOUI icons for advanced format & size tools
Bug: T191031
Change-Id: Ifb6c166ecfe082414677420939106d55a5715bb2
2018-03-29 15:53:15 +01:00
Kunal Mehta 5ae7c42382 Move WikiEditorHooks into includes/
Change-Id: Ifc4fb72e68d9a879b763061f1585cac47e9f756f
2018-02-16 14:07:54 -08:00