Commit graph

824 commits

Author SHA1 Message Date
jenkins-bot
16f1acae07 Merge "Upstream isElementInViewport from MobileFrontend" 2016-03-03 20:38:56 +00:00
Florian
18c6615d01 MediaWiki Widgets: Add new SearchInputWidget
SearchInputWidget is similar to a TitleInputWidget, but doesn't has
a visible loading indication, doesn't highlight the first result and
uses the opensearch api endpoint for suggestions, instead of
prefixsearch.

Extra points:
 * Improve documentation of mw.widgets.TitleInputWidget's configuration
   option validateTitle

Bug: T118443
Change-Id: I8b8098041fe2971389fa908d007d2e77255829ec
2016-03-03 16:29:40 +00:00
jhobs
3f4e016873 Upstream isElementInViewport from MobileFrontend
As a useful utility function, we've copied this method several times
across multiple extensions, which is a pretty good sign it should
actually live in core.

Changes:
 * Add `mediawiki.viewport` module
 * Rewrite method to be more robust and accept any viewport
 * Add `mw.viewport` to jsduck categories file
 * Add method for checking if an element is close to the viewport
 * Add unit tests

Bug: T124317
Change-Id: I38eec4f1e568f51e7e212b2b3f10b8da8d36f316
2016-03-02 14:22:14 -08:00
jenkins-bot
fb7b3eebeb Merge "mw.Upload.BookletLayout/Dialog: Add determinate progress bar" 2016-03-02 01:48:19 +00:00
Alex Monk
46cabd4252 Add mobile target to mediawiki.special
Bug: T126935
Change-Id: I1135397d150b5ad978da88bfd9d85c1d9e294eb7
2016-03-01 11:50:16 +00:00
Alex Monk
848eabef42 Make mediawiki.action.view.redirectPage available on mobile
Bug: T63861
Change-Id: I71d3d415fe918e8b0a090860cad9271092b1bd7e
2016-02-26 00:02:16 +00:00
James D. Forrester
0964884cce Follow-up 6281b0a: LookupElement is still not in core
Change-Id: Ie5300ae042d31a64d2b5d40bcf289f4474d3f898
2016-02-19 11:53:26 -08:00
Bartosz Dziewoński
6281b0a353 Resources: Narrow down dependencies on 'oojs-ui' to the smaller modules
I wasn't reading through them very carefully, so it's possible
that some of the 'oojs-ui-widgets' could be narrowed down further
to just 'oojs-ui-core', but this is good enough for me. At least
we're no longer loading toolbars everywhere.

Change-Id: I58799e22f9c0a2f78c1b4a02c4b7af576157883a
2016-02-19 11:11:14 -08:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Prateek Saxena
90a8212c14 mw.Upload.BookletLayout/Dialog: Add determinate progress bar
The BookletLayout now emits events during the upload file phase. It
uses these events to update a progress bar at the top of infoForm.

Bug: T115861
Change-Id: I0fd7f21f3fc1ef042330b7571c247e09c24d1a5c
2016-02-17 08:33:58 +05:30
Prateek Saxena
e80ea1c4e3 UploadBooklet: Show image thumbnail in both steps
Bug: T115860
Change-Id: I0794206dad06fd0652e9b62884e8996e836b73b3
2016-02-16 07:13:12 +05:30
Prateek Saxena
c4b335f713 UploadBooklet: Switch on showDropTarget in the SelectFileWidget
Bug: T115721
Change-Id: I026cc2d52fb1cb9ff4632d1c977ba23047c6b653
2016-02-16 02:19:29 +01:00
Bartosz Dziewoński
eeebe6db6e mw.ForeignStructuredUpload.BookletLayout: Remove A/B test code
We don't want it to accidentally end up in MediaWiki 1.27 release.
It can be restored again when needed.

This reverts commit d0e47d475c.

