MediaWiki talk:Gadget-Stockphoto.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
MediaWiki:Gadget-Stockphoto.js forms part of the MediaWiki interface and can only be edited by administrators, stewards and interface editors.
To request a change to MediaWiki:Gadget-Stockphoto.js, add {{Edit request}} to this talk page, followed by a description of your request.
This interface message or skin may be documented on mediawiki.org or translatewiki.net.
When editing this script please adhere to the Commons:JavaScript styleguide.
SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 3 days.

Stockphoto gadget on Commons URL-encodes HTML entities in "Use this file on the web"[edit]

{{Edit request}}

List of steps to reproduce (step by step, including full links if applicable):

   visit https://commons.wikimedia.org/wiki/File:Cornus_sericea_1208027.jpg
   click on "Use this file on the web"
   copy content of "Embed this file"

What happens?: This is the code suggested to embed:

<a title="Dave Powell, USDA Forest Service, Bugwood.org, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons" href="https://commons.wikimedia.org/wiki/File:Cornus_sericea_1208027.jpg"><img width="256" alt="Cornus sericea 1208027" src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Cornus_sericea_1208027.jpg/256px-Cornus_sericea_1208027.jpg"></a>

What should have happened instead?: In the opening <a>-tag you find this piece of code:

<https://creativecommons.org/licenses/by/3.0>

The entities for < and > arround the URL produce < and > when embedding for instance in a wordpress page and prevents the code to work, the image does not appear.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc: the current version of Wikimedia Commons.

--Christian Ries (talk) 14:58, 23 August 2021 (UTC)Reply[reply]


Hi @cries, thanks for taking the time to report this! This is a local gadget on Wikimedia Commons.

User scripts, gadgets, templates, custom CSS are local on-wiki content. Local content is managed independently on each wiki, by each wiki community themselves. Phabricator is mostly used for MediaWiki, MediaWiki extensions, or server configuration, or by developers and teams to organize what they plan to work on. This needs fixing on the local wiki, likely in https://commons.wikimedia.org/wiki/MediaWiki:Gadget-Stockphoto.js . Please bring this up on the local wiki. Hence I am closing this task here - thanks for your understanding!

TASK DETAIL https://phabricator.wikimedia.org/T289494

EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Aklapper Cc: Aklapper, cries, DannyS712, Analytics.mediafiles, Jayprakash12345

@Christian Ries: I can’t reproduce this anymore; I now get:
<a title="Dave Powell, USDA Forest Service, Bugwood.org, CC BY 3.0 &lt;https://creativecommons.org/licenses/by/3.0&gt;, via Wikimedia Commons" href="https://commons.wikimedia.org/wiki/File:Cornus_sericea_1208027.jpg"><img width="256" alt="Cornus sericea 1208027" src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Cornus_sericea_1208027.jpg/256px-Cornus_sericea_1208027.jpg"></a>
– note that it now uses &lt; and &gt; correctly. --Lucas Werkmeister (talk) 19:09, 30 September 2023 (UTC)Reply[reply]

"Use this file on the web" iframe embed code for Common videos do not provide correct width and height values[edit]

As it says in the headline. :) It looks like the width and height values are not being passed to the generated HTML iframe code. Ckoerner (talk) 19:50, 13 September 2022 (UTC)Reply[reply]

"embed_this_file" ("undefined")[edit]

Note that most languages instead of showing the field "Embed this file" show "undefined" (and since many years) because they do not have the entry "embed_this_file" defined. This is true at least for French, German and Italian. Please see MediaWiki talk:Gadget-Stockphoto.js/it and related languages. --Valerio Bozzolan (talk) 14:02, 6 October 2022 (UTC)Reply[reply]

Correct display of two licenses[edit]

The File:Android update.jpg file has two licenses. One in the photo and the other on android. And the problem is that when you click on "Use this file" only one is shown Артём 13327 (talk) 18:52, 29 October 2022 (UTC)Reply[reply]

About internationalization of Chinese[edit]

This gadget has localization of zh. However, in many cases, our interface language is not zh, but its variants, such as zh-sg and zh-tw. There should be some additional handling of internationalization for this language, so as to use zh when my interface language is any variant of Chinese.

