'imagesPerRow' => 0, // Default number of images per-row in the gallery. 0 -> Adapt to screensize
'imageWidth' => 120, // Width of the cells containing images in galleries (in "px")
'imageHeight' => 120, // Height of the cells containing images in galleries (in "px")
- 'captionLength' => 25, // Length to truncate filename to in caption when using "showfilename"
+ 'captionLength' => true, // Deprecated @since 1.28
+ // Length to truncate filename to in caption when using "showfilename".
+ // A value of 'true' will truncate the filename to one line using CSS
+ // and will be the behaviour after deprecation.
'showBytes' => true, // Show the filesize in bytes in categories
'mode' => 'traditional',
];
// Preloaded into LinkCache above
Linker::linkKnown(
$nt,
- htmlspecialchars( $lang->truncate( $nt->getText(), $this->mCaptionLength ) )
- ) . "<br />\n" :
+ htmlspecialchars(
+ $this->mCaptionLength !== true ?
+ $lang->truncate( $nt->getText(), $this->mCaptionLength ) :
+ $nt->getText()
+ ),
+ [
+ 'class' => 'galleryfilename' .
+ ( $this->mCaptionLength === true ? ' galleryfilename-truncate' : '' )
+ ]
+ ) . "\n" :
'';
$galleryText = $textlink . $text . $fileSize;
]
];
}
+ // (T140537) Disallow looking too far in the past for 'newbies' queries. If the user requested
+ // a timestamp offset far in the past such that there are no edits by users with user_ids in
+ // the range, we would end up scanning all revisions from that offset until start of time.
+ $condition[] = 'rev_timestamp > ' .
+ $this->mDb->addQuotes( $this->mDb->timestamp( wfTimestamp() - 30 * 24 * 60 * 60 ) );
} else {
$uid = User::idFromName( $this->target );
if ( $uid ) {
word-wrap: break-word;
}
+.galleryfilename {
+ display: block;
+}
+
+.galleryfilename-truncate {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
/* new gallery stuff */
ul.mw-gallery-nolines li.gallerybox div.thumb {
background-color: transparent;
.mw-gallery-slideshow-img-container a {
display: block;
-}
\ No newline at end of file
+}
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
<div class="thumb" style="height: 150px;">Nonexistent.jpg</div>
<div class="gallerytext">
-<p><a href="/wiki/File:Nonexistent.jpg" title="File:Nonexistent.jpg">Nonexistent.jpg</a><br />
+<p><a href="/wiki/File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">Nonexistent.jpg</a>
caption
</p>
</div>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
<div class="thumb" style="height: 150px;">Nonexistent.jpg</div>
<div class="gallerytext">
-<p><a href="/wiki/File:Nonexistent.jpg" title="File:Nonexistent.jpg">Nonexistent.jpg</a><br />
+<p><a href="/wiki/File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">Nonexistent.jpg</a>
</p>
</div>
</div></li>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
<div class="gallerytext">
-<p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
+<p><a href="/wiki/File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">Foobar.jpg</a>
some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
</p>
</div>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
<div class="gallerytext">
-<p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
+<p><a href="/wiki/File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">Foobar.jpg</a>
</p>
</div>
</div></li>