Bug: T120867
Change-Id: Ie1a90ad2d2ccdecf189313e18c3c5b24576363f4
2016-02-11 05:03:35 +00:00
Bartosz Dziewoński
1bbcb4da12 mediawiki.widgets: Remove backwards-compatibility dependency on 'mediawiki.widgets.CategorySelector'
Follow-up to 40a8367fe9.

Change-Id: I28faea785cf13d1e741ae6f746a76bd7aeeaf3eb
2016-02-03 19:33:20 +00:00
Brad Jorsch
f0207e8ca6 Add Special:ApiSandbox
Like Extension:ApiSandbox, but rewritten to use OOJS-UI and to add many
long-requested features.

Bug: T89386
Bug: T92893
Bug: T98457
Bug: T98083
Bug: T89229
Bug: T66008
Bug: T50607
Bug: T47811
Bug: T38875
Bug: T36962
Bug: T34740
Change-Id: Ic42a6c5ef54b811cd63cfef2132942b27a626fe5
Depends-On: I85c0eedcd31a0e419d8055eca0d9cb1ba872ae62
Depends-On: Ic85ff4abbbcd2076ebf5cdfaa0e95e98878e2308
2016-02-03 11:13:59 -05:00
jenkins-bot
01f81c322c Merge "TableSorter: Use SVGs with PNG fallbacks instead of GIFs" 2016-01-26 13:09:29 +00:00
Glaisher
a2ea9f8b92 Make mediawiki.special.pageLanguage work again
Broken with the switch to OOUI.
This also adds 'id' param to OOUI HTMLRadioField.
Follow-up to b51076a844.

Change-Id: I69c5fa9830a8b8b7cd6bf3468b5600325d34c070
2016-01-26 12:12:49 +00:00
Ed Sanders
9080b6f763 TableSorter: Use SVGs with PNG fallbacks instead of GIFs
Also removes the never-used sort_none.gif.

Change-Id: Ia16e19985f68b1d188b4391c1156d61c781059cf
2016-01-25 17:58:36 +00:00
Bartosz Dziewoński
2852e5959e mw.Upload.BookletLayout: Show an error rather than explode when uploads are disabled
Also, localise the error messages.

Bug: T119314
Change-Id: I0b2f53b91454f22e2001462397087da9e055b701
2016-01-22 19:30:40 +00:00
Alex Monk
639cecb4be Allow UserInputWidget on mobile
Change-Id: I87699a93ca1b34c6d248456fcc060f584623d158
2016-01-21 00:41:40 +00:00
Luke Faraone
606a21cb14 Add links to toggle checkbox selections in Special:Log
This implements a new JavaScript module, mediawiki.checkboxtoggle.
The module is suitable to be reused in any other list of checkboxes.

Bug: T92230
Change-Id: I92141a7079fc7fcd7152ef418d82f4f7969b163b
2016-01-17 22:49:05 -08:00
jenkins-bot
5bd4dd1f26 Merge "SpecialComparePages: Float the boxes, if available space is given" 2016-01-12 00:07:45 +00:00
Florian
0a8dcdb451 SpecialComparePages: Float the boxes, if available space is given
Follow up: I480c2165c908ca7c8e08ed5990e386ddb515f3b0

Bug: T122907
Change-Id: Iaf139974e850621a668c8ac32f3dc88ba3b70508
2016-01-11 12:53:38 -08:00
Kunal Mehta
e0ec23d313 API: Avoid FOUC on help pages
Loading CSS with OutputPage::addModules() causes a FOUC because the
styles are loaded through JavaScript, using addModuleStyles() fixes
this. But it doesn't load module dependencies, so load the
mediawiki.hlist styles explicitly in ApiHelp.

Bug: T117901
Change-Id: I1dfd194d686c05573eefc85d5dfd7ee2731bf286
2016-01-10 22:41:48 -08:00
Kunal Mehta
2b0a5ad110 Remove JavaScript .hlist fallback for IE8
IE8 is no longer served JavaScript, so the fallback will never run.

