User talk:Magnus Manske/sdc tool.js

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

Gadget?[edit]

@Magnus Manske: What would you think about making this a gadget? Happy to do it if/when you think the script is ready :) Jean-Fred (talk) 16:23, 23 September 2019 (UTC)[reply]

Turn off adding edited files to watchlist?[edit]

It seems the tool adds edited files to the watchlist. Is it possible to turn that off? Thanks a lot in advance, --Marsupium (talk) 17:04, 29 September 2019 (UTC)[reply]

I believe this is not specific to the tool, but general :-/ see phab:T216369 Jean-Fred (talk) 18:25, 29 September 2019 (UTC)[reply]
I see. Thank you! --Marsupium (talk) 15:15, 30 September 2019 (UTC)[reply]

Accesskey[edit]

The use of "s" as an accesskey interferes with the accesskey for saving a page. Could the accesskey be disabled when you are in editing view ($wgAction == edit or submit)? (Or perhaps the entire script should be disabled when in editing view? How often would you use it while editing a page?) Jon Harald Søby (talk) 09:38, 1 October 2019 (UTC)[reply]

Adding other statements[edit]

Hi @Magnus Manske: , I find I am using significant event (P793) and location (P276) alot. Could you add those to the tool? There seems to be agreement on P276: Commons_talk:Structured_data/Modeling#Location. Sadads (talk) 17:27, 3 October 2019 (UTC)[reply]

Doesnt work[edit]

It doesn't work for me. Do you know weather there is an interference with any other gadget? I switched of Cat-a-lot thought it might be hiddent behind, but it wasnt. Tried in FF and Chrome, havent found the link. Juandev (talk) 21:57, 8 October 2019 (UTC)[reply]

I am having the same issue, I have tried loading it on multiple devices: nothing. Also on Chrome. Sadads (talk) 03:53, 16 October 2019 (UTC)[reply]
"Doesn't work" does not give me much to work with, pardon the pun. Anything in the JavaScript console error log? --Magnus Manske (talk) 08:10, 16 October 2019 (UTC)[reply]
@Magnus Manske: The small text for the tool has disappeared here either on Firefox on 69.0.2 on Ubuntu, console is talkative:
JQMIGRATE: Migrate is installed with logging active, version 3.0.1 load.php:1105:217
This page is using the deprecated ResourceLoader module "jquery.ui.position". load.php:57:272
This page is using the deprecated ResourceLoader module "jquery.ui.widget". load.php:88:947
This page is using the deprecated ResourceLoader module "jquery.ui.core".
Please use OOUI instead. load.php:11:89
Use of "mw.RegExp.escape" is deprecated. Use mw.util.escapeRegExp() instead. 2 load.php:4:516
jQuery.Deferred exception: OO.ui is undefined @https://commons.wikimedia.org/w/index.php?title=User:Magnus_Manske/sdc_tool.js&action=raw&ctype=text/javascript:20:2
mightThrow@https://commons.wikimedia.org/w/load.php?lang=en&modules=ext.categoryTree%2CeventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2CstartUp%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.echo.api%2Cinit%7Cext.tmh.OgvJsSupport%2Cmw-audio-captions%2Cmw-info-button%2Cplayer%2Cvideo-js%2Cvideojs-resolution-switcher%7Cext.uls.common%2Ccompactlinks%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.wikimediaEvents.loggedin%2Cwikibase%7Cjquery%2Coojs%2Csite%7Cjquery.client%2Ccookie%2CgetAttrs%2ChighlightText%2Cspinner%2Csuggestions%2CtextSelection%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Cnotify%2CsearchSuggest%2Cstorage%2Ctemplate%2Cuser%2Cutil%7Cmediawiki.ForeignApi.core%7Cmediawiki.editfont.styles%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%2Cstartup%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.regexp%7Cmediawiki.ui.button%7Cskins.vector.js%7Cuser.defaults%7Cwikibase.client.linkitem.init&skin=vector&version=aba6f:1012:916
resolve/</process<@https://commons.wikimedia.org/w/load.php?lang=en&modules=ext.categoryTree%2CeventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2CstartUp%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.echo.api%2Cinit%7Cext.tmh.OgvJsSupport%2Cmw-audio-captions%2Cmw-info-button%2Cplayer%2Cvideo-js%2Cvideojs-resolution-switcher%7Cext.uls.common%2Ccompactlinks%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.wikimediaEvents.loggedin%2Cwikibase%7Cjquery%2Coojs%2Csite%7Cjquery.client%2Ccookie%2CgetAttrs%2ChighlightText%2Cspinner%2Csuggestions%2CtextSelection%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Cnotify%2CsearchSuggest%2Cstorage%2Ctemplate%2Cuser%2Cutil%7Cmediawiki.ForeignApi.core%7Cmediawiki.editfont.styles%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%2Cstartup%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.regexp%7Cmediawiki.ui.button%7Cskins.vector.js%7Cuser.defaults%7Cwikibase.client.linkitem.init&skin=vector&version=aba6f:1013:589
 undefined load.php:1015:749
