Add more specific class to cite errors

Problem:

* VisualEditor needs to be able to more reliably target Cite errors.

Solution:

* Add a more specific class to cite errors

Grumble:

* Ideally all extensions would use mw-ext-{extension name} as a prefix to
  their CSS classes (or something similar).

Bug: 51337
Change-Id: If4f5360cc1c7b765ad896b14901a9b024782cc93
This commit is contained in:
Ed Sanders 2013-07-10 14:48:31 -07:00 committed by Jforrester
parent da5a49ba48
commit 4f3f9068b0
2 changed files with 12 additions and 12 deletions

View file

@ -1172,7 +1172,7 @@ class Cite {
# We rely on the fact that PHP is okay with passing unused argu- # We rely on the fact that PHP is okay with passing unused argu-
# ments to functions. If $1 is not used in the message, wfMessage will # ments to functions. If $1 is not used in the message, wfMessage will
# just ignore the extra parameter. # just ignore the extra parameter.
$ret = '<strong class="error">' . $ret = '<strong class="error mw-ext-cite-error">' .
wfMessage( 'cite_error', wfMessage( $key, $param )->plain() )->plain() . wfMessage( 'cite_error', wfMessage( $key, $param )->plain() )->plain() .
'</strong>'; '</strong>';
if ( $parse == 'parse' ) { if ( $parse == 'parse' ) {

View file

@ -10,7 +10,7 @@ Simple <ref>, no <references/>
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref> Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
!! result !! result
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup> <p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup>
<br /><strong class="error">Cite error: <code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found</strong> <br /><strong class="error mw-ext-cite-error">Cite error: <code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found</strong>
</p> </p>
!! end !! end
@ -142,7 +142,7 @@ Templating<ref>Text<!--comment--></ref>
{{REVISIONID}}<ref>elite</ref> {{REVISIONID}}<ref>elite</ref>
!! result !! result
<p>1337<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup> <p>1337<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup>
<br /><strong class="error">Cite error: <code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found</strong> <br /><strong class="error mw-ext-cite-error">Cite error: <code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found</strong>
</p> </p>
!! end !! end
@ -253,23 +253,23 @@ Erroneous refs
<references /> <references />
!! result !! result
<p><strong class="error">Cite error: Invalid <code>&lt;ref&gt;</code> tag; <p><strong class="error mw-ext-cite-error">Cite error: Invalid <code>&lt;ref&gt;</code> tag;
name cannot be a simple integer. Use a descriptive title</strong> name cannot be a simple integer. Use a descriptive title</strong>
</p><p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup> </p><p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup>
</p><p><strong class="error">Cite error: Invalid <code>&lt;ref&gt;</code> tag; </p><p><strong class="error mw-ext-cite-error">Cite error: Invalid <code>&lt;ref&gt;</code> tag;
refs with no content must have a name</strong> refs with no content must have a name</strong>
</p><p><sup id="cite_ref-bar_2-0" class="reference"><a href="#cite_note-bar-2">[2]</a></sup> </p><p><sup id="cite_ref-bar_2-0" class="reference"><a href="#cite_note-bar-2">[2]</a></sup>
</p><p><sup id="cite_ref-blankwithnoreference_3-0" class="reference"><a href="#cite_note-blankwithnoreference-3">[3]</a></sup> </p><p><sup id="cite_ref-blankwithnoreference_3-0" class="reference"><a href="#cite_note-blankwithnoreference-3">[3]</a></sup>
</p><p><strong class="error">Cite error: Invalid <code>&lt;references&gt;</code> tag; </p><p><strong class="error mw-ext-cite-error">Cite error: Invalid <code>&lt;references&gt;</code> tag;
parameter "group" is allowed only. parameter "group" is allowed only.
Use <code>&lt;references /&gt;</code>, or <code>&lt;references group="..." /&gt;</code></strong> Use <code>&lt;references /&gt;</code>, or <code>&lt;references group="..." /&gt;</code></strong>
</p> </p>
<ol class="references"> <ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Also zero, but differently! (Normal ref)</span> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Also zero, but differently! (Normal ref)</span>
</li> </li>
<li id="cite_note-bar"><span class="mw-cite-backlink"><a href="#cite_ref-bar_0">↑</a></span> <strong class="error">Cite error: Invalid <code>&lt;ref&gt;</code> tag; <li id="cite_note-bar"><span class="mw-cite-backlink"><a href="#cite_ref-bar_0">↑</a></span> <strong class="error mw-ext-cite-error">Cite error: Invalid <code>&lt;ref&gt;</code> tag;
no text was provided for refs named <code>bar</code></strong></li> no text was provided for refs named <code>bar</code></strong></li>
<li id="cite_note-blankwithnoreference"><span class="mw-cite-backlink"><a href="#cite_ref-blankwithnoreference_0">↑</a></span> <strong class="error">Cite error: Invalid <code>&lt;ref&gt;</code> tag; <li id="cite_note-blankwithnoreference"><span class="mw-cite-backlink"><a href="#cite_ref-blankwithnoreference_0">↑</a></span> <strong class="error mw-ext-cite-error">Cite error: Invalid <code>&lt;ref&gt;</code> tag;
no text was provided for refs named <code>blankwithnoreference</code></strong></li> no text was provided for refs named <code>blankwithnoreference</code></strong></li>
</ol> </ol>
@ -379,12 +379,12 @@ AAA<ref group="参">ref a</ref>BBB<ref group="注">note b</ref>CCC<ref group="
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1">[2 1]</a></sup> <p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1">[2 1]</a></sup>
</p> </p>
<ol class="references"> <ol class="references">
<li id="cite_note-foo"><span class="mw-cite-backlink"><a href="#cite_ref-foo_0">↑</a></span> <strong class="error">Cite error: Invalid <code>&lt;ref&gt;</code> tag; <li id="cite_note-foo"><span class="mw-cite-backlink"><a href="#cite_ref-foo_0">↑</a></span> <strong class="error mw-ext-cite-error">Cite error: Invalid <code>&lt;ref&gt;</code> tag;
no text was provided for refs named <code>foo</code></strong></li> no text was provided for refs named <code>foo</code></strong></li>
</ol> </ol>
<p><strong class="error">Cite error: <code>&lt;ref&gt;</code> tag with name "unused" defined in <code>&lt;references&gt;</code> is not used in prior text.</strong><br /> <p><strong class="error mw-ext-cite-error">Cite error: <code>&lt;ref&gt;</code> tag with name "unused" defined in <code>&lt;references&gt;</code> is not used in prior text.</strong><br />
<strong class="error">Cite error: <code>&lt;ref&gt;</code> tag in <code>&lt;references&gt;</code> has conflicting group attribute "1".</strong><br /> <strong class="error mw-ext-cite-error">Cite error: <code>&lt;ref&gt;</code> tag in <code>&lt;references&gt;</code> has conflicting group attribute "1".</strong><br />
<strong class="error">Cite error: <code>&lt;ref&gt;</code> tag defined in <code>&lt;references&gt;</code> has no name attribute.</strong> <strong class="error mw-ext-cite-error">Cite error: <code>&lt;ref&gt;</code> tag defined in <code>&lt;references&gt;</code> has no name attribute.</strong>
</p> </p>
!! end !! end