Change-Id: Ic2524d7c6d019cc7b978d79ee0ae64a6371fb42e
2016-01-10 22:36:51 -08:00
Kunal Mehta
4a40a5d217 Remove unused jquery.validate module
jquery.validate was added in r99929, presumably for Gadgets 3.0 work.
However it's entirely unused in core, extensions in Gerrit, and on
Wikimedia sites. Even if Gadgets 3.0 were to require it, it should
probably live in the Gadgets extension rather than core.

Change-Id: Iebe09e853a6eb67af4a06b296606a8193df18d34
2016-01-07 15:28:07 -08:00
Brad Jorsch
57342159da Add datetime input widget
Since OOJS-UI isn't currently in a position to accept such things, the
decision is to put it in MediaWiki instead. Once OOJS-UI is
un-monolithicized and the i18n issue is solved, this should be somehow
moved there instead.

Change-Id: Ia3942c76804c865c1039904d170ee6eafcdc6793
2016-01-04 21:14:55 -08:00
Florian
51cce7a83e Use OOUI on Special:BlockList
Switch to OOUI HtmlForm and replace mediawiki.userSuggest with
OOUI HtmlForm type user.

Bug: T117734
Change-Id: I37d9acbdd272c0cc2f2e120aada2e9fcea215509
2016-01-02 18:02:42 +00:00
Prateek Saxena
d4f129d7bf mw.Upload.BookletLayout: Add help text for name and description fields
Copied the following string from UploadWizard into core to be shown as
help text near the input fields:
 * mwe-upwiz-tooltip-title
 * mwe-upwiz-tooltip-description

Bug: T116086
Change-Id: Iaaac4908c71b416888921a4e45de66fa87ab448d
2016-01-01 19:44:30 +00:00
Bartosz Dziewoński
3f01cebe9d mw.Upload.BookletLayout: Don't show file extension in the filename input
Also:
* Strip/replace characters that are invalid in MediaWiki page titles
  from the default file name using mw.Title.newFromFileName
* Upload files with the canonical extension for given file type (e.g.
  map '.JPEG' to '.jpg') using mw.Title.normalizeExtension

Change-Id: Ied06682a61581303b720096bb087fc2d9ae4fdbe
2015-12-28 22:15:45 +01:00
jenkins-bot
8578488e2b Merge "mw.ForeignStructuredUpload.BookletLayout: Use lastModified or EXIF date" 2015-12-28 19:39:37 +00:00
Prateek Saxena
8c635917cd mw.ForeignStructuredUpload.BookletLayout: Use lastModified or EXIF date
Use the file's lastModified date, or EXIF DateTimeOriginal (where
available) as the default value of the DateInputWidget instead of
leaving it blank.

A lot of the code here is from mw.UploadWizardUpload.prototype.checkFile.

Bug: T115863
Change-Id: I75adec9718d89a7177050e8b848478d1b0069dd0
2015-12-28 20:29:30 +01:00
Michael Holloway
f6bda94623 Enable mediawiki.action.view.redirect on mobile
Added mobile target to its entry in Resources.php.  Tested in
Chromium dev tools with various emulated mobile devices and it Just
Works.

Bug: T93262
Change-Id: Idb416b0877ea5a3764936389dfe59d4653ad96d0
2015-12-25 21:52:06 -05:00
jenkins-bot
40fcbabb81 Merge "Remove mediawiki.special.javaScriptTest module" 2015-12-23 20:06:42 +00:00
Timo Tijhof
6b758fc982 Remove mediawiki.special.javaScriptTest module
We're almost ready to drop the non-plain mode of Special:JavaScriptTest
in favour of Special:JavaScript/qunit/plain. There's a few mobile-related
extensions still using the non-karma mode for qunit testing.

However, none of them make use of the Skin selector, which was mainly a debug
thing I added in the initial version. It no longer makes sense since our tests
now enforce an anti-dependency on skin html and other context. Encouraging
testing in multiple skins in the old UI therefore no longer makes sense.

