Commit graph

781 commits

Author SHA1 Message Date
Adam Wight 85f45fd49d Introduce feature flag for template dialog sidebar changes
Bug: T274263
Change-Id: If274efa94474c3de79c5917b76c1a290f93172e1
2021-05-17 12:25:46 +02:00
Svantje Lilienthal 2665734b10 Renaming temporary config variable and splitting it from cirrus search lookup
This allows using the config variable independendly from the cirrus search extension.
This way it can be used for all subtickets of T271802.

Bug: T277028
Change-Id: I1b3bdda5fa6fbfe5c531c3b51c2c8e2a28ed1faf
2021-05-10 14:47:31 +02:00
Adam Wight f89301bedf Optional verbose template search
Renames "Add a template" to "Template Search" in most cases and
provides inline help for the workflow.

Bug: T277028
Change-Id: I3fee87cb89b5044e785596e71ef3f1a18f2694ce
2021-05-10 12:45:12 +00:00
Andrew Kostka c1d36072ea Add collapsible descriptions to the transclusion dialog
Bug: T273426
Change-Id: I793a66f5c5877451b70058e9388dd86b3fcaadd7
2021-05-10 11:18:17 +00:00
jenkins-bot 5d1e79630f Merge "Introduce VisualEditorApiVisualEditorPostSaveHook" 2021-05-06 17:57:38 +00:00
jenkins-bot a4d1863a80 Merge "Use standard search API when searching for templates" 2021-05-03 08:12:35 +00:00
Kosta Harlan f035ce51f1 Introduce VisualEditorApiVisualEditorPostSaveHook
What:

Add hook that runs after a save attempt is made in ApiVisualEditorEdit.
The hook receives the same data available in ApiVisualEditorEdit, and
implementations of the hook can modify the API response.

