Pregunta

Starting somewhere around Semantic MediaWiki version 1.0* certain errors stopped being reported as text, and were replaced with a yellow triangular warning icon (Semantic MediaWiki error.png) with the error text in a rollover tooltip.

(Image from: http://semantic-mediawiki.org/w/extensions/SemanticMediaWiki/skins/images/warning.png)

Is there a way to change this behavior to show the text instead?

* http://semantic-mediawiki.org/wiki/Help:Upgrading_from_0.7_to_1.0

Edit: Here's an example of the HTML in which this icon appears:

<span class="smwttpersist"><span class="smwtticon">warning.png</span>
<span class="smwttcontent"><ul>
<li>Some subquery has no valid condition.</li></ul></span></span>

I'd prefer a toggle in a prefs file somewhere, but a JavaScript workaround would also be welcome.

¿Fue útil?

Solución

It is fairly easy to transform tooltips to normal text with javascript, e. g.:

$(function() {
    $('img[src$="warning.png"]').each(function() {
        var tooltip = $(this).attr('title');
        $(this).after($('<span>').text(tooltip));
    });
});

If it is not a normal tooltip (title attribute) but something more fancy, then it is usually enough to just override the CSS with something like:

.tooltip-class {
    display: inline;
    position: static;
    border: 0;
    padding: 0;
    background-color: transparent;
}

You can use the wiki page MediaWiki:Common.js for placing javascript and MediaWiki:Common.css for CSS code.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top