Commit graph

235 commits

Author SHA1 Message Date
Thiemo Kreuz fae6118071 Document and use mw.Api parameter defaults
Reasoning:
* format=json must be the default. Nothing else makes sense in
  the context of this code. This should not be a surprise.
* formatversion=2 is only a default when the custom
  getContentApi() is used, but not when mw.Api is used. One
  might argue that it's safer to always specify formatversion=2.
  However, this is not done in other places in this codebase.
  It should never be done or always.
* I find it confusing when the action=… is missing. Let's not
  rely on this default.

Change-Id: I6ca29f76bffc0849103c5bcff4aaf28fcaaa4c52
2021-07-12 09:13:59 +02:00
Thiemo Kreuz 26b0322ff0 Minor documentation updates in template related classes
Bug: T285483
Change-Id: I1cf17d7bfb01326b93bc781b2501a492d50f0aab
2021-06-25 16:46:59 +02:00
Thiemo Kreuz 4367235dcc Inline many var declarations in the code below
This makes the code more readable and easier to reason about.
The ESLint rule responsible for this code style was removed
just recently.

Notes:
* I focus on classes that are relevant for what the WMDE team
  does right now.
* I merge multiple `var` keywords only when the variables are
  strongly connected.
* Caching the length in a for loop makes the code hard to
  read, but not really faster when it's a trivial property
  access anyway.

Bug: T284895
Change-Id: I621fed61d894a83dc95f58129bbe679d82b0f5f5
2021-06-23 09:02:24 +00:00
Thiemo Kreuz c2017f74b2 Remove @param/@return docs that literally repeat the code
These don't add any knowledge but make the code harder to read
and maintain, and are an additional source of errors.

Change-Id: Ied57741a3f985e355adfddb4e75378d5c497faa9
2021-06-14 15:44:51 +02:00
Bartosz Dziewoński fb32aa4978 Revert incorrect changes to ve.ui.MWBackCommand that made it stop working
This would would be correct if it was in a method of ve.ui.MWBackTool,
but this is actually a different class ve.ui.MWBackCommand (they are
both in the same file), which doesn't have a 'toolbar' property.

This partially reverts commit 4984c5ffbb
"Avoid using mw.ArticleTarget methods on global ve.init.target in tools".

Bug: T279613
Change-Id: Ia5e80e34cc5021295639cf18b3c324d2821aecf5
2021-04-08 15:37:46 +02:00
Bartosz Dziewoński 4984c5ffbb Avoid using mw.ArticleTarget methods on global ve.init.target in tools
Bug: T278399
Change-Id: I49475db2aa014ef4807ff55755c1b773e6aa0e6a
2021-03-30 15:27:54 +00: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
Ed Sanders dd862a837d MobileArticleTarget: Move MWBackTool to a separate file
Change-Id: I1561f454bcc779f97c758ba7178b09d15f52fe42
2020-07-31 16:15:10 +00:00
jenkins-bot b097557733 Merge "Fix: focus order and screen reader issue in help popup dialog" 2020-07-13 19:58:59 +00:00
Akinwale Alagbe 92f2fb1522 Fix: focus order and screen reader issue in help popup dialog
Bug: T257175
Change-Id: Ib1e72caf06de827d5867e2badfd16408d32e9593
2020-07-13 21:32:43 +02:00
Ed Sanders a8753df147 MWSignatureNode: Don't inherit from TransclusionNode
We don't share much functionality, and we have to do a bunch
of hacks to disable functionality we don't want.

Change-Id: I9861123d8f1cbab1923f1aa5be713c2dadaed53d
2020-07-08 22:18:35 +02:00
jenkins-bot 6dd197a10f Merge "init: Manage education popup state the same way as welcome popup state" 2020-06-01 20:57:40 +00:00
Bartosz Dziewoński 21b25bd77d Fix deleting signature nodes
Code in ve.dm.MWTransclusionNode (which ve.dm.MWSignatureNode extends)
expects the node data to have an 'attributes' property.

We could override a bunch of methods to fix this, or add checks in the
original code, but it seems more future-proof to instead ensure that
the property exists.

Bug: T248585
Change-Id: I5bd721ca73605a396509669145b740db7283afd3
2020-05-12 01:01:18 +02:00
Roan Kattouw 31db495bcf init: Manage education popup state the same way as welcome popup state
And factor out the common code for using a preference with a fallback to
localStorage or a cookie.

