Commit graph

5266 commits

Author SHA1 Message Date
Timo Tijhof
15b88fc280 jquery.makeCollapsible: Restore considering empty <a> as part of toggle
Before 2d95d36a8e, clicks on links inside toggles with non-empty
targets that are not '#', were ignored ("pass through") since they
are not intended for the toggle.

In 2d95d36a8e, this was simplified to ignoring clicks from all <a>
elements inside toggles. However this ignored too much as links
without 'href' attribute are also sometimes used inside toggles
to look like links and have no href-target, which means clicking
them does nothing and is in fact meant to toggle the element.

Restore previous behaviour and restore previous test + add a new
test for this specific case.

Bug: T166298
Change-Id: Ia3a0648f809f94be0977a83b469fbd184aa72aff
2017-05-25 21:23:17 +00:00
jenkins-bot
0506b18121 Merge "Fix version of DonationInterface deployed to donatewiki" 2017-05-25 20:44:53 +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
Timo Tijhof
b3fb2770d1 mediawiki.page.watch: Deprecate mw.page object
Let's deprecate the mw.page object in the same way we did with mw.special.

mw.page.watch is the only property that exists inside mw.page, and it's mostly
internal. Let's expose that via module.exports instead (for use by Wikibase
and VisualEditor).

Change-Id: I0e6a95bd4fbaba06eae5137ac7af84f62bebf6f0
2017-05-23 20:04:45 +00:00
Fomafix
c89a97409a Create object mw.page in watch.js
The object mw.page is only used in watch.js and it is not intended to extend
this object by other modules because with module.exports exists a more
flexible way.

This change avoids the dependency on module 'mediawiki.page.startup'.

Change-Id: Ib717261c20856d048c67e2196e9dc619b72ab1db
2017-05-23 21:07:04 +02:00
jenkins-bot
f03eef77f4 Merge "Restore dependency on module 'mediawiki.page.startup'" 2017-05-23 18:49:18 +00:00
jenkins-bot
6cfbd6141c Merge "mediawiki.action.edit.preview: Enable 'useskin' mode for action=parse API" 2017-05-23 18:31:15 +00:00
Fomafix
ef456a7805 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
2017-05-23 20:01:51 +02: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
Timo Tijhof
5c249f53c0 mediawiki.action.edit.preview: Enable 'useskin' mode for action=parse API
Bug: T130632
Change-Id: Ie3615866e88aaca2ec117f3342d64357c22b2754
2017-05-21 19:06:43 +02:00
jenkins-bot
e91875e1eb Merge "Put print click handler on link, not on list item" 2017-05-21 15:45:41 +00:00
Brion Vibber
c72590ea6c Put print click handler on link, not on list item
Was responding to clicks outside the link, which was confusing.

Bug: T24256
Change-Id: I22f7cf20a08bb4204b0442defeb7cfb83899b969
2017-05-21 17:03:10 +02:00
jenkins-bot
0e9d9a1c14 Merge "Print: prefer JS print over printable version." 2017-05-21 13:32:21 +00:00
Derk-Jan Hartman
866b44bd89 Print: prefer JS print over printable version.
Bug: T24256
Change-Id: Ic3dc15e578ce4a94959285c9ae579e9088423544
2017-05-21 13:17:23 +00:00
jenkins-bot
33399b2971 Merge "ApiSandbox: Fix HTTP error handling" 2017-05-20 19:35:34 +00:00
Moritz Oberhauser
2d95d36a8e Allow more customization on the default toggle system
The naming convention remains unchainched. Default toggles are added if no mw-collapsible-toggle child element is present. Premade toggles have already one ore more mw-collapsible-toggle elements defined.

Default and premade toggles (mw-collapsible-toggle) still cannot be mixed/combined with remote toggles (mw-customtoggle).

* The default toggle got less rigid by removing dependency on <a> elements.
* Support for multiple premade toggles was introduced.
* The expand/collapse messages can be used by premade toggles via mw-collapsible-text.
* Removed the linksPassthru option. This step allowed merging premadeToggleHandler into actionHandler.
* The pass through functionality is now applied to all <a> elements since the default toggle does no longer depends on those.
* Removed mw-collapsible-bracket because it was not used and is deprecated by mw-collapsible-text.
* The test suite was adapted to reflect the latest changes.

