Commit graph

625 commits

Author SHA1 Message Date
umherirrender
49de213dc1 deprecate make(Known?)LinkObj methods
Restore deprecation warnings from 1.16. The methods Linker::makeLinkObj
and Linker::makeKnownLinkObj should be replaced by calls to link().

Change-Id: I658289ac2b52a193b76edd946368e228cfa389cb
2012-10-25 10:33:57 +02:00
Liangent
7323171000 Localize parentheses in Linker::formatTemplates()
Change-Id: I27c4c26206ba1e9c27a5c120a95491eb30e55522
2012-10-23 21:32:41 +08:00
umherirrender
9d19d7342a Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I7db616db8c969567d420c0161fa207b366e292b6
2012-10-19 22:03:05 +02:00
Siebrand
7d4c391e25 Merge "Deprecate static User::edits() in favour of User::getEditCount()" 2012-10-18 00:00:11 +00:00
Marius Hoch
63ed4ac0e4 Deprecate static User::edits() in favour of User::getEditCount()
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
2012-10-18 01:41:00 +02:00
Brion Vibber
966cda2f80 Initial stab at responsive images for screen densities.
* 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
2012-10-11 10:54:21 -07:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Tyler Anthony Romeo
0a1e291036 Added protocol option to Linker and OutputPage::addReturnTo.
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
2012-09-27 13:47:42 -04:00
csteipp
21971b28bc (bug 39700) Add htmlspecialchars encoding to label
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
2012-08-31 14:51:25 -07:00
Platonides
0168a529a9 Remove a couple of unused globals
Change-Id: I173334c43e1bc2ed5f404f82e770d3e20fa65914
2012-08-27 22:31:01 +02:00
Catrope
873ac24d32 Document Linker::tocList()'s $lang parameter correctly
Change-Id: I6982dc30a0ceeedc8e549ee3bdaa5bc139d6364c
2012-08-22 12:49:39 -07:00
Siebrand Mazeland
3ff6874d2f Follow up I66fb2d11: use wfGetLangObj() instead
Change-Id: I333021ee4edc7481b664986c27e12fbcac9d0d08
2012-08-22 21:31:05 +02:00
Catrope
f80b212aa2 Fix tocList() breakage in 6fe1f050
The $lang parameter defaults to false, but Message::inLanguage() doesn't
like false, so do an explicit check for false.

Change-Id: I66fb2d11269a988ae92b1594314807a4eed54f1b
2012-08-22 12:21:59 -07:00
tpt
2b9c22deb3 (bug 23226) Add |class= parameter to image links in order to add class(es) to HTML img tag.
Change-Id: If58802ad2c513c1db7bc3488daf4e078b8694b02
2012-08-21 17:25:42 -07:00
Siebrand Mazeland
6fe1f0509b Replace deprecated wfMsg* calls with Message class calls.
Doing this in steps of roughly 100 changes per commit, so that it remains reviewable.

Change-Id: Ib15e670badd3f6aecae8b60e2f9129a31341ce16
2012-08-21 18:38:44 +02:00
Catrope
9846b1c1e9 Merge "(bug 24437) Add nofollow to image link" 2012-08-15 01:37:24 +00:00
Alexandre Emsenhuber
e08852997a Follow-up I47412b67: pass an array of query parameters to Linker::link()
Change-Id: I3cdc0a57a9cda740c482addd2c9c833a70897381
2012-08-14 13:27:54 +02:00
Alexandre Emsenhuber
419129ae67 Follow-up I47412b67 (dde8471): convert string query to array
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
2012-08-14 11:51:26 +02:00
Aaron Schulz
eeb7300f60 Merge "Linker::link() prints deprecated warning if $query is a string" 2012-08-07 19:31:42 +00:00
csteipp
79b4f79434 (bug 24437) Add nofollow to image link
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
2012-08-07 09:14:28 -07:00
Daniel Werner
dde847152a Linker::link() prints deprecated warning if $query is a string
Change-Id: I47412b67b964ff0d868f181903628de3fd41365a
2012-08-07 12:50:05 +02:00
robin
e4b4bfdf9b (bug 38351) Image alignment should follow the page content language
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
2012-08-03 00:48:06 +02:00
jan
5184c95cb7 Add feature to disable rollback edit count
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
2012-08-02 09:12:42 +02:00
jan
9bae2198c9 (bug 18834) Add an edit count to rollback link
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
2012-07-31 22:46:37 +02:00
Alexandre Emsenhuber
df8c25e288 Do checks in the correct order in Linker::getLinkColour().
There's no point doing potentially expensive checks (exists() and
getLength()) if the page is simply not in a content namespace.