Bug: T235566
Change-Id: Ibb983319edcd2987225fe89677fd10e3ff8f9df6
2020-05-01 19:12:30 -07:00
jenkins-bot 4a2d636dab Merge "Fix: non descriptive announcement of version no." 2020-02-25 22:00:52 +00:00
Akinwale Alagbe dd91c3cd09 Fix: non descriptive announcement of version no.
When user navigate to the version number,
the screen reader only narrates the hexadecimal number
associated with the version label without providing context
about what this number represents

Bug: T245470
Change-Id: If9cccac0d71de2de5da96a3a053d21e3deb0d80c
2020-02-25 21:45:31 +00:00
Bartosz Dziewoński 8c949955e6 ve.ui.MWEducationPopupTool: Autofocus the button to close it
Change-Id: I4c2a3620b0477492713580baab8c3ae503009ed5
2020-02-19 00:25:37 +01:00
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
jenkins-bot cee6e3e6a9 Merge "ve.ui.MWEducationPopupTool: Respect default preferences for anon users" 2019-12-13 16:23:24 +00:00
Ed Sanders ffa3742ce1 build: Update linters
Change-Id: I03d1a8e63b730ad98ec07ad5f630ba82698de5be
2019-11-01 16:20:22 +00:00
Bartosz Dziewoński 4086de5a9a ve.ui.MWEducationPopupTool: Respect default preferences for anon users
Bug: T231762
Change-Id: I05dccf79becab9487ee2a67c4970c938d52e25d7
2019-10-22 20:02:21 +02:00
Bartosz Dziewoński a02323698b ve.ui.MWEditModeTool: Fix showing active editor
This line of code seems to have been accidentally deleted in
1761b6d6d6.

Bug: T232359
Change-Id: I7d9568cc11a7c96e607203d41ab132c6f304d304
2019-09-09 18:32:56 +02:00
jenkins-bot 6cd05557d0 Merge "MobileArticleTarget: v1 of toolbar refresh" 2019-08-30 17:43:58 +00:00
David Lynch 593d26b4ab Don't let double-clicking the save button trigger a save
Tapping the toolbar save button while the save dialog is open triggers a save
because of the accesskey. It shouldn't save on a double-tap, because that's
easy to accidentally do / trigger on a slow device.

Bug: T230816
Depends-On: I4c3afce9d57c9bca737272b40b9a4862b5794bac
Change-Id: I1925b1b97de6a811f73196b616ec09a2c30c336f
2019-08-29 22:43:53 +00:00
David Lynch 1761b6d6d6 MobileArticleTarget: v1 of toolbar refresh
Bug: T211789
Bug: T230807
Change-Id: Ifd2319039628a8143dc09f6fa35e4a9825d3062c
2019-08-29 15:27:56 +00:00
Ed Sanders 7cc538fe51 Use upstream pulsating dot
Bug: T226719
Depends-On: Ibd035ea48b7d0316a7627a91623ff6116ccbae31
Change-Id: Iedf88e9c5ac8efa809ccb25f2081eff9946da395
2019-08-28 13:40:29 +01:00
Ed Sanders 3f892fe368 Simplify pulsating dot to one DOM node using :before/:after
Change-Id: I81af08d58a33b6d3751bfc5012217b9bd98e69dc
2019-06-27 15:35:50 +01:00
James D. Forrester dd5a1f0285 Follow-up f9330c8564: Don't auto-add MWSaveTool
Bug: T222325
Change-Id: I1ccd43c6de51cd2fc8d4fc3291b1870b99736d80
2019-05-02 15:57:34 -07:00
Ed Sanders f9330c8564 Replace the save button with a save tool
Now shows correct tooltip for save button (including
the access key).

Bug: T163142
Change-Id: If14a1a5a5829fc215cb79827392173dc05c4bdd7
2019-04-30 19:32:33 +00:00
Ed Sanders fed2067df9 Fix function name
Change-Id: I540ec247f37a21dfd0b84c8b593a6a37197bfcb2
2019-02-06 21:54:23 +00:00
Ed Sanders 375edf0182 Fix uncaught jQuery linting errors
Change-Id: I17482ec84c95e88881ab4bee9b9cadb27b2dc472
2019-01-18 21:03:38 +00:00
James D. Forrester 3c293ea00c doc: Bump copyright year for 2019
Change-Id: I8991b97c980d4149f53eb5601036220ef3c0c440
2019-01-01 13:24:23 +00:00
Bartosz Dziewoński 22a80e430e Use ve.targetLinksToNewWindow where possible
Also, avoid parsing HTML manually in a few places.