Change-Id: Ic8627c4c185e8e4175e6fef1c8e1c2190e54edaa
2017-05-20 15:27:53 +02:00
Brad Jorsch
c7e60349bf ApiSandbox: Fix HTTP error handling
Since bf69459, ApiSandbox seems to stall out when an API request
results in an HTTP error (e.g. due to a PHP fatal error). Before that
revision, it displayed the 'apisandbox-results-error' message in this
situation.

Apparently the jQuery 3 changes to Deferred behavior caused it to be
impossible to have a then() filter return `this` (or anything else) in
order to avoid replacing the existing promise that's being resolved or
rejected.

Bug: T165857
Change-Id: I3f646cdfe7fe8987437980790788821f51e728d1
2017-05-20 13:21:56 +02:00
jenkins-bot
0be08c438f Merge "Use Devanagari digits for list items on ne.wikipedia" 2017-05-20 06:22:41 +00:00
Sébastien Santoro
f87b3b6886 Use Devanagari digits for list items on ne.wikipedia
Nepalese uses Devanagari, so we wish to use this alphabet for
list items' digits.

Bug: T151633
Change-Id: Id9cb42932fd8b8aa2cfb5418c4a3cd16ec37a60e
2017-05-19 16:36:22 +00:00
jenkins-bot
657aa49b87 Merge "MediaSearchWidget: Only resize new results" 2017-05-19 16:25:40 +00:00
Thalia
6547ac19a5 MediaSearchWidget: Only resize new results
When repositioning images based on the "change" event,
ignore images that have already been assigned to a row.

Bug: T163727
Change-Id: Ida7556d8848f98d97d82aef9caf5c1d43bb47d7b
2017-05-19 17:44:19 +02:00
Fomafix
8ef5a6709d Resources.php: Add missing dependencies to module 'mediawiki.user'
Change-Id: Ie68418a47d4b4b98fac2b275def392294bd01909
2017-05-17 18:24:40 +02:00
jenkins-bot
730bc6692e Merge "RCFilters UI: Actually backwards-compat instead of overriding false" 2017-05-17 09:40:10 +00:00
Moriel Schottlender
599d4d07f6 RCFilters UI: Actually backwards-compat instead of overriding false
Another typo in the code made highlight feature always load as false
when you loaded a saved filter.

Bug: T165437
Change-Id: I0e0efa3576659e4145b20013e4af7a06e4e7c0ff
2017-05-16 17:35:43 -07:00
James D. Forrester
e7e607e807 Update OOjs UI to v0.21.4
Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.21.4

Depends-On: I676c9aadbf4739437b94ec729cc4fe47ed19c886
Change-Id: Ie9f8e42c46948688495cbd80e778b484c7b03982
2017-05-16 23:34:01 +01:00
jenkins-bot
0d7607db15 Merge "Resources.php: Add missing dependencies to module 'mediawiki.util'" 2017-05-16 09:02:00 +00: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
930f8f7a4a RCFilters: Actually be consistent when storing 'highlight' state
Saved queries are storing *filter* definitions, not parameters, so
highlight state (dictating whether highlights are enabled) are supposed
to be stored as boolean.

A previous fix that was meant to make sure we store and handle all
*parameters* as strings '0' and '1' was a bit overzealous, and stored
highlight state in saved queries as '1' and '0' too. The current state
then compared that to the filter-state, which produces false/true.

This resulting in saved queries only being matched to the current
state as never true, because the comparison goes by actual obejct
key-values, not symbolic values.

Bug: T165381
Change-Id: Ifdec3a8c058a0e004304e48a857c58639928b36f
2017-05-15 19:46:12 +00:00
Moriel Schottlender
e37ebca631 RCFilters: Always put highlight values in the URL
Up until now, we only populated highlights in the URL if the item had
a highlight, otherwise it was not in the url at all. However, now that
the system can load defaults from saved queries that can have highlights
themselves, then every time we reload the page (and the system checks
to get defaults merged with the URL query) nothing actively overrides
the default highlight value if it exists.

This meant that if you have a saved query default with any highlights
in it, every time you load the page from the URL it will **also add**
the default highlights that you have saved.

To prevent this, the URL now needs to always populate items with
highlight value, even if that value is null. When we literally ask
for defaults or when we actively load a saved query, that value will
be overridden, but if we have a URL with highlights enabled at all,
the defaults will not override and add a redundany unneeded highlight
just because it existed in your saved query.

