Commit graph

57 commits

Author SHA1 Message Date
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Marius Hoch
a547b22fce TraditionalImageGallery factor getCaptionHtml into own function
Better design and also want to override this in Wikibase.

Bug: T192869
Change-Id: I24de654ba9a14b8fe0925007e6ceeabca277c075
2018-04-25 13:23:20 +02:00
Marius Hoch
40ad4433ec Make ImageGallery more flexible for use in Wikibase
Also add missing declaration/ documentation of
ImageGalleryBase::mCaptionLength.

Bug: T46727
Change-Id: I314061b224ff2921eb5532be53e0c9cdc4f52c01
2018-04-13 12:57:30 +02:00
Umherirrender
3124a990a2 Use ::class to resolve class names in includes files
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
2018-01-27 20:34:29 +01:00
Prateek Saxena
60a64e8912 Gallery: Use Parser::parseWidthParam() for gallery dimensions
Used by the `setWidths` and `setHeights` methods to make sure we are
using correct values.

Makes `parseWidthParam` static to be used in the gallery class.

Bug: T129372
Change-Id: I38b9ef0ea26e3748ad5d5458fadd2545f677ef93
2018-01-25 17:35:40 -05:00
Thiemo Mättig
ef470ebf7f Remove @param comments that literally repeat what the code says
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
2018-01-10 14:14:26 +01:00
Tim Starling
dc2948d76d A few doc comment fixups
* Remove some creation dates, they are not protected by GPL
* Remove duplicate @defgroup API
* Remove @ingroup from some @file doc comments on class files. It is not
  useful to list class files alongside classes in the doxygen module menu.
  Add @ingroup to some more class files that had @ingroup on their file,
  that was probably the author's intent.
* In PackedOverlayImageGallery, use the file comment as a class comment
* Don't put @defgroup and @file in the same comment. @defgroup makes the
  whole doc comment describe the group.
* Instead of putting AnsiTermColorer in two groups, use hierarchical
  groups.

