Commit graph

21 commits

Author SHA1 Message Date
Moriel Schottlender
232deffd81 RCFilters: Preserve collapsed state and adjust display
When collapsed, make sure we are adjusting the 'min-height' on the
'rcfilters-head' div so that it actually takes the space it should.

Make sure the preference of whether the area is collapsed or not is
preserved for the user, per RC or WL pages, and that it is loaded
properly with the correct minimum height dimensions depending on
which state is in the preferences, so to prevent "jump" of the
result list after load.

Bug: T177206
Change-Id: I82c3042cd1bb85dedcd6b5458b157fed94def808
2018-06-20 11:12:00 -07:00
Fomafix
aad2e5c38b Preferences: Allow only languages with translations in user options
This change allows only language codes with translations for the user
option 'language'. This restrict the selectable values in the
preferences and also prevents setting the user option via API.

With the URL parameter 'uselang' the user interface language can
still set to a language code without translation.

In the current situation this change will remove the following language
codes from the allowed values:
> print '* ' . implode( "\n* ", array_diff(
	array_keys( Language::fetchLanguageNames( null, 'mw' ) ),
	array_keys( Language::fetchLanguageNames( null, 'mwfile' ) )
) );
* aa
* als
* bat-smg
* be-x-old
* cho
* fiu-vro
* ho
* hz
* kj
* kr
* mh
* mus
* ng
* no
* rn
* roa-rup
* shi-latn
* shi-tfng
* simple
* tum
* uz-cyrl
* uz-latn
* zh-classical
* zh-min-nan
* zh-yue

The change I1dd6fb1f240ce3319b132d0f29f0622fba33e655 ensures that the
deprecated language codes get replaced by the new language codes. The
other untranslated language codes get replaced by the content language
codes when the user loads the preferences.

Bug: T118199
Change-Id: I1382996b031af3fe9f6e1568beeb6376dcbcd217
2018-06-14 13:32:47 +00:00
jenkins-bot
7793c8acc6 Merge "RCFilters: Add an opt-out preference for filters on watchlist" 2018-06-05 01:39:50 +00:00
Bartosz Dziewoński
03583f7a91 Use PHP 7 "\u{NNNN}" Unicode codepoint escapes in string literals (part 2)
This is a follow-up to Idc3dee3a7fb5ebfaef395754d8859b18f1f8769a
containing some less trivial changes.

Change-Id: Ia7af2c1d000307d43278cde4a246df413d4ef263
2018-06-04 16:40:48 +00:00
Roan Kattouw
5b2dd85524 RCFilters: Add an opt-out preference for filters on watchlist
And a temporary feature flag so we can roll it out in stages.

Bug: T195431
Change-Id: I170840146a197ac381df94434350ae2f0561d147
2018-05-31 17:24:28 +00:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
jenkins-bot
402dd3cd82 Merge "preferences: Preserve Status from saveFormData() in submitForm()" 2018-05-30 19:24:43 +00:00
Reedy
6b6c71558e Fix PreferencesForm alias
Change-Id: I6f24c6283b4165b9209e53f8fc3b8ecb5feb9ca4
2018-05-29 21:44:18 +00:00
Bartosz Dziewoński
c513ec19ef Restore 'PreferencesForm' as alias for 'PreferencesFormLegacy'
In change 4633f4d46a it was changed
to an interface implemented by both PreferencesFormLegacy and
PreferencesFormOOUI so that existing typehints for some functions
parameter would accept them both. Replace those typehints to use
HTMLForm instead. There was really no guarantee in the past that
they would only be given PreferencesForm or its subclasses, either.

Because the typehint change affects some hooks, note it as a
deprecation in MW 1.31 and a breaking change in MW 1.32.

Also add @since tags and correct some typos in code comments.

Follow-up to 4633f4d46a.

Change-Id: I61749f1d864cf68afe90cd9e15ba2d7a74252501
2018-05-24 21:20:50 +00:00
Alexia E. Smith
7b2182d9e5 preferences: Preserve Status from saveFormData() in submitForm()
The old Preference::tryUISubmit() and the new submitForm() would
blissfully return Status::newGood(), even when it isn't good.

Bug: T191933
Change-Id: I4e35c5a71800f88b2063dd0361d83a56f54d58c3
2018-05-24 20:25:28 +01:00
Fomafix
384dc90874 Avoid sorting the language array twice
Language::fetchLanguageNames returns already a sorted array. An
additional ksort is only needed when inserting a new value.

Change-Id: If8c7b16fa6e7dfe1545f72ac9c742a2f43eaee57
2018-05-22 23:02:34 -07:00
Ed Sanders
70e9ff4917 Preserve 'ooui' query string when overriding
Change-Id: I32df23b427f18e6275beaa6cc10cd58dc3b6eb36
2018-05-08 21:24:41 +00:00
Ed Sanders
4633f4d46a Special:Preferences: Create flag to enable OOjs UI
This reverts commit 808e45d13d.

Bug: T117781
Change-Id: I152b82bcd647d97062eb82cd2d1064609124f9bc
2018-05-03 15:23:14 +00:00
James D. Forrester
225b462a50 Drop deprecated EnableAPI and EnableWriteAPI settings
The siteinfo API response's 'writeapi' value is now hard-set to true,
as are the ResourceLoader variables wgEnableAPI and wgEnableWriteAPI,
to be deprecated later.

Bug: T115414
Change-Id: I54ff9428b247ba203d67aba079149393f323d5a9
2018-04-18 00:30:34 +00:00
Max Semenik
ba35762773 Log DefaultPreferencesFactory usage
Bug: T190425
Change-Id: I17e4792501811787ce90195c07915876d6c233e8
2018-04-09 14:45:11 -07:00
Moriel Schottlender
d13b22c474 RCFilters: Hide 'reload watchlist automatically' setting if RCFilters is enabled
Bug: T186277
Change-Id: I78a2bae5f8d0e6f947276c69fa1806eeaad46197
2018-03-26 18:30:37 +03:00
James D. Forrester
6d4e15476c Title: Refactor JS/CSS page handling to be more sane
Change-Id: Ia7837dc614dcc8896a7d4b6d663dc45b6bd4f7ee
2018-02-16 17:35:12 +00:00
Umherirrender
3124a990a2 Use ::class to resolve class names in includes files
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
2018-01-27 20:34:29 +01:00
Max Semenik
55497cdc1a Phan: resolve and reenable PhanAccessMethodProtected
Change-Id: I2bd7c787012f4f54600f3289d9d0d725f87788bc
2018-01-23 09:31:13 -08:00
Umherirrender
23ef520a1c Improve some parameter docs
Change-Id: I31e983d7ac287158101b18ad95779d83537302a2
2018-01-07 11:39:08 +01:00
Sam Wilson
2e248f0bb2 Convert Preferences class into PreferencesFactory service
This deprecates the Preferences class and replaces it with
a PreferencesFactory service. Basically, all code from Preferences
is moved into DefaultPreferencesFactory. All Prefereces methods
are now either shims calling DefaultPreferencesFactory or just
throw exceptions.

Bug: T178449
Change-Id: Id0b2db0c2de0890f6e1609a9a0dca207c4600f99
2018-01-03 09:48:25 +08:00