Commit graph

1264 commits

Author SHA1 Message Date
jdlrobson
366b4aafdb Enable mediawiki.special.userlogin.common.styles on mobile and allow skins to style it
Depends-On: I0fe9efcf98bbd8e188d91a29d4cfda897d47808d
Bug: T173597
Change-Id: I36e596e4d6060ef168464732028cd0dcbf21d0f8
2017-08-28 12:51:44 -05:00
Moriel Schottlender
8f56e150cc RCFilters: Adjust highlight for seen/unseen states in Watchlist
Bug: T171235
Change-Id: I33d059d2be83e4730e6dc82f689f49a514286874
2017-08-28 11:35:15 -04:00
James D. Forrester
1360468d9c EditPage: Remove temporary OOUI page class name
Follow-up to I2b468c8b84, broken out for simplicity.

Change-Id: I16578dafafbcf7dfbbbb909ceb89cd64d5b40a82
2017-08-22 16:53:27 -07:00
jenkins-bot
0becca63c3 Merge "EditPage: Remove legacy non-OOUI render mode" 2017-08-22 22:54:26 +00:00
Kunal Mehta
478caa076f EditPage: Remove legacy non-OOUI render mode
Mostly remove it at least. Some things from the transition are still
left around:

* EditPage::isOouiEnabled() will now always return true and is soft
  deprecated as some extensions are using it to detect whether in OOUI
  mode.
* EditPage::getCheckboxes() is left around since getCheckboxesOOUI()
  calls it. Someone else will need to disentangle that.
* The "mw-editform-ooui" class is kept as some on-wiki JavaScript uses
  it to detect whether running in the OOUI mode.
* CSS is still using the .mw-editform-ooui class. It should be
  transitioned to use .mw-editform in a follow-up.

Other cleanup:
* mediawiki.action.edit now directly depends upon oojs-ui-core instead
  of transitively via mediawiki.widgets.visibleByteLimit. As a result, the
  mw.loader.using call was removed from the JavaScript file.

Bug: T172315
Change-Id: I2b468c8b846db015b5a1e3d2500abb8ea252c442
2017-08-22 12:47:16 -07:00
James D. Forrester
49d3911a76 resources: Provide the WikimediaUI LESS config vars for all OOjs UI users
Bug: T123359
Change-Id: I11677b9bacdbba9e17574891ca30428051b13606
2017-08-21 17:13:54 -07:00
jenkins-bot
69f16b7a69 Merge "RCFilters: Add title attribute to [x] button" 2017-08-21 19:23:28 +00:00
Moriel Schottlender
944bdda518 RCFilters: Add title attribute to [x] button
For accessibility, add title attribute to the remove button in
the active filters area.

Bug: T173608
Change-Id: Idcf735e3b610345a8206f83fe5f8115900455cc2
2017-08-21 11:05:26 -07:00
Moriel Schottlender
538d1d2c9e RCFilters: Add title attribute to highlighted rows
For accessibility and screen readers, add the actual highlighted
filter names to a title attribute in rows that are highlighted.

Bug: T173608
Change-Id: Id71a45621e545897988010acfd054760a617b1f1
2017-08-18 18:04:24 -07:00
jenkins-bot
2d2cb5e1a3 Merge "WLFilters: convert mark as seen button to new style" 2017-08-18 22:04:35 +00:00
Stephane Bisson
7da24265c8 WLFilters: convert mark as seen button to new style
Bug: T171121
Change-Id: I52b3c318fe8270c857d9afebdfd7f440d56131c9
2017-08-18 19:38:34 +00:00
Timo Tijhof
3863dd231f Remove deprecated jquery.mwExtension module
* Deprecated since MediaWiki 1.26.

* Not used anywhere in Wikimedia Git.

* Grafana mw-js-deprecate dashboard shows < 1 hit per day on average
  for any of the jquery.mwExtension properties, during the past 3 weeks.
  Most days 0, some days 18 individual hits.
  By comparison, legacy wikibits before we removed it in May 2017 was down
  to about 6,000/24h (combined), so removal is quite overdue.

Change-Id: Ib66d1844b4fb8d7185b0e6607b9f98c1be632bb5
2017-08-17 18:54:11 -07:00
jenkins-bot
70d904b5bd Merge "RCFilters: tweak old changes indicator" 2017-08-17 05:56:55 +00:00
Geoffrey Mon
700e49dddd Unwatch link for pages in Special:Watchlist
When the 'watchlistunwatchlinks' preference option is enabled, this
adds a '×' link to each entry of the watchlist that unwatches the page
of that entry. When clicked, it changes into a '+' which can be used to
re-watch the page (effectively undoing the earlier unwatch).
When a page is unwatched, its entries and the entries of its associated
talk page (or vice versa) become translucent and are struck through.

Without JS, '×'/'+' link to action=(un)watch for the relevant page.

In addition, ChangesList classes have been modified to allow a prefixer
that adds a prefix to each line (used in this case to put the unwatch
link) and to add HTML data attributes to reliably determine the target
page of each entry. Unit tests have been updated accordingly.

Bug: T2424
Change-Id: I450b2901413d7e75c11de2a446829fdbb22d31e1
2017-08-12 19:36:29 -04:00
jenkins-bot
1e8f417f3d Merge "Live Preview: Cope with the edit summary being an OOjs UI widget" 2017-08-09 20:55:58 +00:00
James D. Forrester
d4a7517329 Live Preview: Cope with the edit summary being an OOjs UI widget
Bug: T171156
Change-Id: Idb9118421ffbd438dd7b018a8dbf8bb991036232
2017-08-09 15:47:30 -04:00
Stephane Bisson
797c27e537 RCFilters: tweak old changes indicator
Bug: T172213
Change-Id: Ia9e669376390a56e52422352840a5d9e2576b1a8
2017-08-07 16:43:54 -04:00
Stephane Bisson
e3460a6666 RCFilters: set live update button title
Bug: T167743
Change-Id: Iefea4001371921753e0622c195810b080c459968
2017-08-02 15:15:03 -04:00
Max Semenik
fd6e9ef2d4 Human-readable section ID support
It adds the ability to replace the current section ID escaping
schema (.C0.DE) with a HTML5-compliant escaping schema that is
displayed as Unicode in many modern browsers.

See the linked bug for discussion of various options that were
considered before the implementation. A few remarks:
* Because Sanitizer::escapeId() is used in a bunch of places without
  escaping, I'm deprecating it without altering its behavior.
* The bug described in comments for Parser::guessLegacySectionNameFromWikiText()
  is still there in some Edge versions that display mojibake.

Bug: T152540
Change-Id: Id304010a0342efbb7ef2d56c5b8b244f2e4fb2c5
2017-08-01 20:32:20 -07:00
jenkins-bot
1f2c768a9d Merge "RCFilters: Add 'enhanced' view (Group by pages)" 2017-08-02 01:19:59 +00:00
Moriel Schottlender
eb767102f7 RCFilters: Add 'enhanced' view (Group by pages)
Bug: T168513
Change-Id: If099f8809342f68662f91824a2b023bf90833760
2017-08-01 18:09:07 -07:00
jenkins-bot
4838f88d84 Merge "RCFilters: Add 'advanced filters' label to the view selection" 2017-08-02 00:44:44 +00:00
Moriel Schottlender
9d7f4ef9ac RCFilters: Add 'advanced filters' label to the view selection
Bug: T171894
Change-Id: I595d7d4a66eaedb76c9a4e4690be4ec4ef696a2d
2017-08-01 16:23:18 -07:00
Bartosz Dziewoński
58c66f541a Revert "mw.action.edit: Restore modifier keys for accesskey in tooltip for summary field"
No longer needed after changes from T168408.

This reverts commit 0269ae0fe5.

Bug: T168408
Change-Id: I50c24a9bada19a0e7d3a009c9afec073f6ffa357
2017-08-01 20:58:52 +00:00
Stephane Bisson
e2bea6350c RCFilters: show new changes
When "live update" is off and new changes are detected,
show a link to load and prepend the changes to the list.

Also adding a line between old and new changes
when grouping by pages is off.

Bug: T163426
Change-Id: I6a111d23956bdc04caa4c71e9deede056779aafa
2017-07-31 08:50:09 -04:00
jenkins-bot
be656c67a2 Merge "RCFilters: Make 'related links' collapsible" 2017-07-29 01:16:05 +00:00
Moriel Schottlender
b71ad28776 RCFilters: Make 'related links' collapsible
Bug: T166919
Change-Id: I89d69c6614f641ac92143f0b1a718145e9cd61bd
2017-07-28 18:03:49 -07:00
Stephane Bisson
58753c9c14 RCFilters: Allow setting a new query as default
When creating a new saved query, there's a checkbox
to set it as default as the same time.

Bug: T171922
Change-Id: Id6da0e79c54bc65d76636bbff64b2ece568c0cd4
2017-07-28 16:55:37 -04:00
jdlrobson
35bad07bce mediawiki.legacy.shared can be run in mobile target
Minerva explicitly disables it
These are needed for rendering for:
?useformat=mobile&useskin=vector