Change-Id: I86a2b3a36071cf508b8e99ef20bdf3e0e20f3c82
2012-07-25 09:50:58 +02:00
Aaron Schulz
00be71361c Merge "cleanup callback in usort call" 2012-07-13 17:24:57 +00:00
Antoine Musso
d5737f8f17 update @param @return doc in several files
Change-Id: I0e23227330f90dc4121fd2a313d2e9a33c3c97a7
2012-07-10 17:08:52 +02:00
umherirrender
56d6199bd0 cleanup callback in usort call
Change-Id: Iac42074d46cf9185339596cff167d72b0a8704b4
2012-07-08 11:40:50 +02:00
Alexandre Emsenhuber
026e8534c6 Add a context parameter to Liker::generateRollback() and Linker::buildRollbackLink() and updated callers.
This allows both methods to not always rely on global object, but also to use the local context when possible.

Change-Id: Id10f55ed9b18c889afd8d9937d9f35acb376cce4
2012-07-05 23:10:03 +02:00
Alexandre Emsenhuber
547b24f781 Fix parameter name: $displayText does not exist, but $altUserName does.
Change-Id: Ic901d6a74701eb8c1802ac7a28c479b253353a14
2012-07-05 20:01:10 +02:00
jeblad
631e79d556 Added a hook for formatting autocomments
Removed some spurious whitespace

Changed how wfRunHooks are used, and also the test for default formatting

Change-Id: I4c3fc1080f83166d7b89aeb9a1487e173e9ccb65
2012-06-15 13:25:31 +02:00
Liangent
e7ddfcf22e replace whitespace with 'word-separator' message
Change-Id: I34e099af74196579f20685e45d81b00ed8f76461
2012-06-11 19:59:45 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Liangent
8c65834425 Add new message 'brackets' and use it to kill some hardcoded []s.
Change-Id: Idae8d9201d1c291316ab520d204ae8c5cde2d890
2012-05-30 14:40:11 +08:00
Alexandre Emsenhuber
a682b7335a Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I0db3461139284edcb6ac02923eb83d54e6756ffb
2012-05-12 22:33:51 +02:00
Alexandre Emsenhuber
d3fecf5ac6 Added Linker::getInvalidTitleDescription() to display invalid title entries in various places.
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
2012-05-07 18:25:52 +02:00
Amir E. Aharoni
4b439bb6ad Bug 35034 - moved autocomment-prefix between the prefix and the arrow. Follow up to r109086. 2012-03-13 23:09:06 +00:00
Siebrand Mazeland
481943429e (bug 34702) More localised parentheses. Patch contributed by Yusuke Matsubara. 2012-02-28 11:56:59 +00:00
Siebrand Mazeland
fa53862b3f Wow. Messy. Follow-up r112426, r112424: Fix incorrect calls. Should have been escaped() instead of escape(). 2012-02-26 12:11:35 +00:00
Siebrand Mazeland
7e7079374f Follow-up r112424: Per IAlex on IRC: Use escape() instead of plain() for improved security. 2012-02-26 12:07:21 +00:00
Siebrand Mazeland
fbe974a6f8 Follow-up r112410, r112412: Cheaper processing using plain(). 2012-02-26 11:49:01 +00:00
Siebrand Mazeland
50eabdff63 Follow-up r112410: (bug 34702) Use localised parentheses for comment, too. 2012-02-25 20:53:54 +00:00
Siebrand Mazeland
68643f5079 (bug 34702) Use localised parentheses in Special:Contributions. 2012-02-25 20:42:08 +00:00
Andrew Garrett
a548e4b595 Revert r97042, causes bug 34432 2012-02-17 22:15:17 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Amir E. Aharoni
9691721f65 Follow up to r105855 - now with updated phpunit tests. 2012-01-17 00:17:55 +00:00