Replaces hardcoded CSS colors with Codex design tokens
for the purposes of improving dark-mode support.
These changes resolves issues where text was
illegible in dark-mode (white text on white background).
Bug: T367362
Change-Id: I6314c8013839ac1e9a67178be7d1cb4bc45a3321
The help panel is rather cramped, only 125px high. Previewing the
actual margins above and below each heading is not really helpful.
It's also that no other element in the help panel does have this
whitespace.
Also remove a bit of redundancy from some selectors. Saying that
something is for the table "cells" is more than enough. Adding the
"td" doesn't make it better, just longer.
Change-Id: I11bbd5b8ceee709c3a51b20fb06d2315bb4d9316
This is already being set in CodeMirror, where it was added in
I16598fcdbeee51e6fae88376ec81f1c8552b383d to keep the toolbar
above the CM scrollbar. It is of general use though, so should
be set in WikiEditor.
Bug: T360084
Change-Id: I85ca9727b00e884b74316bd540ddced7f87e112d
In general, floating elements use a subtle dropdown
e.g. "Return to reply" button in DiscussionTools.
Change-Id: If3363557e3f85bbb3000b75e98d5130be1017e2f
These buttons can appear in any order depending on when
the code loads. Remove the default OOUI button negative
margin.
Replace group padding with margin now there is no negative
margin on the buttons.
Change-Id: Id2ebf7aa0b27da1d03d56f59e8a9a96f7656106d
The ResizingDragBar makes the editor resizable, so we need to set the
CodeMirror height to 100%. Previous attempts to fix this at
Ib49d1d9e71 and I4deeda192b suffered from race conditions based on
which modules loaded first. We can avoid this by simply putting the CSS
rule here in WikiEditor.
Bug: T357794
Follow-Up: I4deeda192bdc233101ba61739a636f8fd143c1de
Change-Id: Ia5e9767e0814eac29d58bc0d9c1023344a29dd84
Modules loaded with packageFiles are always executed in module scope
(with a closure), even in debug mode.
The behaviour of non-packageFiles debug mode is the only reason files
have closures.
https: //www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Closure
Change-Id: Idd7ffde7900adbca914c43a6bf7cb1b3fbf92bfa
Most toolbar items don't need this because they're inline-block
buttons and spans etc., but items of type 'element' can be block
elements (for example, the Realtime Preview button) and switching
them to flex items means they don't have to do anything special
to ensure their own layout.
This will make it easier to switch VisualEditor to use the
standard system of adding to the toolbar (in
Ic307f9dc7ad976862c8d8c6551ed29e6071f655f ).
Bug: T308423
Change-Id: Iff6d80628ebb5ec5685136fa02c2345eb5b49d42
If the form is reset, make sure that the preview is re-run.
There isn't actually any reset button in the normal edit
form, but Edit Recovery uses reset() to remove any
recovered data, and if RTP is open when that's done the preview
needs to be updated.
Bug: T351821
Depends-On: I1ec757d5ddd9f0db66496c6aaef70747d93a5c83
Change-Id: I30481edae4c071e8586ac1dc7d587bd550965967
Steps to reproduce:
* Start making changes to a page in the classic editor.
* Use the normal "Show preview" or "Show diff" button at the bottom
of the editor. The page reloads and now shows a preview/diff at
the top, above the editor.
* Now start using the realtime preview feature on the right side of
the editor.
You will notice that the preview/diff above the editor starts to
flicker, but is never updated. (There is no need to update it. The
realtime preview that is updated is the one in the right pane.)
The original code was added via T293347. I believe the flicker
exists since then. It's effectively a misconfiguration. I hope the
comments make this clear.
This is also a direct follow up to T307046 where the diff view was
fixed (it just disappeared before), but flickers since then.
Bug: T293347
Bug: T307046
Change-Id: I481610389cec902268a8fd09f6b0452131752d54
Add a deprecation log message for the autoMsg and autoSafeMsg
functions in WikiEditor. The console output details what needs
to change, and adds a link to on-wiki search for the affected
string.
Depends-On: I2835341867df85552579ea6927cd39a6f889fa6b
Change-Id: I2aea96c8a4097f34b02301083f9db0be95042243
WikiEditor has a clever functionality where you can enter a message
key directly by using [key]Msg syntax in the object definition. While
that may have been a clever approach, it led to tons of messages
in this extension having to be marked as RawHtmlMessages because
they could potentially be parsed as HTML. Thus I am replacing all
of these instances with using mw.message explicitly instead, with
the necessary method attached.
The autoMsg (and its cloned autoSafeMsg) functions have had FIXME
comments attached since 2018 saying that these methods are
unnecessarily complex and should be replaced with using mw.messages
directly.
This solves a lot of problems for translators in Translatewiki, and
hopefully makes the code more straightforward and easier to understand
for those reading it down the line.
I would like to remove the autoMsg and autoSafeMsg functions
altogether, but their functionality is still in use in a few
extensions (and potentially on-wiki code), so we would have to
clean up that first.
Bug: T154891
Bug: T294760
Change-Id: I2835341867df85552579ea6927cd39a6f889fa6b
These config settings were specific to the Cite extension,
and are misleading on wikis that don't have that extension
installed. Move the functionality to the Cite extension
instead.
Bug: T339973
Depends-On: Ib3fdc897dd3330f69c5832003d4c3cb1e6dba2f3
Change-Id: Ib619706ddfca724990e1db2d51f12a2eb05f6a72
This reverts commit 929e8463fb.
Reason for revert: we're still seeing double-logging of some events, so this is apparently still needed until we can track down what's causing that.
Change-Id: Ifc32dfc7aa2ca67169759ecd8c278f1aea2dbef8
This reverts 843efa2f46,
no longer needed after I6028fa4a34916a6cd20161009cf5893492286c2d.
Bug: T334263
Depends-On: I6028fa4a34916a6cd20161009cf5893492286c2d
Change-Id: Ie4506d46d350fb53d6d0264763c2d55fc142997e
Replacing 'mediawiki.ui/variables.less' @import with
new skin-aware 'mediawiki.skin.variables.less' standard.
Also
- replacing several static values with new Codex design token featuring
skin variables.
- reinstate static values only on resizeable drag bar. This is not a
standardized component yet and will be revisited with further Codex
component definitions in future.
Bump required MediaWiki core version to v1.41.0.
Bug: T319381
Bug: T332541
Change-Id: I323561894ddf23aa89f51439fc9df2b7642eaca5
PHP EditAttemptStep logging code is not moved.
* Use the new mw.track() handlers from WikimediaEvents
* Ensure that 'integration' and 'editor_interface' are set on all
events, since they're not hard-coded in the handler any more
(and there are no client-side init events that add defaults)
This must be merged together with WikimediaEvents change
Iace4d53a972396ca5b8713000570cc47c9986034 (but we can't use
Depends-On, because CI requires code here to be removed first).
Bug: T332438
Change-Id: I0ef0a96aafdf89a4ebe32131a85b18c25744bb2c
Delete almost all code realting to the onboarding popup (blue
pulsating dot) and Beta Feature. Leave only one line to delete
any existing localStorage item that was used to remember the
dismissal of the onboarding popup.
Bug: T327515
Change-Id: I8d05e143858a2269dd6f3302dcc6cee6b0855ffd
Visiting a ?action=edit URL can, depending on user settings, result in
the MobileFrontend overlay appearing on top of WikiEditor. In these
cases, don't log anything.
Bug: T320281
Change-Id: Ib98d2cd6f2e541423e5aeebd3093bad97d6fcc4f
There were analytics validation errors because events were being logged
without a session ID. The session ID is only set on document-ready, as
it's fetched from a hidden input on the document.
Change-Id: Iaa24d430b780eaad54b78cb0d2ef0670fa2e32b1
The EditAttemptStep instrument is a candidate for migration to the
Metrics Platform [0]. The first step of the migration is to log events
both using the Event Platform (i.e. via mw.eventLog.submit()) and using
the Metrics Platform Client (i.e. via mw.eventLog.dispatch()).
The Metrics Platform Client can mix in additional information -
so-called context attributes [1] - based on the stream configuration.
The majority of the default values mixed into each event via the
mw.eventLog.Schema defaults mechanism are already known to the Metrics
Platform Client.
Note well that the Metrics Platform Client will not log an event without
one or more streams being configured to receive that event. Therefore,
this change is a NOP.
An example stream configuration is given in [2].
[0] https://wikitech.wikimedia.org/wiki/Metrics_Platform
[1] https://gerrit.wikimedia.org/g/mediawiki/libs/metrics-platform/+/aed6738b845/js/src/StreamConfig.d.ts#31
[2] https://phabricator.wikimedia.org/T309013#7953227
Bug: T309013
Bug: T320281
Change-Id: Ia08bac484fb3a2209879531def859a01290120fd
The #wikiPreview element can contain other child elements such
as the already-removed one of .previewnote but also (on category
pages) category lists, which we don't want.
This changes to only clone the specific content element. We could
just create this in JS, but don't at this point have access to
the lang direction.
Bug: T315558
Change-Id: Ifcd02e9cf005e00c8dd69df162893fb673117231
Add `position: relative` to .ext-WikiEditor-realtimepreview-preview`
per this suggestion (T315049#8174670) by Matma Rex.
Bug: T315049
Change-Id: I70813f68ffd74fab4978127ecee9bd557d467ebb
Set inManualMode to the result of the current prefers-reduced-motion
setting.
Add another property (reducedMotion) for later UI/message work
Bug: T314787
Change-Id: Ifeb8b996430830499945e73eca2dcfe0355c8046