Change-Id: I759c023b4ce63186929b893953042fc0a5059aa2
2017-07-27 14:49:59 -07:00
jdlrobson
4c30c19d6b mediawiki.hlist: Add sensible defaults
This allows skins to define how hlists appear (e.g. which pseudo
elements to use or whether to use them at all)  while
providing some sensible defaults.

Bug: T42062
Change-Id: I61b5f077d8b4a4c7fe845b7b6d1df98bb2dbafc8
2017-07-22 01:34:23 +00:00
Tjones
af420fe8b5 Merge "Revert "Make mw.widgets.SearchInputWidget extend OO.ui.SearchInputWidget"" 2017-07-19 21:51:18 +00:00
EBernhardson
baf123f07d Revert "Make mw.widgets.SearchInputWidget extend OO.ui.SearchInputWidget"
Typing a search query into the main box on Special:Search
causes the search to be performed for the first autocomplete
result, rather than the typed query. The first autocomplet 
result should only be searched for if explicitly selected with
the mouse or arrow key.

This reverts commit 7882e3b660.

Bug: T171112
Change-Id: I1af6ba90542fafe3ed1aeca420e9d6df6612f7d0
2017-07-19 21:39:36 +00:00
jenkins-bot
081f44fa7f Merge "RCFilters: Add range group filters - limit, days and hours" 2017-07-19 02:32:21 +00:00
Moriel Schottlender
91b2ebe834 RCFilters: Add range group filters - limit, days and hours
- Add 'hidden' groups that have base defaults but are not
  viewed in the filter drop-down.
- Add a UI for days, hours and limit selections, based on their
  group models.
- Clean up the fieldset form to remove redundant line breaks
  and empty objects.
- Add 'hours' as a subset of days, where the UI can split itself
  by picking up values >=1 and <1
- Add the ability to allow 'arbitrary' information from the URL
  values, but also make sure there is a validation method
  and a possibility to re-sort the values that are added in.

Bug: T162784
Bug: T162786
Change-Id: I8068a7cc411eef40ddb8af4eef1d4f1e5f2a2b82
2017-07-18 19:21:10 -07:00
Moriel Schottlender
e0b50f4cfa RCFilters: Correct language for invert button
Bug: T166912
Change-Id: Iabbbe2c76d5dc51f2aa49646c84b8eba7bc692a1
2017-07-17 15:38:32 -07:00
jenkins-bot
024a0a9d84 Merge "RCFilters: Basic implementation of live updates" 2017-07-08 00:28:22 +00:00
Roan Kattouw
ebc36b75b8 RCFilters: Basic implementation of live updates
Adds a live updates button that refreshes the changes list every 3 seconds.
For now this is pretty dumb in that it re-requests the entire list every time;
the next step would be to make it only load new changes using the &from=
query parameter.

Bug: T167743
Change-Id: Ic2ddea840e5c46f42b32ae4fff91138cacc28ec0
2017-07-07 17:00:53 -07:00
Matthias Mullie
eea0ff89b6 SpecialNewFiles: Swap from/to date serverside
Bug: T168695
Change-Id: I760096138da15a6f3b84a6db68ab5590f5a3e59b
2017-07-07 16:03:55 +00:00
jenkins-bot
0ef2a58569 Merge "RCFilters: Change tooltip messages for view buttons" 2017-06-30 22:20:16 +00:00
Moriel Schottlender
225428200e RCFilters: Change tooltip messages for view buttons
Bug: T167384
Change-Id: I30ec6b8931539ccaad8d2d1a609d117f2a13767d
2017-06-30 22:06:16 +00:00
jenkins-bot
7ad35afab2 Merge "Allow search suggestions in skins operating in mobile mode" 2017-06-30 22:05:59 +00:00
jdlrobson
28c72dc940 Allow search suggestions in skins operating in mobile mode
MobileFrontend silently removes this skin from the page. This is
now made explicit and the module can be safely loaded in a mobile
environment.

This is used by both Timeless which although does not work
perfectly on a mobile device it should be easy to fix with additional
work.

Change-Id: Iedea2872d14430db452cec7e758f20d854778414
Depends-On: Ic36e9792f9217f3fd37bbd1f5c66d894301363f0
2017-06-30 21:50:54 +00:00
Matthias Mullie
05259c3de4 Improve error messages for (known unknown) network errors
Bug: T132611
Change-Id: I22f26e56e089edad7c423ac8f0007b5439de3e58
2017-06-30 14:44:45 +02:00
Bartosz Dziewoński
7882e3b660 Make mw.widgets.SearchInputWidget extend OO.ui.SearchInputWidget
Mixin mw.widgets.TitleWidget instead of extending mw.widgets.TitleInputWidget.

* Remove code that reimplemented pieces of OO.ui.SearchInputWidget.
* Remove code that overrode pieces of mw.widgets.TitleInputWidget.
* Copy the code from mw.widgets.TitleInputWidget that we actually want.

This should result in no functional changes, other than losing the
TitleInputWidget API (some methods and config options) that no one
relied on, as far as I can tell.

Bug: T169194
Change-Id: Ic1482b4c7cfde7d4cf0b8900654bd3a454776010
2017-06-29 22:25:56 +02:00
Moriel Schottlender
d8ee0c30ce RCFilters: Correct display of save filter popup
- Correct language in the 'apply' button
- Add a placeholder to the input
- Make the 'apply' button disabled if the input is empty
- Remove the use of the OOUI-built-in validation, since all
  we do is "validate" that the input isn't empty, and there's
  no need to show error mode (red border) for that, especially
  since the 'apply' button is disabled in that case.

Bug: T169042
Change-Id: I5e3600b1ac8e63d8a25c0540468fe42febfc3a70
2017-06-28 10:35:53 -07:00
Ed Sanders
f4717b49cd Use visibleByteLimit on Special:MovePage
Change-Id: Ie9e2bef8397851ca5899bfb7a3849853d07590ff
2017-06-28 12:32:27 +00:00
jenkins-bot
943a2498d0 Merge "Factor out byte limit label logic from edit page to utility function" 2017-06-28 12:31:29 +00:00
jenkins-bot
f1c48a9d21 Merge "RCFilters: Change the input icon on interaction" 2017-06-23 18:35:45 +00:00
Ed Sanders
02e938af1c Factor out byte limit label logic from edit page to utility function
Other input widgets have byte limits and may want to display the counter.

Change-Id: I61b72ab75007d80b9e0bba0f391c88cbac2bce3d
2017-06-23 17:16:46 +00:00
jenkins-bot
19ca7f2fdb Merge "RCFilters: Change to the new views redesign" 2017-06-23 00:06:46 +00:00
Moriel Schottlender
a267e4ef04 RCFilters: Change to the new views redesign
- Allow for multiple footers for the menu, each configured
  for its own view (or multiple views)
- Move the switch view buttons to the right of the input
- Add a 'back' button on the menu header when we're in
  advanced filters view, moving back to default view

Bug: T167384
Change-Id: I9fd0243f88f92ddacb4c912ff974f7d325f32f5d
2017-06-22 23:50:59 +00:00
jenkins-bot
388fcc2370 Merge "API: Display message-per-value style help for submodule parameters" 2017-06-22 17:10:36 +00:00
jenkins-bot
9f532a7cee Merge "Load mediawiki.action.edit.styles on mobile" 2017-06-21 17:07:02 +00:00
jdlrobson
c1756a1088 Load mediawiki.action.edit.styles on mobile
Hopefully uncontroversial.
Mobile non-js editing is currently feature flagged
by $wgMFAllowNonJavaScriptEditing so this shouldn't have
any impact on production but will ensure the editor gets
styled consistently with future changes here.

Change-Id: If8994370e9ec7fc424ce7cb22df922d029cfc035
2017-06-20 14:29:31 -07:00
jenkins-bot
3cecf7e6f1 Merge "ApiSandbox: Indicate when login is suppressed" 2017-06-20 21:02:30 +00:00
Brad Jorsch
d4392eaaea API: Display message-per-value style help for submodule parameters
The module's summary will be used as the description of the value.

Since these are often very long lists, this also changes ApiSandbox to
collapse <dl> lists in parameter descriptions by default.

Bug: T123930
Change-Id: I205b68a52a94cae4c1cdf7ec9fd3e8a04d565919
2017-06-20 17:35:51 +00:00
Brad Jorsch
06802684e0 ApiSandbox: Indicate when login is suppressed
ApiMain will add a header to indicate that lacksSameOriginSecurity()
forced the request to be processed as if logged out, and ApiSandbox will
detect this header to display a helpful message on the results page.

Bug: T165797
Change-Id: I56390b31563c75d83cf0a8ffb1b8e4f3283895f0
2017-06-20 12:03:39 -04:00
Bartosz Dziewoński
0269ae0fe5 mw.action.edit: Restore modifier keys for accesskey in tooltip for summary field
.updateTooltipAccessKeys() is called automatically after the page
loads (from mediawiki.page.ready), but infusing the field blows away
these changes.

This is a poor workaround, the same issue will appear if e.g. the
buttons are infused. The functionality provided by jquery.accessKeyLabel
should be an OOjs UI feature, or we should somehow call it automatically
after infusing widgets.