Bug: T165231
Change-Id: Ia43b5c777c0b4e238e99818696a3a60dda0daca9
2017-05-14 02:23:56 +00:00
Moriel Schottlender
ee5397eaa0 RCFilters: Fix getFilterRepresentation to consider '0' as false
Because '0' is a string, it's true, but for our purposes, it's
supposed to be false. Thanks JavaScript.

This bug was actually pretty horrific, it meant that when you refresh
the representation is all wrong (all items in the group were considered
true if the group was 'send_unselected_if_any' which meant that most
of those (that are full coverage) 'corrected themselves' to be all-false
which meant you lost filters when refreshing, even though the parameters
appeared in the URL (the url helpfully corrects itself based on the model
but the model was wrong.)

How did this pass unit tests, one might ask. Well, the unit tests were
treating parameter values as numbers, rather than strings, a fact that
is promptly fixed in this commit.

Also, for consistency and proper data validation, all parameters are
now always stored and handled as strings, in the model.

Bug: T165230
Change-Id: I16d8d95be067b3e48e557ef25f8eb6a49736aa4e
2017-05-13 13:22:58 -07:00
Moriel Schottlender
c1bd4b7d27 Refactor filter-specific logic into group models
Make the view model more generic and ready to accept other types
of filtering, like namespaces and tags, by handing off the responsibility
and logic of the parameterizing and filter relationships to the groups.

Change-Id: I9c333719e89088d96d044d72ddb9c39feeeb68ca
2017-05-12 15:06:20 +00: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
Roan Kattouw
f3afb5441f RCFilters UI: Add tooltip to saved links items
Bug: T164861
Change-Id: Ic7c38c59c53d4d83b959eff36d4b1d198bb654ea
2017-05-12 13:17:23 +00:00
jenkins-bot
4a8f414a2d Merge "RCFilters: Treat saved query with multiple spaces as empty" 2017-05-12 13:16:23 +00:00
jenkins-bot
6479f229ac Merge "RCFilters: Actually read/write highlight parameter" 2017-05-12 13:15:48 +00:00
jenkins-bot
9f7ad0b2ec Merge "RCFilters UI: Add down indicator to SavedLinksListWidget button" 2017-05-12 01:07:38 +00:00
jenkins-bot
3c97f1b788 Merge "RCFilters UI: Don't remove removed saved links twice" 2017-05-12 01:07:35 +00:00
Moriel Schottlender
834882dfa0 RCFilters: Treat saved query with multiple spaces as empty
Because it is empty, even if there's multiple spaces. Also, if the
input is invalid and we didn't save the query, don't close the
popup.

Bug: T165113
Change-Id: I30e68b0b90e2a4077fb4068c1462d40b03cbfe8c
2017-05-11 17:52:45 -07:00
Moriel Schottlender
9f35c35524 RCFilters: Actually read/write highlight parameter
The highlight parameter enables/disables the highlight view. It was
not properly updated to the URL, and a separate typo made it not update
the model correctly.

Bug: T165107
Change-Id: Ie711d4d08fb3eeffca50c2953016e02e2620f898
2017-05-11 17:02:22 -07:00
jenkins-bot
75483c8722 Merge "Gate option to save RC filters to default false" 2017-05-11 21:45:46 +00:00
Matthew Flaschen
5b9f2c8d00 Gate option to save RC filters to default false
Change-Id: I1c9e382c265a097b5eea07b529ec542a60562307
2017-05-11 17:14:14 -04:00
Bartosz Dziewoński
75c3d36ff7 mw.Upload.Dialog: Define .static.name
Bug: T164999
Change-Id: I0e5d11bdeac1ea60caaa146041057e7a9faf351c
2017-05-11 20:11:40 +02:00
Roan Kattouw
a2a9246b47 RCFilters UI: Add down indicator to SavedLinksListWidget button
Bug: T164861
Change-Id: I23c602e9bcfbbe8f39f3e3efc4a5482490699214
2017-05-11 07:42:12 +00:00
Roan Kattouw
9ef0027faa RCFilters UI: Don't remove removed saved links twice
The second removal also didn't remove the right thing.

Change-Id: Iab32ae2e19e2b19995b88fbfd2e84a36dbda1bac
2017-05-10 18:31:41 -07:00
jenkins-bot
c7a997a378 Merge "OOUI-ificiation of TablePager nav" 2017-05-10 17:04:22 +00:00
Volker E
adf31f97d4 Update OOjs UI to v0.21.3
Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.21.3

Change-Id: I53696e023197ae4dd85605d6615e9faceda05398
2017-05-09 18:21:26 -07:00