Commit graph

102 commits

Author SHA1 Message Date
Sam Wilson 68c6d366ce Add config var to disable Beta Feature
Add new $wgWikiEditorRealtimePreviewBeta configuration variable
to make it possible to turn off the RTP Beta Feature even when
the BetaFeatures extension is installed.

Bug: T323033
Change-Id: Ib79f4eaee9cee7404ff883f5e0685610d9dba9d9
2023-01-09 13:08:55 -05:00
Jon Robson 59b04bcba3 Load WikiEditor modules on mobile.
Bug: T324723
Change-Id: Ifa355f3821c72935c74650fa635a6ab863c70d39
2023-01-04 12:52:38 -08:00
Sam Wilson 3ac3629c8d Realtime Preview: add mediawiki.storage module dependency
It is used by the onboarding pulsating dot and popup.

Follow-Up: I7f4dd0858349b0e7c4f4bedea5c7a62a51c6fa3a
Change-Id: Ic61559793fcac47f6b6246872212f70fcf870cbf
2022-07-11 05:51:51 +00:00
Sam Wilson 4ff946aea4 Realtime Preview onboarding popup
Add a pulsating blue dot to the Realtime Preview toolbar button
that displays an onboarding popup when clicked and disappears
forever when dismissed.

Bug: T294589
Change-Id: I7f4dd0858349b0e7c4f4bedea5c7a62a51c6fa3a
2022-06-01 14:11:49 +08:00
jenkins-bot b62c5cf06a Merge "Use new ResourceLoader namespace" 2022-05-25 02:16:51 +00:00
Tim Starling 6b2cca3b2b Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due
to T308443.

Bug: T308718
Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
Change-Id: I289b8cb5e74b5d87e26bfe6b779a22eaaa1071ee
2022-05-24 22:59:49 +00:00
Sam Wilson 3ab9a863a2 Realtime preview: improve toolbar button style
* Add hover and active styles to match normal toolbar state styling.
* Move border from right to left on `.section-secondary .group`.
* Add a skinStyle for MonoBook so it doesn't get the button style,
  because it provides its own.

Bug: T303991
Change-Id: I6f08906156a9768729d779b6c50c9e804f51fb98
2022-04-26 15:08:28 +08:00
Thiemo Kreuz 7573a7dbad Remove all unused "loading" code, messages and animations
The CSS was already unused when the extension was created in 2010.
A comment that still mentioned the CSS class was removed via
I0798864 in 2022.

The message is unused since I9fb7e66, that was in 2021.

Change-Id: I25cd31efc4ee61ff3f857c280b5cd18c3ae4bd00
2022-04-21 15:29:15 +02:00
Sam Wilson 84b41f07be Reduce $wgWikiEditorRealtimeDisableDuration from 10 to 6 seconds
Bug: T304568
Change-Id: I70c7b0e42b47f564ea3106544da0674fa28d1b71
2022-04-21 11:10:12 +08:00
Sam Wilson 4c760f8634 Realtime Preview: display manual-reload bar when previews are slow
After three slow preview requests, switch to showing a bar at the
top of the preview area that contains a manual 'reload' button.

The manual bar will be hidden when an error message is show, but
re-shown again after the error is dismissed. Closing and
re-opening the preview pane doesn't reset the manual mode.

Bug: T304568
Change-Id: Ia72bd1ceab68fdaed5de53137bd8ac5961db4714
2022-04-20 13:01:14 +08:00
Sam Wilson 94d4912103 Realtime Preview: add hover button for reloading
Add a 'reload' button to the right-side preview pane (that shows
on hover, and stays in the same place when the preview is
scrolled), and also an accesskey to trigger the preview. If the
preview is not open when the accesskey is pressed, it'll be
opened.

Bug: T303532
Change-Id: Ifa77ad7cf6d2ed6a8b955f9a324986d1c6f9a993
2022-04-14 08:08:58 +08:00
MusikAnimal b8bdd64ee5 Realtime Preview: add as a Beta Feature
For MW installations where BetaFeatures is not available, Realtime
Preview is enabled solely with the $wgWikiEditorRealtimePreview
configuration setting.

Bug: T304596
Change-Id: I880022883bf526a2aef237f4a75e790b0f9bd4e5
2022-04-06 13:45:44 -04:00
Sam Wilson e6b77fb2ab Persist Realtime Preview state in a user preference
Store the current state (enabled/disabled) of Realtime Preview in
a new user preference `wikieditor-realtimepreview` and set it
when enabling or disabling the preview pane.

Bug: T294599
Change-Id: Id5f51c6d77ed0077906d5d5178cbfa785cc04dcf
2022-03-31 21:01:36 +08:00
MusikAnimal f1a2ba96eb Realtime Preview: disable if average response time is very slow
$wgWikiEditorRealtimeDisableDuration is introduced which allows
sysadmins to control the average time after which Realtime Preview
should be disabled. For now, this shows a simple error message that is
intentionally not localized. In a future patch, we will force the
user into a 'manual preview' workflow. See T304568 for more.

Bug: T302282
Change-Id: I2f01eef19fe81c19efedcc0073a28884f0055359
2022-03-30 12:28:23 -04:00
jenkins-bot 07423d1a9f Merge "Add nicer realtime preview error messages" 2022-03-24 20:00:40 +00:00
Sam Wilson 6175e2c519 Add nicer realtime preview error messages
Add a new ErrorLayout to display error messages along with an
image.

Bug: T303383
Change-Id: I1ec27a212b5ab67d3e805c0d7756432850de89ea
2022-03-24 14:56:19 +08:00
MusikAnimal 68e6561857 RealtimePreview: add config setting for debounce time
Change-Id: Iaf49f076c5a290ab9049267b0aede1e6b13a9136
2022-03-24 02:00:19 -04:00
Sam Wilson 411be83bc3 Add toggle button and two-pane layout for realtime preview
* Toolbar button to toggle a two-pane layout on and off.
* Resizable bar for the width of the two panes.
* Resizable bar for the edit box height, even when realtime preview is off.
* Only enabled when $wgWikiEditorRealtimePreview = true.
* Fires JS hooks when enabled, resized, and disabled.

Bug: T293347
Change-Id: Id09d44519249c0b7f5c33d48d524b7c92a5a9106
2022-03-13 07:28:01 +08:00
Sam Wilson 2aa9e1d298 Remove unused messages and commented-out code
It looks like `wikieditor-loading` was already commented out in 2010:
9d278e8dee%5E!/#F114
and I couldn't find any usage of `wikieditor-toolbar-loading`.

Change-Id: I07988643ca502dcbd7c3208fb803a84003947d5e
2022-03-02 02:40:05 +00:00
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