Commit graph

730 commits

Author SHA1 Message Date
Yuri Astrakhan
a77032257f Allow mobile to reduce image quality
http://www.mediawiki.org/wiki/Requests_for_comment/Reducing_image_quality_for_mobile

Per above RFC, this patch implements the core changes required to
specify quality reduction of JPEG via URL. To test, make sure your
setup uses 404-based thumb generation. Vagrant supports it by adding
"multimedia" role:  $ vagrant add-role multimedia && vagrant provision
* Pick any thumbnail jpeg URL that exists on the test wiki, e.g.
  http://.../images/thumb/4/49/Img.jpg/400px-Img.jpg
* check that basic scaling works by altering 400
* add quality parameter qlow- right before px:
  http://.../images/thumb/4/49/Img.jpg/qlow-400px-Img.jpg

Change-Id: I930ea06be6d302ffc8832d12b251422a9f1b3e75
2014-05-09 16:39:54 -04:00
Fomafix
9a0ec78355 Linker.php: Do not double escape accesskey in tooltip
Bug: 65029
Change-Id: Iba28651b890e9ea187a55a65eb12ee725598f32d
2014-05-08 10:16:46 +00:00
umherirrender
23bb3d1cb4 Follow-Ups to "Fixed some @params documentation"
Fix of inline comments of the following patch sets:
Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca
Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36
Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634
Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102
Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b

Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
2014-04-23 13:39:49 +02:00
umherirrender
a3983418d5 Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I0056b4a8df243cfc0c5f25378de48f7a35170aca
2014-04-22 13:07:02 +02:00
jenkins-bot
a8304d4c73 Merge "Add 'mw-anonuserlink' class for anonymous users" 2014-04-17 20:21:32 +00:00
jenkins-bot
b101f05438 Merge "includes/Linker.php: Added hook for "Media:" links" 2014-04-17 19:39:37 +00:00
Robert Vogel
020fc0b649 includes/Linker.php: Added hook for "Media:" links
The static method 'Linker::makeMediaLinkFile' produced a HTML string
without usage of MediaWiki 'Html' class. It also lacked a hook to allow
modifications of the output HTML.

I altered the implementation and added a hook that provides a signature
and behaviour similar to the existing 'LinkerMakeExternalLink' and
'LinkBegin'/'LinkEnd' hooks. It provides all available context information
and allows modification of single attributes or the output HTML as a
whole. I have updated the 'docs/hooks.txt' file to provide proper
documentation.

Change-Id: I6d7769298a4ca6cbbf807fcebb91fb0d2222f8d8
2014-04-14 14:39:54 +02:00
umherirrender
725d9d125d Removed unneeded spaces and colons in @param and friends
Also swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
2014-04-08 16:02:49 +00:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
daniel
154bcdc63f Introducing TitleValue
TitleValue is intended to be a light weight alternative to the Title
class. Any operations on TitleValue are implemented in separate
service classes, like TitleFormatter and PageLinkRenderer. See
<https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue>
for more information.

This change updates SpecialCategories and SpecialLinkSearch to use
TitleValue instead of Title, to demonstrate how TitleValue would be
used, and how the necessary services can be injected and applied.

The intention is to improve testability and reusability; these
advantages will however only become apparent with further refactoring
of the respective special pages. This will be done in follow-up
changes.

More work will be needed to migrate essential functionality from
Title and Linker classes into the respective service classes,
MediaWikiTitleCodec and MediaWikiPageLinkRenderer.

Change-Id: I8eef5a165de4ffcacfbc4911fdacdb15d502fff4
2014-03-28 18:42:17 +00:00
Kunal Mehta
f2de3967d9 Add 'mw-anonuserlink' class for anonymous users
Bug: 43179
Change-Id: I57780e1045044e8532dc6defc4cca2e27434c055
2014-02-23 16:24:34 -08:00
umherirrender
ac7d91f834 More use of Title::hasFragment
Missing two places for the new method.

Also change a remaining var access of Title::mFragment to accessor.

Follow-Up: I27d9c3e40e6de6800f4488de167cf06e83c88ce6
Change-Id: I5d26b9a7662673b902e3f7147cbc95ca0626d721
2014-01-24 22:22:45 +01:00
umherirrender
c0d3e85b06 Add Title::hasFragment and use it
Makes checks against the fragment easier to read and all the same.
At the moment some using strval, some use type safe comparsion.