Bug: T168042
Change-Id: I2b166be34b8394c296fbc7326570cd732284888f
2017-06-19 20:09:16 +00:00
jenkins-bot
37be8b0d8b Merge "Add missing dependencies to module 'mediawiki.api'" 2017-06-19 08:37:55 +00:00
Moriel Schottlender
b3a899bc84 RCFilters: Change the input icon on interaction
Bug: T166917
Change-Id: I72ed88c25d2dfbbafa35cd802d2b9718aa7ba6c8
2017-06-16 12:55:18 -07:00
Moriel Schottlender
7725c75586 RCFilters: Add edit tags drop down
Fetches the tags from the wiki and displays them as additional
filters for RCFilters.

Bug: T159942
Bug: T161650
Bug: T164130
Change-Id: I7bfa99cd5aeb34b6c7de74c15aac158ee40eac2f
2017-06-15 19:33:34 +00:00
Fomafix
ae236ccd33 Add missing dependencies to module 'mediawiki.api'
Change-Id: I62f6e75d840d07a4ae6676fa88c6b655aa575bba
2017-06-15 15:54:04 +02:00
Moriel Schottlender
51ce88abb9 RCFilters: Add 'views' concept and a namespace view to RCFilters
Enhanced RCFilters: Add the ability to filter by namespaces to RCFilters.
	🎉	🎁	🎊

- Add the ability to separate groups of filters by 'views'
- Add the first views as 'default' (for predefined filters)
  and 'namespace' as the list of namespaces.
- Add 'nsinvert' to namespace group
- Allow highlighting namespaces
- Allow searching on either view, depending on prefix
- Add a way to switch views by typing prefix, clicking the
  'Namespaces' button or clicking a tag (either namespace
  or filter tag, changes the view accordingly, and adds
  or removes the prefix from the input to stay consistent)
- Add an optional wrapper text for tags, so we can represent
  them with their respective prefixes and (if needed) with
  a special message for inverted state.
- Add unit tests and make pass
- Bonus: Fix issue with URL not updating (and not being updated)
  the inverted and highlight enabled states.

Bug: T159942
Bug: T163521
Bug: T164130
Change-Id: I7e83f0800cbeb289dfd3461c1c5a197c053147ca
2017-06-14 12:57:13 -07:00
Moriel Schottlender
85876bbc71 RCFilters: Make frontend URL follow backend rules and add 'urlversion=2'
The backend always merges the query with wiki/user defaults before
it gives us data. The frontend, though, initially assumed that the
state is given strictly by the URL parameters (especially after the
URL shorening commit). This made it so that the frontend state is
incompatible with backend state.

However, always merging frontend state with user/wiki defaults can
produce inconsistencies between URLs in the same wiki, preventing
users from sharing them -- and making it potentially break if ever
a wiki default changes.

The solution is to add 'urlversion=2' to all RCFilters-generated
URLs and have the backend recognize this parameter as 'do not
merge with defaults'.

When RCFilters frontend loads, it checks whether the parameter
exists; if it doesn't, it merges whatever it sees with the defaults
just like the backend, then it transforms the URL to represent the
correct full state, and adds 'urlversion=2' to the URL parameters,
making it consistent across accounts and through time for the
next time it will load.

