Module talk:WikidataIB/Archive 7: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:WikidataIB) (bot
m Archiving 1 discussion(s) from Module talk:WikidataIB) (bot
Line 182:
::::Thanks, I have used it for that particular property to avoid the original problem. But unless I use {{para|uselbl|y}} for every property, there is no way to ensure it won't happen with another property. How about the following: if the sitelink equals the label or one of the aliases (up to case differences) then do not truncate the commas. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 19:52, 23 September 2020 (UTC)
::::: {{re|MSGJ|label=Martin}} That's looks like a good improvement. Aliases are another can of worms, so I've left that out for the moment, but skipping the sitelink processing altogether if the the label and sitelink are the same (apart from case) should clearly be more efficient. The implementation in the sandbox looks good enough and simple enough for me to be confident in updating the main module. It should all work now without using the {{para|uselbl}} parameter. Thank you. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 14:22, 24 September 2020 (UTC)
 
== Wrapping of pencil icon ==
 
Would it be possible to prevent a line break just before the pencil icon because it looks a little unsightly? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 09:39, 22 September 2020 (UTC)
: {{re|MSGJ|label=Martin}} I thought I had done that. The pen icon is separated from the preceding text by a non-breaking space, as you can see if you inspect this:
:* <code><nowiki>{{wdib|fwd=ALL|qid=Q42|P26}}</nowiki></code> → {{wdib|fwd=ALL|qid=Q42|P26}}
: If I experiment by forcing a narrow column, we get:
:* 6em gives: <div style="display: inline-block; width: 6em; background-color: #EEF;">{{wdib|fwd=ALL|qid=Q42|P26}}</div>
:* 5em gives: <div style="display: inline-block; width: 5em; background-color: #EEF;">{{wdib|fwd=ALL|qid=Q42|P26}}</div>
: That's a nuisance. My browser prefers to break the line after the non-breaking space for certain column widths! and I assume yours does too. It makes you wonder what the point of the nbsp is. In the module sandbox I tried moving the non-breaking space ''inside'' the span that encloses the pen image and it gives the same problem:
:* 6em gives: <div style="display: inline-block; width: 6em; background-color: #EEF;">{{wdib/sandbox|fwd=ALL|qid=Q42|P26}}</div>
: In the module sandbox1, I've even tried removing the span altogether with no luck. It looks like browsers treat the image as a reason to ignore the non-breaking nature of the nbsp.
:* <code>With image gives: <div style="display: inline-block; width: 7em; background-color: #EEF;">{{#invoke:WikidataIB/sandbox1|getValue|fwd=ALL|qid=Q42|P26}}</div></code>
:* <code>With &nbsp;text gives: <div style="display: inline-block; width: 7em; background-color: #EEF;">Jane Belson&nbsp;[[#top|P]]</div></code>
: At that point, I'm out of ideas. I'll head over to Stack Overflow and see if there are any solutions there. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 11:09, 22 September 2020 (UTC)
::Thanks for the answer and confirming that you are seeing the same issue as I &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 11:58, 22 September 2020 (UTC)
:::You might have to wrap the whole thing in a div or a span with class="nowrap". I don't know how to do that in Lua. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:21, 22 September 2020 (UTC)
:::: {{re|Jonesey95}} we can't do that. The text returned from Wikidata can be sizeable and has to fit inside an infobox. The result of nowrapping the entire field could be an infobox as wide as the screen. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 19:08, 22 September 2020 (UTC)
 
"''It looks like browsers treat the image as a reason...''" caught my eye. I haven't checked, but is that icon actually an image file? What about changing that to a [[List of Unicode characters|Unicode]] character (I could think of U+21C5: <code>⇅</code>), or maybe a [[Wingdings]] character (1F589: <code>🖉</code>). There are more options in those links. [[User:Rehman|<span style="font-variant:small-caps; font-weight:bold; color:darkblue">Reh</span>]][[User talk:Rehman|<span style="color:green">man</span>]] 04:14, 23 September 2020 (UTC)
[[File:OOjs UI icon edit-ltr-progressive.svg|thumb|right]]
:It's [[:File:OOjs UI icon edit-ltr-progressive.svg]]. Maybe using a character would be better - good idea! That Wingdings character in blue might be nice &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 08:25, 23 September 2020 (UTC)
:: Using the unicode character for an "upper right pencil" gives: <div style="display: inline-block; width: 6em; background-color: #EEF;">Jane Belson&nbsp;[[#top|&#10000;]]</div>
:: That might be a possibility if everybody can see it. I would need to check it across different operating systems. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 16:44, 24 September 2020 (UTC)
:::That one looks good. Can the underline be suppressed? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 16:57, 24 September 2020 (UTC)
:::: I don't see an underline (working on Windows, latest Chrome browser). But underlining of text can always be suppressed by enclosing the text in <code><nowiki><span style="text-decoration: none;"> ... </span></nowiki></code> or incorporating that style in an existing tag or class. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 17:46, 24 September 2020 (UTC)
:::::Weird that I still see the underline on my browser (Windows/Chrome) even with text-decoration: none &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 18:48, 24 September 2020 (UTC) <div style="text-decoration: none; display: inline-block; width: 6em; background-color: #EEF;">Jane Belson&nbsp;[[#top|&#10000;]]</div>
:::::I'm obviously not understanding how to use the CSS properly &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 20:36, 26 September 2020 (UTC)