Change-Id: I27d9c3e40e6de6800f4488de167cf06e83c88ce6
2014-01-24 15:42:13 +00:00
Siebrand Mazeland
7e504fd3f3 Remove pre-1.18 compatibility note for Linker::link
Change-Id: I7cda583c5a2c029e14d814bca245d99549f3d24b
2014-01-10 19:10:31 +01:00
jenkins-bot
69246bb766 Merge "Change Title::getInterwiki() in conditions to Title::isExternal()" 2014-01-02 23:31:37 +00:00
umherirrender
65a4ae9fe9 Change Title::getInterwiki() in conditions to Title::isExternal()
Change-Id: Icce26e6194ae96f262029554e05b49117d5e112e
2014-01-02 11:59:10 +01:00
umherirrender
073abe3e12 No variable assignment on return statement
Split the variable assignment and the return statement in two lines for
better readability.

When there was two return statements in one method the logic was swapped
to have only one return statement.

Change-Id: Id7a01b4a2df96036435f9e1a9be5678dd124b0af
2014-01-02 09:43:35 +00:00
Siebrand Mazeland
c2868ebb61 Remove long deprecated methods from Linker
- Linker::makeBrokenLink() (deprecated in 1.16)
- Linker::makeBrokenLinkObj() (deprecated in 1.16)
- Linker::makeColouredLinkObj() (deprecated in 1.16)
- Linker::makeSizeLinkObj() (deprecated in 1.17)

Change-Id: I230096cbf964cdff980f33f76790a524d318408d
2013-12-27 16:08:27 +01:00
Siebrand Mazeland
47e893ca21 Prevent fatal when File::transform() returns false
Bug: 58128
Change-Id: I115affb472bba99268575834de8cbf2d0318a32e
2013-12-09 13:49:46 +00:00
Siebrand Mazeland
c05d05fb75 Do not access MediaTransformOutput->url directly in Linker
Use the available getUrl(). Also update parameter documentation.

This will allow setting MediaTransformOutput::$url to protected in a
following patch.

Change-Id: I54dfbbc845d1fccd106afc7de1f06fa6e06f6a48
2013-12-05 13:55:04 +01:00
umherirrender
0bc583af2c Move closing parenthesis from multi line if and function to own line
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.

Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
2013-12-01 21:39:00 +01:00
umherirrender
5ca5672aac Fixed spacing
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs

Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
2013-12-01 20:58:51 +01:00
umherirrender
146c8258db Avoid repeat of class name when appending in Linker
Simplify the line to make it easier to read, the current way can be read
wrong, see the removed todo.

Change-Id: I71c91acac39b1bacf208c93410da3a2bf576b725
2013-12-01 12:52:19 +01:00
tholam
4563a42e0d Update ImagePage to use HiDPI
Changed processResponsiveImages method in Linker class from
protected to public so that it may be used in the ImagePage class.
called the method in the openShowImage method to generate the srcset.

Bug: 56969
Change-Id: I2494ce98ba1a32d5a963b53482929de9abb048fd
2013-11-20 03:21:12 +00:00
jenkins-bot
85d95e6abd Merge "Use i18n instead of hardcoded brackets and spaces" 2013-10-25 09:00:29 +00:00
Brad Jorsch
33c5d1dbcf Use restriction-level-* messages in Linker::formatTemplates
The current implementation of Linker::formatTemplates only checks for
"sysop" and "autoconfirmed", and completely ignores any other protection
levels. That needs fixing.

Rather than introducing additional messages "template-protected-*" to
match template-protected and template-semiprotected, let's just use the
existing restriction-level-foo messages and wrap them in parentheses.

The old messages are kept for backwards compatability, but could
probably be considered deprecated.

Bug: 43462
Change-Id: I0c507f4ecc1921f599acbda834fa55e96388fa7b
2013-10-23 03:21:57 +00:00
Siebrand Mazeland
16c2a52df5 Use i18n instead of hardcoded brackets and spaces
Change-Id: If914e26f2af23f04c46f011ad8a276a9d3190583
2013-10-21 21:39:43 +00:00
MatmaRex
435491fb25 skin: Convert table of contents from <table> to <div>
It makes no sense semantically; it was only used to make the TOC not
span full width of the page, which is easily achieved with CSS.

