Yet another script announcement...
If you have a high screen resolution (1280x? and above), you might have noticed that galleries and categories waste a lot of screen space, as they only show four thumbnails in a row. The user option to resize the thumbnails is currently deactivated for caching doomsday predictions, AFAIK.
But fear not, have a tiny JavaScript to rearrange thumbnails in gallery tables, so your screen width will be optimally filled: [[MediaWiki:ResizeGalleries.js]]
I keep having the vague notion of someone else who wrote a script like that before, but I didn't see it on [[Category:User scripts]]. Maybe it's just because its sooo obvious...
Cheers, Magnus
On 7/4/07, Magnus Manske magnusmanske@googlemail.com wrote:
Yet another script announcement...
If you have a high screen resolution (1280x? and above), you might have noticed that galleries and categories waste a lot of screen space, as they only show four thumbnails in a row. The user option to resize the thumbnails is currently deactivated for caching doomsday predictions, AFAIK.
But fear not, have a tiny JavaScript to rearrange thumbnails in gallery tables, so your screen width will be optimally filled: [[MediaWiki:ResizeGalleries.js]]
I keep having the vague notion of someone else who wrote a script like that before, but I didn't see it on [[Category:User scripts]]. Maybe it's just because its sooo obvious...
Cheers, Magnus
Commons-l mailing list Commons-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/commons-l
Wohoo! as someone with a 1920 x 1200 px resolution categories are exceedingly annoying to me... Magnus, yet again you demonstrate your brilliance ;)
Thank you for this and everything else, you're making the Commons an easier place to work!
On 05/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
Yet another script announcement...
If you have a high screen resolution (1280x? and above), you might have noticed that galleries and categories waste a lot of screen space, as they only show four thumbnails in a row. The user option to resize the thumbnails is currently deactivated for caching doomsday predictions, AFAIK.
I don't think so. This works:
<gallery caption="foo" widths=400 heights=300 perrow=2>
You can guess what these options do.
However your script is still useful since in general we don't want to assume anyone has anything more than a 800x600 screen.
So, nice work, as usual ;)
cheers Brianna
On 7/5/07, Brianna Laugher brianna.laugher@gmail.com wrote:
On 05/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
Yet another script announcement...
If you have a high screen resolution (1280x? and above), you might have noticed that galleries and categories waste a lot of screen space, as they only show four thumbnails in a row. The user option to resize the thumbnails is currently deactivated for caching doomsday predictions, AFAIK.
I don't think so. This works:
<gallery caption="foo" widths=400 heights=300 perrow=2>
You can guess what these options do.
Yes (and I should fix my script to honor these, if they are ever used:-) but this will generate a /single/ page cache, which is fine. If every user could say "I always want my thumbnails at 123x123 pixels", then the page would have to be regenerated for that user. You actually have that option in your user settings (under "Files"), but AFAIK it doesn't do anything.
Magnus
Interesting sidenote: I was wondering how well-known the <gallery> attributes are. Searching for "gallery perrow" in the gallery namespace [1] returns 12 results (it says "showing 1-20 of 46", but never mind :-)
So, not the most popular thing, apparently. I'll still fix the script to honor the settings tonight, if noone beats me to it...
Magnus
[1] http://commons.wikimedia.org/wiki/Special:Search?ns0=1&search=gallery+pe...
Sorry to ask, as I'm sure this is obvious to most, but how do I implement that script? It sounds very useful.
Michael
Magnus Manske wrote:
Yet another script announcement...
If you have a high screen resolution (1280x? and above), you might have noticed that galleries and categories waste a lot of screen space, as they only show four thumbnails in a row. The user option to resize the thumbnails is currently deactivated for caching doomsday predictions, AFAIK.
But fear not, have a tiny JavaScript to rearrange thumbnails in gallery tables, so your screen width will be optimally filled: [[MediaWiki:ResizeGalleries.js]]
I keep having the vague notion of someone else who wrote a script like that before, but I didn't see it on [[Category:User scripts]]. Maybe it's just because its sooo obvious...
Cheers, Magnus
Commons-l mailing list Commons-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/commons-l
On 05/07/07, Michael Maggs Michael@maggs.name wrote:
Sorry to ask, as I'm sure this is obvious to most, but how do I implement that script? It sounds very useful.
Installation instructions are at http://commons.wikimedia.org/wiki/MediaWiki_talk:ResizeGalleries.js .
cheers, Brianna
But fear not, have a tiny JavaScript to rearrange thumbnails in gallery tables, so your screen width will be optimally filled:
This is probably the greatest thing since sliced bread! Let's test this a bit and include it in the default JS.
On 05/07/07, Dschwen lists@schwen.de wrote:
But fear not, have a tiny JavaScript to rearrange thumbnails in gallery tables, so your screen width will be optimally filled:
This is probably the greatest thing since sliced bread! Let's test this a bit and include it in the default JS. -- [[:en:User:Dschwen]] [[:de:User:Dschwen]] [[:fr:User:Dschwen]] [[:commons:User:Dschwen]]
Commons-l mailing list Commons-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/commons-l
I don't think it would be a great idea to include this by default because every user has a different screen resolution, perhaps we could use JavaScript to find out the resolution of the user and give them the number of rows suited to there resolution. --UH
I don't think it would be a great idea to include this by default because every user has a different screen resolution, perhaps we could use JavaScript to find out the resolution of the user and give them the number of rows suited to there resolution.
Number of columns. But this is exactly what the script does. Anyway maybe I can answer you concern with my next posting...
On 7/5/07, Uber Halogen uberhalogen@googlemail.com wrote:
I don't think it would be a great idea to include this by default because every user has a different screen resolution, perhaps we could use JavaScript to find out the resolution of the user and give them the number of rows suited to there resolution.
You mean the number of columns, right?
Well, my script *does* determine the screen resolution (actually, the width of the visible page in pixel). But instead of "giving it" to the user, who can't actually use this information, it automagically rearranges the view to this column number. That's the whole purpose of it!
Or did I miss your point?
Cheers, Magnus
On 05/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
You mean the number of columns, right?
Well, my script *does* determine the screen resolution (actually, the width of the visible page in pixel).
So it dynamically adjusts when you resize a window? Marvellous. We ought to roll this out beyond Commons, come to think of it - the other projects don't use galleries much, but they are out there.
On 7/5/07, Andrew Gray shimgray@gmail.com wrote:
On 05/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
You mean the number of columns, right?
Well, my script *does* determine the screen resolution (actually, the width of the visible page in pixel).
So it dynamically adjusts when you resize a window? Marvellous. We ought to roll this out beyond Commons, come to think of it - the other projects don't use galleries much, but they are out there.
No, currently it uses the window width of the page at the moment of page loading. I can look into dynamic rearranging while resizing a browser window if that's a) possible with JavaScript b) a real issue
Cheers, Magnus
On 7/5/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/5/07, Andrew Gray shimgray@gmail.com wrote:
On 05/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
You mean the number of columns, right?
Well, my script *does* determine the screen resolution (actually, the width of the visible page in pixel).
So it dynamically adjusts when you resize a window? Marvellous. We ought to roll this out beyond Commons, come to think of it - the other projects don't use galleries much, but they are out there.
No, currently it uses the window width of the page at the moment of page loading. I can look into dynamic rearranging while resizing a browser window if that's a) possible with JavaScript b) a real issue
Resizing the browser window now triggers rearranging of the thumbnails. If you've already installed ResizeGalleries, force-reload any commons page to enjoy :-)
Cheers, Magnus
Magnus Manske wrote:
Resizing the browser window now triggers rearranging of the thumbnails. If you've already installed ResizeGalleries, force-reload any commons page to enjoy :-)
This is a great script, Magnus! Thanks a lot :-)
I tried to "install" it on en.wikipedia, but it doesn't seem to work. I copied and pasted the text from the script directly into my monobook.js, but even after tons of reloading my galleries are four images wide. Any idea how this could be fixed? (Or maybe my setup is just screwy somehow...)
Anyway, thanks again, Magnus, and thanks in advance for any help with this.
[[en:User:Bdesham]]
On 7/5/07, Benjamin Esham bdesham@gmail.com wrote:
Magnus Manske wrote:
Resizing the browser window now triggers rearranging of the thumbnails. If you've already installed ResizeGalleries, force-reload any commons page to enjoy :-)
This is a great script, Magnus! Thanks a lot :-)
I tried to "install" it on en.wikipedia, but it doesn't seem to work. I copied and pasted the text from the script directly into my monobook.js, but even after tons of reloading my galleries are four images wide. Any idea how this could be fixed? (Or maybe my setup is just screwy somehow...)
Anyway, thanks again, Magnus, and thanks in advance for any help with this.
Works for me: http://en.wikipedia.org/wiki/User:Magnus_Manske/monobook.js
Successfully tested on: http://en.wikipedia.org/wiki/Gallery_of_banknotes#Iceland
For testing, replace your monobook.js with mine, force-reload, see what happens.
Cheers, Magnus
Magnus Manske wrote:
Benjamin Esham wrote:
I tried to "install" it on en.wikipedia, but it doesn't seem to work.
For testing, replace your monobook.js with mine, force-reload, see what happens.
Hmm... I had the exact same code in mine, but it started working when I "replaced" it with yours. Maybe some of the other stuff in my monobook.js was bad code. Anyway, it works now... thanks!
page loading. I can look into dynamic rearranging while resizing a browser window if that's a) possible with JavaScript b) a real issue
a) there is an "onResize" event-handler b) I'd advise against it. How often do resize your browserwindow (almost never) and how long lasts a single gallery pageview (a minute? less?) ? The script complication wouldn't be worth it.
On 7/5/07, Dschwen lists@schwen.de wrote:
page loading. I can look into dynamic rearranging while resizing a browser window if that's a) possible with JavaScript b) a real issue
a) there is an "onResize" event-handler b) I'd advise against it. How often do resize your browserwindow (almost never) and how long lasts a single gallery pageview (a minute? less?) ? The script complication wouldn't be worth it.
'twas two lines, actually :-)
Magnus
On 7/5/07, Dschwen lists@schwen.de wrote:
'twas two lines, actually :-)
Yeah, hm, I guess my answer came to quick then ;-)
:-)
Before we put this live in any way, please test it. I found it doesn't work on IE7 (actually removes the thumbails!), probably due to the different reference handling of IE. Works fine in current Opera.
Can anyone check IE6?
Cheers, Magnus
Before we put this live in any way, please test it. I found it doesn't work on IE7 (actually removes the thumbails!), probably due to the different reference handling of IE. Works fine in current Opera.
Also it causes thumb reloading in Konqueror. Probably a related issue.
Magnus Manske wrote:
On 7/5/07, Dschwen wrote:
'twas two lines, actually :-)
Yeah, hm, I guess my answer came to quick then ;-)
:-)
Before we put this live in any way, please test it. I found it doesn't work on IE7 (actually removes the thumbails!), probably due to the different reference handling of IE. Works fine in current Opera.
Can anyone check IE6?
Same on IE6
I have been looking on it. Now should be fixed. Please check. Happens that IE want the rows into a <tbody> or they aren't shown. The problem was finding such behaviour ;-)
On 7/5/07, Platonides Platonides@gmail.com wrote:
I have been looking on it. Now should be fixed. Please check. Happens that IE want the rows into a <tbody> or they aren't shown. The problem was finding such behaviour ;-)
Great work - I thought I'd go crazy over the IE thing :-)
Confirmed working in IE7, Firefox 2.0.0.4, Opera 9.21. Unless there's objections, maybe we should turn it on for everyone?
Cheers, Magnus
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Magnus Manske's mail client expels the following stream of bytes on 7/5/2007 3:01 PM:
On 7/5/07, Platonides wrote:
I have been looking on it. Now should be fixed. Please check. Happens that IE want the rows into a <tbody> or they aren't shown. The problem was finding such behaviour ;-)
Great work - I thought I'd go crazy over the IE thing :-)
Confirmed working in IE7, Firefox 2.0.0.4, Opera 9.21. Unless there's objections, maybe we should turn it on for everyone?
I dunno about turning this on for everyone; perhaps a discussion at the VP should suffice.
Also, this is confirmed working for Firefox 3.0a7pre (Minefield), however there is one small bug: http://lirepublik.110mb.com/images/ResizeGalleries.png . Does this happen to everyone using this?
- -- Charli (vishwin60/zelzany) (whisper) Go to sleep; you are not hungry! ~anonymous flight attendant
On 7/6/07, Charli Li chengli1@verizon.net wrote:
I dunno about turning this on for everyone; perhaps a discussion at the VP should suffice.
Will do so.
Also, this is confirmed working for Firefox 3.0a7pre (Minefield), however there is one small bug: http://lirepublik.110mb.com/images/ResizeGalleries.png . Does this happen to everyone using this?
You mean the missing borders around the thumbnails? Firefox 2.0.0.4 shows them all right, as do Opera 9.2x and IE7. Maybe it's where the "0a7 pre" comes into play? :-)
Cheers, Magnus
On 7/6/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/6/07, Charli Li chengli1@verizon.net wrote:
I dunno about turning this on for everyone; perhaps a discussion at the VP should suffice.
Will do so.
Also, this is confirmed working for Firefox 3.0a7pre (Minefield), however there is one small bug: http://lirepublik.110mb.com/images/ResizeGalleries.png . Does this happen to everyone using this?
You mean the missing borders around the thumbnails? Firefox 2.0.0.4 shows them all right, as do Opera 9.2x and IE7. Maybe it's where the "0a7 pre" comes into play? :-)
Cheers, Magnus
I have a problem with the thumbs being just a *tad* too wide for the screen.... as you can see in Vishwin's screenshot he had to scroll to the right a tad to show the edges of the right-most images. It isn't by much but is a tad annoying; bug or is there a way to fix it?
Someone (probably me;-) will have to fiddle with the hardcoded width settings again. Note that under no circumstances, a thumbnail will be obstructed by more than a few pixel.
Cheers, Magnus
On 7/6/07, Ayelie ayelie.at.large@gmail.com wrote:
On 7/6/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/6/07, Charli Li chengli1@verizon.net wrote:
I dunno about turning this on for everyone; perhaps a discussion at the VP should suffice.
Will do so.
Also, this is confirmed working for Firefox 3.0a7pre (Minefield), however there is one small bug: http://lirepublik.110mb.com/images/ResizeGalleries.png
. Does this
happen to everyone using this?
You mean the missing borders around the thumbnails? Firefox 2.0.0.4 shows them all right, as do Opera 9.2x and IE7. Maybe it's where the "0a7 pre" comes into play? :-)
Cheers, Magnus
I have a problem with the thumbs being just a *tad* too wide for the screen.... as you can see in Vishwin's screenshot he had to scroll to the right a tad to show the edges of the right-most images. It isn't by much but is a tad annoying; bug or is there a way to fix it?
-- Ayelie ~Editor at Large _______________________________________________ Commons-l mailing list Commons-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/commons-l
Magnus Manske wrote:
Before we put this live in any way, please test it.
It seems to work fine on Safari 2.0.4 (the latest public release, AFAIK), and Firefox 2.0.0.4, both on Mac OS X.
Cheers,
On 05/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/5/07, Uber Halogen uberhalogen@googlemail.com wrote:
I don't think it would be a great idea to include this by default because every user has a different screen resolution, perhaps we could use JavaScript to find out the resolution of the user and give them the number of rows suited to there resolution.
You mean the number of columns, right?
Well, my script *does* determine the screen resolution (actually, the width of the visible page in pixel). But instead of "giving it" to the user, who can't actually use this information, it automagically rearranges the view to this column number. That's the whole purpose of it!
Or did I miss your point?
Cheers, Magnus
Commons-l mailing list Commons-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/commons-l
Sorry, I thought the user had to specify the number of columns manually - my bad. --UH