This means several new behaviors over the 'short url' commit:
- Accessing Special:RecentChanges directly (no query) will result
  in one of two things:
  -- If there is a saved query that's set to default:
     The system will load that saved query "straight forward" (as
     if the user clicked that option from the menu) causing, also,
     an ajax re-request from the server (since the server does not
     yet know about saved queries or their potential for being
     the default state.)
  -- If there is no saved query default: The system will load
     user/wiki defaults (like the backend does) and then fix the
     url to represent this state fully (with parameters showing the
     actual state of the filters.
  -- Both cases will also result in adding 'urlversion=2' to
     the end result URL.
- Accessing Special:RecentChanges?urlversion=2 (without any other
  parameters) will result in loading a completely empty filter set
  in RCFilters. We assume that 'urlversion=2' does not load defaults
  even if it is the only parameter in the URL.
- Accessing Special:RecentChanges?hideX=1 (parameter set without
  urlversion=2) will result in the front end taking the requested
  parameters, merging them with user/wiki default (reproducing what
  the backend does) and then adding urlversion=2 to the URL.

In all cases except for the default-saved-query-load case, the initial
load will **not** re-request data from the backend. The backend needs
to adjust to respect urlversion=2 as well (will come in an upcoming
commit) so the state and expectation of both the front- and back-end
are the same.

This commit also factors out URL handing to a separate class (UriProcessor)
and adds unit tests for it.

Bug: T166907
Bug: T166972
Bug: T166974
Change-Id: I0eed3bc0d4fa4810b6301b535c75b6bfbc8b4a5b
2017-06-14 10:50:49 -07:00
jenkins-bot
9c9ea2491d Merge "Allow skins to control style of mediawiki.hlist" 2017-06-12 18:10:16 +00:00
Bartosz Dziewoński
39f6710d74 Split off styles for PHP DateInputWidget to separate module
This lets us load them with addModuleStyles() (without generating a warning).

Bug: T167343
Change-Id: I88f0716c6a5ac702cc07e8015cfe25d81538a536
2017-06-07 21:49:42 +02:00
jenkins-bot
c2e9f2f981 Merge "Add appropriate OOjs UI icon pack dependencies for OOjs UI itself" 2017-06-06 14:53:20 +00:00
Fomafix
cd8e02ead8 Resources.php: Alphabetical sort of mediawiki.special.*
Change-Id: Ic49128620b6b52e5a69803eefac6c982d740c1b7
2017-06-04 21:37:10 +02:00
Bartosz Dziewoński
70471939f9 Add appropriate OOjs UI icon pack dependencies for OOjs UI itself
Ridiculous? Why yes, yes it is. See T166948.

Bug: T166730
Bug: T166948
Change-Id: I6428ca0d44d8773486230445e466bd5de272e873
2017-06-03 14:15:04 +02:00
James D. Forrester
9527f2ff86 resources: Add appropriate OOjs UI icon pack dependencies
resources/src/mediawiki/mediawiki.filewarning.js
* Add 'alerts' as it uses 'alert'

resources/src/mediawiki/page/gallery-slideshow.js:
* Add 'movement' as it uses 'previous' and 'next'

resources/src/mediawiki.special/mediawiki.special.apisandbox.js:
* Add 'content' as it uses 'info'
* Add 'interactions' as it uses 'add' and 'help'
* Add 'editing-advanced' as it uses 'code'

resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js:
* Add 'movement' as it uses 'collapse', 'previous', and 'next'

includes/widget/SearchInputWidget.php and
resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js:
* Add 'interactions' as it uses 'search'

resources/src/mediawiki.widgets.datetime/CalendarWidget.js:
* Add 'movement' as it uses 'previous' and 'next'

Bug: T166730
Change-Id: I0618c681d06891621470ca1cb500dedfdf05f93b
2017-06-01 17:17:37 -07:00
jdlrobson
d31fa9cfa7 Allow skins to control style of mediawiki.hlist
Bug: T42062
Change-Id: I9305af5d30c8c24b44f4a0c6a466581c45fa3028
2017-06-01 16:05:59 -07:00
James D. Forrester
953f5c47fe RCFilters: Depend on the 'content' icon pack, for the 'history' icon
Change-Id: I93dcc4b0f0861a94ac6aa02a40276355f080e1bc
2017-06-01 12:26:15 -07:00
jenkins-bot
975f7ef08f Merge "Refactor registration of OOjs UI resource modules" 2017-06-01 17:37:28 +00:00
James D. Forrester
57ff59e559 mediawiki.special/mediawiki.special.apisandbox: Use 'trash' icon which still exists
Bug: T166730
Change-Id: I38c526d2660aae8c221f74ce2927c2e338c01be1
2017-06-01 17:19:10 +02:00
James D. Forrester
b8f03e8e78 mediawiki.widgets.datetime/DateTimeInputWidget: Use 'trash' icon which still exists
Bug: T166730
Change-Id: I30a833ee93d49bb9480f5cfed332a9aa8e306713
2017-06-01 17:19:07 +02:00
Bartosz Dziewoński
c8ad83310f Refactor registration of OOjs UI resource modules
includes/resourceloader/ResourceLoaderOOUIModule.php
* New trait centralizing some logic for dealing with OOjs UI themes,
  previously duplicated in OutputPage, ResourcesOOUI.php and
  ResourceLoaderOOUIImageModule.
* Follow-up change I74362f0fc215b26f1f104ce7bdbbac1e106736ad uses this
  as a base to allow skins/extensions to define new OOjs UI themes.

resources/Resources.php
resources/ResourcesOOUI.php
includes/resourceloader/ResourceLoader.php
* OOjs UI resource module definitions are moved back to their rightly
  place in Resources.php. They are again (almost) normal and static.
* Theme-specific logic is now handled by the module code, definitions
  only specify 'themeScripts'/'themeStyles'/'themeImages'.
* ResourcesOOUI.php is deleted and no longer loaded by ResourceLoader.

includes/resourceloader/ResourceLoaderOOUIFileModule.php
includes/resourceloader/ResourceLoaderOOUIImageModule.php
* Glue code previously existing in ResourcesOOUI.php now lives here.
* Use the ResourceLoaderOOUIModule trait to avoid code duplication.

Change-Id: I39cc2a735d9625c87bf4ede6f5fb0ec441d47dcc
2017-06-01 17:04:05 +02:00
jenkins-bot
bd3375a84e Merge "Use PHP DateInputWidget in Contribs and use for range filtering" 2017-05-30 20:58:35 +00:00
Moriel Schottlender
8af6e14a95 RCFilters UI: Migrate FloatingMenuSelectWidget to MenuSelectWidget
FloatingMenuSelectWidget has been deprecated in OOUI, moving to the
MenuSelectWidget widget instead.

Change-Id: Id4e5e4c551d50242ce19837c2e958b9773139906
2017-05-30 13:55:59 +03:00
Geoffrey Mon
b66888733c Use PHP DateInputWidget in Contribs and use for range filtering
* Add two DateInputWidgets to Special:Contributions, one for start and
  one for end
** If start input is empty but end input is not, display edits up to end
   input, and vice versa
** If both inputs are specified, display edits between the two dates
** If both inputs are empty, no date range is used
* Legacy options (year=/month=) are converted to use for the end
  timestamp, so URLs with them should still work.
* Unit tests!

Bug: T120733
Change-Id: Id15f2b2ce2954fe98dfbbb7b0e86c0e4e5713f5e
2017-05-29 16:39:07 +00:00
Moriel Schottlender
032056937e RCFilters: Dismiss Apex' insistence to add checkmark to optionWidgets
Bug: T165446
Change-Id: I8188b34675e7e49f3603e7b7154e4e0800e94c37
2017-05-28 23:09:39 +03:00
jenkins-bot
d41a6afe00 Merge "RCFilters: Style the Saved Links placeholder and add a title" 2017-05-26 19:54:54 +00:00
Fomafix
7da28ab3ce Restore dependency on module 'mediawiki.page.startup'
Module 'mediawiki.page.watch.ajax' requires a dependency to module
'mediawiki.page.startup' because 'mediawiki.page.startup' creates the object
mw.page and 'mediawiki.page.watch.ajax' requires this object.

This dependency got lost in 06a0dec057.

Bug: T114288
Change-Id: Iebfda85c77eaf6bb19d2ae755813b1c36a95dac8
(cherry picked from commit ef456a7805)
2017-05-24 15:20:20 +00:00
jenkins-bot
1928a85867 Merge "Initialize mw.util.$content in mediawiki.util" 2017-05-23 14:04:52 +00:00
jenkins-bot
36127c29c2 Merge "Date range filtering in Special:NewFiles" 2017-05-23 13:56:23 +00:00
Fomafix
06a0dec057 Initialize mw.util.$content in mediawiki.util
This avoids the public method mw.util.init().

Add a noop function and a deprecation warning to mw.util.init().

The dependency to module 'mediawiki.page.startup' is not necessary anymore
for using mw.util.$content.

Change-Id: Ib8ca3f9afa43de0ff0bb87569dd2ddfddf2a69b8
2017-05-23 13:44:20 +00:00
Fomafix
e39ec1e3e9 mediawiki.page.patrol.ajax: Remove dependency on mediawiki.page.startup
The module 'mediawiki.page.patrol.ajax' does not need a dependency on
the module 'mediawiki.page.startup'.

Change-Id: I2619a0709b93c26a8b3906273b4d5a988230d662
2017-05-23 07:11:52 +00:00
Fomafix
8ef5a6709d Resources.php: Add missing dependencies to module 'mediawiki.user'
Change-Id: Ie68418a47d4b4b98fac2b275def392294bd01909
2017-05-17 18:24:40 +02:00
Fomafix
3ad01cdecc Resources.php: Add missing dependencies to module 'mediawiki.util'
Change-Id: Iac3070adc36533ae046f57ecc7c772247b42420d
2017-05-16 06:20:29 +02:00
Moriel Schottlender
9b4237dde5 RCFilters: Style the Saved Links placeholder and add a title
Bug: T164861
Change-Id: I4cfdfdc82d53631008df35e9444781cf91bad06e
2017-05-15 12:37:43 -07:00
Roan Kattouw
960e85b443 RCFilters UI: Add a placeholder to SavedLinksListWidget when it's empty
No longer hide the button when the menu is empty, but instead
show the placeholder item when the *model* is empty.

Bug: T164861
Change-Id: I96e5e375de5f35946663042f6731d7b69e53308b
2017-05-12 14:29:55 +00:00
Geoffrey Mon
3a7ce3d629 Date range filtering in Special:NewFiles
Bug: T13836
Change-Id: I6149a081db2494a36a715259b76a0c0470149b8c
2017-05-12 13:26:44 +00:00
jenkins-bot
841e78dfbc Merge "RCFilters UI: Add a 'saved queries' quick filters feature" 2017-05-08 23:47:54 +00:00
Moriel Schottlender
8936e6455a RCFilters UI: Add a 'saved queries' quick filters feature
Bug: T151994
Bug: T164128
Change-Id: I5cede87633147736d3b4ee5b8ea178ae21bd441f
2017-05-08 16:20:44 -07:00
Fomafix
0927a5045d Clear postEdit cookie on server-side
* Load module 'mediawiki.action.view.postEdit' only when needed.
* Transfer message key via JavaScript config variable wgPostEdit.
* The response is maked as not-cachable to prevent that other users get the
  post edit message.

This change redefines the global JavaScript variable wgPostEdit from true
to a string and set it on server-side.

Bug: T164148
Change-Id: Id780bc280ce4a2fa4606141419932b7dcd45157b
2017-05-05 23:58:19 +00:00
Fomafix
85a48d8fec mediawiki.user: Remove deprecated mw.user.bucket
The function mw.user.bucket is already deprecated since MediaWiki 1.23.

Change-Id: I2589dc7ce94004504a7aad080374877391f20057
2017-05-02 05:29:41 +00:00
Ed Sanders
f8ac9bb2e6 Cleanup postEdit and match styles to mw.notification
* Remove HTML template
* Add mw-notification class and dependency
* Fix variable scoping issues so firing two notifications
  doesn't cause one to become stuck

Bug: T58313
Change-Id: I9a702d23a8a9b5cc098cbb413213d73813bec097
2017-04-27 22:15:51 +00:00
jenkins-bot
762d73a3c6 Merge "RCFilters UI: Create base classes for shared objects" 2017-04-25 23:41:44 +00:00
Moriel Schottlender
856cc85f4b RCFilters UI: Create base classes for shared objects
Preparing for adding other types of items than filters (namespaces,
users, tags, etc) this commit creates base classes for the model
and relevant widgets and extends Filter* from them.

Bug: T159942
Bug: T163521
Change-Id: I61c88a1f14a3ca9d91aa831187eda156468a6591
2017-04-25 16:14:11 -07:00
Timo Tijhof
7439282580 Special:Block: Fix FOUC of bold 'mw-block-hideuser'
Loading Special:Block/<your own name> shows "Confirm block", but
this then becomes bold a second later. This is because the styles
are part of 'mediawiki.special.block' which also contains JavaScript
and is loaded with addModules().

Move the styles to mediawiki.special.css instead.

Change-Id: I1c47256227603a6cde36238fdd7e11205d9494ec
2017-04-25 13:38:34 -07:00
Prateek Saxena
a6b31205ac mw.widgets: Add SelectWithInputWidget and its PHP implementation
Bug: T106999
Change-Id: Ic158bec3c463fba5099b05f41c9686f833e1c313
2017-04-24 10:19:55 +02:00
jenkins-bot
53034b5e4a Merge "RCFilters: Adjust to use MenuTagMultiselectWidget" 2017-04-13 20:04:41 +00:00
Moriel Schottlender
a703e5236b RCFilters: Adjust to use MenuTagMultiselectWidget
The new widget in OOUI is more stable and easier to manage,
and gives us a few features that we were missing, like
arrow behavior in the menu.

Depends on OOUI release 0.21.0

Bug: T162829
Bug: T159768
Bug: T162709
Bug: T162917
Change-Id: I42be0691304b1e93b4e9c02eba2e3a724a5ffd67
Depends-On: Ic216769f48e4677da5b7274f491aa08a95aa8076
2017-04-13 12:53:01 -07:00
Timo Tijhof
bf69459d50 Upgrade to jQuery v3
Source code:
 https://code.jquery.com/jquery-3.2.1.js
 https://code.jquery.com/jquery-migrate-3.0.0.js

Documentation:
 https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/
 https://jquery.com/upgrade-guide/3.0/

This is not a breaking change because jQuery Migrate covers
all breaking changes.

However some extensions (especially unit tests) may've relied
on undocumented behaviour. For that reason, and due to unresolved
upsteam issues this is still behind a feature flag for now.

It is true by default to ensure this has wide exposure to discover
issues as quickly as possible. If this is not resolved before
the end of the 1.29 release cycle it should be turned off again.

Bug: T124742
Change-Id: I3c3dedaa9a9d449eaa2b7e5d24b4540e7fa421c0
2017-04-12 21:07:37 -07:00
Timo Tijhof
0beaa51bb1 wikibits: Remove methods deprecated since 1.17 and 1.18
Keeping only importScript and friends and addOnloadHook for now.

Inline wikiUrlencode logic so that the dependency on mediawiki.util can be
removed, which caused significant performance overhead (See I54f087655e1c).

Follows-up:
* 68fae478a8 (1.22; deprecation warnings for ua vars)
* ec69391a4f (1.22; deprecation warnings for jsMsg)
* fcf4934a52 (1.23; deprecation warnings for the rest)

The following have been deprecated since either 1.17 or 1.18. Deprecation
warnings were added in 1.22. Most of these variables have also been replaced
with dummy placeholders in 1.22 so that calling code is silently disabled
instead of causing cascading failures into other code. Anything still using
these variables to date has been broken since at least April 2013.

* User-Agent variables:
  is_gecko, is_chrome_mac, is_chrome, webkit_version, is_safari_win, is_safari,
  webkit_match, is_ff2, ff2_bugs, is_ff2_win, is_ff2_x11, opera95_bugs,
  opera7_bugs, opera6_bugs, is_opera_95, is_opera_preseven, is_opera, ie6_bugs.
  (deprecated since 1.17; warnings and hardcoded to false since 1.22)
  clientPC
  (deprecated since 1.17; warnings added in 1.22)

* DOM manipulation:
  changeText, killEvt, addHandler, hookEvent, addClickHandler, removeHandler,
  getElementsByClassName, getInnerText.
  (deprecated since 1.17; replaced with no-op warning dummies in 1.22)

* Checkbox utilities:
  setupCheckboxShiftClick, addCheckboxClickHandlers.
  (deprecated since 1.17; replaced with no-op warning dummies in 1.22)

* Classic toolbar utilities:
  mwEditButtons, mwCustomEditButtons
  (deprecated since 1.17; replaced with no-op warning dummies in 1.22)

* Misc utilities:
  - injectSpinner, removeSpinner, escapeQuotes, escapeQuotesHTML, jsMsg
    (deprecated since 1.17; replaced with no-op warning dummies in 1.22)
  - addPortletLink, appendCSS, tooltipAccessKeyPrefix,
    tooltipAccessKeyRegexp, updateTooltipAccessKeys
    (deprecated since 1.17; warnings added in 1.22)

Bug: T122755
Change-Id: I7f9f61ea81ad1efa0b5cff79b5e5f4bbe2d401fe
2017-04-11 12:50:13 -07:00
Timo Tijhof
edd4985b72 Remove support for jquery.placeholder shim
Browser support according to MDN:
* input placeholder:
  - Chrome 10
  - Firefox 4
  - IE 10
  - Opera 11.00
  - Safari 5.0

* textarea placeholder:
  - Chrome
  - Firefox 4
  - IE 10
  - Opera 11.50
  - Safari 5.0

<https://developer.mozilla.org/en/docs/Web/HTML/Element/input>
<https://developer.mozilla.org/en/docs/Web/HTML/Element/textarea>

Bug: T159911
Change-Id: I388e99c5760681049abbe8d9c173b83af9121b02
2017-04-04 02:52:30 +00:00
James D. Forrester
09fcee6110 startup: Drop JavaScript support for ES3-only browsers
Bug: T128115
Change-Id: I95400637d1b85d2c607cd91bcb39ce21733295c8
2017-04-03 19:04:08 -07:00
Prateek Saxena
35f70a240a Rename CategorySelector to CategoryMultiselectWidget
For consistency.

Bug: T161285
Change-Id: I7c9e0089ba6b77f4bc73e14b989630487f6f3174
2017-03-28 15:53:18 +05:30
Timo Tijhof
2bbce5264b qunit: Remove experimental CompletenessTest feature
The CompletenessTest was my attempt at measuring a basic code coverage
using run-time inspection instead of static instrumentation.

Originally added in 540419a82e (2010; MediaWiki 1.17).

It was never finished, remained fairly buggy and disabled by default.
It is also no longer used anywhere.

Bug: T155194
Change-Id: I26e7466426dddb43596f402e31005a89060c1b96
2017-03-24 17:33:40 -07:00
Roan Kattouw
cfbbc8daa4 RCFilters UI: Pass in userId to ChangesListHighlights schema
Bug: T160928
Depends-On: Ia2bc679e37deb34b215ad16dfc3b8cfefdc8365c
Change-Id: I9d3f9281c2681ab1c89676234ddd544f76f3dc7f
2017-03-22 15:09:10 -07:00
Moriel Schottlender
c93784a3c6 RCFilters: Normalize overlay font-size for Monobook
Bug: T161033
Change-Id: Ia2215046f6d3fd026ecd1b27625cb94e806ababf
2017-03-21 16:00:59 -07:00
jenkins-bot
f3400d2195 Merge "Remove the localStorage replication of the block cookie" 2017-03-20 23:16:32 +00:00
jenkins-bot
83aaaa24c9 Merge "Revert "RCFilters: Change reset button title when it changes state"" 2017-03-20 22:00:30 +00:00
Catrope
ef41ed0e80 Revert "RCFilters: Change reset button title when it changes state"
It makes no sense to add a tooltip to a button that already
has text, especially if the tooltip text is (almost)
the same as the button text.

This reverts commit 31047fb1bf.

Change-Id: I2f9c819a85fc05f37c7c0c5acf2d72319bdb0d76
2017-03-20 21:43:32 +00:00
jenkins-bot
21a7aa4ff5 Merge "mediawiki.widgets: Remove autoEllipsis() from TitleOptionWidget" 2017-03-20 21:35:43 +00:00
Moriel Schottlender
31047fb1bf RCFilters: Change reset button title when it changes state
The button changes state between 'restore default filters' and
the trash icon which is to remove all selected filters.

The title for the button should also change accordingly.

Change-Id: I9070f0c4959f5c7c97d57d943103ae2baf89d6d2
2017-03-20 11:21:16 -07:00
Timo Tijhof
ac817da014 mediawiki.widgets: Remove autoEllipsis() from TitleOptionWidget
Redundant with CSS 'text-overflow: ellipsis', which is already applied.

Aside from ellipsis overflow, autoEllipsis() was also serving as indirect
caller of `highlightText( option.matchText )` and `attr('title')`,
which we want to keep, so leave that in its place.

Bug: T160804
Change-Id: I550183750d66d769cc9c960150a2349d1b9181aa
2017-03-20 10:55:49 -07:00
jenkins-bot
f92515d697 Merge "RCFilters UI: Implement conflict global result message" 2017-03-18 02:01:52 +00:00
Moriel Schottlender
509cb1b47c RCFilters UI: Implement conflict global result message
Bug: T156427
Change-Id: I7ae968477091db37e3e2d17fca6f212f919d90d8
2017-03-17 18:16:26 -07:00
jenkins-bot
cff581a00f Merge "RCFilters UI: Create tooltips for filter states" 2017-03-18 01:05:30 +00:00
jenkins-bot
6b408fa3da Merge "Mark 'jquery.autoElllipsis' module as deprecated" 2017-03-18 00:50:14 +00:00
Roan Kattouw
8fd37d3832 RCFilters UI: Create tooltips for filter states
Tooltips represent the state of the filter, whether it is
conflicted, included, or fully covered.

If none of the above, tooltip message falls back on displaying
the description of the filter.

Bug: T156864
Change-Id: Ic97c7c6aae78bb6ddf51f0294eeae4b7f86a1a1d
2017-03-17 17:42:26 -07:00
jenkins-bot
bf79a09a71 Merge "resourceloader: Fix broken 'deprecated' string messages" 2017-03-18 00:38:43 +00:00
Timo Tijhof
ac9308de40 Mark 'jquery.autoElllipsis' module as deprecated
It was originally introduced for jquery.searchSuggest, which hasn't
used this since 2014 (56a4aff8ca) when it was removed for
performance reasons (T61172) in favour of CSS text-overflow.

Deprecation is done the same way as for 'jquery.arrowSteps'.

Bug: T160804
Change-Id: Ib7b37b94200a8802de9d98581d3cb42df6e5ba17
2017-03-17 17:33:59 -07:00
Timo Tijhof
8a7fb8577f resourceloader: Fix broken 'deprecated' string messages
Some used a string value, others an array with 'message' property.
Standardise on the string value, which seems more intuitive.

Change-Id: I5caead7b7017d2bad660db02fb45a54a26bf3728
2017-03-17 17:23:34 -07:00
Timo Tijhof
f53fd6fd47 Remove unused 'jquery.arrowSteps' (deprecated in 1.28)
Was only used by UploadWizard, and no-where else in Wikimedia Git.
UploadWizard has its own copy as of last year. (T144974)

Change-Id: I3d426f67f8ba061d10434469f261cb725bd672d6
2017-03-17 17:13:26 -07:00
jenkins-bot
db16d59db8 Merge "RCFilters UI: Add a 'what's this?' link to filter groups" 2017-03-17 20:05:22 +00:00
Moriel Schottlender
2b4666ed2e RCFilters UI: Add a 'what's this?' link to filter groups
Bug: T159186
Change-Id: I347c23fdabab2a1e1c52f5b10995bcbb2a316875
2017-03-17 19:47:27 +00:00
Sam Wilson
6e7c7f9d76 Remove the localStorage replication of the block cookie
The block cookie was being replicated to localStorage in an attempt
to make it harder for users to get around the block by deleting the
cookie (and changing IP addresses).

This whole setup was hard to test, had a few bugs (e.g. the localStorage
value would never expire), and given that it is a minor improvement
over just a plain cookie, it is now being removed. The cookie is only
intended to stop casual block-evaders (other users will get around it
by deleting the cookie or using incognito mode) and so it is not felt
worth having the extra complexity that will only guard against people
who know to remove cookies, not use incognito mode, and yet don't know
to remove localStorage.

Bug: T152952
Change-Id: Ifb06dc2390f4d648d7fcb39e30267de5eddc6941
2017-03-17 11:58:48 -07:00
Brad Jorsch
d7e06fe0aa Add password validation to Special:ChangeCredentials
Change-Id: I70a99f4e742a2ba9ade0348001924fc5a50428d4
2017-03-16 15:42:24 +00:00
Brad Jorsch
4d59edf138 Update account creation form validation
Use the cancreateerror returned from list=users&usprop=cancreate for
username validation.

Use the new action=validatepassword to validate entered passwords.

This also injects the resulting errors in the style of HTMLForm's field
validation rather than at the top of the form.

Change-Id: Ie8c1270eb605367556fe36b0b2080eb3f957dc54
2017-03-16 15:42:06 +00:00
jenkins-bot
cb2e21ca43 Merge "Skin: Only load jquery.makeCollapsible if needed" 2017-03-15 17:58:03 +00:00
jenkins-bot
24e421e2a2 Merge "Minor fixes for second sister search AB test" 2017-03-14 16:12:38 +00:00
Jan Drewniak
dfac17c488 Minor fixes for second sister search AB test
These are a few minor fixes to improved the
UX of the new sister search sidebar.

- Making the link color on sister search results blue
- Fixing the order of the multimedia search results widget
- added a more explicit 'more results' message instead
of the current '(more)' message.
- aligning the top of the sidebar with the top of the regular
search results.
- fixing a typo in the multimedia widget.

Bug: T158935
Change-Id: Iaae603cc217b7847bebfa61b050b7c86bdd19f14
2017-03-14 12:26:28 +01:00
Matthew Flaschen
aa063f4c5a Back-end of new RecentChanges page, refactoring
Generate old RC, Related changes (it was already displayed and working
on 'Related changes' before this change), and Watchlist/etc. and data
for new UI from back-end.

This moves everything used for defining the old (unstructured) and new
(structured) filters into unified objects, ChangesListFilter and
ChangesListFilterGroup (and sub-classes).

This includes the query logic (see below) and logic for adding
CSS attribution classes.

This is a breaking change (for subclasses of ChangesListSpecialpage)
due to the signature (and name) change of buildMainQueryConds and
doMainQuery.  An alternative that I don't think is a breaking change
would be to put the filter->DB logic in runMainQueryHook, but then it's
doing more than just running a hook.

This is because it used to only build $conds here, but it's clear from
filterOnUserExperienceLevel filters need more than this.  I added all
the DB parameters from the hook, but this could be debated.

I have an checked and fixed the WMF-deployed extensions affected by
this.

Other than that, there should be full back-compat (including legacy
filters not using the new system).

* add hidepatrolled/hideunpatrolled to new UI.

* Move userExpLevel from RC to ChangesListSpecialPage.  Although for
now the structured UI only displays on RC anyway, when it displays on
watchlist, it seems we'll want userExpLevel there.

  Change this to make 'all' exclude unregistered users.

* Don't have front-end convert none-selected to 'all' on string_options.

* Needs the hideanons/hideliu special redirect to be done before this
is merged (T151873)

Bug: T152754
Bug: T152797
Change-Id: Iec2d82f6a830403d1c948a280efa58992e0cdee7
2017-03-11 01:42:01 +00:00
Timo Tijhof
692bf795a9 Skin: Only load jquery.makeCollapsible if needed
Currently, module 'jquery.makeCollapsible' is loaded on all pages
regarless of whether the page contains any collapsible elements.

It is required via 'mediawiki.page.ready'. Change this to lazy-loading
when needed only.

However, this lazy-load is discovered very late (after page ready,
after modules ready). To avoid regressing UX with an annoying reflow
of content and a very late hiding of collapsed elements, still
enqueue it in the main module loader by default on pages that
contain collapsible content server-side.

Bug: T159911
Change-Id: I4703ecd52d2d60207ba39108a4b3ef4aa1570965
2017-03-08 20:25:59 +00:00
jenkins-bot
47d2b3d82a Merge "RCFilters UI: Add 'highlight' icon to highlight button" 2017-03-08 01:29:22 +00:00
Moriel Schottlender
a07385a2dc RCFilters UI: Add 'highlight' icon to highlight button
Bug: T149467
Change-Id: Iba11de7ba47e41046631dbf16f464f8bd3820811
Depends-On: I0b5adaaec52f9cc01c3dfb6262adaf2da368476e
2017-03-08 01:17:40 +00:00
jenkins-bot
4365234401 Merge "RCFilters UI: Add tooltip to highlight menu" 2017-03-07 02:19:49 +00:00
Moriel Schottlender
d385d18d20 RCFilters UI: Add tooltip to highlight menu
Bug: T159587
Change-Id: Iae5e050fd721d8c51d0b6c150d039c7f2ed6647d
2017-03-07 02:10:11 +00:00
Roan Kattouw
3575c181a0 RCFilters UI: Fix double-loading of mw.rcfilters.less
Change-Id: I424d4f84bb17a54980b311da7db9fdbb5ce56530
2017-03-06 15:49:47 -08:00
jenkins-bot
b72a6e0a9e Merge "Add missing dependency from 'mediawiki.user' to 'mediawiki.storage'" 2017-03-06 20:53:06 +00:00
Bartosz Dziewoński
869b8d4e7c mw.special.block: Add missing dependency
Bug: T159741
Change-Id: Iff4686b9d5411675582426b3264b88e49baf1f74
2017-03-06 21:31:32 +01:00
Fomafix
2b5f00be22 Add missing dependency from 'mediawiki.user' to 'mediawiki.storage'
Follows-up 213cdfbec8.

Change-Id: I2fb1ae48eade34e5df640313b7976541655f2a79
2017-03-06 20:02:19 +01:00
Brad Jorsch
b9c17438d9 Fix mediawiki.action.edit.collapsibleFooter dependencies
Ie9a4612de changed it to use mw.storage, but didn't update the
dependencies. So if nothing else happened to load mediawiki.storage
already, it blows up.

Change-Id: Id276a29d914dacd1d176469db542b41ce6498ea1
2017-03-06 12:32:48 -05:00
James D. Forrester
d7212e6cfb startup: Drop JavaScript support for browsers without DOM Level 2
In practice, this means nothing, as the main browsers affected
were Internet Explorer 8 and early versions of Android (before
1.6), which are already Grade C.

Change-Id: I4488402686c8b9fefa0af5fed3c9a4b83cbff798
2017-03-03 00:08:33 +00:00
Moriel Schottlender
658af7f47f RCFilters: Add loading animation
Change-Id: I09d39a387eb1ed2fe4c1292f0a255d180035baa0
2017-03-01 10:41:18 -08:00
Roan Kattouw
8061012c0b RCFilters UI: Add popup footer with feedback link
Bug: T150959
Change-Id: Id10c39222a3d3d65d4ab1d006123f93b9972288f
Depends-On: Ie947ebe5d43da25e10119a34a736762b3fff5659
2017-02-28 10:29:47 -08:00
Moriel Schottlender
9cd003fb87 RCFilters UI: Style the 'old' RC option fieldset
Bug: T158006
Change-Id: I230dc9095e41abf32e95adc68c40265b53a5f698
2017-02-24 00:55:02 +00:00
Stephane Bisson
09e441003b RCFilters UI: Highlight behavior
Let there be highlight! and there were highlights
And RCFilters separated the highlight from the darkness
And it defined highlights as five colors
The lights are called yellow and green, and the darks red and blue
And there were colors and there were circles; one highlight.

This is the commit that adds highlight support for filters both in the backend
and the UI. The backend tags results based on which filter they fit and the
front end paints those results according to the color chosen by the user.
Highlights can be toggled off and on.

Also added circle indicators to the capsule items and each line of results
to indicate whether the line has more than one color affecting it.

Bug: T149467
Bug: T156164
Change-Id: I341c3f7c224271a18d455b9e5f5457ec43de802d
2017-02-23 10:58:56 -08:00
Moriel Schottlender
b279eedd59 Split RCFilter's RL modules
Create 'dm' / 'ui' and 'controller' modules for ResourceLoader,
make sure that Special:RecentChanges loads 'ui' module (that
depends on the other two) and yet the qunit tests only load
the dm module.

Bug: T156532
Change-Id: If53a735458703f0bd2c094349edf86f38f05ccd7
2017-02-17 17:34:06 -08:00
Stephane Bisson
b516b80750 RC filters: AJAX and pushState/popState
Selecting/unselecting a filter now refreshes the results list using AJAX.

Also added pushState to update the URL, and popstate handling
to make the back button work.

Bug: T153949
Change-Id: I8c1ec557ccfe4b1d20aaaab3ef0d3182a1993f24
2017-02-09 17:10:24 +00:00
James D. Forrester
f13a0d9521 resources: Bump moment.js from 2.8.4 to 2.15.0
Languages and locales now with support:
* aeb-arab
* dv
* fy
* gd
* jv
* kk-cyrl
* ky
* lo
* ms
* pa
* se
* si
* ss
* sw
* te
* zh-hk

Skipped languages because we don't support them in MW:
* ar-ly
* en-ie
* en-nz
* es-do
* fr-ch
* me
* tlh
* tzl

Change-Id: I7f89569c6ee6640d368af1378e84c5a9e725da0d
2017-02-08 20:17:46 +00:00
Moriel Schottlender
f1f34d096b RCFilters UI: Add popup for capsule items
Change-Id: Icdb5ef84929e5f7bf504e99f6e6987ef4e73ae60
2017-02-07 23:01:11 +00:00
jenkins-bot
e92ea2ef79 Merge "Make 'groups' a data model in the FiltersViewModel" 2017-02-06 11:59:14 +00:00
Moriel Schottlender
1ac69cd38d Make 'groups' a data model in the FiltersViewModel
Transform the groups Object to a full data model that
handles events, and connect the FilterGroupWidget to
its model for responding to these events.

Bug: T156533
Change-Id: Iebde3138e16bac7f62e8f557e5ce08f41a9535cb
2017-02-05 18:08:02 -08:00
jenkins-bot
ec84fa3d7d Merge "Displaying interwiki results in sidebar" 2017-02-03 19:04:54 +00:00
Jan Drewniak
d78a470fcd Displaying interwiki results in sidebar
Displays newly designed interwiki search results in the
sidebar of the specialSearch page.

A prototype of this change can be viewed on this labs url:

http://sistersearch.wmflabs.org/w/index.php?title=Special:Search&search=mars

Bug: T149806

Change-Id: I66e4b6a502dae488d105f11cad73e145990c2327
2017-02-03 18:18:20 +01:00
jenkins-bot
fb52b78920 Merge "UsersMultiselect widget and form field." 2017-02-01 14:37:50 +00:00
Phantom42
c70f464c07 UsersMultiselect widget and form field.
New widget and html form field, which allows selecting multiple
users using convenient single-line input (CapsuleMultiselectWidget)

Bug: T131492
Change-Id: I7b6ffe7fb47e0a7083e2a956156ab0f142444398
2017-02-01 00:35:33 +02:00
This, that and the other
73224f4f8b User group memberships that expire
This patch adds an ug_expiry column to the user_groups table, a timestamp
giving a date when the user group expires. A new UserGroupMembership class,
based on the Block class, manages entries in this table.

When the expiry date passes, the row in user_groups is ignored, and will
eventually be purged from the DB when UserGroupMembership::insert is next
called. Old, expired user group memberships are not kept; instead, the log
entries are available to find the history of these memberships, similar
to the way it has always worked for blocks and protections.

Anyone getting user group info through the User object will get correct
information. However, code that reads the user_groups table directly will
now need to skip over rows with ug_expiry < wfTimestampNow(). See
UsersPager for an example of how to do this.

NULL is used to represent infinite (no) expiry, rather than a string
'infinity' or similar (except in the API). This allows existing user group
assignments and log entries, which are all infinite in duration, to be
treated the same as new, infinite-length memberships, without special
casing everything.

The whole thing is behind the temporary feature flag
$wgDisableUserGroupExpiry, in accordance with the WMF schema change policy.

The opportunity has been taken to refactor some static user-group-related
functions out of User into UserGroupMembership, and also to add a primary
key (ug_user, ug_group) to the user_groups table.

There are a few breaking changes:
- UserRightsProxy-like objects are now required to have a
  getGroupMemberships() function.
- $user->mGroups (on a User object) is no longer present.
- Some protected functions in UsersPager are altered or removed.
- The UsersPagerDoBatchLookups hook (unused in any Wikimedia Git-hosted
  extension) has a change of parameter.

Bug: T12493
Depends-On: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
Depends-On: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Change-Id: I93c955dc7a970f78e32aa503c01c67da30971d1a
2017-01-27 09:24:20 +00:00
jenkins-bot
0a15b1785f Merge "ApiSandbox: Allow displaying query parameters in various formats" 2017-01-26 17:46:03 +00:00
jenkins-bot
69ebd59830 Merge "RCFilters UI: Add 'remove' and 'restore defaults' to filter list" 2017-01-25 05:57:02 +00:00
Moriel Schottlender
dc3a4da2c5 RCFilters UI: Add 'remove' and 'restore defaults' to filter list
Bug: T144448
Bug: T149391
Change-Id: I418ad6b34ae8a7456a7e66bc703d4dccf36764a5
2017-01-25 15:18:15 +11:00
Roan Kattouw
b3ed469f15 rcfilters: Remove implemented filters from list of links
This is a bit hacky because the filter name needs to be inferred
from the class on each span, and because the separators aren't
wrapped.

Change-Id: Ib39ad435d3b48fa38533926e4ab49942c3bd5d6f
2017-01-24 15:35:10 +11:00
Brad Jorsch
fe1e817d2a ApiSandbox: Allow displaying query parameters in various formats
I9c24a230 added a box with a JSON-formatted version of the request
parmeters, saying "In the future we can provide more formats via a
dropdown". That future should have been then. It is now.

Beyond simply making it possible to select the format via a dropdown,
this change adds a JS hook, apisandbox.formatRequest, to allow adding
new formats from extensions, gadgets, and site scripts instead of
requiring them all to be added to core.

Change-Id: I20b093e0891f36cb3f1faa3eb3d6aed0f17b6b7d
2017-01-23 15:30:44 +00:00
jenkins-bot
cf3deb6637 Merge "Revert "ApiSandbox: Display params as JSON on request page"" 2017-01-22 18:38:46 +00:00
Florianschmidtwelzow
4b49705613 Revert "Added reason suggestion in block/delete/protect forms"
See the task, this was probably entirely my fault not having
looked at this more carefully. Technically the change is ok,
however, it seems to doesn't make much sense in combination
with the Reason dropdown box.

This reverts commit faab2411c2.

Task: T34950
Change-Id: I1eeb9c68ff0db20d29e7d5f0fb18f0bfa3224416
2017-01-21 20:03:45 +01:00
jenkins-bot
f9090467a5 Merge "Use parsed HTML error responses instead of api-error-*" 2017-01-19 09:59:33 +00:00
Roan Kattouw
e3da2e2319 mediawiki.rcfilters: Add the remaining MW core filters
Add JSON definitions and i18n messages.

Bug: T149452
Change-Id: I287e9e5db9ff625bde026056efc81ce4b2401607
2017-01-19 00:30:45 +00:00
Matthias Mullie
e8d7173e9f Use parsed HTML error responses instead of api-error-*
There is no point in keeping these api-error- messages.
They were originally introduced in UploadWizard, then moved
to core, where nothing else (apart from some in BookletLayout)
uses them. They are mostly duplicates of other messages in
core, and these are very easy to miss when updating a message
in core.

Instead of building the messages on the frontend, we're much
better off requesting a parsed error response from the API
right away. This also lets us get rid of sime hacks (e.g. for
AbuseFilter)

And then a few other api-error-* messages have been removed
in favor of their alternatives (which are also used elsewhere)

And stashfailed is not a warning. Maybe it was at some point,
but stashfailed now dies with an error.

Bug: T47843
Change-Id: I41d88e2aad308a1fecd10d97085345a17d0c3603
2017-01-17 09:53:05 -08:00
Bartosz Dziewoński
205231d7da HTMLDateTimeField: Remove hacks for HTML5 form validation attributes
No longer needed after I08244addcf9b6eb96137895f28e7b750914fef5c.
Also remove datetime.js from mediawiki.htmlform module.

Change-Id: Ic2410c689de3f70f573fa1c71456e6d3f334f80b
2017-01-10 22:53:33 +00:00
rlot
faab2411c2 Added reason suggestion in block/delete/protect forms
Bug: T34950
Change-Id: I9778c4992b127c36355949665b4fdf7482e7e0e7
2017-01-10 21:18:51 +00:00
Moriel Schottlender
091551b5af Add userExpLevel filter in the RCFilters UI
Bug: T149435
Change-Id: I6a19d4b24c45068dbd9ddb8a36a0f8a87868b912
2017-01-05 12:13:04 -08:00
Moriel Schottlender
873d3c9ffc Adding new interface for review filters to RecentChanges
Add a new filter experience to Special:RecentChanges with
a drop-down filter menu. Put it behind the rcenhancedfilters
preference, which is hidden for now.

Bug: T149435
Bug: T149452
Bug: T144448
Change-Id: Ic545ff1462998b610d7edae59472ecce2e7d51ea
2017-01-05 01:14:08 +00:00
Bartosz Dziewoński
b6bb8c6d9a Revert "ApiSandbox: Display params as JSON on request page"
This reverts commit 8bc0e7ca17.

Change-Id: Ie60b7718161db483ff391f3b5dcc117af83fe2e4
2017-01-04 16:13:54 +00:00
jenkins-bot
056214ccdb Merge "ApiSandbox: Display params as JSON on request page" 2017-01-03 20:47:06 +00:00
Ed Sanders
8bc0e7ca17 ApiSandbox: Display params as JSON on request page
In the future we can provide more formats via a dropdown
(e.g. PHP object notation, MW formatted javascript, ...)
but for now JSON is a very commonly used format, and easily
adaptable.

Bug: T130501
Change-Id: I9c24a2309d2474e9543e2b577fe90d160a1b6cbc
2016-12-28 12:27:33 +00:00
Phantom42
3430f519bd Fix rendering issues on RecentChanges Special page
Legend is rendered correctly now, fixed namespace checkboxes
behaviour, fixed styles of the changes list.

Bug: T112693
Change-Id: If2c5701587eee50a6d578459f6b38b6f16cd5fe9
2016-12-25 00:28:36 +02:00
Amir E. Aharoni
58612ee9fa Move the Ukrainian grammar rules from PHP and JS to JSON
Bug: T115217
Change-Id: I15a06b07e381cc9074e64e746d22ec51e9e638c4
2016-12-18 11:10:16 +00:00
jenkins-bot
94224eda67 Merge "Make the code for grammar data processing common" 2016-12-18 11:06:38 +00:00
Timo Tijhof
8af16939fd mediawiki.searchSuggest: Remove inline browser compat check
Introduced in 1f987fb5ee.

This is quite dated and obsolete since then. The current code in
the 'mediawiki.searchSuggest' and 'jquery.suggestions' works fine
in all currently supported Grade A browsers (per startup.js).

Change-Id: I6d281459e230fa6a2971a31314f9e963dc83ff2b
2016-12-17 01:29:30 +00:00
Amir E. Aharoni
6b03e2e88e Make the code for grammar data processing common
This makes the code for processing JSON files with
grammar transformations reusable by different languages
and applies the same logic to Russian and Hebrew.
It will be done to other languages in further patches.

This patch is not supposed to change any functionality,
and the tests are intact (except a comment in the test
for Hebrew - the class doesn't exist any longer).

PHP:
* Move the JSON grammar transformation data processing logic
  from LanguageRu.php to convertGrammar() in Language.php.
  By default all these data files are supposed to be
  processed identically, so the code should be common.
  If there is no JSON data file, nothing new happens.
* LanguageRu's own convertGrammar() method is removed.
* The LanguageHe class is removed, now that all its functionality
  is handled by generic JSON data processing in the Language class.
  LanguageHe.php file is removed from the repo and from autoloading.

JavaScript:
* Move the JSON grammar transformation data processing logic
  from ru.js to mediawiki.language.js.
* JavaScript grammar code files he.js and ru.js are removed
  from the repo and from Resources.php, because all the data
  is in JSON, and the default logic in mediawiki.language.js
  works for both languages.

Bug: T115217
Change-Id: I5e75467121c3d791bb84f9e6fdfcf07c1840f81a
2016-12-16 15:52:14 +02:00
Geoffrey Mon
73592aea1c Don't show dialog to confirm whether to reset watchlist
People don't seem to like having a dialog to ask for confirmation to set all
pages to visited in the watchlist, and the PHP server-side reset
functionality doesn't ask for a confirmation anyways.

Bug: T153438
Change-Id: I92aa3c0670925efc691d8bdba2c1c503e17ddb8c
2016-12-16 14:30:42 +01:00
Geoffrey Mon
9ea1142fad Mark pages on watchlist as visited using JS without reload
When the "mark pages as visited" is clicked, a dialog appears,
asking for confirmation. On confirmation, an API request is sent
to mark all pages as visited, and all unvisited watchlist entries
are changed to appear visited.

Based on a userscript by User:NQ (from English Wikipedia)
https://en.wikipedia.org/wiki/User:NQ/WatchlistResetConfirm.js

Bug: T150045
Change-Id: I45fb02a1edc1b0331925e9a244a2455f86ad3886
2016-12-12 20:00:06 +00:00
Geoffrey Mon
b9c8a8d03d Move Special:Watchlist auto-reload check from PHP to JS
This makes the watchlist js load all the time, instead of only
if the auto-reload preference is set, so we can put other things
in the same js module.

Bug: T150045
Change-Id: Ib8acca39593fe3d2369dc3187a9a55413553843d
2016-12-11 14:29:41 -05:00
Brad Jorsch
1f15d1d582 API: More i18n cleanup
* Use errorformat for action=login Failed responses in non-BC mode.
* We removed 'messageHtml' from action=rollback's response on error, but
  left it for success. Remove it there too, it's even less useful.
* We changed action=watch's reporting of errors, but left the
  mostly-pointless reporting of "success" UI messages. These should be
  handled on the client side.

Change-Id: Ia6c402a4254fbacf4c2c3f125ce8bf0bcc71e509
2016-12-08 21:25:38 +00:00
Ed Sanders
5ee5ae6f69 Move link-underline user preference rule to body class
ResourceLoaderUserCSSPrefsModule is now empty and can be removed.

Change-Id: I806e117131765b859e990c14735bb9494db9a37e
2016-12-02 11:25:03 -08:00
Ed Sanders
5aa030a9fb Bring in MediaSearchWidget from VE
Bug: T140166
Change-Id: If53ef7f4b62c7a5d4da565c14dd2a353778694e5
2016-11-29 17:10:02 +00:00
jenkins-bot
3290c9e151 Merge "ApiSandbox: Support 'all' specifiers" 2016-11-23 19:00:27 +00:00
Ed Sanders
edf4dfe756 Add exceptions in mw.Title where mb_strtoupper doesn't match String.toUpperCase
Bug: T147646
Bug: T141723
Change-Id: Ic7a3d0cebbf4aec507db195ba8f587cecc1992aa
2016-11-23 18:45:44 +01:00
jenkins-bot
87c3b700ac Merge "mw.widgets.CategorySelector: Add placeholder text" 2016-11-23 13:09:29 +00:00
Peter Hedenskog
fd5c3b5817 Remove JSON polyfill, deprecate 'json' module
All A-graded browsers now supports JSON so skip the
JSON polyfill. Krinkle investigated the current
status for 3 months on Wikimedia traffic (T141344#2784065)
with support being nearly 100%.

Bug: T141344
Change-Id: I8280faf1cbcd876ead2dafae4347b7d46e3e2acb
2016-11-22 23:28:19 +00:00
Prateek Saxena
b201298c54 mw.widgets.CategorySelector: Add placeholder text
Bug: T147813
Change-Id: Ic8aacf41b9d9f91808664af898e7752904276c2a
2016-11-23 03:57:11 +05:30
Brad Jorsch
25bbaf41c5 ApiSandbox: Support 'all' specifiers
Change-Id: I43972b6a4236c87772ed50a7787c43edb795bed8
2016-11-22 12:19:12 -05:00
Timo Tijhof
189c906062 resourceloader: Remove unused getPosition() code
Unused as of bc374082fa (T109837).

Change-Id: I1d8f7109bbe49700f1824fdce0439e958e84f6fa
2016-11-18 19:02:12 +00:00
Tyler Anthony Romeo
1cc3a57296 Send a cookie with autoblocks to prevent vandalism.
Send a cookie with blocks that have autoblock turned on so that
the user will be identified to MediaWiki and any IP they try
to edit anonymously from will be blocked, even without logging
in to the originally blocked account. Additionally, the block
info is stored in local storage as well as an even stronger
deterrence.

Note: this is meant to deter normal vandals, i.e., not attackers
who know what cookies and local storage are and will be actively
removing the cookie.

This feature is disabled by default, and can be enabled with the
new $wgCookieSetOnAutoblock configuration variable (by setting
it to true);

The cookie will expire at the same time as the block or after
$wgCookieExpiration (whichever is sooner).

Bug: T5233
Bug: T147610
Change-Id: Ic3383af56c555c1592d272490ff4da683b9d7b1b
2016-11-16 10:29:46 -08:00
Brad Jorsch
c0821b20aa ApiSandbox: Add text about limit's "max" value
In action=help this is reflected by the "Type" field, but that field
isn't displayed in ApiSandbox.

Change-Id: I7e491acc8ba7fdc3463f3cf1656b13fb3949d7d3
2016-11-14 12:05:31 -05:00
Brad Jorsch
44f8496104 API: Pretty-printed responses should always use HTTP status 200
To accomplish this, the responsibility for setting the HTTP status code
in the response is moved to ApiFormatBase.

This also adds a line to the pretty-printed response and to ApiSandbox's
output to indicate the status that would be used.

Bug: T150344
Change-Id: Iaf0698ee1b93565d9b02b5a9aa8f93ceb135658b
2016-11-09 12:03:40 -05:00
jenkins-bot
afb713a1fa Merge "Enable APISandbox code on mobile" 2016-10-14 13:07:39 +00:00
jdlrobson
8f3a8ad533 Enable APISandbox code on mobile
It's a special page and only uses mobile vetted code
so completely fine to load this on mobile

That said the visual display needs a lot of work but that
can be remedied in a follow up.

Bug: T148049
Change-Id: I2a8424e7c348bd5283aba99d1a81bb259d7e54c5
2016-10-13 10:36:22 -07:00