Bug: 658
Change-Id: I4ecd0659d1f955a9b593d281a3fef0a81c218a52
2013-07-02 01:08:45 +02:00
MatmaRex
a0beab8a61 Remove the space from between headline and its section edit link
I kept it in I6a6c12a9, but really there's no reason for it to be
there, as the link is delineated with square brackets and visually
with a 1 em padding. It only causes funkiness when copying text.

Change-Id: I7bde0e4fd646108f9319d5d5d00e7ea49fee9252
2013-05-11 20:40:39 +02:00
MatmaRex
7833589c5d (bug 41729) Move section edit links to after the headings
This requires minor changes in various parts of MediaWiki, and
being extra careful about cached rendered pages' HTML.

Fun fact: editsection links are not made in Parser. They're made in
Linker, in Skin *and* in ParserOutput.

Client-side code and screen-scrapers will have to be adjusted to
handle both cases (old HTML will still be visible on cached page
renders until they are purged); extensions using the DoEditSectionLink
or EditSectionLink hooks might need adjustments as well.

* Linker: Change the HTML of pages to move the link itself from the
  beginning of the heading (before <span class="mw-headline">) to the end
  of the  heading (after the span).
* Skin: Change the class from .editsection to .mw-editsection; we use this
  opportunity to clean up old cruft, and this makes it much easier to
  handle cached renders (by just detecting the old class).
* ParserOutput: Implement a horrible hack to support cached parser
  outputs with the old order of items.
* Ensure everything that should support both classes supports both
  classes (this includes print stylesheets and some scripts).
* Implement styles for the new look for all the skins (did this in
  shared.css; the styles are non-intrusive and can be overridden
  easily, and all of the skins were using the same look before).

Change-Id: I6a6c12a90de3604012420b20c1f520e0ece170ab
2013-04-29 00:00:09 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
7c9a49082c Use wfAppendQuery to append a query
Also pass a array to wfAppendQuery, which than does the urlencoding.

Prefer a wfScript() over the global or string

Change-Id: Icada534cb4c99c9441938a2e8dcbc11a142360c6
2013-04-12 07:31:52 +00:00
C. Scott Ananian
11adcad08b Fix link target and retina thumbnails for manual thumbnails. (Bug 45405.)
The output for [[Image:Bad.jpg|thumb=Foobar.jpg|Title]] used to be:

<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a
href="/wiki/File:Foobar.jpg" class="image"><img alt=""
src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220"
class="thumbimage" srcset="http://example.com/images/0/09/Bad.jpg 1.5x,
http://example.com/images/0/09/Bad.jpg 2x" /></a>  <div
class="thumbcaption"><div class="magnify"><a href="/wiki/File:Bad.jpg"
class="internal" title="Enlarge"><img
src="/skins/common/images/magnify-clip.png" width="15" height="11" alt=""
/></a></div>Title</div></div></div>

Note that the target of the <a> is the thumb, not the original image,
and that the srcset is loading the full resolution version of Bad.jpg.

The attached patches fix the link target and srcset issues
(suppressing the srcset when a manual thumb is used).  It also adds a
new "Thumb.png" pseudo-file to the parserTests so that we can write
new tests documenting how manual thumbnails are expected to work,
and adds the 'php' option to the thumbnail tests (since the Parsoid
parser generates different output).

Change-Id: I5be80bfce855b85f9debf3ef1776b877d1f84b9f
2013-03-29 12:12:02 -04:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
Alexandre Emsenhuber
15833dafdf Fix case of some Title methods
Change-Id: I1a37ffb0e8cde4deac027721b0e463585b58d634
2013-03-26 10:54:15 +01:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
jenkins-bot
fac1ec45f1 Merge "Don't use isset() to check whether an existing variable is null" 2013-03-12 15:08:56 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
c6a889acc4 Don't use isset() to check whether an existing variable is null
Change-Id: Ie63f060fb7928fd51a8ad71293955f923f6a18c3
2013-03-10 16:23:46 +01:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Siebrand Mazeland
9b7889b84b Use American English spelling for behavior
Spotted in ipbreason-dropdown by Shirayuki.

Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
2013-03-04 10:24:57 +01:00
jenkins-bot
88e01ff9d6 Merge "Fix documentation in Linker::formatTemplates." 2013-02-20 15:39:55 +00:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
Tyler Anthony Romeo
eb95f300b8 Fix documentation in Linker::formatTemplates.
Follow up to 265404d93c.
Make it clear that when a string is passed to the function,
it has to be already escaped. Also added Message as a
possible parameter type.

