Commit graph

712 commits

Author SHA1 Message Date
Ed Sanders 1d20fd47a3 Remove $controls / $tabs / $buttons interfaces
Bug: T380034
Change-Id: I041ae16f5916a51697aabd1a31d6f7fbc051b8e4
2024-12-04 12:48:57 +00:00
Ed Sanders 79151572ae Remove unnecessary local context variables
Change-Id: Ia8e9d9b750f3d9cc1ab9859afe0cb5c6084058df
2024-11-15 12:47:27 +00:00
Ed Sanders f922f8e861 Convert more functions to arrow callbacks
Change-Id: I983e2c774fe8cdfebbb8de28adbb00b744dc11d8
2024-11-15 12:47:27 +00:00
Ed Sanders c56593d4c6 Pass correct "context" object to openDialog
Change-Id: I236fc93d5c58542a9b935894ab1e4f99663bd734
2024-11-15 12:47:27 +00:00
Ed Sanders 24dd704bb0 ESLint: Manually enforce prefer-const
Change-Id: I91bd16ebbd2ef6056c025aaaa6b488488e31f50d
2024-11-15 12:47:27 +00:00
Ed Sanders 796d82a7ab ESLint: Enforce no-var and autofix
Change-Id: I6f2a1e11acdcdb70902357316b504f903abe8bca
2024-11-15 11:08:22 +00:00
Ed Sanders 5fc902bd9c ESLint: Update to ES6 and autofix
Change-Id: I38afd9a3340ca9a85e7204978cae00b48513f5ca
2024-11-15 11:07:55 +00:00
jenkins-bot 1ac9d8fb87 Merge "Retry adding keyboard shortcuts for formatting tools in WikiEditor 2010" 2024-10-23 18:33:32 +00:00
Siddharth VP 5413262fee Retry adding keyboard shortcuts for formatting tools in WikiEditor 2010
Retry I63414a78ce2546125d557cb37ccb37ea16a15fe1: adds 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.

jQuery event.which is used instead of event.code or event.key for
compatibility with alternative keyboard layouts and non-English
keyboards.

Bug: T62928
Change-Id: I18db5b6c53000457524573a9ae06939e8df0dc4f
2024-10-17 01:20:53 +05:30
thiemowmde 1a61bea0d0 Sensible limits for resizeable booklet panels
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
2024-10-16 14:58:39 +02:00
jenkins-bot 718297c26f Merge "Revert "Keyboard shortcuts for formatting tools in WikiEditor 2010"" 2024-10-10 17:32:59 +00:00
Jon Harald Søby b937a0afc6 Revert "Keyboard shortcuts for formatting tools in WikiEditor 2010"
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
2024-10-09 13:29:41 +00:00
jenkins-bot 0d106ac68a Merge "Keyboard shortcuts for formatting tools in WikiEditor 2010" 2024-10-04 11:43:47 +00:00
Siddharth VP 250a2a3ff3 Keyboard shortcuts for formatting tools in WikiEditor 2010
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
2024-10-02 15:56:53 +05:30
matr1x-101 c8c9880b19 ManualWidget: Added design token for dark mode compatibility
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
2024-09-20 20:23:09 +00:00
Jdrewniak dafd7515b3 Partially replace hardcoded colors with Codex tokens
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
2024-06-26 21:58:27 +02:00
libraryupgrader 903ef038c8 build: Updating npm dependencies
* eslint-config-wikimedia: 0.27.0 → 0.28.2
  The following rules are failing and were disabled:
  * modules:
    * es-x/no-object-assign

* grunt-stylelint: 0.19.0 → 0.20.1
* stylelint-config-wikimedia: 0.16.1 → 0.17.2

Change-Id: I49a4e6d4e44639b380782fda105672ffa362d44e
2024-06-19 04:27:34 +00:00
Ed Sanders df2af61312 JSDoc: Update jsdoc-wmf-theme to 1.0.1
Change-Id: Ibbdc916cebd200bab3b0e0ebb7a7fd0bf8c85c96
2024-06-10 16:38:16 +01:00
thiemowmde 918aa229b5 JSDoc: convert @cfg to @param
Bug: T307415
Change-Id: I6a13002daa97dd7a7f19edcbb73105da08423223
2024-05-28 10:21:21 +02:00
libraryupgrader 15d85a37db build: Updating eslint-config-wikimedia to 0.27.0
Change-Id: I93cd056771246ee4956b6843b0dbabacf75bbfd6
2024-04-20 01:49:20 +00:00
thiemowmde eb5d3aa089 Remove non-helpful whitespace from "Headings" help panel
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
2024-04-17 11:52:08 +00:00
Sam Wilson d50b6ee867 Set toolbar z-index to 7, to be above other UI elements
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
2024-03-14 09:43:16 +08:00
jenkins-bot b7a78685ef Merge "RealtimePreview: Add drop shadow to floating button" 2024-03-13 23:55:07 +00:00
jenkins-bot f31fc338ed Merge "RealtimePreview: Use LESS nesting in ResizingDragBar" 2024-03-13 23:46:00 +00:00
jenkins-bot ccd8760ac0 Merge "Fix overlap between preview button and edit switcher" 2024-03-13 23:45:58 +00:00
jenkins-bot daf81ae37a Merge "ResizingDragBar: force CodeMirror to have 100% height" 2024-03-13 23:35:36 +00:00
jenkins-bot a29a4dba26 Merge "Remove redundant closure for all modules with packageFiles" 2024-03-13 16:37:46 +00:00
Ed Sanders aab2a44fd9 RealtimePreview: Add drop shadow to floating button
In general, floating elements use a subtle dropdown
e.g. "Return to reply" button in DiscussionTools.

