User talk:MichaelSchoenitzer/quickpresets

Active discussions

Hello Schoenitzer! Thank you for nice software. I post my feedback.

  • How about "always-ON" option?
I suppose this program checks the value in instance of (P31), and showing correspondent table in the "quick_props". I think this is cool idea. But at the same time, "instance of" property is not so stable. For example, in MediaWiki (Q83), this script shows nothing. Because there is no statement instance of (P31) software (Q7397). So it is useful if "always-ON" table (which is shown in every item pages) is available. For example, by setting "-1" to "qid" in the "quick_props".
  • How about include your software name in edit summary?
This is nice software. So I think it is informative for various editors if software name appears in edit summary.

Thanks! --Was a bee (talk) 10:04, 31 December 2017 (UTC)

Thank you quick update.--Was a bee (talk) 06:11, 1 January 2018 (UTC)
I already added a option for a preset that is displayed if not instance of (P31) is present. I plan to add a possibility to add something for showing a preset for every value of instance of (P31). But I don't understand your note about MediaWiki (Q83) – it works for me. MediaWiki (Q83) has a instance of (P31) free software (Q341) and free software (Q341) subclass of (P279) software (Q7397) -> so it shows my preset for software (Q7397). -- MichaelSchoenitzer (talk) 15:09, 1 January 2018 (UTC)
@Was a bee: Now also added "any P31". -- MichaelSchoenitzer (talk) 15:59, 1 January 2018 (UTC)
Oh, I searched bottom of the page. Edit box is properly shown at below of claims. I didn't expect such recursive detecting function was implemented. --Was a bee (talk) 17:02, 1 January 2018 (UTC)
"Any P31" works nice! Thank you very much. --Was a bee (talk) 18:21, 1 January 2018 (UTC)

Help for getting it workingEdit

I added the script to my common.js as you can see at https://www.wikidata.org/wiki/User:ChristianKl/common.js . However when I browse an item like Elsa von Holzhausen (Q47007717) nothing additional happens. ChristianKl❫ 13:09, 2 January 2018 (UTC)

@ChristianKl: When I use your setting, it works to me at Elsa von Holzhausen (Q47007717). Input box is shown just below the "+add statement". Browser setting interrupts or other gadget interferes? --Was a bee (talk) 10:25, 3 January 2018 (UTC)
Hello Was a bee !
this is exactly the tool I've been dreaming for years to quickly complete wikisource texts that have been imported by a bot, but I have exactly the same problem. I added the script to my common.js and copied your default settings, but nothing happens when I browse a Q5 item with only P31 set.
could you please help me fix this ? --Hsarrazin (talk) 21:00, 9 January 2018 (UTC)
@Hsarrazin: Oh I'm not developer, so what I can do is little. For my case, I'm browsing with Google Chrome. This script works nice on that. Now I checked in Internet Explorer 11. When I browsing with IE 11, nothing is shown. I pressed debug tool by press F12 key, one error is shown. There is no ":" in line 125. I don't know what this exactly means. If you use IE11, wait User:MichaelSchoenitzer fixing this or try Google chrome[1]. --Was a bee (talk) 14:39, 10 January 2018 (UTC)
@Was a bee:
sorry, I read a little too fast, and thought you were the one who developped it :)
@MichaelSchoenitzer:, can you help me with problem described above, please ? --Hsarrazin (talk) 15:20, 10 January 2018 (UTC)
Busy at the moment. Will come back to this in the next days! -- MichaelSchoenitzer (talk) 23:44, 10 January 2018 (UTC)
@Hsarrazin, ChristianKl: Can you please provide me with more info:
  1. What browser are you using?
  2. It it also not working at a human person?
  3. When you open the web-konsole do you see any errors?
  4. If you enter quick_props in the web-konsole does it show your config (or what else)?