TypeError: OO.ui is undefined index.php:20:2
    <anonymous> https://commons.wikimedia.org/w/index.php?title=User:Magnus_Manske/sdc_tool.js&action=raw&ctype=text/javascript:20
    jQuery 2
        mightThrow
        process
JQMIGRATE: jQuery.fn.unbind() is deprecated load.php:1105:792
JQMIGRATE: jQuery.fn.bind() is deprecated load.php:1105:792
JQMIGRATE: jQuery.fn.delegate() is deprecated load.php:1105:792
Thanks for your work! --Marsupium (talk) 20:29, 16 October 2019 (UTC)[reply]
Doesnt work means, that I am not ably to find a link. In your instructional videou, you point to the link in right below corner, but I dont see it there, I dont find it nowere. Juandev (talk) 09:03, 17 October 2019 (UTC)[reply]
Getting the same lack of link here as well, Sadads (talk) 12:32, 17 October 2019 (UTC)[reply]
So I am getting

Uncaught TypeError: Cannot read property 'Dialog' of undefined at HTMLDocument.<anonymous> (index.php?title=User:Magnus_Manske/sdc_tool.js&action=raw&ctype=text/javascript:20) at mightThrow (load.php?lang=en&modules=ext.tmh.video-js|jquery|mediawiki.action.view.postEdit|mediawiki.notification%2CvisibleTimeout&skin=vector&version=1gml2:851) at process (load.php?lang=en&modules=ext.tmh.video-js|jquery|mediawiki.action.view.postEdit|mediawiki.notification%2CvisibleTimeout&skin=vector&version=1gml2:852)

15:02, 21 October 2019 (UTC)
Seems to have been fixed with this edit by User:Zhuyifei1999. Sadads (talk) 20:34, 18 November 2019 (UTC)[reply]

Could you add P3018[edit]

Could you add located in protected area (P3018) to the list of properties. This property should be added to every photo taken in a protected are. --GPSLeo (talk) 11:18, 4 April 2020 (UTC)[reply]

Removing statements[edit]

Hey Magnus, as part of the really poor implementation of Commons:Computer-aided tagging, I am finding a lot of situations where I would like to be able to run search, use SDC, and remove statements. Could you enable that? AC/DC just received this functionality: but that is not as good for leveraging Commons Search. Sadads (talk) 01:06, 8 April 2020 (UTC)[reply]

@Magnus Manske: Realizing I didn't do a ping, Sadads (talk) 01:07, 8 April 2020 (UTC)[reply]

Use with audio files[edit]

Thank you for a great tool. After the recent upload of Swedish folk music I wanted to use this with audio files. It required a small modification that you or someone else may find useful, see User:Belteshassar/sdc tool.js. Belteshassar (talk) 15:45, 26 July 2020 (UTC)[reply]

Add P6243 : 'digital representation of'[edit]

{{Edit request}} In line 235 you will find the following structure

		properties : {
			P180 : 'depicts' ,
			P195 : 'collection' ,
			P793 : 'significant event' ,
			P1071 : 'location of creation' ,
			P7108 : 'location of the point of view' ,
			P5961 : 'depicted part' ,
			P8058 : 'symbol of' , 
		} ,