Change-Id: If3363557e3f85bbb3000b75e98d5130be1017e2f
2024-03-12 11:19:01 -07:00
Ed Sanders 864f39b359 RealtimePreview: Use LESS nesting in ResizingDragBar
Change-Id: I47b9840291907d764036c7917e3b2bad908ba7af
2024-03-12 11:19:01 -07:00
Ed Sanders 7837e3952c Fix overlap between preview button and edit switcher
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
2024-03-12 11:18:50 -07:00
Ed Sanders 008e2c5a94 Tweak monobook padding for realtimepreview-button
Change-Id: I6756a65d9b654ed2a23b168c88b7c80ded9f952f
2024-03-11 17:55:16 -07:00
MusikAnimal 178a731b6e ResizingDragBar: force CodeMirror to have 100% height
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
2024-03-07 16:38:45 -05:00
Fomafix b799a886ca Remove redundant closure for all modules with packageFiles
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
2024-03-06 15:07:43 +00:00
Sam Wilson 23e4ebd244 Use flexbox for toolbar group items
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
2024-01-31 06:43:59 +03:00
Sam Wilson f1bcbe75c3 Realtime Preview: also trigger on form.reset()
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
2023-12-08 16:00:04 +00:00
Ed Sanders e02c689cdd Fix remaining uses of 'parent'->'super'
Bug: T120821
Change-Id: Ie3b14562b045cee98ffb241e604b5b234cafd699
2023-11-02 17:11:24 +00:00
thiemowmde ac8c355e20 Fix unrelated elements flickering during realtime preview
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
2023-09-13 11:17:12 +00:00
jenkins-bot dccaad391b Merge "build: Update linters" 2023-08-21 21:11:18 +00:00
Fomafix 483ebc7259 Add missing space before closing parenthesis
Change-Id: Ib44cb31d63fb05e28364e3dd396e96e185097c20
2023-08-17 09:52:11 +00:00
Ed Sanders 6b074036b4 build: Update linters
Change-Id: Id75edd20f605550f21266164c29e2c5f52254cbb
2023-08-16 17:10:28 +01:00
Umherirrender 3c57553f83 Add missing @param in jquery.wikiEditor.js
Change-Id: Ia6922e71075b9fc24d5b194f02131d42642954e3
2023-08-10 00:35:04 +02:00
samtar 9c56922e25
RealtimePreview: Set tabindex on realtimepreview-preview
Set tabindex="1" on `ext-WikiEditor-realtimepreview-preview`

Bug: T317108
Change-Id: I06847674ebccf05e8cb45492056222e13cd00ef8
2023-07-12 13:36:31 +01:00
Jon Harald Søby dbdc003abb Add deprecation log message for autoMsg
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
2023-07-11 19:45:59 +00:00
Jon Harald Søby 499c71114a Stop using autoMsg and use mw.messages directly instead
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
2023-07-06 10:39:24 +02:00
Jon Harald Søby 5c18abff00 Move reference-specific settings to the Cite extension
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
2023-06-22 14:07:29 +02:00
DLynch 3e568552b6 Revert "Remove hacks that avoid duplicate event logging with MobileFrontend"
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
2023-06-09 15:20:01 -05:00
Bartosz Dziewoński 929e8463fb Remove hacks that avoid duplicate event logging with MobileFrontend
This reverts 843efa2f46,
no longer needed after I6028fa4a34916a6cd20161009cf5893492286c2d.

Bug: T334263
Depends-On: I6028fa4a34916a6cd20161009cf5893492286c2d
Change-Id: Ie4506d46d350fb53d6d0264763c2d55fc142997e
2023-04-06 22:49:06 +00:00
Umherirrender 6b9eeb34d8 stylelint: Enable selector-pseudo-element-colon-notation
Via stylelint --fix

Change-Id: I5a9835a0faf610d8401b4bb80bae08999d7b9a0e
2023-03-30 01:14:34 +02:00
Volker E 58e69d97b9 styles: Replace 'mediawiki.ui/variables' call with skin variables
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
2023-03-27 11:26:24 -07:00
jenkins-bot 71f6366371 Merge "Centralize EditAttemptStep logging code in WikimediaEvents" 2023-03-27 15:30:41 +00:00