Also introduce templated
parameters (https://www.mediawiki.org/wiki/API:Templated_parameters) in
the API parameters; this allows plugins to pass arbitrary data along
with their request using e.g. plugins=linkrecommendation&data-linkrecommendation=foo

Add ServiceWiring files, a PHP namespace, and a HookRunner class to
support the above changes.

Why:

VE plugins may wish to send additional data when saving an edit and take
action based on that data on the server-side. See for example the
AddLink plugin in I7a052f8e which sends annotation data, and then uses
the new hook to perform a database operation.

Change-Id: I392691475fbdcec766acbd832600e82efcb5bfe8
2021-04-30 20:50:01 +02:00
Thiemo Kreuz 6e08a27fc7 Use standard search API when searching for templates
Bug: T274903
Change-Id: I7de8f6cc55ab678ed741ae5ebbaad608b9a9b0db
2021-04-30 12:52:45 +00:00
Cindy Cicalese 442f5da371 Replace usage of deprecated User watchlist methods
This bumps the MediaWiki requirement to 1.37.

Bug: T281187
Change-Id: Iddcd1cbf67ad1f8e918c1da07347dd19e5f6f7d9
2021-04-29 09:32:22 -07:00
WMDE-Fisch 2920c68adf Use verbose label for the example
Bug: T273425
Change-Id: Ia56aa35f98f31859e48781848b7481ebd5e2bd1c
2021-04-20 10:34:52 +00:00
Andrew Kostka 3c2db5fba9 Relocate parameter descriptions in the transclusion dialog
Bug: T273425
Change-Id: I2044b65ba88ae00e394fb84cb8e96a218995918a
2021-04-15 13:08:53 +02:00
jenkins-bot 1e4de0e464 Merge "Add a combo box for suggested values in the transclusion dialog" 2021-04-09 10:40:33 +00:00
Andrew Kostka de2f5b3055 Add a combo box for suggested values in the transclusion dialog
Bug: T271898
Change-Id: Ic637eea2cac45f79234b62c787e1b76d68b61570
2021-04-08 16:10:22 +02:00
Bartosz Dziewoński e04f78d48a Replace use of deprecated CSS class 'mw-ajax-loader'
Bug: T278894
Change-Id: I100bbe06da198f5175366c25b74daf3af986aae3
2021-03-31 20:46:58 +02:00
jenkins-bot e0e57eee45 Merge "Finalize event platform migration" 2021-02-25 09:27:09 +00:00
Adam Wight 28cb0b27de Finalize event platform migration
Bug: T275015
Change-Id: I8ad39924bce85da4dc09be23926ad33d1529a8db
2021-02-24 17:05:10 +01:00
vladshapik 3d29dd25e9 Avoid using User::IsIP
Remove using of User::isIP since this method will be hard-deprecated. Now it is soft-deprecated

Bug: T275602
Change-Id: Ia625be523706d1e24649f7aa15679491f9598b7f
2021-02-24 17:38:04 +02:00
Bartosz Dziewoński ef8e7945cc Stop showing the "Editing tabs" popup some time after SET switch
If someone has edited before the switch (2016-ish), never edited since
then, and try to edit again now, it's probably no longer helpful to
show them a popup dialog about a change that happened 5 years ago.

The immediate motivation for this, though, is T273189. We discovered a
bug with the preferences that, among other issues, caused this dialog
to not be shown in some cases where it should have been, and fixing
the bug now would cause it to be shown the on the next edit attempt.
If someone has edited before the switch (2016-ish), *and* edited since
then, and try to edit again now, it's definitely not helpful at all to
show them a popup dialog about a change that happened 5 years ago.

Bug: T273189
Change-Id: I4b5a3d8dbdf1c853eb39fcfc85a9fe87a4db0f21
2021-02-05 12:41:01 +00:00
Bartosz Dziewoński b1fa5839c4 Remove two unused configuration options
* VisualEditorNewAccountEnableProportion
* VisualEditorAutoAccountEnable

Seemingly never used on Wikimedia wikis, and untested since 2016.

Bug: T273177
Change-Id: Ic132ef2091399fd223626ae307830f278e72ec01
2021-02-05 12:40:28 +00:00
jenkins-bot b6033895f5 Merge "Add edit count bucket to VisualEditorTemplateDialogUse events" 2021-02-01 10:22:38 +00:00
Bartosz Dziewoński d65fe812f5 Show non-breaking spaces in the editor
MWEntityNode representing   is now displayed with a light
grey background and has a tooltip explaining that this is a
non-breaking space and not a random grey blotch.

This is not done for TextNode (in core VisualEditor), as that doesn't
actually work: Parsoid converts all   in input to regular spaces.

It's still not easily possible to insert a non-breaking space.

Bug: T96666
Change-Id: Icbdf7cc3e5d675b199d08777a3439dc5dedceac1
2021-01-28 19:09:29 +00:00
jenkins-bot 6a8350b92b Merge "ve.dm.MWTemplateModel: Don't add spurious empty parameters" 2021-01-27 16:31:10 +00:00
Ed Sanders d831370ed4 Update VE core submodule to master (ca6a97f42)
New changes:
4589f5f00 Clear node offset cache when leaving read-only mode
68b0f8372 Show attribute changes as diffs when appropriate

Local changes:
Pull through for Ic6ec7f5ebabc912235ff7e688425f415f2c3ff20

Bug: T272603
Change-Id: I574fc56799ed165e63e16881429c4ed740850234
2021-01-22 20:40:28 +01:00
Adam Wight 9a1072a960 Add edit count bucket to VisualEditorTemplateDialogUse events
Bug: T269986
Change-Id: I68cc15d58a23149a6edc71cac229f6b29d33fd92
2021-01-21 13:17:03 +01:00
Ed Sanders 4e33a6ff0a Follow-up e04e98458: Add missing "Moved down/up" messages
Change-Id: I3cea39f7915e1627f68c3280357517e607b90772
2021-01-19 22:55:03 +00:00
Ed Sanders e20decc77c MWSaveDialog: Remove wrap option from showMessage
This was used when we used to pass API errors to showMessage, but
is now unused by the two remaining users (missing edit summary, and
"press ctrl+enter to submit").

Change-Id: I8a6b4db78d4e451cf3ec85fcdfd8293328aaaa3c
2021-01-16 16:22:23 +00:00
James D. Forrester 075d976f25 Update VE core submodule to master (3fc99cc9c)
New changes:
d1928f49d Describe text style annotation changes, instead of showing remove-insert
3fc99cc9c Describe link addition/removals

Bug: T160588
Change-Id: I44ffe020e22f8602fc0d5abbac66bfcda0f873e8
2020-12-18 12:49:14 -08:00
WMDE-Fisch 2ce9934ab9 Add tracking of template usage
The names in the schema are roughly following what's
done in Schema:TemplateWizard. The information if
templates have TemplateData will be logged seperatly.

Bug: T259705
Change-Id: Iafa7256f675dbfd6a5a6de794061901780e3c55d
2020-12-16 12:56:45 +01:00
Ed Sanders 9c926903a0 CollabTarget: Add missing message
Change-Id: I162ea3de02b902d9076f9656b9fe872adf85cd86
2020-12-04 14:43:45 +00:00
Máté Szabó d127dc48b7 ve.dm.MWTemplateModel: Don't add spurious empty parameters
Make ve.dm.MWTemplateModel#serialize ignore empty parameters if they were not
present in the transclusion before the edit. This avoids dirty diffs where an
user edits a template transclusion via VisualEditor, and the editor adds all
available template parameters to the edit wikitext, even if they were not
changed during the edit.

This logic was ported from the old Wikia-WMF VisualEditor project.[1]

Additionally, add tests for ve.dm.MWTemplateModel serialization.

---
[1] https://github.com/Wikia/app/pull/6450/commits/858eaa9

Bug: T101075
Change-Id: I35f8812724658904d30034db4e4684193a661c1e
2020-11-16 19:54:44 +01:00
Bartosz Dziewoński 9f9966d1cd ApiVisualEditorEdit: Use action=parse 'subtitle' option
Bug: T259313
Depends-On: Id1fa03d05e6a984862861a1de37d84e48a692d79
Change-Id: I15df60de7c2376d04e07c27a8c1f4d057af53b20
2020-10-29 18:49:51 +00:00
Ed Sanders 6c36e403aa Convert ve.init.mw.DesktopArticleTarget.init-vector.css to LESS
Change-Id: I5e7c56ebf9e68706e8fc39b1bd4bf81be878ffe4
2020-10-14 13:11:48 +01:00
Ed Sanders 5c84f0cd88 Rewrite EducationPopup so it isn't a mixin
Reference images are moved to Cite and used by Citoid.

Bug: T170919
Bug: T171292
Depends-On: I02041246dda1b3d3ad1bcc0b014fa022e8259b62
Change-Id: Id97659ed1fa64a1223a8957fefaf2a149edd0e9c
2020-09-24 21:33:50 +01:00
Bartosz Dziewoński a98946ca81 Add missing test file (ve.DiffMatchPatch.test.js)
Change-Id: I3c09fe669ad8391300762af3ce026ede7114ce10
2020-09-08 13:54:37 +01:00
Ed Sanders 519bef6a9a extension.json: Sort config, Hooks, DefaultUserOptions & AutoloadClasses
Change-Id: I6a62ccb0843653da50c46693aed4945b21e90ee5
2020-09-07 19:14:14 +00:00
James D. Forrester 8a78603988 Drop support for wgCommentByteLimit, hard-coded null in MW nowadays
Change-Id: I767e0633415568134c46fccbafdaceb1ab76dea3
2020-08-26 20:25:38 +00:00
C. Scott Ananian 49a3387323 Remove Parsoid integration hack, added for 1.35 LTS
We'll update this before 1.36 is released, unless we get Parsoid
integrated "properly" before then.

Change-Id: I92d8555b1f5dc121c5f596b5cb6d59414280388f
2020-08-24 15:34:44 -04:00
Ed Sanders ac085df47e Create config option for making VE a BetaFeature, off by default
Currently we always register VE as a Beta Feature, and then
expect users to use $wgHiddenPrefs to hide it, hackily.

Also, set this new preference to false so that 3rd party
wikis don't show the BF by default.

Bug: T254349
Change-Id: I92fe3d44bb4d762ca7b1bc693b7d2e74367c84ec
2020-08-18 15:52:51 +00:00
Timo Tijhof 95d1ea520b ve.init.mw.DesktopArticleTarget.init: Update mediawiki.page.ready dependency
In MediaWiki core, Ic418c23a740 moves mediawiki.page.startup into
mediawiki.page.ready, leaving an alias behind. Once that change lands,
this change is safe to land as well to avoid the indirection and so
that the core alias can be removed swiftly (VE is the only user).

The dependency on mediawiki.page.startup was originally added in
I494b364b485e6 to make sure that accesskey tooltips are computed by
mediawiki.util, before VE initialises (this happened via mw.util.init,
which at the time was called from mediawiki.page.startup.js),
This has all changed a lot in the years since then and might not
actually be needed any more. If that's the case, feel free to remove
the dependency instead.

Depends-On: Ic418c23a7400abba22fd07b17f173d3c5f1d1d10
Change-Id: I250b38a836f28bfb440f19282a9677977f30c615
2020-08-14 23:37:47 +00:00
Ed Sanders 09f4af2a63 CollabTarget: Add close button on mobile
Move comment button into 'insert' menu to make room.

Change-Id: I00ace1477d08041e9af6d81ae2e6635151575f8b
2020-08-03 07:55:06 +00:00
Ed Sanders dd862a837d MobileArticleTarget: Move MWBackTool to a separate file
Change-Id: I1561f454bcc779f97c758ba7178b09d15f52fe42
2020-07-31 16:15:10 +00:00
Ed Sanders 61edb5c2f7 ExportWikitextDialog: Add explicit editfont dependency
Change-Id: I74e3dd7a78093dd52b5ae6b0474ff3c1e1712775
2020-07-31 16:14:38 +01:00
jenkins-bot 31d7b7efa2 Merge "Special:CollabPad: Replace getPageClasses as if the page were an article" 2020-07-31 13:40:10 +00:00
Ed Sanders 341e86decb Special:CollabPad: Replace getPageClasses as if the page were an article
This stops Vector2 treating the page as a special page where
fixed width doesn't apply.

Change-Id: I4dfed639cfc46be565e491d0df7375e3248e1602
2020-07-31 13:36:04 +01:00
jenkins-bot d377cbe9d1 Merge "Use mw.cookie instead of jquery.cookie" 2020-07-30 22:36:46 +00:00
David Lynch deb218aeec Use mw.cookie instead of jquery.cookie
jquery.cookie is no longer maintained, and we're coming up on maybe
running into issues with sameSite which jquery.cookie doesn't support.
Moving to mw.cookie will let us centralize that fix.

Also, removed some dependencies on jquery.cookie in code that doesn't
seem to ever use it.

Bug: T252597
Change-Id: I8634cfd42c2a5ab3c9d712417a7d1a55508274fd
2020-07-30 17:07:40 -05:00
Ed Sanders ec872093aa ExportWikitextDialog: Add help text
Change-Id: I5508c167aa8119eb86356858fc0eedf69cc093bf
2020-07-30 16:43:59 +01:00
Ed Sanders a9d7884d3b ExportWikitextDialog: Add ellipses to "Export" buttons
This indicates these are not the final actions in the process.

Change-Id: I88227a1025f56ea59ef76a59b81cde22e81a959a
2020-07-30 16:23:02 +01:00
Ed Sanders 3ebcf5695d ExportWikitextDialog: Add copy button to wikitext
Change-Id: I8ed63a0ac38a812b09e51738b25b6b384ba30c04
2020-07-30 16:17:32 +01:00
C. Scott Ananian 4b04f413fa Zero-configuration VisualEditor + PHP for MediaWiki LTS
This copies the Parsoid extension code into includes/VEParsoid
to allow a "one extension, zero-configuration" install of
VisualEditor for MW's LTS release. The Parsoid code has been
re-namespaced (`VEParsoid` instead of `MWParsoid`) to avoid
autoloader conflicts if you actually install Parsoid as an
extension (as we do in Wikimedia production). Similarly, we
arrange that the ServiceWiring and RestRoutes configurations
are skipped unless running in zeroconf mode, to avoid
conflicts with the Parsoid extension.

This import matches Parsoid commit b30f223.

Bug: T248343
Change-Id: Ic63ce40f59c4be8f4fdc5f9ac17798353fc86866
2020-07-13 18:39:08 +00:00