Change-Id: I4fb309d0dfcdf61b92c42db4b7ca2ea651d5f071
2013-01-23 00:43:53 -05:00
jenkins-bot
78f603d87c Merge "Links created by Linker::makeExternalLink didn't include rel=nofollow" 2013-01-21 22:33:07 +00:00
Platonides
5d064a7433 Reorganise the functions doing wfProfileOut and returning on all if branches.
Makes life easier for static analysis, since they don't need to
handle if the end of a function where a wfProfileOut was not called
was reachable or not.

It is recommended to review this change ignoring whitespaces
(specially for includes/parser/Tidy.php)

Also documented the rationale for the elseif chain in UploadBase::detectVirus()

Change-Id: Ic4f65937fa9e6f926d8fcfd670e3b0e99e06eefc
2013-01-13 17:53:05 +01:00
Marius Hoch
a53fe6f080 (bug 39397) Only show rollback links if they work
To only show rollback links if they work I had to patch Linker
to have a function (Linker::rollbackData) which can verify
that the editor isn't the only editor of the page. Furthermore
it is checked that the user name or the text of the revision
we might rollback to isn't deleted. Due to the fact that I've
altered the already existing method which showed how many edits
a rollback will revert for that, this wont affect the performance.

Change-Id: I5d1adec993370c39ae8c5c712edd919d456441c6
2013-01-09 17:04:44 +01:00
jenkins-bot
5e2eb7f385 Merge "Miscellaneous profiling fixes" 2013-01-09 08:24:16 +00:00
Tyler Anthony Romeo
265404d93c (bug 41365) Added transclusion count to InfoAction.
Currently InfoAction lists the pages that are transcluded
onto the specified page. This adds a list of pages on which
the current page is transcluded. Also, it adds an option to
limit the list size for transclusion links due to memory
concerns.

Change-Id: I45b077cf3f241b1927f7b1818b04b72115d55c28
2013-01-08 11:45:45 -05:00
Platonides
fb0966908b Miscellaneous profiling fixes
Change-Id: I8d8ce0bc0383e4feb4ed38fd96b2dd516dcb742e
2013-01-06 22:35:11 +01:00
Kaldari
3fd7bacbba Improving function descriptions in Linker
Change-Id: Id3aff70f8b5813f80e5b44bf14cb8198b2e16d4b
2012-12-20 06:44:22 +00:00
Marius Hoch
a92e7fb58b Links created by Linker::makeExternalLink didn't include rel=nofollow
The links created by Linker::makeExternalLink didn't obey $wgNoFollowLinks
(and $wgNoFollowNsExceptions, $wgNoFollowDomainExceptions). To
fix this I made the function call Parser::getExternalLinkRel which
I implemented earlier.

Fixes bug 41983.

Change-Id: I2ff35f89502db2e1f8266f3a943e38c0ea67aced
2012-12-05 22:28:03 +01:00
Kevin Israel
a80bc92245 Add comments to Linker::formatLinksInComment()
Per Tim Starling's suggestion, added comments to the regex in
Linker::formatLinksInComment().

Change-Id: If85567e5a2e57dd56f5f263f3512e9ed2f9c940c
2012-11-29 22:33:48 +00:00
Kevin Israel
3a751a39b1 Optimized regex in Linker.php
Optimized the regex in Linker::formatLinksInComment().

Change-Id: Idea5554bcb8d7e78ddf972ce4c9827fa738ff837
2012-11-29 22:33:38 +00:00
csteipp
ebc73c7df7 (bug 36780) Improve display of IPv6 addresses
Also add partial tests for Linker::userLink()

Change-Id: I680a59bb0ec3ca1d85ed12b0debb3446c73a3aab
2012-11-26 23:00:33 +00:00
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