Besides, considering MediaWiki:Gadget-Stockphoto.js/zh is written in simplified Chinese, a traditional Chinese version (which can be named MediaWiki:Gadget-Stockphoto.js/zh-hant) is needed, for zh-hant/tw/hk/mo ot be used. SolidBlock (talk) 11:13, 15 July 2023 (UTC)Reply[reply]

Edit request[edit]

{{Edit request}} Hello, I wish change the icons of MediaWiki:Gadget-Stockphoto.js by replacing the icons by : File:OOjs UI icon download.svg (), File:OOjs UI icon arrowNext-ltr.svg (), File:OOjs UI icon logo-wikipedia.svg (), File:OOjs UI icon message.svg (), File:OOjs UI icon lightbulb.svg () and File:OOjs UI icon close-ltr.svg (). What do you think ? Cordially <span data-dtsignatureforswitching="1"></span> manȷıro💬 18:44, 30 July 2023 (UTC)Reply[reply]

@Manjiro5: IMHO this should be discussed somewhere else first, maybe COM:VP; I don’t want to change it based on just one user suggesting it, and it doesn’t seem to have generated any discussion here so far. --Lucas Werkmeister (talk) 19:11, 30 September 2023 (UTC)Reply[reply]
@Lucas Werkmeister Hello, firstly, thanks for your answer ;-) . I will do the proposal tomorrow in the village pump. Have a nice day/night. Regards, manȷıro💬 21:32, 30 September 2023 (UTC)Reply[reply]

Default markup for 'Use this image' is suboptimal[edit]

For an image - say: File:Aris’s Birmingham Gazette - 1771-11-11 - p1.jpg - the default markup provided by the "Use this file" link on the toolbar is:

[[File:Aris’s Birmingham Gazette - 1771-11-11 - p1.jpg|thumb|Aris’s Birmingham Gazette - 1771-11-11 - p1]]

The right hand part of this ("|Aris’s Birmingham Gazette - 1771-11-11 - p1]]") repeats the filename. It should instead (where available) use the caption from the file's structured data, in the user's preferred language:

[[File:Aris’s Birmingham Gazette - 1771-11-11 - p1.jpg|thumb|front page masthead of Aris’s Birmingham Gazette, 11 November 1771 edition]]

This applies to all the applicable markup snippets under each of the "Use this file" links on a file page; for example the non-thumbnail wiki markup and the alt attribute under "Embed this file".

I'm told This probably would require changes in MediaWiki:Gadget-Stockphoto.js

I'm hopeful we might get someone to look at this during the Wikimedia hackathon, in progress as I write. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 03:28, 15 August 2023 (UTC)Reply[reply]

There were no takers at Wikimania, so this still needs attention Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:31, 25 August 2023 (UTC)Reply[reply]

Adding a link "Gadget info"[edit]

It would be awesome to put a link "Gadget info" in the footer of the popup to reach the page MediaWiki:Gadget-Stockphoto.js and find more info. This would allow some users to meet the documentation, join discussions, report problems in the translations, eventually become a developer, etc., hoping to report and fix problems more efficiently. bozz (talk) 11:25, 4 September 2023 (UTC)Reply[reply]

Good idea, but I’d rather link to Help:Gadget-Stockphoto as that’s more useful for the average (non-techy) user (and Help:Gadget-Stockphoto can link to the source code), and would place the link in the icon list appearing next to the image rather than in a modal window for discoverability. —Tacsipacsi (talk) 00:37, 5 September 2023 (UTC)Reply[reply]

Gadget-Stockphoto.js causes unwanted scrolling behavior on File: pages[edit]

As discussed in this Phabricator issue, when enabled, this gadget has been pinpointed as the source of a bug that causes File: pages to scroll upwards by themselves after a page refresh while the page is scrolled down part of the way.

Screen recording of the bug in action: https://archive.org/download/c9sm3/bug.webm
OS: Linux Mint 20.2; Browser: Firefox 117.0.1 (64-bit)
All addons/userscripts/custom css/templates/other gadgets were disabled during pinpointing the cause of the bug. –Vuccala (talk) 14:03, 27 September 2023 (UTC)Reply[reply]