This also fixes one of the most frequent errors in resourceloader logs and gets
rid of an ugly hack in Resources.php that causes a small amount of overhead
in ResourceLoader::__construct().

> MessageBlobStore failed to find skinname-fallback
> MessageBlobStore failed to find skinname-apioutput

Change-Id: Idaacf718703883c6a7e83a17ccd3f41ebdca53d1
2015-12-23 19:58:15 +00:00
Timo Tijhof
82def5ea5f mediawiki.page.patrol.ajax: Rename file to match module name
Change-Id: If8b99d336749d26f18246491ca094487b4dea18e
2015-12-21 19:10:58 -08:00
Prateek Saxena
b042c5cc31 SpecialWatchlist: Unbold title when it's clicked
Bug: T40908
Change-Id: I0c93f2dfefeae902a069c72bfa3c1ec7807ed57a
2015-12-16 09:50:39 +00:00
Bartosz Dziewoński
bcf968010b mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form
Second attempt. First, reverted one: I6f68122b5399f4b8766825c752e964478ae7563d.

To improve in the future:
* Use a better error message when not all logged-in users can upload

Bug: T115866
Change-Id: I1ac083fd491c7445240b4fd9f7b3badacb2d2d37
2015-12-15 16:25:08 +00:00
Bartosz Dziewoński
89c55dc655 mediawiki.api.user: New module, factored out of mediawiki.user
The convenient getUserInfo() function can now be used with mw.ForeignApi.

Bug: T117868
Change-Id: Ic0b5fe3812723bf51a5cf6600437c480dc5abb8f
2015-12-15 16:21:06 +00:00
Prateek Saxena
4ebc75547a mw.ForeignStructuredUpload.BookletLayout: Option 4: Image improvements
Add higher quality PNGs. Also added SVGs, and now using the
.background-image-svg() mixing to use SVGs.

Change-Id: I8d8fbf8e58b4ef5d9956731c8b85d5db07b3f5ed
2015-12-15 15:26:58 +00:00
Bartosz Dziewoński
d0e47d475c mw.ForeignStructuredUpload.BookletLayout: A/B test of 4 different interfaces
It turns out that people click the checkbox affirming that they are
they author of the file and that they release it under CC BY-SA even
when neither of those is true. So we're trying some interfaces that
require a modicum of thought rather than just a click on "I agree".

  Option 1: The form we have right now, with a single checkbox.

  Option 2: Four checkboxes, each with a label explaining one facet of
    the requirements (own work; no pictures of copyrighted work;
    educational/useful; irrevocably released as CC BY-SA).

  Option 3: Some Yes/No questions structured so that 'Yes' is not
    always the right answer to continue uploading.

  Option 4: Longer introduction before a single checkbox (as in option
    1), with examples of good and unacceptable content.

As only logged in users are able to upload files, we're able to bucket
them into four groups by user ID number. When the user completes a
file upload, the bucket number is saved server-side in a change tag by
the companion patch I90cb12c505b2581f36113ec6b4f7bf732f0971b7 (we could
match the user IDs cross-wiki by username, but that sounds painful).

For testing and debugging, add '?uploadbucket=N' to the URL to force
given interface option to appear. Any completed upload won't count
towards the bucket.

Note that for expediency, the tested options all assume uploads to
'shared' repository (that is, Wikimedia Commons). The winner's
messages will be tweaked to work with 'local' and other targets too.

This patch DOES NOT ENABLE THE TEST yet, it just implements the options.
Enabling it on specific wikis can be done via config:
* $wgForeignUploadTestEnabled = true/false (defaults to 'false')
  Whether the test is running.
* $wgForeignUploadTestDefault = 1/2/3/4 (defaults to '1')
  Interface to use when the test is not running (and for anons).