Please add P6243 : 'digital representation of' to the list.--Jarekt (talk) 03:22, 13 August 2020 (UTC)[reply]

✓ Done Jarekt (talk) 01:40, 17 August 2020 (UTC)[reply]

Add P170 : 'creator'[edit]

I propose to add P170, because the "creator" tag is one of the most important to photographs. --Seewolf (talk) 11:48, 21 September 2020 (UTC)[reply]

Came here to make the same request. Would love to see creator here for artworks. Sweet kate (talk) 22:36, 13 December 2020 (UTC)[reply]

"depicted part" should only work as a qualifier to "depicts"[edit]

Hi Magnus,

I just made a bit of a mess: Category:Exterior of the Festspielhaus Bayreuth contains outside views of a building. I used the SDC too to add depicts (P180) = Bayreuth Festival Theatre (Q329133). Then I saw that the tool also allows to add depicted part (P5961), so I thought I'd add exterior (Q1385033) (and/or façade (Q183061)) as a qualifier to depicts (P180) = Bayreuth Festival Theatre (Q329133). Unfortunately, I ended up adding depicted part (P5961) = exterior (Q1385033) as a statement on its own rather than as a qualifier to depicts (P180). Afaik, that's not how it's supposed to work and I'm a bit surprised that the tool even let me do that. I've reverted everything and partially achieved what I wanted to do with AC/DC. But I very much prefer the Cat-a-lot way of selecting files that the SDC tool offers, so I hope you might be able to have another look at this. Thanks a lot, --El Grafo (talk) 09:59, 1 October 2020 (UTC)[reply]

Width of the text[edit]

Issue
Proposed solution

I have a few issues with this SDC tool:

  1. a lot of text is hidden as the text is much wider as the image. The actual values are hidden most of the time. Only the full text is visible at last image on a row (see attached screen print)
  2. as a lot of structured data of meta data is added recently by User:BotMultichillT the list of properties is quite large. Could you alter the tool that is does only show the property that you want to update.
  3. the SDC link on the right bottom is hidden behind the cat-a-lot link. I have to switch off this much used tool to be able to use SDC. This was mentioned above in the section #Doesnt work, and apparently solved by then. Anyway it does not work for me. I am using Chrome.
  4. the text in the screen print is in Dutch. I was unable to switch language. I tried 3 ways: 1) Language selector on the top of the screen 2) Language in the preferences 3) Babel template on my User page. None of these had any result. The language remained Dutch

HenkvD (talk) 18:58, 28 November 2020 (UTC)[reply]

For 1) (hidden texts) I propose to show properties and values on separate lines. I created a test script User:HenkvD/sdc tool/test.js which is a copy of this script and updated 2 lines. As a tick I made the property line Bold by marking it as prominent. Maybe you can think of a different solution to differentiate properties, values and prominent values. HenkvD (talk) 11:00, 1 December 2020 (UTC)[reply]

Wikidata Object can not be selected anymore and is not preselected as default anymore[edit]

Hello @Magnus Manske: , the tool currently (since today) does not work for me (using Google Chrome). It does not allow me to select a wikidata object, nor is the wikidata object of the wikidata infobox preselected. Previously (till yesterday) the wikidata object of the wikidata infobox has been used as default. Thanks a lot! --M2k~dewiki (talk) 17:23, 30 March 2021 (UTC)[reply]

Hello, today it is possible to set a target item again, but previously the connected wikidata object was selected automatically, so now there is an additional step to do every time. If "Cat-a-lot" and "SDC" are both activated at the same time, the tooltip for "Cat-a-lot" often is placed on the same position as the tooltip for "SDC", so "Cat-a-lot" has been deactived in order to use "SDC". Thanks a lot! --M2k~dewiki (talk) 17:44, 2 April 2021 (UTC)[reply]

Select multiple files[edit]