I have some ideas for reasons & improvements but need to know what's really behind the issue. -- MichaelSchoenitzer (talk) 15:25, 12 January 2018 (UTC)
@MichaelSchoenitzer:
Sometimes the tool works but mostly it doesn't and it still doesn't at either the latest Firefox or Chrome version for me on Windows 10. I deactivated my custom CSS and it still doesn't work. I get the error: "I get :JQMIGRATE: jQuery.fn.offset() requires a valid DOM element
load.php:140:200
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: moz-extension://b29a1630-7d3c-49d7-b3f2-923289cd189f/common/common.js
Source Map URL: common.js.map
Full log is at https://pastebin.com/KJXDxZ6N
I"m not sure what you mean with "quick_props in the web-konsole". ChristianKl❫ 01:15, 14 January 2018 (UTC)
@ChristianKl: Just to be clear: Is the log from when you opened a item with instance of (P31) human (Q5) (or software (Q7397)) set? With my last point I meant: please if the tool does not show up even through it should, open the browser console (Ctr+Shift+K in Firefox) and type in quick_props and look what result you will be shown (Array [ {…}, {…}, {…} ] or undefined). -- MichaelSchoenitzer (talk) 01:52, 14 January 2018 (UTC)
I did it again with Elsa von Holzhausen (Q47007717) as my test item and for some reasons it now works. In case it stops working again I will report back. ChristianKl❫ 01:59, 14 January 2018 (UTC)
@MichaelSchoenitzer: I now have the normal version working but it doesn't update when I change the file with the presets. What do I need to do to make it update? ChristianKl❫ 18:28, 14 January 2018 (UTC)
It would be great if the tool would provide multiple P31 values to be chosen in cases where there's no P31 filled. ChristianKl❫ 19:41, 14 January 2018 (UTC)
Well, the Idea of the tool is, that you can specify in which situations it should show you which presets. You can make it show you a selection of different P31 values with a configuration-block like this:
	{
		qid: null,
		name: "Noch kein P31",
		defaults: [
			{
				name: "Ist ein",
				pid: 31,
				values: [
					{name: "Mensch", qid: 5 },
					{name: "Software", qid: 7397 },
					]
			}
		]
	},
qid: null tells quickpresets that in case no P31 is set, it should show you a block with Title "Noch kein P31", where you can set P31 to Q5 or Q7397. -- MichaelSchoenitzer (talk) 23:56, 14 January 2018 (UTC)

“Added undefined …”Edit

@MichaelSchoenitzer: Whatever I add, it says “Added undefined item_label” with the correct label item_label of the item added as value after the statement was added, but the property used always says “undefined”. The script actually works (i.e. the claim is indeed added), and this bug is hopefully easy to fix. —MisterSynergy (talk) 21:54, 12 January 2018 (UTC)

@MisterSynergy: moved here. Interesting bug. What browser do you use? Can you open the web console and enter quick_props[0].defaults[0].name (and maybe also try a few other numbercombinations) and tell me if the result is undefined or a correct value. -- MichaelSchoenitzer (talk) 01:49, 13 January 2018 (UTC)
@MisterSynergy: Pinging again, since last ping apparently didn't work. -- MichaelSchoenitzer (talk) 01:00, 14 January 2018 (UTC)
quick_props[0].defaults[0].name="gender", quick_props[0].defaults[1].name="occupation", quick_props[0].defaults[2].name="citizenship", quick_props[0].defaults[3].name="given name", quick_props[0].defaults[4].name="family name" (as defined in User:MisterSynergy/quickpresets_settings.js). quick_props[1].defaults[0].name="License", quick_props[1].defaults[1].name="Os", quick_props[1].defaults[2].name="Language", quick_props[1].defaults[3].name="Gui". Both indicies return "undefined" when increased by 1 then. I use the latest 64 bit Firefox. —MisterSynergy (talk) 06:48, 14 January 2018 (UTC)
  Done @MisterSynergy: Found and fixed it! -- MichaelSchoenitzer (talk) 23:48, 14 January 2018 (UTC)
Thanks, works now! —MisterSynergy (talk) 06:11, 16 January 2018 (UTC)

new try : fails to use my presetsEdit

Hello,

Doing a new try with this tool, that could be very useful :)

I set up my own presets at User:Hsarrazin/common.js -> it should use User:Hsarrazin/quickpresets_settings.js, but in reality, it uses default presets, which I do not need.

I would also like it to propose P31 when there is none : human (Q5), version, edition, or translation (Q3331189) or literary work (Q7725634), as I work on wikisource editions.

Could you help me fix this, please ? --Hsarrazin (talk) 09:58, 10 April 2018 (UTC)

