aboutsummaryrefslogtreecommitdiffstats
path: root/includes/ImageGallery.php
Commit message (Collapse)AuthorAgeFilesLines
* New more slick gallery displayBrian Wolff2013-08-141-425/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extension adds a "mode" parameter to the gallery tag, allowing different formats for the gallery tag (galleries in the ui can be controlled by a global) The added modes are: *traditional - The original gallery *nolines - Like the original, no borders, less padding *packed - All images aligned by having same height. JS also justifies the images. (I think this one is the one that will go over best with users.) *packed-overlay - like packed, but caption goes over top the image in a transloucent box. *packed-hover - like packed-overlay, but caption only visible on hover. Degrades gracefully on screen readers, and falls back to packed-overlay if you are using a touch screen. I kind of like this mode when the caption is not that important (ex a category where its just the file name). This also adds a hook to allow people to make their own gallery version. I believe there would be interest in this, as different people have done different experiments. For example: * Wikia: http://community.wikia.com/wiki/Help:Galleries,_Slideshows,_and_Sliders/wikitext * Wikinews: https://en.wikinews.org/wiki/Template:Picture_select What I would like to see for this patch, is first it gets enabled, with the default still "traditional". After about a month or two we consult with users. If feedback is positive, we change the default mode to one of the others (probably "packed"). Adds a "mode" parameter to gallery for different mode, including one 'height-constrained-overlay' which looks much more like other modern websites. Note: This makes one change to the old gallery format. It makes Nonexistent files be rendered like thumbnails (i.e. they are rendered with a little grey border). One thing I'm slightly worried about with this patch, is that I added an option to MediaTransformOutput::toHtml to override the width attribute. I'm not sure if that is the best approach, and would appreciate thoughts on that. This should be merged at the same time as Ie82c1548 Change-Id: I33462a8b52502ed76aeb163b66e3704c8618ba23
* Allow handler specific parameters in <gallery> (page number, etc)Brian Wolff2013-07-051-5/+10
| | | | | | | | | | | | | | | | For multipage media, people really want to be able to specify if the image gallery should display page 1 or page 10. This also allows other handler specific parameters like thumbtime for videos, "lossy" for tiff files, etc. Note, this only allows the handler specific options (typically things that would change an image). Other options in the thumb syntax like class, border, upright, left, etc are still not supported (and mostly probably should not be) Bug: 8480 Change-Id: Ib831d89ed8676deb2f44238ff9a23ce58ad4d2df
* Add broken-file-category for file links inside <gallery/>MatmaRex2013-06-241-0/+4
| | | | | Bug: 50119 Change-Id: I7d06f48e53df43213bda52feec0d3f390e10f742
* Fixed spacing in files direct in includes folderumherirrender2013-04-211-5/+5
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
* Added/Removed spaces around string concatenationumherirrender2013-04-131-1/+1
| | | | | | | | | And added/removed spaces around some other tokens, like +, -, *, /, <, >, =, ! Fixed windows newline style Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* Spellchecked /includes directoryYuri Astrakhan2013-03-131-1/+1
| | | | | | | | | * 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
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-3/+3
| | | | | | | | | | | 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
* Use TargetLanguage of the Parser in ImageGalleryumherirrender2013-03-091-4/+14
| | | | | | | | If there is a parser set on ImageGallery, the target language of the parser should be used, because this parsed piece of html can get into the parser cache. Change-Id: I2e47b316e3dcc6a3db4fb5d13f5065e35fc369dd
* Merge "remove space before semicolon"IAlex2013-02-101-1/+1
|\
| * remove space before semicolonumherirrender2013-02-091-1/+1
| | | | | | | | Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
* | fix some spacingumherirrender2013-02-091-1/+1
|/ | | | | | | | | | Added/removed spaces after opening/before closing parentheses Added a space after a comma Removed unneeded parentheses in condition Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
* Use wfMessage instead of deprecated wfMsg*Alex Monk2012-08-181-1/+1
| | | | | | Or $this->msg in special pages. Change-Id: I774a89d646615053c8424050e42ad95601f92543
* Removed checks for the "MEDIAWIKI" constant on files that only define classes.Alexandre Emsenhuber2012-05-231-3/+0
| | | | | | This checks are not needed in that case. Change-Id: Ia83447427de8b7ea32aced8ff43c7a252b8d504c
* Added missing GPLv2 headers in some places.Alexandre Emsenhuber2012-05-121-0/+21
| | | | | | Also made file/class documentation more consistent. Change-Id: I0db3461139284edcb6ac02923eb83d54e6756ffb
* (bug 34852) new optional 'link' parameter to <gallery>Kim Eik2012-04-161-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds an optional parameter |link= to the <gallery> tag. This will allow for images to link to other pages and externals urls instead of being hardlinked to the image file that is displayed in the gallery. Here are a couple of examples. Link as WikiLink: <gallery> File:20120106_001.jpg|link=Main_Page </gallery> Link as absolute URI: <gallery> File:20120106_001.jpg|my caption|alt=my alt text|link=http://bugzilla.wikimedia.org </gallery> this would cause the link on the thumbnails rendered by the gallery tag to link to a custom page/url instead of the actual media/image. a link should be an internal wiki link or an absolute uri as shown in the examples. Change-Id: I21b276ad5c7a8df13b3a716957d23fd53c37d29e
* More return documentationSam Reed2012-02-091-0/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111101
* Fixing some of the "@return true" or "@return false", need to be "@return ↵Sam Reed2012-02-091-1/+1
| | | | | | | | | bool" and then the metadata can say true if foo, false if bar Other documentation improvements Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111073
* Add some escaping to r109547, 109548, 109549Sam Reed2012-01-191-1/+1
| | | | | | | Improve RELEASE-NOTES-1.19 also Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109550
* * (bug 33819) Display filesize on Special:NewFiles in appropriate unit.Sam Reed2012-01-191-2/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109547
* add missing deprecation notices and added deprecation version to existing onesJeroen De Dauw2011-12-131-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/105985
* Cleanup to r84610 per CR: changed BeforeParserMakeImageLinkObj hook to use a ↵Aaron Schulz2011-09-061-3/+3
| | | | | | | RepoGroup style param array that also excepts a 'broken' parameter. This new parameter replaces the odd "use timestamp '0' to make a broken thumbnail' convention. No other callers are using this hook other than FR, so the old time/sha1 params where removed. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96357
* More wikia upstreamingSam Reed2011-08-171-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94838
* sync up RELEASE-NOTESSam Reed2011-07-151-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92341
* refixing bug 27338 with all parser test fixes, reverts r91557Ryan Kaldari2011-07-061-4/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91573
* Revert r91426 and followups r91427, r91430: Breaks Gallery-related parser testsChad Horohoe2011-07-061-1/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91557
* better fix for bug 27338 - doesnt rely on line-heightRyan Kaldari2011-07-041-4/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91427
* fixing rounding problem, per comment at r82309Ryan Kaldari2011-07-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91426
* And even more documentationSam Reed2011-05-281-0/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89062
* some coding style tweaksJack Phoenix2011-05-161-20/+20
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88233
* More versions added to @deprecated tagsSam Reed2011-05-061-1/+2
| | | | | | | | | Couple of inbound calls fixed up Some ancient code removed as it's been marked deprecated Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87584
* Adjust maxwidth calculation for galleries. Bug 27577Leo Koppelkamm2011-05-021-1/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87266
* Add |alt= option for galleries ( Bug 18682 ). Recommit of r86749, with ↵Leo Koppelkamm2011-04-251-22/+27
| | | | | | | nested |alt= now fixed. Patch by Jan Paul Posma Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86859
* Reverting r86749: The alt stuff is far too simplistic. One way to fix it ↵Leo Koppelkamm2011-04-231-27/+22
| | | | | | | would be to generalize makeImage() in the parser to process gallery params as well, but I don't have time to that now Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86752
* Add ability to use add alt texts for images in galleries ( Bug 18682 ). ↵Leo Koppelkamm2011-04-231-22/+27
| | | | | | | Patch by Jan Paul Posma. Also cleaned up some comments and var names Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86749
* Follow-up changes to r84610:Aaron Schulz2011-04-041-1/+1
| | | | | | | | | | | * Cleaned up mImageTimeKeys format * ImageMap: Removed redundant addImage call (makeImage handes this) * ParserFunctions: added time/sha1 to addImage() call * Removed excess ampersands in hooks * Added some function doc comments Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85305
* Followup r85244; Define all methods as static, implement a DummyLinker to ↵Daniel Friesen2011-04-031-22/+5
| | | | | | | forward calls for passing to hooks and finish off anything in the way. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85247
* Follow-up r84659: no need to pass parser by reference to event handlersAaron Schulz2011-03-241-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84669
* * Replaced crufty BeforeParserMakeImageLinkObj/BeforeGalleryFindFile hooks ↵Aaron Schulz2011-03-241-15/+8
| | | | | | | | | with BeforeParserFetchFileAndTile hook * Updated the only calling extension (these was basically single-purpose hooks) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84659
* Remove some trailing whitespaceSam Reed2011-03-241-0/+1
| | | | | | | Add some documentation Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84653
* * Follow-up r84610: don't assume a Parser object is attachedAaron Schulz2011-03-231-4/+15
| | | | | | | * Removed unused $i var Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84632
* * Put parser output file version tracking to coreAaron Schulz2011-03-231-5/+2
| | | | | | | | * Added some ParserOutput accessors * A few cleanups to fetchFile() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84610
* * Made BeforeParserMakeImageLinkObj/BeforeGalleryFindFile let hooks set sha1 ↵Aaron Schulz2011-03-231-6/+9
| | | | | | | | | | | | | | | parameter * Made FlaggedRevs specify files by sha1,timestamp to handle renames with no redirects. This makes them handled as well as templates in this regard. (bug 27836) * Moved BeforeGalleryFindFile hook to proper place (don't trigger for non-NS_FILE titles) * Removed unused mRevisionId field from ImageGallery * Removed old hotfix from makeMediaLinkObj(); all the current callers would crash beforehand if the title was null anyway * Updated hook docs (some prior params were missing) * Broke some long lines and cleaned up some whitespace * TODO: track file info in core rather than fr_fileSHA1Keys and ugly, duplicated, queries. This should be easy to do now. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84591
* Fix overestimation of max-width when using perrow mode.Derk-Jan Hartman2011-03-141-8/+15
| | | | | | | | | | Also use const variables to make this more readable. Fixes bug 27577 Follow up to r77411 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83965
* Gallery's perrow was overwriting the original style= attribute. Derk-Jan Hartman2011-02-201-1/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82538
* followup r82181 and r82215 to fix the FIXME and botched fix for FIXME.Mark A. Hershberger2011-02-161-3/+7
| | | | | | | | | | | Patch supplied by DieBuche (bug #27338) along with screenshot demonstrating fix. Took out fix for bug #27458 (“<gallery> has a white background now”) since bug it conflicts with a fix for bug #26470. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82309
* re r82181 remove min-height that doesn't work with IE6Mark A. Hershberger2011-02-161-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82215
* * (bug 27338) Gallery in 1.17 breaks for audio/video + ogghandlerMark A. Hershberger2011-02-151-9/+8
| | | | | | | | | | | | | | | | Patch by DieBuche, who explains the CSS: If the image height is lower than the line-height, the margin-top is applied to the top of the line. a very short image will not follow for 3-4px laters, thus leading to a bigger distance from the top than it should be. vertical-align:text-top moves the picture up, so this problem doesn't happen I've not tested this, but DieBuche and Derk-Jan Hartman tested and provided screenshots in the bug. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82181
* Simple commit trimming some trailing whitespaceSam Reed2010-12-221-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78806
* Follow up to r77411. Patch by DieBucheDerk-Jan Hartman2010-12-051-7/+9
| | | | | | | | | | | | | | | 1. Adds a line css to actually fix Bug 3770 (Sorry, I had forgotten to paste it there as well) 2. Fixes a problem, where the box size would be slighty higher if the image thumb has a height of less than 8px 3. Normalize the calculation of the vertical padding to be exactly the same one as the horizontal padding. (This is only relevant for unusually large galleries, eg. previously it returned a not-exactly-square box if you specified 500px as both width and height) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77836
* Give image <gallery>s fluid widthAryeh Gregor2010-11-291-21/+20
| | | | | | | | | | | | | Bug 3276. Patch by DieBuche, with style cleanups by me, plus a tweak from comment 27 of the bug to fix spacing. This incidentally removes the border around galleries, but this was hard to notice anyway, and could be easily readded if desired. Tested in a few browsers, including IE6, but more testing and/or input from CSS gurus would be appreciated. Updates parser tests, including for Cite. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77411