MediaWiki talk:GallerySlideshow.js/Archive/2011

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

By default

This is currently a gadget. Is there a technical reason why it couldn't be a default feature? --  Docu  at 23:21, 30 January 2011 (UTC)

Nope, no technical reason. If you can gather some majority on the VP, I'll happily enable it globally--DieBuche (talk) 15:18, 9 February 2011 (UTC)
This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)

Where did it go

It doesn't seem to be there any more. --  Docu  at 07:54, 21 May 2011 (UTC)

I don't see it neither, since at least yesterday, nor on Monobook nor on Vector. Nemo 16:12, 21 May 2011 (UTC)
This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)

wikiScript URLs

Hi,

Regarding this edit:

-	apiURL: mw.util.wikiScript( 'api' ),
+	apiURL: (/^\/\//.test(mw.config.get("wgServer")) ? document.location.protocol : '') + mw.config.get("wgServer") + mw.util.wikiScript( 'api' ),
+	indexURL: mw.config.get('wgServer') + mw.config.get('wgScript'),

Why this mechanism to hardcode the current protocol in case wgServer is protocol-relative ? As far as I know, just like requesting /foo.html works fine, //example.org/foo.html works too. No need to expand all the way to include the servername and protocol.

I'm not reverting this because the above edit basically reverted part of an edit I did, so I'm starting discussion first. Was there a problem with just mw.util.wikiScript( 'api' ) ? If so, please say so because that means something should be fixed upstream, instead of here in this gadget. Otherwise, I'll revert back to the way it was, with just a simple call to mw.util.wikiScript without any ternary operators and concatenation of function calls returning strings. –Krinkletalk 17:12, 11 October 2011 (UTC)

There was nothing wrong with your edit. Just revert that part. I made the changes before you came in the copy in my user-namespace and did not adopt your ones. The new variable indexURL is required. Please do not drop it out. A time ago IE7 throw error "access denied" when using protocol relative requests. Now it seems to work. -- RE rillke questions? 17:28, 11 October 2011 (UTC)

Ok, there in another thing to fix (works in math but not in js): Please replace all two occurences of

if (3 < delay < 61) {

with

if ((3 < delay) && (delay < 61)) {

Thank you. -- RE rillke questions? 17:34, 12 October 2011 (UTC)

And this fix:

				for (var id in pages) {
-					var v = pages[id],
-						r = v.imageinfo[v.imageinfo.length - 1],
+					var v = pages[id];
+					if ('undefined' !== typeof v.missing || !v.categories || !v.imageinfo) {
+						continue;
+					}
+					var r = v.imageinfo[v.imageinfo.length - 1],
						rc = v.imageinfo[0],

Reason: There is sometimes no imageinfo available: Hidden revisions, recently deleted

And this fix:

-		maxImageWidth: Math.floor(($(window).width() - 40 - Math.max(Math.min($(window).width()*0.2, 320), 180) )/50) * 50,
+		maxImageWidth: Math.floor(($(window).width() - 50 - Math.max(Math.min($(window).width()*0.2, 320), 180) )/50) * 50,

Reason: Image sometimes too big and hidden.

And this one:

-						if ($('#SlideContainer').height() && key == 27) gallery.toggleVisibility();
+						gallery.pause();
+						if ($('#SlideContainer').height() && key == 27) gallery.toggleVisibility();

Reason: Slideshow should not play when not shown.


Thank you -- RE rillke questions? 14:56, 14 October 2011 (UTC)

✓ Done by DieBuche. Thank you! -- RE rillke questions? 16:34, 16 October 2011 (UTC)

This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)

Delay bug

Hello,

There is a bug in the delay input for the automatic slideshow. When the popup opens, it says to give the delay in milliseconds; however, any input is multiplied by 1000. I'm guessing the intent was to have the user enter the delay in seconds, but this inconsistency is very confusing.

Thank you, and great work on the gadget. InverseHypercube (talk) 04:09, 16 October 2011 (UTC)

Yes, I made a mistake. That's why I am waiting for
if (3 < delay < 61) {
to be fixed. The issue is known. Thank you for reporting. -- RE rillke questions? 09:01, 16 October 2011 (UTC)
It is now fixed. For all those who cannot read and enter a number between 3 and 60 it is multiplied by 1000 otherwise, if the number is >= 2500, it is accepted. -- RE rillke questions? 21:21, 16 October 2011 (UTC)
I was a bit confused by that as well, but figured it out.
I like the overall result and I think we should make GallerySlideshow a general feature for all users.
BTW is there a way to define the delay in Special:MyPage/common.js? --  Docu  at 11:34, 16 October 2011 (UTC)
Making this default, I fear this would require splitting into a load-on-demand-link installer and the actual code. Otherwise page-loadtime is slowed down significantly. The next thing is, that is not really appropriate on all pages. Imagine a deletion request, which includes a gallery. The second point is the immense server-load. The images are sized to approximately fit your browser window. I fear too many people would like the "overall result". Too many for the thumb-servers :-( I like the new style, DieBuche introduced, too.
There is definitively a way to overwrite the defaults with custom settings, including all used text, changing buttons, delay, ... . I am going to investigate how to expose it. Kind regards. -- RE rillke questions? 21:21, 16 October 2011 (UTC)
There is another way but this would require an additional code-change. I think what I added to the help page is enough. Your opinion? BTW, finding people helping translating the help page, would be highly appreciated. Thank you. -- RE rillke questions? 10:50, 17 October 2011 (UTC)
Another thing: the minimum delay is now 2500 ms while before 1s worked as well. Can this be re-enabled? --  Docu  at 00:49, 18 October 2011 (UTC)
 Oppose a waste of resources. You can't tell me, you can capture a whole image and the description in one second. Even 2.5s is far too fast in my view. It is a slideshow, not a racing. -- RE rillke questions? 07:29, 18 October 2011 (UTC)
Why should it be arbitrarily limited? I say let the user choose; I do not find one second too fast. InverseHypercube (talk) 17:29, 18 October 2011 (UTC)
It's not meant to be the default, but choice users can make when they scan for specific features of images. Volunteer time is precious: let's not waste it. --  Docu  at 11:03, 18 October 2011 (UTC)
✓ Done differently: I didn't change the default, but it remembers your delay once you set it.--DieBuche (talk) 07:33, 18 October 2011 (UTC)
Somehow the gadget seems to be gone entirely. --  Docu  at 11:03, 18 October 2011 (UTC)

That's because we prepare it using ResourceLoader. Sorry. -- RE rillke questions? 11:05, 18 October 2011 (UTC)


Value 1 doesn't seem to work any more. --  Docu  at 12:49, 6 January 2012 (UTC)
✓ Done 1001ms or 1s -- RE rillke questions? 13:02, 6 January 2012 (UTC)
I still get "Invalid input. Only numbers greater than 2000 are accepted." --  Docu  at 11:14, 7 January 2012 (UTC)
Then you should delete all files in your cache. -- RE rillke questions? 11:31, 7 January 2012 (UTC)
This section was archived on a request by: RE rillke questions? 11:31, 7 January 2012 (UTC)

i18n

This new version is terrific! Thanks a lot. Please enable i18n. Here is the French translation :

		delayInsertBtn: 'Définir l’intervalle de temps',
		delayInsert: 'Combien de millisecondes entre chaque image ?',
		delayInvalid: 'Entrée invalide. Seuls les nombres supérieurs à 2500 sont acceptés.',
		playLinkText: 'Lire',
		pauseLinkText: 'Pause',
		prevLinkText: 'Précédent',
		nextLinkText: 'Suivant',
		hideText: 'Quitter le diaporama',
		continueKeyHowTo: 'Clé de départ − Vous pouvez sauvegarder cette clé ou mettre en marque-page le lien si vous souhaitez commencer à cette position plus tard.',
		continueKeyInsert: 'Veuillez insérer la clé de départ. Vous devez faire défiler le diaporama pour constater un changement.',
		continueKeyInsertBtn: 'Insérer la clé de départ',
		continueKeyInvalid: 'Clé invalide',
		licenseLabel: 'Licences disponibles : ',
		helpLinkTitle: 'Aide et documentation de cet outil',
		descriptionLoadText: 'Chargement de la description ...',

Jean-Fred (talk) 19:48, 17 October 2011 (UTC)

Note that "Uploader" is hard-coded. Should be turned into a constant. Jean-Fred (talk) 19:59, 17 October 2011 (UTC)
✓ Done on test.wikipedia.org -- RE rillke questions? 11:17, 18 October 2011 (UTC)
This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)

Feature request

  • Could you filter the description text with the language templates based on the user preference ? Ie, I’d like to only see French (wrapped into {{Fr}}) if there is one.
  • The key display causes a big horizontal scrollbar.
  • Adding the StockPhoto shortcuts somewhere on the right ? (to quickly grab the code to use the image).

Jean-Fred (talk) 19:59, 17 October 2011 (UTC) Jean-Fred (talk) 19:59, 17 October 2011 (UTC)

"key display": Which browser does this happen in? Could you make a screenshot --DieBuche (talk) 07:30, 18 October 2011 (UTC)
At least on firefox if the continue-key is too long. (Sometimes the hex-sortkey in categories is very long.) Should we add overflow: hidden for the coninue-key container? -- RE rillke questions? 07:33, 18 October 2011 (UTC)
Fixed. I wrote word-break in the css when it should have been word-wrap. --DieBuche (talk) 09:52, 20 October 2011 (UTC)
This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)

Bug

On Firefox 7.0.1 The slideshow is unclickable (various links in the description do not work). I do not have this problem on Opera 11 (both on Ubuntu 11.04). Jean-Fred (talk) 19:48, 17 October 2011 (UTC)

Can’t reproduce. Seems to work now. Sorry! Jean-Fred (talk) 19:50, 17 October 2011 (UTC)


Currently the label is shown on all pages containing galleries with >1 images (my mistake). To make it working there I suggest: {{editprotected}}

if ($('.gallery li').length < 2) return; // no need for a gallery with a few images
+ if (mw.config.get('wgNamespaceNumber') === -1) return; // don't install on special pages


- if (typeof(window.GallerySlide) === 'undefined' &&
- 	(mw.config.get('wgNamespaceNumber') === 14 || 
- 	mw.config.get('wgNamespaceNumber') === 4 || 
- 	mw.config.get('wgNamespaceNumber') === 0)) 
+ if ( typeof(window.GallerySlide) === 'undefined' &&
+ 	(mw.config.get('wgNamespaceNumber') !== -1) ) 
{

-- RE rillke questions? 15:15, 21 October 2011 (UTC)

✓ Done --DieBuche (talk) 07:40, 1 November 2011 (UTC)
This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)

RL-Preparations

Ensure loading CSS when clicking on a link in testmode (not with acrivated gadget):

// Remove
var extraParams = '&gsDir=' + this.cmdir + '&gsAutoStart=1' + (mw.util.getParamValue('withJS') ? ('&withJS=' + mw.util.getParamValue('withJS')) : '' );
// Add
var extraParams = '&gsDir=' + this.cmdir + '&gsAutoStart=1' + 
	(mw.util.getParamValue('withJS') ? ('&withJS=' + mw.util.getParamValue('withJS')) : '' ) + 
	(mw.util.getParamValue('withCSS') ? ('&withCSS=' + mw.util.getParamValue('withCSS')) : '' );

Ensure all dependencies are present

//Remove
mw.loader.using('jquery.cookie', function () {
//Add
mw.loader.using(['jquery.cookie', 'mediawiki.html', 'mediawiki.util'], function () {
//Remove
importStylesheet('MediaWiki:Gadget-GallerySlideshow.css');

... But something is still missing. Investigating -- RE rillke questions? 08:51, 18 October 2011 (UTC)

... tested and OK. Works on test.wp. You have to activate the gadget in the interface-section. -- RE rillke questions? 09:06, 18 October 2011 (UTC)

OK, I suggest moving

They work well on test.wp. With RL, i18n and load on demand. -- RE rillke questions? 11:08, 18 October 2011 (UTC)

✓ Done by DieBuche. Thank you. One line has to be uncommented:

  • // $('body').css('overflow', 'visible');

-- RE rillke questions? 08:57, 20 October 2011 (UTC)

✓ Done as well --DieBuche (talk) 09:39, 20 October 2011 (UTC)
This section was archived on a request by: RE rillke questions? 17:58, 15 November 2011 (UTC)
Diashow benötigt aktives JavaScript.

Would be needed to be useful on the WLM gallery page. Otherwise is it too confusing (sorts by file name). --Saibo (Δ) 03:01, 12 December 2011 (UTC)

Partially done. There is a new button "gallery-slideshow" now. The problem is the mess with the sorting in the API-result. -- RE rillke questions? 15:03, 12 December 2011 (UTC)
I already saw it - another big fat button :-( But.. well - easily changeable - the functionality is what it is about. Thanks! :-) *waiting for a sorting as on screen* --Saibo (Δ) 17:04, 12 December 2011 (UTC)
If you do not like them, you can hide them:
#GallerySlideContinue, #GallerySlideInit {
	display: none;
}
-- RE rillke questions? 17:14, 12 December 2011 (UTC)
✓ Done -- RE rillke questions? 18:04, 12 December 2011 (UTC)
Great! :-) Thank you! Sorts corectly in FF 3.6. Not in Opera 11.5 (also logged in) --Saibo (Δ) 21:51, 12 December 2011 (UTC)
What is not correctly in Opera? Complete mess? -- RE rillke questions? 22:51, 12 December 2011 (UTC)
No - just the sorting is not as on the gallery page (just looked again). --Saibo (Δ) 23:27, 12 December 2011 (UTC)

Seems to be an Opera-only problem. In IE it works fine. I assume Sizzle or getElementByClass is fooling the script ;-) -- RE rillke questions? 23:36, 12 December 2011 (UTC)

May be. Not that important if it is just Opera. Maybe you could display a note inside the script if someone uses opera and gsReadFromScreen=1. Then I could remove it from the WLM page. ;) Of course it also matters for other gallery pages - so a note inside would make most sense. If you want to. :-) --Saibo (Δ) 00:51, 13 December 2011 (UTC)
Displays a message from Help:Gadget-GallerySlideshow/OSDHelp now. -- RE rillke questions? 13:57, 13 December 2011 (UTC)
This section was archived on a request by: RE rillke questions? 15:33, 13 December 2011 (UTC)