Hello, it would be great if, as in Help:Gadget-Cat-a-lot#Moving files between categories, and removing files from a category section "Select files", we could select/de-select multiple files "in a row", and also have links "all / none / invert". Christian Ferrer (talk) 18:34, 1 May 2021 (UTC)[reply]

The SDC button behind Cat-a-lot one[edit]

Could you modify the program so that the button appears above the Cat-a-lot button or elsewhere? Otherwise it is covered by the Cat-a-lot button that I usually use. I always use Firefox.

Then I checked that

  1. Cat-a-lot button does not appear in Google Chrome and
  2. both buttons appear correctly located in Microsoft Edge.

--Jmarchn (talk) 09:50, 20 June 2021 (UTC)[reply]

@Magnus Manske: I'm also having problems with Cat-a-lot and SDC playing nice with each other. I'm using Chrome, and Cat-a-lot is covering up SDC. I sometimes can see SDC for a split second before Cat-a-lot overlays it. Maybe SDC can use the lower-left corner instead? My Chrome version is 92.0.4515.107 (Official Build) (64-bit) – Itsfullofstars (talk) 04:05, 6 August 2021 (UTC)[reply]
Also see User_talk:Magnus_Manske/sdc_tool.js#Wikidata_Object_can_not_be_selected_anymore_and_is_not_preselected_as_default_anymore. --M2k~dewiki (talk) 06:42, 6 August 2021 (UTC)[reply]

Please: an improvement!?[edit]

Would it be possible to set a variable (in common.js, i.e. only_depicts = true) that would hide everything that is not depicts displayed below each image? Very thanks! --Jmarchn (talk) 09:57, 20 June 2021 (UTC)[reply]

Hi @Magnus Manske: could captured with (P4082) be added to the tool? - Premeditated (talk) 20:05, 8 January 2022 (UTC)[reply]

Your tools are very useful and I use the SDC script a lot. However, I'm missing created during (P10408) in the list of selectable properties and wonder if you can add it? Sincerely LevandeMänniska (talk), 18:46, 1 November 2022 (UTC)[reply]

 Support Ainali (talk) 23:12, 28 January 2023 (UTC)[reply]

Needs fix to work with phab:T314318[edit]

An interface admin needs to change the two occurrences of the a.image selector to a.image, a.mw-file-description to make the tool work with the new media structure. hgzh 09:34, 21 July 2023 (UTC)[reply]

See diff. Pinging @Raymond @Krd as interface admins. hgzh 10:07, 21 July 2023 (UTC)[reply]
@Hgzh Done. Raymond (talk) 10:12, 21 July 2023 (UTC)[reply]

Preventing File:Wikispecies-logo.svg from being included[edit]

A lot of the Species and Genus categories have the File:Wikispecies-logo.svg embedded as Species navbox at the top of the page -- it keeps getting caught up in using SDC on category pages. Could we put that on a blocklist of images? I am not sure how to do that in the current gadget.Sadads (talk) 14:49, 4 October 2023 (UTC)[reply]

Maybe it needs to be included in the "excludefile" list? Sadads (talk) 14:51, 4 October 2023 (UTC)[reply]
@Magnus Manske: Sadads (talk) 13:27, 17 December 2023 (UTC)[reply]

Solutions to two common problems[edit]

Thanks to Nikki, we have two easy solutions to common problems in previous discussions, and also exacerbated by more SDC statements being added to files. Folks may find these useful:

  • Problem: The SDC tool button gets hidden or covered up behind the Cat-a-lot button.
    Solution: Put in custom CSS code on your Special:Mypage/common.css file to manually place the SDC tool away from Cat-a-lot:
 
 #sdc_main { bottom: 30px !important; }
  • Problem: Too many SDC statements overwhelm the image box, making a big unreadable mess when looking at image tiles in a Category.
    Solution: Put in custom CSS code on your common.css to auto expand the box from a minimum height:
 
 .gallerybox .thumb {<br>
   height: auto !important;<br>
   min-height: 150px;<br>
 }

- Fuzheado (talk) 14:52, 31 January 2024 (UTC)[reply]