Restore deprecation warnings from 1.16. The methods Linker::makeLinkObj
and Linker::makeKnownLinkObj should be replaced by calls to link().
Change-Id: I658289ac2b52a193b76edd946368e228cfa389cb
Moved the logic from the old static User::edits() into
User::getEditCount() and deprecated User::edits() as it's
not following the class hierarchy.
Change-Id: Id2b939ffb903accb8f4dc132a6ac6b6576f81beb
* adds $wgResponsiveImages setting, defaulting to true, to enable the feature
* adds 'srcset' attribute with 1.5x and 2x URLs to image links and image thumbs
* adds jquery.hidpi plugin to check pixel density and implement partial 'srcset' polyfill
** $.devicePixelRatio() returns window.devicePixelRatio, with compat fallback for IE 10
** $().hidpi() performs a 'srcset' polyfill for browsers with no native 'srcset' support
* adds mediawiki.hidpi RL script to trigger hidpi loads after main images load
Note that this is a work in progress. There will be places where this doesn't yet work which output their imgs differently. If moving from a low to high-DPI screen on a MacBook Pro Retina display, you won't see images load until you reload.
Confirmed basic images and thumbs in wikitext appear to work in Safari 6, Chrome 21, Firefox 18 nightly on MacBook Pro Retina display, and IE 10 in Windows 8 at 150% zoom, 200% zoom, and 140% and 180%-ratio Metro tablet sizes.
Internally this is still a bit of a hack; Linker::makeImageLink and Linker::makeThumbLink explicitly ask for 1.5x and 2x scaled versions and insert their URLs, if different, into the original thumbnail object which (in default handler) outputs the srcset. This means that a number of places that handle images differently won't see the higher-resolution versions, such as <gallery> and the large thumbnail on the File: description page.
At some point we may wish to redo some of how the MediaHandler stuff works so that requesting a single thumbnail automatically produces the extra sizes in all circumstances. We might also consider outputting a 'srcset' or multiple src sizes in 'imageinfo' API requests, which would make ApiForeignRepo/InstantCommons more efficient. (Currently it has to make three requests for each image to get the three sizes.)
Change-Id: Id80ebd07a1a9f401a2c2bfeb21aae987e5aa863b
Added new argument to the Linker options array to allow
the forcing of an HTTP or HTTPS protocol. In order to facilitate
this, a protocol argument was added to Title::getLinkURL.
Also, an options argument was added to OutputPage::addReturnTo
so that options can be passed to the linker and so that the
returnto URL can be forced to a certain protocol.
Change-Id: Ia9cc11e310ad6ef23c221bdba3a4834e7c5556e7
Adds htmlspecialchars encoding to the link label, passed
into Linker::makeBrokenImageLinkObj.
This fixes a stored XSS (HTML injection) vulnerability.
* Released as part of 1.20wmf10, 1.19.2, 1.18.5
Change-Id: I0e5f9eeb1f3561b1354aecced74f68ae2fa20dfa
The $lang parameter defaults to false, but Message::inLanguage() doesn't
like false, so do an explicit check for false.
Change-Id: I66fb2d11269a988ae92b1594314807a4eed54f1b
If we detect and warn that the $query parameter is in an incorrect
format, we may as well convert it to the correct one.
Change-Id: Ief137ab758c65ec562c2a523f76b1a4f8c2617b5
Add Parser's extLinkAttribs attributes when an image has a link
parameter, when generating the html. Currently, these may include
rel="nofollow" and the target attribute.
This will correctly add rel="nofollow", respecting $wgNoFollowLinks,
$wgNoFollowDomainExceptions, and $wgNoFollowNsExceptions settings.
Updated parser tests for expected results, added new tests for
$wgNoFollowLinks and $wgNoFollowDomainExceptions exceptions.
Change-Id: Ib4677760ec78a3f0c4ba781d893e0484cc8db3ed
The alignment of image thumbs should follow the page content language instead of the wiki content language.
For this it needs the parser context, and because it makes sense to have it as first parameter, I renamed makeImageLink2() to makeImageLink(), the 2 seemed to be redundant anyway.
The old function name keeps the old behaviour, but can be removed quite soon since almost no extension is using it.
Change-Id: I0c35b06a85528dcc43fdd0578dc9b327c495cf4a
This change replaces I85f480726b41871cdf5349a19e3f650285d1dda6 (includes
the change of Catrope).
Add a feature to disable the rollback edit count (change
9bae2198c9) on special pages. Default it
will be disabled on Recentchanges and Watchlist.
Change-Id: Ifbbf802472ce678694b2b3ba4ef441344cc1d572
Add an edit count to rollback link to show how many edits will be
rollbacked. When the count is over 10 the text "more than 10 edits" will
be outputed.
Change-Id: I5c4050e0a9197d4c505e85685a9780c97138d427
There's no point doing potentially expensive checks (exists() and
getLength()) if the page is simply not in a content namespace.
Change-Id: I86a2b3a36071cf508b8e99ef20bdf3e0e20f3c82
This allows both methods to not always rely on global object, but also to use the local context when possible.
Change-Id: Id10f55ed9b18c889afd8d9937d9f35acb376cce4
Removed some spurious whitespace
Changed how wfRunHooks are used, and also the test for default formatting
Change-Id: I4c3fc1080f83166d7b89aeb9a1487e173e9ccb65
This method will use two new messages 'invalidtitle-knownnamespace' and 'invalidtitle-unknownnamespace' depending on the fact that the given namespace number exists or not.
I did put that method in Linker because I plan to use it in various places, notably in other QueryPage and Pager subclasses.
Change-Id: I13e7cdc2c0a8e86dc5e4b144b6012f3864d2ec06