Commit graph

8899 commits

Author SHA1 Message Date
Sam Wilson
84ef41addb Improve TitleWidget search results
Add the query value as a redlink in the result list,
as is already done if the query value is *not* a prefix
of some other (existing) title.

Bug: T291056
Change-Id: I1569ad5a57cd98fe7deb034512b46e948a3561e1
2021-10-15 09:47:48 +08:00
Fomafix
bff33f9f48 mediawiki.rcfilters.filters.ui: Simplify ItemMenuOptionWidget
* Remove unnecessary check for an empty array.
* Use .map() instead of .forEach() and .push().
* Combine .addClass() calls.
* Avoid eslint-disable-next-line mediawiki/class-doc.

Change-Id: Ia3c27ff08a5e7148af42d8e67f2ccc586227b6c6
2021-10-14 20:24:33 +00:00
jenkins-bot
b281141368 Merge "Final sync of DeleteAction and FileDeleteAction forms" 2021-10-14 06:24:48 +00:00
jenkins-bot
9730926907 Merge "Move mediawiki.ForeignUpload configuration settings to package files" 2021-10-13 23:18:28 +00:00
Daimona Eaytoy
23ec8052ce Final sync of DeleteAction and FileDeleteAction forms
Fix the last drifts between the two. Custom CSS IDs/names/classes in
FileDeleteForm were replaced with the base one, as I think it's better
to be consistent, and it wouldn't be trivial to allow changing those
values in a clean way. Question for reviewers: should this part be
announced on tech news in case somebody is using those values in a
script?

Move the file delete intro above the form, like we do for normal
deletion.

For normal deletion, use the content of the wpReason field as default
value for that field, not the result of merging the dropdown and the
"other" field, which doesn't seem correct (the file version was already
doing this).

Make the file deletion form use the title as token salt like the base
form -- it shouldn't make any difference AFAICS.

After this patch, it should be possible to make DeleteAction extend
FormAction with low effort.

Bug: T288282
Change-Id: I8b115ecb1c94af63d686a575b18362ac32105ae2
2021-10-13 13:48:24 +00:00
Daimona Eaytoy
d2419a1dda Live preview: use the correct content model
I was under the impression that live preview could only be used on
wikitext pages, but this isn't the case. So pass the proper content
model to the API.

Bug: T293022
Change-Id: Icff5b8b25a4b0df3feda2093d5b9c92e6dd9be3a
2021-10-13 15:35:10 +02:00
DannyS712
8b97d3440c RCFilters: Merge mw.rcfilters.init.js into mw.rcfilters.js
After the mediawiki.rcfilters.filters.(dm|ui) modules were merged,
mw.rcfilters.js was just `require`ing the old init script to run some
extra setup, no need for separate files.

Bug: T256836
Change-Id: I6462151152d075af0ef8bce3a5edf0a0ba48761a
2021-10-13 00:12:06 +00:00
jenkins-bot
dfd0c73975 Merge "RCFilters: Merge mediawiki.rcfilters.filters.dm into ui module" 2021-10-09 02:43:33 +00:00
DannyS712
bad94719a8 RCFilters: Merge mediawiki.rcfilters.filters.dm into ui module
The new module retains the name .ui name so that existing
skin style overrides continue to work. We can consider renaming it
to just "mediawiki.rcfilters.filters" in a future patch.

This does not handle file reorganization, since both of the
modules used package files - instead, in the main script we also
require() the old main script for the .dm module so that its
setup code runs. But, we did need to rename the virtual
config file from the .dm module to not clash with the
virtual config file from the .ui module, since the
latter uses a callback instead of retrieving configuration
variables directly. These can be merged later as well.

Bug: T256836
Change-Id: I5ec0af8b8e6bcdba6b7881f946f777b854a33739
2021-10-09 02:23:13 +00:00
jenkins-bot
0ee5a485a8 Merge "ResourceLoaderContext: Set message 'interface' flag and unique 'title'" 2021-10-08 23:49:52 +00:00
Daimona Eaytoy
bbc5bbe9ac Fix bad calculation in TitleWidget
Follow-up: Ieab0606068a78e5b5e5b9b3337f3a75a0b64adbc

This is concatenating an object and a number, so the index is always
  "[object Object]0.5"

Ops :)

Bug: T292600
Change-Id: Icf9df9a3e1fbbb08f1868131cf3fb740ee3a3e08
2021-10-08 16:34:16 +02:00
Bartosz Dziewoński
2769e5f49b ResourceLoaderContext: Set message 'interface' flag and unique 'title'
Bug: T291601
Change-Id: I6375aa97faa794caad74546ebc5e7040ead38129
2021-10-08 00:15:33 +00:00
jenkins-bot
35098e1763 Merge "Use child combinator to only apply style to gallery for new media dom" 2021-10-07 23:13:30 +00:00
jenkins-bot
af9bbfe40f Merge "mediawiki.String: Add new functions lcFirst and ucFirst" 2021-10-07 22:28:35 +00:00
Fomafix
ee640a6f57 Remove unnecessary spaces in parameters of jQuery calls
Change-Id: Ic5ce3bc2af3499a89df683c4405a52ea464238c7
2021-10-07 21:35:40 +00:00
jenkins-bot
58652c0e3d Merge "Improve side-locking logic for diffs" 2021-10-07 17:25:50 +00:00
jenkins-bot
8bd5a616e1 Merge "upload.js: Remove parameters for message 'largefileserver'" 2021-10-07 15:55:44 +00:00
Fomafix
cc62378b98 upload.js: Remove parameters for message 'largefileserver'
The message texts for 'largefileserver' don't have any parameters.

