MediaWiki talk:ResizeGalleries.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Discussion

[edit]

Horizontal scrollbars

[edit]

Great improvement! I seem to get a horizontal scrollbar however when using full screen Firefox with 1280x800 resolution. The script fits 7 thumbnails side by side, but the containers go outside the screen. I'm not sure what exactly should be tweaked, perhaps pixel widths to ems, but horizontal scrollbars on a vertically scrolling page are ugly. --Para 20:05, 5 July 2007 (UTC)[reply]

Is the spacing between the thumb containers accounted for? Disregard could lead to slightly too wide pages. --Dschwen 12:07, 6 July 2007 (UTC)[reply]
The fix mentioned below took care of this problem too. Script adopted! --Para 09:12, 7 July 2007 (UTC)[reply]

Hard-coded element size

[edit]

A great tool! Unfortunately, thumbnail box size is hardcoded in the script. This raises two problems:

  • if the default thumbnail size (120 px) is increased in mediawiki preferences,
  • if the thumbnail size is increased by a user with a syntax like <gallery widths="200px">,

... then the script miscalculates the number of images per row and the gallery runs over the page width, which is worse than with no script at all. A solution : for each gallery, calculate tdwidth and tdpw using the width of the first gallerybox element. — Xavier, 11:56, 6 July 2007 (UTC)[reply]

Without the script, this gallery of six 375 px wide boxes (for 300 px wide thumbnails) is displayed as a 3 rows of 2 images. On a 1280 px wide screen, with a full-screen browser, the script should display this gallery as 2 rows of 3 images. Instead, it displays a single row of 6 images, assuming each box is 155 pixel wide. — Xavier, 12:33, 6 July 2007 (UTC)[reply]

This is fixed now (don't forget to force-reload!:-) --Magnus Manske 19:58, 6 July 2007 (UTC)[reply]
Perfect ! — Xavier, 23:37, 6 July 2007 (UTC)[reply]

Caption is not preserved

[edit]

Another problem is that <caption> elements in the table are not preserved by the script. In the example above, the caption has been set to "Example" and doesn't show when this script is used.

Actually, since this script builds another table from scratch, it doesn't preserve anything but gallerybox elements. It may (or may not) be a good thing in general to remove elements like thead, tfoot, etc. but, for sure, there is no reason to remove captions.

Also, despite it would make no difference today, td elements that surround gallerybox elements should be preserved too (i.e. not deleted and recreated). They may contain formatting attributes (CSS style for example) that should not be removed by this script. — Xavier, 13:37, 6 July 2007 (UTC)[reply]

The current version keeps the original TDs, and doesn't touch CAPTION and the like. --Magnus Manske 19:39, 6 July 2007 (UTC)[reply]
Everything works fine for me (FF2/Linux) now, thanks. Script definitely adopted. — Xavier, 23:37, 6 July 2007 (UTC)[reply]

Gadget

[edit]

This tool is now available as a gadget : MediaWiki:Gadget-ResizeGalleries.js. le Korrigan bla 10:05, 5 December 2007 (UTC)[reply]

Print

[edit]

When I use the Print Preview of Firefox 2.0 then the pictures in row is depentend on the resoultion of window instade of the page size.

The problem is, when a user have a huge screen so that he have 6 pictures in a row, but the printer only can print 5 pictures complete and 6 when cutting on the right side of the picture.

So, is it possible to switch to the usuall rendering in the print preview and the printed page?

-- MichaelFrey 19:32, 4 February 2008 (UTC)[reply]

I supppose eh could resize the page to a size similar to the paper's ... :s Did the default fit all printers? --Platonides 18:18, 16 February 2008 (UTC)[reply]

This script breaks Gallery's perrow=""

[edit]

As the title says this script breaks the gallery's perrow definition:

<gallery align="right" perrow="1" class="noresize">
Image:Commons-logo-en.svg
Image:Commons-logo-en.svg
Image:Commons-logo-en.svg
</gallery>

If set manually it shouldn't be overridden. --Subfader (talk) 16:09, 1 April 2009 (UTC)[reply]

Sometimes it may be desirable to set perrow even if you do want the gallery to resize; see my panorama gallery for an example. However, I just added the option to turn resizing off on a per-gallery basis by setting class="noresize" as shown above. —Ilmari Karonen (talk) 19:04, 8 November 2010 (UTC)[reply]
All these troubles should be gone with bugzilla:3276 --DieBuche (talk) 21:43, 8 November 2010 (UTC)[reply]

Output 1 row of thumbs

[edit]

It would be great if you could define a gallery tag so that one row of images is output instead of a hard number. Would this be possible? I guess it would need some MW-hard-coded parameter? -Subfader (talk) 16:37, 30 July 2009 (UTC)[reply]