wikimedia-gadgets / shortdesc-helper

Gadget on the English Wikipedia.
8 stars 4 forks source link

move shortdesc-helper HTML inside of #mw-content-subtitle by using mw.util.addSubtitle()? #11

Closed NovemLinguae closed 1 year ago

NovemLinguae commented 1 year ago

@jdlrobson Jon (WMF) recommends that we try to use mw.util.addSubtitle() instead of jQuery. This will make things less prone to breakage in the future if skin HTML tag hierarchies or styles change.

I haven't checked if we can just spawn #sdh inside of #mw-content-subtitle yet without breaking styling and functionality, but worth checking. If that technique were to work, we could probably revert patch #10

Do normal pages ever put anything in the subtitle? If there were already an existing subtitle, using mw.util.addSubtitle() would jam both the existing text and this gadget in there.

Current HTML hierarchy using jQuery:

image

Renders this: image

hgzh commented 1 year ago

similar fix for wikidataInfo.js was like this: https://www.wikidata.org/w/index.php?title=User%3AYair_rand%2FWikidataInfo.js&diff=1915953494&oldid=1892012477

the subtitle is commonly used for the "redirected from [xxx]" line, adding the tool's information below should just work fine.

mmiyer commented 1 year ago

Thanks, I implemented that fix and seems to work well.