Hi, at "édition" and "oeuvre littéraire" you a syntax error: a closing ).
Anyway since several people have problems with the configuration I'm currently working on a new version using a new, better config system as well as an interface for building the configuration…
You're welcome to try it out! To use the new version do the following:
  • Replace the two lines in you commons.js with:
mw.loader.using(['wikibase'], function() {
	$.getScript( 'https://www.wikidata.org/w/index.php?title=User:MichaelSchoenitzer/quickpresets_beta.js&action=raw&ctype=text/javascript', function() {
		var quickpresets = new wb.Quickpresets();
		quickpresets.init();
	});
});
importScript('User:MichaelSchoenitzer/quickpresetsconfigurator.js');
Tell me what you think. Please note: especially the config-interface is not finished yet. -- MichaelSchoenitzer (talk) 19:03, 11 April 2018 (UTC)
[
	
	{
                "qid": null,
                "name": "aucun P31",
                "defaults": [
                        {
                                "name": "est",
                                "pid":  "P31",
                                "values": [
                                        {"name": "humain", "qid":  "Q5" },
                                        {"name": "édition", "qid":  "Q3331189" },
                                        {"name": "oeuvre littéraire", "qid":  "Q7725634" },
                                        {"name": "poème", "qid":  "Q5185279" },
                                        {"name": "article", "qid":  "Q191067" }
                                        ]
                        }
                ]
    },
    {
		"qid":  "Q5",
		"name": "humain",
		"defaults": [
			{
				"name": "sexe",
				"pid":  "P21",
				"values": [
					{"name": "homme", "qid":  "Q6581097"},
		            {"name": "femme", "qid":  "Q6581072"},
		            {"name": "Intersexual", "qid":  "Q1097630"},
		            {"name": "Transfemale", "qid":  "Q1052281"},
		            {"name": "Transmale", "qid":  "Q2449503"},
		            {"name": "Genderqueer", "qid":  "Q48270"}
		           ]
			},
			{
				"name": "Occupation",
				"pid":  "P106",
				"values": [
		            {"name": "écrivain", "qid":  "Q36180"},
		            {"name": "Politicien", "qid":  "Q82955"},
		            {"name": "footballeur", "qid":  "Q937857"},
		            {"name": "acteur", "qid":  "Q33999"},
		            {"name": "peintre", "qid":  "Q1028181"},
					{"name": "physicien", "qid":  "Q169470"}
		           ]
			},
			{
				"name": "pays de nationalité",
				"pid":  "P27",
				"values": [
					{"name": "France", "qid":  "Q142"},
		            {"name": "Canada", "qid":  "Q16"},
		            {"name": "Belgique", "qid":  "Q31"},
		            {"name": "Suisse", "qid":  "Q39"},
		            {"name": "Luxembourg", "qid":  "Q32"}
		           ]
			},
			{
				"name": "Langue parlée",
				"pid":  "P1412",
				"values": [
					{"name": "français", "qid":  "Q150"},
					{"name": "ancien français", "qid":  "Q35222"},
					{"name": "français classique", "qid":  "Q3100376"},
					{"name": "moyen français", "qid":  "Q1473289"},
					{"name": "fr-ca", "qid":  "Q2075394"},
					{"name": "fr-be", "qid":  "Q815549"},
					{"name": "fr-ch", "qid":  "Q1480152"},
					{"name": "occitan", "qid":  "Q14185"},
					{"name": "oil", "qid":  "Q37351"}
					]
			}
		]
	},
	{
		"qid":  "Q3331189",
		"name": "édition",
		"defaults": [
				{
				"name": "Langue",
				"pid":  "P407",
				"values": [
					{"name": "français", "qid":  "Q150"},
					{"name": "ancien français", "qid":  "Q35222"},
					{"name": "français classique", "qid":  "Q3100376"},
					{"name": "moyen français", "qid":  "Q1473289"},
					{"name": "fr-ca", "qid":  "Q2075394"},
					{"name": "fr-be", "qid":  "Q815549"},
					{"name": "fr-ch", "qid":  "Q1480152"},
					{"name": "occitan", "qid":  "Q14185"},
					{"name": "oil", "qid":  "Q37351"}
		    		]
			}
		]
	}
]