Also apply https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Creating_elements

Change-Id: Ic86a35067694c5624353918024275e11f9734fa1
2021-10-07 12:40:53 +00:00
Fomafix
f3d33f78fc mediawiki.action.edit.preview: Avoid double escaping of message 'preview'
Change-Id: I0affb120f75cdecdaeb06029118340bc8640db16
2021-10-07 11:20:16 +00:00
Fomafix
e03f565694 Use shortcut mw.msg( ... ) instead of mw.message( ... ).text()
Change-Id: Ide51c960717676adc117823096bfc353e3a6539f
2021-10-07 10:18:20 +00:00
jenkins-bot
6a55ce812e Merge "Correctly use sort index for redirects in TitleWidget" 2021-10-07 00:23:50 +00:00
jenkins-bot
076513776e Merge "jquery.spinner: Fix rendering in RTL interface languages" 2021-10-07 00:01:43 +00:00
jenkins-bot
1bf404e804 Merge "Fix diff align for mixed lang content" 2021-10-06 23:24:20 +00:00
Bartosz Dziewoński
7498be2299 jquery.spinner: Fix rendering in RTL interface languages
Bug: T292673
Change-Id: I14473c2dd7efeaed2179fe2cdaeb29a47071ffe7
2021-10-06 22:41:38 +02:00
James D. Forrester
b4efcdf49a Drop $j alias for $, deprecated since 1.23
Bug: T280944
Change-Id: Ifb41d35d0d08b3c0631040b2f52d856de51adc67
2021-10-06 08:43:40 -07:00
DannyS712
4f1c4618d9 Move mediawiki.ForeignUpload configuration settings to package files
Inject `wgForeignUploadTargets` and `wgEnableUploads` via a
virtual file instead of always adding them to mw.config.

Added a comment about them in the release notes since wgEnableUploads
was used by an (undeployed) extension, but we can make the
breaking change because their inclusion was marked as
@internal.

Bug: T292017
Change-Id: Ib1635b1864963c6c03c4a80e15048a898b8eaf90
2021-10-06 15:28:37 +00:00
Sam Wilson
df3c0d0389 Correctly use sort index for redirects in TitleWidget
The 'index' value for redirects where the target doesn't exist was
not being used.

Bug: T292600
Change-Id: Ieab0606068a78e5b5e5b9b3337f3a75a0b64adbc
2021-10-06 11:07:22 +08:00
jenkins-bot
05d4865d76 Merge "Drop jQuery migrate" 2021-10-06 00:15:36 +00:00
jenkins-bot
e7f4484611 Merge "Make first char of username in ApiQueryAllUsers case-insensitive" 2021-10-05 20:57:54 +00:00
DannyS712
81d7e119bf Remove unused jquery.mw-jump module
Bug: T291720
Follow-up: I84bcd23180b3d1fa541728989f44a376189df95d
Change-Id: I6729822190565b0aa9179ff4a7818f66b9ec3abf
2021-10-05 18:48:33 +00:00
Arlo Breault
5c448e2fd7 Use child combinator to only apply style to gallery for new media dom
Previously, .thumb wouldn't be a direct descendant of .gallerybox
because of the explicit div for padding.  We don't want this rule to
apply to the legacy media dom so use that knowledge as a differentiator.

Follow up to Iff2bdc3aa02f84f0bf4ca55d177706823934cc08

Change-Id: I5ad9bf1913ece4a167fd642b536143695e34d00f
2021-10-05 12:14:06 -04:00
Daimona Eaytoy
b57b5897c9 Improve side-locking logic for diffs
In case of left clicks, update the locked side correctly if the click is
inside the diff table. Only unset the side if the diff is not inside the
table.
Also, when changing side, clear any selection. This avoids some weird
behaviour when switching side (due to the existing selection on the
other side). Doing this conditionally is necessary to avoid T288421.
Also create helpers for getting/setting the current locked side, and
getting the side a Node belongs to.

Bug: T292207
Change-Id: I0e953d5336253a8b1c216d3cfbd0298d53d97842
2021-10-05 10:35:52 +00:00
Daimona Eaytoy
5497fda920 Fix API warning in live preview
Only pass contentmodel-slot when fromslots is passed. This can
only be done when we also pass fromtext, not when using fromtitle.

Instead, Use the "slots" parameter to restrict the diff to the main
slot.