Bug: T120867
Bug: T121021
Change-Id: I557056b867c6a55ef2c9af321eb48893312632a3
2015-12-15 00:23:14 +00:00
Bartosz Dziewoński
34e66f44f1 SpecialChangeEmail: Remove dead code (whole 'mediawiki.special.changeemail' module)
It stopped working after 6b9a1c6d5b
accidentally changed the 'id' of the text input this was validating.

It seems that all browsers these days have some validation for 'email'
fields, so this isn't very useful, and the styling of the notice looks
pretty jarring with the current 'ooui'-style form.

Change-Id: Ifa3103c9c9369654ea1cd4b064a67454b8694bf0
2015-12-14 16:15:48 +01:00
Kunal Mehta
59fca1594c mw.messagePoster: Support foreign wikis
Allow passing in an external api.php URL to post a message on a remote
wiki. Note that the remote content model must have its messagePoster
implementation registered on the local wiki for this to work.

Bug: T111590
Change-Id: Id52b7d3a12ed5e57e29d3f22fb7f4f36b8a908b1
2015-12-10 10:51:27 -08:00
Fomafix
8b4af924d3 TOC: Move JavaScript-related styles to the same module
This change moves the rules for the CSS classes that only
get used by JavaScript into the same module 'mediawiki.toc'.
This module already gets loaded via JavaScript.

This way, the styles are only loaded when they are needed.

Cached HTML pages already contain the module 'mediawiki.toc'
so there is no problem on deployment.

Change-Id: Ib7c81e9433e7e3976e40e407f63fc8e924957faa
2015-12-09 19:35:08 +00:00
Florian
5327e3db56 SpecialWatchlist: Add an option to automatically reload the page when a filter was changed
The biggest negative point (as far as I can tell) with the change mentioned in the follow-up
is, that a user needs at least 3 clicks to change an option, which before it required only
one click. This option adds a new preference for the watchlist (which can be enabled/disabled
using Special:Preferences) which, if enabled, loads a new, tiny module with a script, that
listens on all input and select fields in the header form of Special:Watchlist. Whenever one
of these elements get changed, the watchlist form will be submitted automatically.

The default for this option is false (disabled).

Follow up: I3bcd27596c21aa4

Bug: T50615
Bug: T119322
Change-Id: Icab1a5143df24a06f468165421d40db8fa57e73c
2015-12-04 16:48:22 +01:00
Florian
ffdcafc456 Add mediawiki.api.messages module to easily retrieve a set of messages
Bug: T40280
Change-Id: I6e3fc4beb56c3120702ca291adf6e1521a0bc21f
2015-11-27 15:28:02 +01:00
Bartosz Dziewoński
a9e699553e mw.widgets.CategoryCapsuleItemWidget: Improve marking of missing categories
* Add a 'title' attribute like for wikitext links
* Add a 'missing' property to make it easy to check for redlinks
  in the input programatically

Change-Id: I647af4dee947a6572f0202cf6b8b28777bbdc17e
2015-11-23 16:42:01 +00:00
opatel99
8a791b308d removed duplicate line for api-error-duplicate-archive
Change-Id: Ifafcf02e03e1122a569f66f7d693c3a590ce5e2b
2015-11-22 10:41:11 -06:00
jenkins-bot
f7d2675e39 Merge "ForeignStructuredUpload.BookletLayout: Add direct dependency on 'moment'" 2015-11-17 23:49:42 +00:00
Timo Tijhof
05224f0aa3 mediawiki.action.edit.preview: Remove ref to non-existant 'tooltip-p-lang' message
This message does not exist in MediaWiki core. And even if one creates it locally,
it is not used by MediaWiki.

It is used for the p-logo link (not the section). And for individual links in
the toolbox and other portlet sections. But not for the sections themselves,
those only have labels (typically rendered as <h3> or something).

This reference was spamming logs with:
> [resourceloader] MessageBlobStore::fetchMessage failed to find tooltip-p-lang (en)

Change-Id: Ie1420230dc0857c1e38641697098b4adb2b28afb
2015-11-17 22:59:41 +00:00