Change-Id: I983a7e1917a3f0728173e9621c709d1c8c04f650
2018-12-12 23:19:11 +00:00
jenkins-bot 23c6c3b6e0 Merge "Use mw.Title.wantSignaturesNamespace" 2018-11-27 19:31:13 +00:00
Ed Sanders 0d54a62858 Use mw.Title.wantSignaturesNamespace
Change-Id: I60187f0a3eb9cf5d56a4fdaa3401b107758bd8e3
Depends-On: Ib2faa22c429096d545ddb829a6b4025427ad6071
2018-11-27 18:42:44 +00:00
jenkins-bot 827e3661ec Merge "Track when block notices are shown on visual editor" 2018-11-26 12:35:21 +00:00
Ed Sanders 1a3e8a958c build: Use eslint-config-wikimedia v0.9.0 and make pass
Change-Id: Idb57fc12e7822cf17e10dbb726480fc7de0ae199
2018-11-21 16:51:20 +00:00
Thalia 883e0c23a5 Track when block notices are shown on visual editor
When an edit notice is passed through from the API, allow
a type to be specified, and specify type 'block' if the
notice is a block notice.

If VisualEditorTrackBlockNotices config is true, track
when a message with type 'block' is shown.

Bug: T209633
Change-Id: If5fecc2c2c1c39f4b7245b9a215e1120c93b2b22
2018-11-21 11:22:50 +00:00
David Lynch 803f476528 Analytics: track more things for Growth
Bug: T207802
Change-Id: I77652325ce7b9dda9c4f4a86c1d34421451cf025
2018-10-29 10:21:49 -05:00
Volker E 40b8c0da5c Replace deprecated 'advanced' by renamed to 'settings' icon
Bug: T190581
Change-Id: Ie598c703ca03adb98ca05ed3ab227aba2b5ab971
2018-09-07 19:46:12 -07:00
Ed Sanders 20662e6dde Fix icons broken by OOUI update
Change-Id: I44edf30dc578787935c0052e8675bfde7fdd746d
2018-08-16 22:41:31 +01:00
Ed Sanders 63c698823c Fix typo in API call for version number help
Change-Id: Idcea9d74e27e33930d98d2b896ee08012e46e8f3
2018-05-16 10:23:39 +01: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 8fdc1f7085 Follow-up Iea7ad832: Fix context in MWPopupTool
Bug: T193043
Change-Id: I2b035a50543093988a291ea8c8958a3a7cc9e7ba
2018-04-29 21:45:10 +01:00
jenkins-bot f5b0d655cf Merge "FeedbackTool: Add the ability to vary feedback page for source mode" 2018-04-04 21:24:09 +00:00
James D. Forrester 31730cc5b3 FeedbackTool: Add the ability to vary feedback page for source mode
Wikis with a local link over-ride configured will need to do so here
for the new message `visualeditor-sourcefeedback-link`; wikis with a
remote link configured will need to update their configuration ahead
of this being deployed, setting $wgVisualEditorSourceFeedbackTitle.

Bug: T157953
Change-Id: Iea7ad8328b03f69e01d7c67ca1ddbb7ae7906288
2018-04-04 18:11:10 +00:00
jenkins-bot 5b36d88eae Merge "Make edit notices popup wider (320 -> 380)" 2018-03-27 17:24:58 +00:00
Esanders 3cd35b95e9 Make edit notices popup wider (320 -> 380)
Bug: T184379
Change-Id: Ic68f5e117bb0057bb5fa8b83834707abfbadb3b3
2018-03-27 14:16:25 +00:00
jenkins-bot 6deaeffa95 Merge "Revert "Make edit notices popup wider (320 -> 450)"" 2018-03-27 11:30:12 +00:00
Bartosz Dziewoński a0dacccd83 Revert "Make edit notices popup wider (320 -> 450)"
This reverts commit d5a61eb95d.

Bug: T184379
Change-Id: I0198c6d1faf1474ea0faab7e05ec95cfb43c9206
2018-03-27 10:13:45 +00:00