Also perform a pre-save transform on the new text. This was already
the case before I635d3a9d59c25804fb71e7b31659f3e4cbc6ab5f, where I
inadvertently didn't replace the rvdifftotextpst param.

Bug: T109166
Bug: T292362
Change-Id: Ia1cdfa9d618b43bb12eb979112a620cbe9ceeab5
2021-10-04 15:27:13 +02:00
eranroz
60198b38e7 Fix diff align for mixed lang content
Apply diff-contentalign-left or diff-contentalign-right to handle
content diff similar to regular diff.

Easter egg: Switching the dir in editbox (some browsers allow to switch using Ctrl+Shift or Ctrl+Shift+X)
will apply also on the diff view.

Change-Id: I0a05708333b75880d43d7164c114cf5581e13832
Task: T266738
2021-10-03 17:39:09 +03:00
Amir Sarabadani
388f098bdd Drop jQuery migrate
Bug: T280944
Change-Id: I3c87b3ef925f942489720fabc6aea2433ca2d1be
2021-09-30 18:29:05 +02:00
Bartosz Dziewoński
bc877673c3 preferences: Remove unused hack for the Gadgets extension
The selector doesn't match anything. No one seems to be complaining.

Change-Id: I19561cb6724c6e887d4cdefdc2faf317b6e15cd6
2021-09-29 20:44:28 +00:00
jenkins-bot
3aeed722f3 Merge "Match gallery output with Parsoid" 2021-09-29 02:35:11 +00:00
jenkins-bot
4954ac1496 Merge "Use some variables in content.thumbnails-print.less" 2021-09-28 22:10:13 +00:00
Bartosz Dziewoński
346d9fe5ed Set interface flag when parsing 'previewnote' for live preview
ResourceLoader calls inLanguage(), which clears the interface flag
(T291601), so we need re-enable it.

Bug: T291949
Change-Id: Ifa45007d936b8265d341b20ea5bc6eb017b4e7bb
2021-09-28 18:52:18 +00:00
Arlo Breault
351539a288 Use some variables in content.thumbnails-print.less
Change-Id: Ib97b23eb2c764e36ecccc00a033688b015589a7f
2021-09-28 14:50:06 -04:00
Fomafix
0b56ca7065 mediawiki.String: Add new functions lcFirst and ucFirst
The new functions `lcFirst` and `ucFirst` lowercases/uppercases the
first character of a JavaScript string with support of UTF-16
surrogates for characters out of the Unicode BMP.

Use these new functions at jqueryMsg.

Change-Id: I007b63bfbcc9e4bc7e89f48df9687111bc4db715
2021-09-28 18:16:54 +00:00
jenkins-bot
f253e8f4cb Merge "Use 0 instead of "" in phpCharToUpper.json" 2021-09-28 10:21:07 +00:00
Arlo Breault
f969920754 Match gallery output with Parsoid
The task T268250 is about further refining the Parsoid output but we
should at least match core's output with Parsoid's current while we
decide on that.

Bug: T268250
Change-Id: Iff2bdc3aa02f84f0bf4ca55d177706823934cc08
2021-09-27 19:26:07 -04:00
Bartosz Dziewoński
e5b4d10bb0 preferences: Allow wrapping text of "Restore all default settings..." button
Bug: T227131
Change-Id: Ic562900ba09436e557b317314a5090c4f306c61b
2021-09-27 22:37:36 +02:00
jenkins-bot
ca03262e0b Merge "Use mw.Title for capitalizing and drop wgCapitalizeUploads" 2021-09-27 19:36:36 +00:00
jenkins-bot
53ede2b4c0 Merge "Merge mediawiki.widgets.StashedFileWidget module into only user" 2021-09-27 19:12:57 +00:00
jenkins-bot
d15433f998 Merge "resourceloader: Remove execute() handling of legacy style formats" 2021-09-27 19:12:03 +00:00
jenkins-bot
305b8ddcce Merge "Unbreak "show changes" in live preview for page creations" 2021-09-27 17:26:17 +00:00
Daimona Eaytoy
d0a3ceee1f Unbreak "show changes" in live preview for page creations
Switch live preview to use ApiComparePages, thus making it possible to
view changes for a page being created.

Additionally, ApiComparePages has a different behaviour for section
diffs, which is the same as EditPage: the content of the
(to|from)text-{slot} parameters is inserted as the given section for the
provided (to|from)title parameter.

Also trim the new text, for consistency with EditPage diffs.

Based on Ic87efe9f0140ef06c6be728839beb1f06930d3cc by TheDJ.

Bug: T109166
Change-Id: I635d3a9d59c25804fb71e7b31659f3e4cbc6ab5f
2021-09-27 16:05:06 +00:00
DannyS712
b78fe4bbec Merge mediawiki.widgets.StashedFileWidget module into only user
The mediawiki.widgets.StashedFileWidget module was only used as
a dependency of mediawiki.Upload.BookletLayout and thus doesn't
need to exist as its own module.

Bug: T291443
Change-Id: I8cd85516f80cd32f017b7e34c8c26a24d2a0fee5
2021-09-26 00:38:14 +00:00