![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could an admin please re-copy User:Yair rand/ReferenceTooltips.js to this page to add the recent bug fix? Thanks. -- Yair rand ( talk) 19:19, 4 April 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could someone synchronize the pages again, please? -- Yair rand ( talk) 21:35, 19 April 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Where is element #footer-places
? Also, disabling of this gadget isn't work (Firefox 13).
Saint Johann (
ru)
15:48, 17 June 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
#footer-places
is at the bottom of the page, holding the "Privacy policy", "About Wikipedia", and "Disclaimers" links, but only in Vector skin. I had forgotten to also include the equivalent elements for other skins. There was also another bug in working with other skins that I had missed. Now that both bugs, as well as the problem in Firefox, are fixed, could an admin please copy
User:Yair rand/ReferenceTooltips.js and
User:Yair rand/ReferenceTooltips.css over
MediaWiki:Gadget-ReferenceTooltips.js and
MediaWiki:Gadget-ReferenceTooltips.css again? (Sorry for having to ask so frequently.) --
Yair rand (
talk)
19:52, 17 June 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hello!
Could someone apply these changes to the script? Helder.wiki 21:22, 11 July 2014 (UTC)
This gadget causes the error: NotFoundError: Node was not found. See phab:T109486. Helder 17:54, 18 August 2015 (UTC)
I was using Iceweasel 38.2.0. On Google Chrome it is a little more verbose:
{ "errorMessage": "Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.", "url": "/info/en/?search=%28%CE%B5,_%CE%B4%29-definition_of_limit", "lineNumber": 102, "columnNumber": 812, "errorObject": { "stack": "Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.\n at Error (native)\n at HTMLUListElement.eval (eval at <anonymous> (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:4:681), <anonymous>:102:812)\n at HTMLUListElement.opt.complete (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:110:60)\n at fire (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:45:124)\n at Object.self.fireWith [as resolveWith] (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:46:431)\n at Animation.tick (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:107:719)\n at jQuery.fx.tick (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:112:760)" } }
Helder 18:55, 18 August 2015 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
To allow users to use custom styling of the highlighted reference, please replace:
h.style.border = ""
→ $( h ).removeClass("RTTarget")
h.style.border = "#080086 2px solid"
→ $( h ).addClass("RTTarget")
Note that this class is already defined in MediaWiki:Gadget-ReferenceTooltips.css. Petr Matas 14:44, 9 January 2016 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Problem description: Open Quantum state#Ref-14. Reference 14 contains a link to reference 1. If you hover on the link to reference 1, no tooltip is shown, although reference 1 is off-screen (above the visible area). This is because the check for the reference being below the visible area is implemented, but above is not.
Fix: Please replace
if( !isTouchscreen && ( window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0 ) + $(window).height() > $( h ).offset().top + h.offsetHeight ) {
with
var windowTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; if( !isTouchscreen && windowTop < $( h ).offset().top && windowTop + $(window).height() > $( h ).offset().top + h.offsetHeight ) {
Petr Matas 13:20, 13 January 2016 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could an admin please merge these changes? Changes include:
-- Yair rand ( talk) 23:04, 14 January 2016 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This script contains the lines
$(this)[ isTouchscreen ? 'click' : 'hover' ](function( e ){
and
isTouchscreen || $(tooltipNode).hover(show, hide);
which cause the following warning in the console:
JQMIGRATE: jQuery.fn.hover() is deprecated
Helder 22:54, 7 October 2017 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hello! I would like to suggest to update to the new version of this gadget I've presented at mw:Topic:Ueqlcc482l9yw8gv. There are numerous bugfixes and added features like Harvard-style citations support. Tooltip style & animations are also updated to be consistent with Page Previews' style & animations. It has been tested thoroughly and used in Russian Wikipedia for several months with no complaints.
Jack who built the house ( talk) 11:18, 29 December 2018 (UTC)
jquery.client
and mediawiki.notify
dependencies are needed too.
Jack who built the house (
talk)
19:52, 2 February 2019 (UTC)As reported here, this gadget's feature to show tooltips seems to make links with tooltips unclickable on touchscreen devices:
This is particularly inconvenient on navboxes, which uses {{
navbar|mini=y}}
to show the links on top left. Can this be fixed with a change to this JS?
Nardog (
talk)
09:50, 4 April 2019 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I fixed the issue together with another one, reported at en:Template talk:Harvard citation#Cosmetic issue: nested quotes.
Please update the gadget by moving the code from en:User:Jack who built the house/Gadget-referenceTooltips.js to here.
@ Gzhegozh: you can update in your wiki too. Jack who built the house ( talk) 14:00, 10 May 2019 (UTC)
// Source
/info/en/?search=MediaWiki:Gadget-ReferenceTooltips.js
. Updated my code, now it's correct.
Jack who built the house (
talk)
19:32, 10 May 2019 (UTC)![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Since May 2018 we have the ability to use the dir
attribute in the <ref>
tags to specify the directionality of ref tags as right-to-left (RTL) or left-to-right (LTR). This is widely used in pages that cite both RTL and LTR sources, for example on Persian Wikipedia (fawiki, see
example). Since the ReferenceTooltips code is used on many wikis, it is ideal to add support for directionality in its enwiki version so that all others who copy it would also benefit from it.
I have already implemented the solution into our copy on fawiki. Please incorporate it here too.
Happy to answer any questions (but please {{ ping}} me). huji— TALK 14:47, 1 July 2019 (UTC)
console.log
there.) --
Yair rand (
talk)
16:40, 1 July 2019 (UTC)
The Cite extension has an experimental feature called
book referencing. This feature allows editors to cite multiple parts of an already-cited source using the extends
attribute. For instance, an editor could cite a book with the citation <ref name="Miller">E. Miller, ''The Sun'', (New York: Academic Press, 2005)</ref>
, and then they could cite page 42 in that book with a second citation <ref extends="Miller">p. 42</ref>
.
Continuing with the earlier example, currently when a user hovers over the "p. 42" sub-citation, the tooltip will just contain "p. 42" without the book name. That tooltip is not especially useful. It would be nice if this gadget could handle "book references" more naturally. That is, if a user hovers over a citation of the form <ref name="child" extends="parent">text</ref>
attribute, it would be nice if the tooltip displayed the contents of both the parent
and child
citations. Note that book citations can only go one level deep (you cannot extend a citation that extends another citation), which should make the implementation more straightforward. Thank you for considering this suggestion!
MtMNC (
talk)
06:51, 2 November 2020 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
As it turned out, it can be unclear to users what they are disabling/enabling. So please replace
'rt-enable': 'Enable',
'rt-disable': 'Disable',
with
'rt-enable': 'Enable Reference Tooltips',
'rt-disable': 'Disable Reference Tooltips',
Jack who built the house ( talk) 20:43, 4 February 2024 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please update the JS and CSS parts of the gadget:
Changes:
--font-size-medium
CSS variable and making the font size and several related properties relative (in em
) instead of absolute (in px
).<a>
element for the settings link instead of <div>
as more semantically appropriate.box-shadow
, icon size).Ping me if there are any problems. Jack who built the house ( talk) 08:40, 9 July 2024 (UTC)
I think it was previously smaller?
Some footnotes with wider content get cut off horizontally.
OO.ui.getTeleportTarget()
instead of <body>
? (See
phab:T348286.)
Nardog (
talk)
06:55, 10 July 2024 (UTC)
#mw-teleport-target
could actually be a better idea than hardcoding anything (note that reference tooltips are not OOUI-based).Let's see. Before the change the tooltip was 13px across all skins against 14px body size. We want to make it bigger where the body font size is bigger. #mw-teleport-target
is:
<ol class="references">
?
Nardog (
talk)
07:33, 10 July 2024 (UTC)
font-size: 90%;
to the root font size and bring side effects with it.
Jack who built the house (
talk)
07:40, 10 July 2024 (UTC)
<ol>
element as well as any styles applied to ol.references
. By "root font size" I mean 1rem, so it's not relative to the body font size.
Jack who built the house (
talk)
08:20, 10 July 2024 (UTC)
font-size: 90%;
(or calc(... * 0.9)
or whatever) then?
Nardog (
talk)
08:26, 10 July 2024 (UTC)
#mw-teleport-target
, and I can't yet figure out how to solve it. #mw-teleport-target
is located at the end of the DOM and only has position: absolute;
z-index: 450;
position: absolute
. If I use position: fixed
for a descendant, then its descendants will have fixed positioning relative to the page (which we don't need), even if they have position: absolute
.If #mw-teleport-target
had top: 0;
width: 100%;
#mw-teleport-target
seems to be intended for fixed-positioned elements like dialogs only.
Jack who built the house (
talk)
12:51, 11 July 2024 (UTC)
#mw-teleport-target
was intended exactly for this use case. (As noted below, access it using require( 'mediawiki.page.ready' ).teleportTarget
.) It's used by both Codex and OOUI and is meant to be usable by anything else.top: -2447.62px
on those OOUI dropdowns, which is a bit silly). I would guess nobody noticed because those libraries have generic methods to position anything relative to anything else, and they coped with the weirdness automatically. You might want to file a Phab task (and CC people who worked on the feature:
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/945825), or you'll have to make your code cope with it too.
Matma Rex
talk
16:57, 11 July 2024 (UTC)
const topOffset = -$('#mw-teleport-target').offset().top + $(window).scrollTop();
$('#mw-teleport-target').append(`<div style="position: absolute; top: ${topOffset}px; background-color:yellow;">test test test</div>`);
width: max-content
(which
is a bit newer than Grade C browsers) together with max-width
, you can't have descendants with variable width also.
Jack who built the house (
talk)
17:49, 11 July 2024 (UTC)You might want to file a Phab task (and CC people who worked on the feature: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/945825)
#mw-teleport-target
isn't served by HTML, so I assume you can't just expect it to be there but have to await something.
Nardog (
talk)
07:36, 10 July 2024 (UTC)
mw.loader.using('mediawiki.page.ready').then(function (require) {
console.log(require('mediawiki.page.ready').teleportTarget);
});
--font-size-medium
will land in skins other than Vector 2022 and Minerva? Is #mw-teleport-target
reliable to be used by gadgets like this one (that seek the font size more or less equal to the body font size)?
Jack who built the house (
talk)
08:56, 10 July 2024 (UTC)
The font size variables are not stable as they are not part of https://doc.wikimedia.org/codex/latest/design-tokens/overview.html yet
.rt-overlay.rt-overlay {
font-size: var(--font-size-medium, 14px);
}
in theory, yes, but in practice, I think, the tooltip content is already well-isolated by border + paddings + shadow
Footnote boxes are the same width as before but now much less text fits on each line
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This update addresses user complaints voiced in MediaWiki talk:Gadget-ReferenceTooltips.js#Update request 9 July 2024 and includes other changes.
Please update the JS and CSS parts of the gadget:
Changes:
#mw-teleport-target
; see
phab:T369880.)wikipage.content
hook fired on a page.![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could an admin please re-copy User:Yair rand/ReferenceTooltips.js to this page to add the recent bug fix? Thanks. -- Yair rand ( talk) 19:19, 4 April 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could someone synchronize the pages again, please? -- Yair rand ( talk) 21:35, 19 April 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Where is element #footer-places
? Also, disabling of this gadget isn't work (Firefox 13).
Saint Johann (
ru)
15:48, 17 June 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
#footer-places
is at the bottom of the page, holding the "Privacy policy", "About Wikipedia", and "Disclaimers" links, but only in Vector skin. I had forgotten to also include the equivalent elements for other skins. There was also another bug in working with other skins that I had missed. Now that both bugs, as well as the problem in Firefox, are fixed, could an admin please copy
User:Yair rand/ReferenceTooltips.js and
User:Yair rand/ReferenceTooltips.css over
MediaWiki:Gadget-ReferenceTooltips.js and
MediaWiki:Gadget-ReferenceTooltips.css again? (Sorry for having to ask so frequently.) --
Yair rand (
talk)
19:52, 17 June 2012 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hello!
Could someone apply these changes to the script? Helder.wiki 21:22, 11 July 2014 (UTC)
This gadget causes the error: NotFoundError: Node was not found. See phab:T109486. Helder 17:54, 18 August 2015 (UTC)
I was using Iceweasel 38.2.0. On Google Chrome it is a little more verbose:
{ "errorMessage": "Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.", "url": "/info/en/?search=%28%CE%B5,_%CE%B4%29-definition_of_limit", "lineNumber": 102, "columnNumber": 812, "errorObject": { "stack": "Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.\n at Error (native)\n at HTMLUListElement.eval (eval at <anonymous> (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:4:681), <anonymous>:102:812)\n at HTMLUListElement.opt.complete (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:110:60)\n at fire (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:45:124)\n at Object.self.fireWith [as resolveWith] (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:46:431)\n at Animation.tick (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:107:719)\n at jQuery.fx.tick (https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=3hR%2F0Nym:112:760)" } }
Helder 18:55, 18 August 2015 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
To allow users to use custom styling of the highlighted reference, please replace:
h.style.border = ""
→ $( h ).removeClass("RTTarget")
h.style.border = "#080086 2px solid"
→ $( h ).addClass("RTTarget")
Note that this class is already defined in MediaWiki:Gadget-ReferenceTooltips.css. Petr Matas 14:44, 9 January 2016 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Problem description: Open Quantum state#Ref-14. Reference 14 contains a link to reference 1. If you hover on the link to reference 1, no tooltip is shown, although reference 1 is off-screen (above the visible area). This is because the check for the reference being below the visible area is implemented, but above is not.
Fix: Please replace
if( !isTouchscreen && ( window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0 ) + $(window).height() > $( h ).offset().top + h.offsetHeight ) {
with
var windowTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; if( !isTouchscreen && windowTop < $( h ).offset().top && windowTop + $(window).height() > $( h ).offset().top + h.offsetHeight ) {
Petr Matas 13:20, 13 January 2016 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could an admin please merge these changes? Changes include:
-- Yair rand ( talk) 23:04, 14 January 2016 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This script contains the lines
$(this)[ isTouchscreen ? 'click' : 'hover' ](function( e ){
and
isTouchscreen || $(tooltipNode).hover(show, hide);
which cause the following warning in the console:
JQMIGRATE: jQuery.fn.hover() is deprecated
Helder 22:54, 7 October 2017 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hello! I would like to suggest to update to the new version of this gadget I've presented at mw:Topic:Ueqlcc482l9yw8gv. There are numerous bugfixes and added features like Harvard-style citations support. Tooltip style & animations are also updated to be consistent with Page Previews' style & animations. It has been tested thoroughly and used in Russian Wikipedia for several months with no complaints.
Jack who built the house ( talk) 11:18, 29 December 2018 (UTC)
jquery.client
and mediawiki.notify
dependencies are needed too.
Jack who built the house (
talk)
19:52, 2 February 2019 (UTC)As reported here, this gadget's feature to show tooltips seems to make links with tooltips unclickable on touchscreen devices:
This is particularly inconvenient on navboxes, which uses {{
navbar|mini=y}}
to show the links on top left. Can this be fixed with a change to this JS?
Nardog (
talk)
09:50, 4 April 2019 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I fixed the issue together with another one, reported at en:Template talk:Harvard citation#Cosmetic issue: nested quotes.
Please update the gadget by moving the code from en:User:Jack who built the house/Gadget-referenceTooltips.js to here.
@ Gzhegozh: you can update in your wiki too. Jack who built the house ( talk) 14:00, 10 May 2019 (UTC)
// Source
/info/en/?search=MediaWiki:Gadget-ReferenceTooltips.js
. Updated my code, now it's correct.
Jack who built the house (
talk)
19:32, 10 May 2019 (UTC)![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Since May 2018 we have the ability to use the dir
attribute in the <ref>
tags to specify the directionality of ref tags as right-to-left (RTL) or left-to-right (LTR). This is widely used in pages that cite both RTL and LTR sources, for example on Persian Wikipedia (fawiki, see
example). Since the ReferenceTooltips code is used on many wikis, it is ideal to add support for directionality in its enwiki version so that all others who copy it would also benefit from it.
I have already implemented the solution into our copy on fawiki. Please incorporate it here too.
Happy to answer any questions (but please {{ ping}} me). huji— TALK 14:47, 1 July 2019 (UTC)
console.log
there.) --
Yair rand (
talk)
16:40, 1 July 2019 (UTC)
The Cite extension has an experimental feature called
book referencing. This feature allows editors to cite multiple parts of an already-cited source using the extends
attribute. For instance, an editor could cite a book with the citation <ref name="Miller">E. Miller, ''The Sun'', (New York: Academic Press, 2005)</ref>
, and then they could cite page 42 in that book with a second citation <ref extends="Miller">p. 42</ref>
.
Continuing with the earlier example, currently when a user hovers over the "p. 42" sub-citation, the tooltip will just contain "p. 42" without the book name. That tooltip is not especially useful. It would be nice if this gadget could handle "book references" more naturally. That is, if a user hovers over a citation of the form <ref name="child" extends="parent">text</ref>
attribute, it would be nice if the tooltip displayed the contents of both the parent
and child
citations. Note that book citations can only go one level deep (you cannot extend a citation that extends another citation), which should make the implementation more straightforward. Thank you for considering this suggestion!
MtMNC (
talk)
06:51, 2 November 2020 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
As it turned out, it can be unclear to users what they are disabling/enabling. So please replace
'rt-enable': 'Enable',
'rt-disable': 'Disable',
with
'rt-enable': 'Enable Reference Tooltips',
'rt-disable': 'Disable Reference Tooltips',
Jack who built the house ( talk) 20:43, 4 February 2024 (UTC)
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please update the JS and CSS parts of the gadget:
Changes:
--font-size-medium
CSS variable and making the font size and several related properties relative (in em
) instead of absolute (in px
).<a>
element for the settings link instead of <div>
as more semantically appropriate.box-shadow
, icon size).Ping me if there are any problems. Jack who built the house ( talk) 08:40, 9 July 2024 (UTC)
I think it was previously smaller?
Some footnotes with wider content get cut off horizontally.
OO.ui.getTeleportTarget()
instead of <body>
? (See
phab:T348286.)
Nardog (
talk)
06:55, 10 July 2024 (UTC)
#mw-teleport-target
could actually be a better idea than hardcoding anything (note that reference tooltips are not OOUI-based).Let's see. Before the change the tooltip was 13px across all skins against 14px body size. We want to make it bigger where the body font size is bigger. #mw-teleport-target
is:
<ol class="references">
?
Nardog (
talk)
07:33, 10 July 2024 (UTC)
font-size: 90%;
to the root font size and bring side effects with it.
Jack who built the house (
talk)
07:40, 10 July 2024 (UTC)
<ol>
element as well as any styles applied to ol.references
. By "root font size" I mean 1rem, so it's not relative to the body font size.
Jack who built the house (
talk)
08:20, 10 July 2024 (UTC)
font-size: 90%;
(or calc(... * 0.9)
or whatever) then?
Nardog (
talk)
08:26, 10 July 2024 (UTC)
#mw-teleport-target
, and I can't yet figure out how to solve it. #mw-teleport-target
is located at the end of the DOM and only has position: absolute;
z-index: 450;
position: absolute
. If I use position: fixed
for a descendant, then its descendants will have fixed positioning relative to the page (which we don't need), even if they have position: absolute
.If #mw-teleport-target
had top: 0;
width: 100%;
#mw-teleport-target
seems to be intended for fixed-positioned elements like dialogs only.
Jack who built the house (
talk)
12:51, 11 July 2024 (UTC)
#mw-teleport-target
was intended exactly for this use case. (As noted below, access it using require( 'mediawiki.page.ready' ).teleportTarget
.) It's used by both Codex and OOUI and is meant to be usable by anything else.top: -2447.62px
on those OOUI dropdowns, which is a bit silly). I would guess nobody noticed because those libraries have generic methods to position anything relative to anything else, and they coped with the weirdness automatically. You might want to file a Phab task (and CC people who worked on the feature:
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/945825), or you'll have to make your code cope with it too.
Matma Rex
talk
16:57, 11 July 2024 (UTC)
const topOffset = -$('#mw-teleport-target').offset().top + $(window).scrollTop();
$('#mw-teleport-target').append(`<div style="position: absolute; top: ${topOffset}px; background-color:yellow;">test test test</div>`);
width: max-content
(which
is a bit newer than Grade C browsers) together with max-width
, you can't have descendants with variable width also.
Jack who built the house (
talk)
17:49, 11 July 2024 (UTC)You might want to file a Phab task (and CC people who worked on the feature: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/945825)
#mw-teleport-target
isn't served by HTML, so I assume you can't just expect it to be there but have to await something.
Nardog (
talk)
07:36, 10 July 2024 (UTC)
mw.loader.using('mediawiki.page.ready').then(function (require) {
console.log(require('mediawiki.page.ready').teleportTarget);
});
--font-size-medium
will land in skins other than Vector 2022 and Minerva? Is #mw-teleport-target
reliable to be used by gadgets like this one (that seek the font size more or less equal to the body font size)?
Jack who built the house (
talk)
08:56, 10 July 2024 (UTC)
The font size variables are not stable as they are not part of https://doc.wikimedia.org/codex/latest/design-tokens/overview.html yet
.rt-overlay.rt-overlay {
font-size: var(--font-size-medium, 14px);
}
in theory, yes, but in practice, I think, the tooltip content is already well-isolated by border + paddings + shadow
Footnote boxes are the same width as before but now much less text fits on each line
![]() | This
edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This update addresses user complaints voiced in MediaWiki talk:Gadget-ReferenceTooltips.js#Update request 9 July 2024 and includes other changes.
Please update the JS and CSS parts of the gadget:
Changes:
#mw-teleport-target
; see
phab:T369880.)wikipage.content
hook fired on a page.