This is relevant for the two colapsible panels with the list of
characters, as well as the help panel. Both have an index on the
right that can be resized. As of now it can be collapsed so much
that it disappears entirely, and enlarged so much that it is larger
than 100%. Both situations look broken and confusing. I think these
are sensible limits.
Also remove the horizontal scrollbar. It appears only when the index
is very narrow, but is especially in the way and not useful in this
situation. Just enlarge the index when you need to see the full
words.
Change-Id: I92d11ddbe4976cf218b30689604ed91b0f288eae
This reverts commit 250a2a3ff3.
Reason for revert: For me (I use the Dvorak keyboard), this makes Ctrl+C and Ctrl+V to copy/paste completely unusable. My "c" key is physically the "I" key (`KeyI`), and the "V" key is physically the "." key (`Period`).
When dealing with shortcuts like this, one should use `KeyboardEvent.key`, not `KeyboardEvent.code`.
Bug: T62928
Change-Id: I64f625e0f32bd699790417d0d74a14251ac7dc36
Add shortcuts for bold, italic, subscript, superscript and nowiki
options, and the link insertion tool in WikiEditor. The hotkeys match
the ones used in VisualEditor and NWE 2017.
Bug: T62928
Change-Id: I63414a78ce2546125d557cb37ccb37ea16a15fe1
A previous comment said design token "background-color-interactive" was
unsuitable for the given context, so using "background-color-neutral"
design token instead.
Change-Id: I614369dcb402fdd7368be5996f3bb9720ad780b5
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