Thanks for helping ! the syntax is not easy... Done ! (I copied the settings you give me) but nothing happens :( - on Q51765626, there was no interface when P31 was not set... and there still isn't. --Hsarrazin (talk) 21:54, 11 April 2018 (UTC)

after some testing, on Q5 items, it still displays your configuration, not mine. I don't know what is the problem :(--Hsarrazin (talk) 22:26, 11 April 2018 (UTC)
@Hsarrazin: Found & fixed the bug. Please try if it's now using your config. -- MichaelSchoenitzer (talk) 12:53, 12 April 2018 (UTC)
@Hsarrazin: New ping, since first one failed. -- MichaelSchoenitzer (talk) 12:55, 12 April 2018 (UTC)
Hi MichaelSchoenitzer !
It now load my presets \o/... but fails to add statements, whether I just click on a value or add one throught the special box - it worked, from your presets, yesterday, but didn't anymore 1 hour ago :'( --Hsarrazin (talk) 13:15, 12 April 2018 (UTC)
@Hsarrazin: Fixed two more bugs. (that's why it's still called beta! ;)) -- MichaelSchoenitzer (talk) 14:27, 12 April 2018 (UTC)
It edits now !!! thanks a lot :))
to add new values and properties, do I use Special:ConfigQuickpresets ? will it add them, or replace existing settings ? --Hsarrazin (talk) 14:52, 12 April 2018 (UTC)
Special:ConfigQuickpresets for now can only create a (new) configuration. (It won't save it you have to save it on your self, it will just create it for you) You can of-course by hand join the old an new configuration. I plan on having Special:ConfigQuickpresets beeing able to load the existend config in the future – but that might take a while. -- MichaelSchoenitzer (talk) 23:37, 12 April 2018 (UTC)

User box createdEdit

Babel user information
de-N Dieser Benutzer spricht Deutsch als Muttersprache.
ȹThis user uses quickpresets.
Users by language

User box is created for this program, Template:User quickpresets. Because there were no logo, I putted the character "ȹ", which consists of q and p. From "quick presets". Feel free to edit, change the template (including logo). Thanks!

Usage
{{#babel:de-N|quickpresets}}
Output
See at the right

--Was a bee (talk) 07:28, 28 April 2018 (UTC)

Thanks a lot! Very cool – I like the idea of using ȹ as logo. -- MichaelSchoenitzer (talk) 14:54, 28 April 2018 (UTC)

Instance and recursive P279Edit

Hi! Today I've tried to set User:Epìdosis/quickpresets - film.js. It works well, apart from one problem: I read "The tool will not only work for items with instance of (P31) set to the specified value, but also for value that are a subclass of (P279) of it (incl. recursive applying)" and I understood that, when I set "qid: 11424", it includes not only items with instance of (P31) film (Q11424), but also items with (e.g.) instance of (P31) short film (Q24862) or instance of (P31) silent short film (Q20667187), because silent short film (Q20667187) subclass of (P279) short film (Q24862) and short film (Q24862) subclass of (P279) film (Q11424). Am I wrong? In fact, it works only with items having instance of (P31) film (Q11424).

Than just a suggestion: the tool supports string datatype ... would it be possible to support also external identifier datatype? Thank you very much, --Epìdosis 18:26, 22 April 2019 (UTC) Ah, and how about supporting time datatype? --Epìdosis 18:41, 22 April 2019 (UTC)

A forkEdit

Hi. Nice work! Just to let you know that the wikibase instance http://wiki.personaldata.io is now running its own fork of quickpresets, already modified quite a bit to make it work outside of Wikidata. You might find it interesting to see what it took. Intro to that instance of the tool at https://forum.personaldata.io/t/another-gadget-quickpresets/217 Thanks for your work! Pdehaye (talk) 02:52, 3 January 2020 (UTC)

Specific values for Lexemes spaceEdit

Hi,

I'm a huge user of this tool for my needs on authors and books. But my favorite presets for Q-space also appear in L-space, where I would clearly need other values.

i.e. in Q-space, when no P31 is set, I have the choice for "P31:Human, Edition, Work, Poem, Article, etc." which should NOT appear in L-space.

How can I define different presets for Q-space and L-space, please ? --Hsarrazin (talk) 12:39, 1 April 2020 (UTC)

Return to the user page of "MichaelSchoenitzer/quickpresets".