Change-Id: If54f6e0b2bc1ea6de42045885cf836ee67b8e961
2017-12-04 11:11:52 +11:00
Umherirrender
a9007e8baf Add missing & to @param documentation to match functon call
Change-Id: I81e68310abcbc59964b22e0e74842d509f6b1fb9
2017-08-11 18:47:46 +02:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
Matthias Mullie
ebb1680359 Show dimensions in TraditionalImageGallery
Bug: T121869
Change-Id: Ie2cb3f1594302f1726ae3d9d2d668c81b7e6b0f1
2017-03-07 13:09:00 +01:00
jenkins-bot
bfce465c0f Merge "Add showThumbnails option to slideshow galleries" 2017-01-02 07:06:52 +00:00
divadsn
7492975a28 Removed deprecated class ImageGallery
Bug: T61113
Change-Id: If315002ef7d1a3937f150d0dda930976c1d95f57
2017-01-01 15:56:55 +00:00
pppery
7fd737c4aa Add showThumbnails option to slideshow galleries
This option causes the thumbnail images for the slideshow to be visible
as soon as the slideshow is loaded. They can still be closed normally.`

Bug: T147913
Change-Id: Iae6fd4f016d9fc98280d4ba92e4332ff06e1fb9e
2016-12-20 20:07:14 +00:00
Arlo Breault
9da9ca5f96 Clarify comment in traditional gallery
Change-Id: I13aa2132d64a1dca8a5ab867fdffc48aca2cf9d1
2016-09-19 12:24:56 -07:00
jenkins-bot
df5e7c3aa0 Merge "Truncate gallery caption filenames with CSS" 2016-07-18 23:39:30 +00:00
Ed Sanders
af7ffaeeec Rename 'slider' gallery mode to 'slideshow'
Bug: T140093
Change-Id: I6f01344b9ac61e3d2a8e7a9d920ba37786537ff8
2016-07-12 14:48:58 +01:00
Ed Sanders
486027d7d5 Truncate gallery caption filenames with CSS
Bug: T139766
Change-Id: Iba7efb8f89e132b8eb39f3c9ba76d2b1a9181b2f
2016-07-09 14:21:12 +01:00
Prateek Saxena
e3aa36ddee Gallery: Add new slider mode
Bug: T128429
Change-Id: I14cac38cf1c66d9ba9584772a1cd3f345731b2af
2016-07-07 09:11:32 -07:00
Kunal Mehta
b9d4bc7824 TraditionalImageGallery: Preload Titles being linked into LinkCache
Change-Id: Ie8b2508a52c1c1476f34f0b8e16184bed15310e1
2016-05-19 19:08:03 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Arlo Breault
3d8bb2923e Fix typo
Change-Id: Ifcea7b157dd1c22f45d03627c8bb0d42da548f79
2016-01-24 10:14:04 -08:00
umherirrender
9d6357bed1 PHP 7 compatibility: Fix variable interpolation in ImageGalleryBase.php
Bug: T115249
Change-Id: I772553cbddad4aa9296ad88877426e31b3d38bbb
2015-12-03 18:59:56 +01:00
umherirrender
5311afb6a4 phpcs: Assignment expression not allowed
Fix some "Assignment expression not allowed"

Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull

Change-Id: Ibfc62b0aaa5c7fa63081edea3ef2b4d0dc984f85
2015-11-18 19:39:19 +01:00
umherirrender
0c3a9674cf Load 'mediawiki.page.gallery.styles' also without javascript
Using OutputPage::addModules lets the style loaded over javascript
Using OutputPage::addModuleStyles forces loading over css

Follows I32697c2c65824d7622c1840330d6074ebb68b488

Bug: T117328
Change-Id: I3ddf105d180336b6eb7ae31286221151055e649f
2015-10-31 17:33:15 +00:00
umherirrender
27700d276f Load module mediawiki.page.gallery.styles for all ImageGalleries
Move the added module from Parser.php to TraditionalImageGallery,
because there the gallerybox class is added to the html and at the
moment all core image galleries are extending the traditional one.

That brings the styles back for special pages like Special:NewFiles,
Special:MostImages and also on category pages with media files.

Follows Ib1aef04dc4fece78e6615386ecaef6a9f368f49e

Bug: T113511
Change-Id: I32697c2c65824d7622c1840330d6074ebb68b488
2015-09-24 16:46:47 +02:00
umherirrender
e3d610bba2 Pass context to parent constructor in PackedImageGallery
This avoids a "ContextSource::getContext called without context."

Change-Id: Ib17139d4be3bf990acff1a1a435d6a7437b6f443
2015-07-11 11:35:34 +02:00
Alex Monk
e7c9096ecc HTTPS-ify links to Wikimedia's sites in MW core source
See https://blog.wikimedia.org/2015/06/12/securing-wikimedia-sites-with-https/

Ignoring SVN stuff because svn.wikimedia.org's SSL certificate has expired, and
ignoring wgSharedUploadPath because T25122 wants to get rid of it.

Also a couple of BZ -> phab changes

Change-Id: I02fd23ac6c30a4a4c718e57d4dedbc693dd653c0
2015-06-13 19:23:23 +01:00
Brian Wolff
06c9f3ae7f Add srcset for images in <gallery>
Bug: T64709
Change-Id: I476beb6cf072c5a38570143d1f56baa3f49d23d4
2015-02-25 19:52:06 -04:00
Kunal Mehta
364890d3d4 Make ImageGalleryBase member variables protected
This was supposed to have happened in 1.24, but oh well.

Follows up 0804f31c1c.

Change-Id: I1ff42f108d0955fd93e7ff7212cd5c1236cd944a
2015-02-04 11:28:29 -08:00
Florianschmidtwelzow
03bf64c84c Really allow Extensions to make a new gallery format
Adjust GalleryGetModes call to fit Hooks::run() signature.

Follow up: I33462a8b52502ed76aeb163b66e3704c8618ba23

Change-Id: I916dade31d6d67de4bb82582cc71585e83fec1c9
2014-12-22 19:09:52 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Brian Wolff
6869f5613b Add missing </div> tag to packed-overlay galleries
Bug: 71030
Change-Id: I7a1781797498b079137becee68f81bf478e6f10e
2014-09-19 00:28:02 -03:00
umherirrender
7c6a25856c Add missing @return to function docs
Change-Id: I45b9d02f94ecc58372268ec5e6a0b572a0b7e2a9
2014-08-23 23:14:57 +02:00
umherirrender
a5ed2df445 Use config instead of globals for ImageGallery
Have to pass a context to the constructor to acutally use it for
settings.

Also adds a RequestContext::getMainAndWarn to get a default warning,
when using the main request, but it would be better to pass one.

Change-Id: I1628a1790c45d44aa4239701486b8b1b7c59a0e6
2014-08-22 22:36:59 +02:00
umherirrender
3b2b6a2773 Add missing @param to function docs
Change-Id: I47fa96a976f55a1a93cb75397285edb8c7f4cd8a
2014-08-14 20:22:52 +02:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
2014-07-24 19:43:03 +02:00
umherirrender
1051c349a0 Fix @deprecated of ImageGalleryBase
Follows-up 0804f31c1c. @deprecated "since", not "in".

Change-Id: I9f28fd431eb84258d89c34c7c1e3e8a90a594dba
2014-07-24 12:47:59 +00:00
Max Semenik
467f4affd1 New hook, AfterParserFetchFileAndTitle
It is needed for PageImages to collect information about galleries, improving results
for Commons mainspace.

Bug: 66510
Change-Id: I3136d648ef2c1841767db0ab33855cd168e3de3e
2014-07-01 17:40:11 -07:00
umherirrender
d1d37f0818 Remove ImageGalleryBase::useSkin() (deprecated since 1.18)
Change-Id: If1f92984bec36948a1149fffef765e7fa78cc26a
2014-06-25 16:46:16 +02:00
Mark A. Hershberger
0804f31c1c Add deprecation notices to recent s/var/public/ property changes.
See change I309cf46891223c5f1520e97b04d4ed315a300e7a for more
information.

Change-Id: I9fe5270f490657450ba2fcdb329abf66736f38c3
2014-05-10 08:35:20 -04:00
Mark A. Hershberger
d7f494c7be Make gallery properties publically accessible.
They were public in the previous release of MediaWiki (1.22), although
the visibility was not set explicitly.

See I779d5a683982dc25bc7cdd30addd5870f2a7efd0 and
https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/12

Change-Id: I309cf46891223c5f1520e97b04d4ed315a300e7a
2014-05-03 13:12:18 -04:00
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
umherirrender
9c614ac02d Fixed some @params documentation
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: I8c9f30128b46086064326708a4878228ba459447
2014-04-14 19:52:18 +00:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
Siebrand Mazeland
bdd721886c Update type hints in TraditionalImageGallery
Change-Id: I09c7d15c8717277c0a84c63f1ebdbffb066d8910
2013-12-02 11:55:27 +01:00
Siebrand Mazeland
fd07e5e455 Declare visibility on class properties of ImageGalleryBase
Change-Id: I779d5a683982dc25bc7cdd30addd5870f2a7efd0
2013-11-25 06:40:50 +01:00
Siebrand Mazeland
3f9d374252 Update documentation for gallery related files
Change-Id: I113a5e055655aa4c99fa09e7ab5cc472815bf38c
2013-11-25 06:40:49 +01:00
Siebrand Mazeland
d3d3a966c5 Replace Linker::link() by linkKnown()
Change-Id: I70b15ea6352f65fcff70fcc85e743441e4fcab08
2013-11-25 06:40:47 +01:00
Siebrand Mazeland
77226ddee7 Remove commented out code
Change-Id: I5989410f8b97508b2b9a3af81f276a58bb18005a
2013-11-25 06:40:46 +01:00
Siebrand Mazeland
589875173b Break long lines in gallery classes
Change-Id: I49d9618155f0edc3fbeacc7bcec6351ada3886eb
2013-11-25 06:40:45 +01:00