Commit graph

432 commits

Author SHA1 Message Date
Tim Starling
f5b882aadc Moving Conrad's recent parser work out to a branch. Reverted r62434, r62416, r62150, r62111, r62085, r62081, r62080, r62077, r62076, r62069, r62049, r62035. 2010-02-19 05:19:32 +00:00
Conrad Irwin
76d285dc36 More sensible semantics for pipe trick with section links after r62076
[[hello#world|]] -> [[hello#world|world]] (not [[hello#world]])
2010-02-09 01:05:49 +00:00
Aryeh Gregor
7021df418c Whitespace 2010-02-08 20:05:06 +00:00
Aryeh Gregor
2936105241 Use consistent case when calling functions 2010-02-08 18:54:08 +00:00
Conrad Irwin
fe91f53371 Fix bug 20339 allow pipe-trick in log reasons
follows on from r62069 moving logic from Parser into Linker 
(copying brion's technique for dealing with subpages)
2010-02-07 14:50:55 +00:00
OverlordQ
e4a73a9eb0 Followup to r61912, make sure hight is actually given, also dont ignore if upright is specified 2010-02-03 08:53:43 +00:00
OverlordQ
0071dd7375 Fix for not being able to override thumbnail height 2010-02-03 06:21:25 +00:00
Tim Starling
4438c46cf3 Revert r56514 and r60421 per CR. 2010-02-03 04:54:20 +00:00
Conrad Irwin
472c3267fe Bug 18784 - Internal links like [[File:Foo|caption]] should read 'caption', not 'File:Foo' when Foo is not an image 2010-02-01 20:43:24 +00:00
Bryan Tong Minh
e72c96772d Fix regression from r60593: The title attribute for links to NS_MEDIA titles no longer contains the namespace as before.
Passed 559 of 559 tests (100%)... ALL TESTS PASSED!
2010-01-12 19:43:03 +00:00
Mark A. Hershberger
add6090790 Make LTR wgLang do the right thing on RTL wgContLang wikis. See bug 6100 and dupes like bug 4047, bug 19228, bug 9137, etc. 2010-01-07 09:32:09 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Bryan Tong Minh
1f12cbc8ed (bug 18885) Red links for media files do not support shared repositories
$wgUploadNavigationUrl now also affects images inline images that do not
exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to
it as appropriate.
2010-01-03 22:45:34 +00:00
Alexandre Emsenhuber
c3ec19debc Replaced all @fixme with "@todo Fixme" since doxygen doesn't have a @fixme command 2009-12-15 21:26:58 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Daniel Kinzler
52f05fd8fa adding support for <a> tags as a parser tag hook, in order to support rdfa output 2009-11-07 16:46:34 +00:00
Aaron Schulz
90dcb3c1f2 * bug 21267 change "show/hide" to "show", if user cannot submit Special:Revisiondelete
* Added revDeleteLinkDisabled() function
2009-10-30 02:14:22 +00:00
Chad Horohoe
f01eb6c10b (bug 21280) Document Linker.php 2009-10-26 14:25:48 +00:00
Bryan Tong Minh
918171cef4 Update HTMLForm for upcoming Special:Upload rewrite.
* Add support for edittools
* Add support for multipart/form-data
* Set id for wpEditToken
* Add support for tooltip and accesskey
* Allow setting a name for the submit button
* Give sections an id
2009-10-18 19:29:35 +00:00
Alexandre Emsenhuber
3bd4424b23 * (bug 21116) MediaWiki:Templatesused, MediaWiki:Templatesusedpreview and MediaWiki:Templatesusedsection now support plural
* break lines a 80 chars in RELEASE-NOTES
2009-10-15 19:10:52 +00:00
Roan Kattouw
b4044991f6 Followup to r56174: tooltipAndAccesskey also returns a string 2009-09-17 14:22:31 +00:00
Alexandre Emsenhuber
b87c11ed37 Fixes for r56068 and r55984:
* missing "!" for the check $wgEnableTooltipsAndAccesskeys
* Linker::tooltip() return a string, no an array
* spacing fixes
2009-09-11 10:59:15 +00:00
Brion Vibber
4b06ec132a Cleanup r55984: rename new $wgDisableTooltipsAndAccesskeys to $wgEnableTooltipsAndAccesskeys and swap value.
'enable' settings are less confusing than 'disable' settings. :)
2009-09-08 20:59:44 +00:00
Domas Mituzas
2196f00313 features time - a feature that allows to disable a feature!
(rationale: allows turning off relatively expensive code that generates invisible stuff :)
2009-09-07 18:38:40 +00:00
Domas Mituzas
7b0ff4c549 don't lookup any classes for 'known' links - fixes excessive queries caused by links in footer 2009-09-07 18:20:32 +00:00
Chad Horohoe
75cd6a9069 Revert r53534 (bug 15745, Make the edit summary link parser detect links more like the real parser). Causes preg_replace_callback bug in 5.2.8 and below, crashes lots of things. See bug 19845 and http://bugs.php.net/bug.php?id=48501 2009-08-27 22:27:42 +00:00
Brion Vibber
71432fb487 Pet peeve time: reduce clutter from common $wgContLang->isRTL() ? 'x' : 'y' pattern. :)
Introduced helpers:
  $lang->getDir() returns 'ltr' or 'rtl' for HTML 'dir' attrib
  $lang->alignStart() returns 'left' or 'right' for HTML 'align' attrib or CSS 'text-align' property
  $lang->alignEnd() returns 'right' or 'left'

And cleaned up a couple arrays of icons to just reverse the order of items rather than repeating the items twice for each possibility.
2009-08-22 01:24:04 +00:00
Aryeh Gregor
aece69bc89 Switch from Xml:: to Html:: in a few places
These should all theoretically be covered by the parser tests.  All
tests pass, the only change needed was to account for less overescaping
in Html::expandAttributes().  There's no reason to escape <>' in
"-quoted attributes, unless I'm mistaken and have just added some XSS.
2009-08-21 20:39:35 +00:00
Tim Starling
831b6d2bf7 * Per my CR comments on r44560: merged FileCache into RepoGroup and fixed wfFindFile() global function bloat. Did not port unused functions such as the batch loading functions.
* Fixed the formal parameter bloat in the file finding functions by making wfFindFile(), RepoGroup::findFile() and FileRepo::findFile() take an associative array of options instead of a rapidly growing collection of formal parameters. Maintained backwards compatibility for the $time parameter, which was the only one used in an extension.
* Took the advice of the todo comment on FileRepo::findFiles() and implemented a calling convention for specifying times (and other options)
* Removed the file object cache from Parser, redundant with the RepoGroup file cache
* Deleted clueless and non-functional LocalRepo::findFiles(). Does not respect redirects, deletion bitfields, or anything else nuanced about FileRepo::findFile(). Does not have the same calling convention as FileRepo::findFiles().
2009-08-15 09:59:59 +00:00
Aryeh Gregor
7aa4a8f90c For HTML 5, drop type="" attributes for CSS/JS
This time done in a nice, centralized fashion, reducing LOC for callers
even if HTML 5 is disabled.  The implementation is a new Html class,
similar to Xml but intended to be HTML-specific from the beginning
instead of half-heartedly attempting to provide generic XML services but
actually with lots of HTML-specific stuff tacked on.

As part of the new Html class, a global config option $wgWellFormedXml
is added.  It's set to true by default, but if set to false, the Html
class will drop some things that HTML 5 doesn't require, like
self-closing " />" syntax and attribute quotation marks (sometimes).
2009-08-11 00:09:24 +00:00
Aryeh Gregor
6babcbbeeb Don't use summary attribute in TOCs
The summary attribute is obsolete in HTML 5.  It wasn't serving any
useful purpose anyway, since it duplicated the h2 inside the table.  (Of
course, we should really stop using <table> for TOCs altogether!)
2009-08-10 01:42:45 +00:00
Brion Vibber
369f767c01 Cleanup for r53518 (subpage support for edit comments)
Reported bug: PHP Notice: Undefined variable: thelink in /var/www/w/includes/Linker.php on line 1090 on hitting http://translatewiki.net/w/i.php?title=Special:Log&dir=prev&user=Siebrand
Weren't properly checking for the case where we end up with an invalid link at the end.
2009-07-21 17:07:56 +00:00
Remember the dot
f35c56e72a Follow-up to r52963: Moved ID attributes on header elements to the spans within the headers to avoid breaking things, at least until we can decide what the best way to handle these IDs is. 2009-07-21 04:19:34 +00:00
Alex Z
3de7d6f25c (bug 15745) Make the edit summary link parser detect links more like the real parser, added a parser test for it 2009-07-20 06:29:46 +00:00
Brion Vibber
a721830762 Also treat [[#section]] links as expected with the 'local' param for diff view vs RC/history view. 2009-07-20 02:26:37 +00:00
Brion Vibber
43bf053fd0 * (bug 14080) Short notation links to subpages didn't work in edit summaries
Moved Parser::maybeDoSubpage guts to Linker to call from both locations.
Added some parser test cases.
Note that this might not behave exactly like the main parser in cases where the link text would get altered, but the links are functional. Yay!
2009-07-20 02:07:56 +00:00
Roan Kattouw
b18ec94952 * Fix typo in Linker.php
* Only call ParserOutput::setTOCHTML() if a TOC was really generated
2009-07-14 13:35:07 +00:00
Remember the dot
a70213071d Removed repetition of URIs in the title attributes (tooltips) of external links. Web browsers typically display the target URIs of links in the status bar, making repeating the URIs in tooltips redundant. Some browsers, like Opera, can be configured to display the URIs in tooltips instead of the status bar without the web page having to supply title attributes at all.
As part of this process, I refactored some of Linker.php and removed an unused parameter from getExternalLinkAttributes.
2009-07-12 23:32:16 +00:00
Remember the dot
b7f4c5612e Updated parser tests for r52726. Also fixed some corner cases and updated the parser test for PMID links. 2009-07-11 04:47:12 +00:00
Remember the dot
9fae5055fa Removed redundant anchors from headings as suggested by Aryeh Gregor on wikitech-l. Even IE6 supports jumping to elements by ID using URLs, so there is no need to make this any more complicated than it has to be. 2009-07-09 03:50:49 +00:00
Remember the dot
05978d7cf3 Title attributes are now always blank on framed and thumbnailed images, and default to blank on inline images instead of defaulting to the image's filename. Additionally, the alt attribute now defaults to the filename on framed and thumbnailed images if no caption or alt attribute is specified.
I was unable to run the parser test suite ("MediaWiki internal error"), so the test suite may need to be updated to reflect these changes.
2009-07-03 05:13:58 +00:00
Roan Kattouw
4a71b9a810 Revert r52410 (Put the [edit] link after the section header instead of before, and don't right-float it anymore) for now because of unresolved issues 2009-06-25 21:10:10 +00:00
Roan Kattouw
9fbe8ba6af (bug 11270) Put the [edit] link after the section header instead of before, and don't right-float it anymore 2009-06-25 20:00:56 +00:00
Roan Kattouw
82022f21bc Core changes for NavigableTOC extension:
* Always generate the section tree, even when we're not generating a TOC
* Add Parser::mergeSectionTrees() to merge two section trees into one
* Add Linker::generateTOC() to generate the HTML for a TOC from a section tree, and add the section anchor to the section tree to facilitate this. This adds the ability to generate TOCs in extensions; haven't converted Parser.php to use it (yet?). As a side effect, this fixes API bug 18720
2009-06-25 11:05:22 +00:00
Roan Kattouw
ae130186e8 Core changes for NavigableTOC extension:
* Add TOC HTML to ParserOutput
* Add class tocsection-$section to <li> elements in the TOC representing sections in the current page (as opposed to transcluded sections)
2009-06-20 21:47:10 +00:00
Siebrand Mazeland
74e9732dae * deprecated makeMediaLink() to makeMediaLinkObj
* add FIXME where I was not able to replace a deprecated method
* add doxygen @deprecated where wfDeprecated() was present, but not the doc

Should conclude replacing or tagging remaining deprecated Linker::make*Link*() in core. Linking to r51559 for code review
2009-06-13 13:41:48 +00:00
Siebrand Mazeland
9b923334c7 Move deprecated methods to the bottom of the class. 2009-06-08 22:33:37 +00:00
Siebrand Mazeland
cf8c96d06c Follow-up to r51543: fix syntax error in Linker.php 2009-06-06 17:04:07 +00:00
Siebrand Mazeland
0d3a39aec4 * replace use of deprecated makeLink() by link() in core
* replace other deprecated Linker::*link*() methods in special pages
2009-06-06 17:00:20 +00:00
Siebrand Mazeland
055fcbd7cb * replace use of deprecated makeLinkObj() by link() in core
* add FIXME where makeLinkObj was used in documentation
2009-06-06 15:45:43 +00:00