r96684 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96683‎ | r96684 | r96685 >
Date:19:05, 9 September 2011
Author:maxsem
Status:ok
Tags:
Comment:
Modified paths:
  • /trunk/extensions/wikihiero/SpecialHieroglyphs.php (modified) (history)
  • /trunk/extensions/wikihiero/modules/ext.wikihiero.Special.css (modified) (history)
  • /trunk/extensions/wikihiero/modules/ext.wikihiero.css (modified) (history)
  • /trunk/extensions/wikihiero/tests.txt (modified) (history)
  • /trunk/extensions/wikihiero/wikihiero.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/wikihiero/tests.txt
@@ -3,7 +3,7 @@
44 !! input
55 <hiero>A1 - B2 D3</hiero>
66 !! result
7 -<table class='hiero-table hiero-outer' dir='ltr'><tr><td> <table class="hiero-table"><tr> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_A1.png' title='A1' alt='A1' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_B2.png' title='B2' alt='B2' /></td><td><img style='margin:1px;' height='20' src='/extensions/wikihiero/img/hiero_D3.png' title='D3' alt='D3' /></td></tr></table> </td></tr></table>
 7+<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td> <table class="mw-hiero-table"><tr> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_A1.png' title='A1' alt='A1' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_B2.png' title='B2' alt='B2' /></td><td><img style='margin:1px;' height='20' src='/extensions/wikihiero/img/hiero_D3.png' title='D3' alt='D3' /></td></tr></table> </td></tr></table>
88
99 !! end
1010
@@ -12,7 +12,7 @@
1313 !! input
1414 <hiero><script>alert("FAIL")</script></hiero>
1515 !! result
16 -<table class='hiero-table hiero-outer' dir='ltr'><tr><td> <table class="hiero-table"><tr> <td>&lt;script&gt;alert(FAIL)&lt;script&gt;</td> </tr></table> </td></tr></table>
 16+<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td> <table class="mw-hiero-table"><tr> <td>&lt;script&gt;alert(FAIL)&lt;script&gt;</td> </tr></table> </td></tr></table>
1717
1818 !! end
1919
@@ -21,7 +21,7 @@
2222 !! input
2323 <hiero>a:A1</hiero>
2424 !! result
25 -<table class='hiero-table hiero-outer' dir='ltr'><tr><td> <table class="hiero-table"><tr> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_a&amp;A1.png' title='a&amp;A1' alt='a&amp;A1' /></td> </tr></table> </td></tr></table>
 25+<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td> <table class="mw-hiero-table"><tr> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_a&amp;A1.png' title='a&amp;A1' alt='a&amp;A1' /></td> </tr></table> </td></tr></table>
2626
2727 !! end
2828
@@ -30,7 +30,7 @@
3131 !! input
3232 <hiero>N28:Aa13-R19-t:N24</hiero>
3333 !! result
34 -<table class='hiero-table hiero-outer' dir='ltr'><tr><td> <table class="hiero-table"><tr> <td><img style='margin:1px;' height='15' src='/extensions/wikihiero/img/hiero_N28.png' title='N28' alt='N28' /><br /><img style='margin:1px;' height='8' src='/extensions/wikihiero/img/hiero_Aa13.png' title='Aa13' alt='Aa13' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_R19.png' title='R19' alt='R19' /></td><td><img style='margin:1px;' height='11' src='/extensions/wikihiero/img/hiero_X1.png' title='X1 [t]' alt='t' /><br /><img style='margin:1px;' height='14' src='/extensions/wikihiero/img/hiero_N24.png' title='N24' alt='N24' /></td> </tr></table> </td></tr></table>
 34+<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td> <table class="mw-hiero-table"><tr> <td><img style='margin:1px;' height='15' src='/extensions/wikihiero/img/hiero_N28.png' title='N28' alt='N28' /><br /><img style='margin:1px;' height='8' src='/extensions/wikihiero/img/hiero_Aa13.png' title='Aa13' alt='Aa13' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_R19.png' title='R19' alt='R19' /></td><td><img style='margin:1px;' height='11' src='/extensions/wikihiero/img/hiero_X1.png' title='X1 [t]' alt='t' /><br /><img style='margin:1px;' height='14' src='/extensions/wikihiero/img/hiero_N24.png' title='N24' alt='N24' /></td> </tr></table> </td></tr></table>
3535
3636 !! end
3737
@@ -39,7 +39,7 @@
4040 !! input
4141 <hiero>N5-O34:N29-N35:N35</hiero>
4242 !! result
43 -<table class='hiero-table hiero-outer' dir='ltr'><tr><td> <table class="hiero-table"><tr> <td><img style='margin:1px;' height='18' src='/extensions/wikihiero/img/hiero_N5.png' title='N5' alt='N5' /></td><td><img style='margin:1px;' height='6' src='/extensions/wikihiero/img/hiero_O34.png' title='O34' alt='O34' /><br /><img style='margin:1px;' height='17' src='/extensions/wikihiero/img/hiero_N29.png' title='N29' alt='N29' /></td> <td><img style='margin:1px;' height='5' src='/extensions/wikihiero/img/hiero_N35.png' title='N35' alt='N35' /><br /><img style='margin:1px;' height='5' src='/extensions/wikihiero/img/hiero_N35.png' title='N35' alt='N35' /></td> </tr></table> </td></tr></table>
 43+<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td> <table class="mw-hiero-table"><tr> <td><img style='margin:1px;' height='18' src='/extensions/wikihiero/img/hiero_N5.png' title='N5' alt='N5' /></td><td><img style='margin:1px;' height='6' src='/extensions/wikihiero/img/hiero_O34.png' title='O34' alt='O34' /><br /><img style='margin:1px;' height='17' src='/extensions/wikihiero/img/hiero_N29.png' title='N29' alt='N29' /></td> <td><img style='margin:1px;' height='5' src='/extensions/wikihiero/img/hiero_N35.png' title='N35' alt='N35' /><br /><img style='margin:1px;' height='5' src='/extensions/wikihiero/img/hiero_N35.png' title='N35' alt='N35' /></td> </tr></table> </td></tr></table>
4444
4545 !! end
4646
@@ -49,6 +49,6 @@
5050 <hiero>M23-X1:R4-X8-Q2:D4-W17-R14-G4-R8-O29:V30-U23 !
5151 N26-D58-O49:Z1-F13:N31-V30:N16:N21*Z1-D45:N25</hiero>
5252 !! result
53 -<table class='hiero-table hiero-outer' dir='ltr'><tr><td> <table class="hiero-table"><tr> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_M23.png' title='M23' alt='M23' /></td><td><img style='margin:1px;' height='11' src='/extensions/wikihiero/img/hiero_X1.png' title='X1' alt='X1' /><br /><img style='margin:1px;' height='15' src='/extensions/wikihiero/img/hiero_R4.png' title='R4' alt='R4' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_X8.png' title='X8' alt='X8' /></td><td><img style='margin:1px;' height='24' src='/extensions/wikihiero/img/hiero_Q2.png' title='Q2' alt='Q2' /><br /><img style='margin:1px;' height='12' src='/extensions/wikihiero/img/hiero_D4.png' title='D4' alt='D4' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_W17.png' title='W17' alt='W17' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_R14.png' title='R14' alt='R14' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_G4.png' title='G4' alt='G4' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_R8.png' title='R8' alt='R8' /></td><td><img style='margin:1px;' height='7' src='/extensions/wikihiero/img/hiero_O29.png' title='O29' alt='O29' /><br /><img style='margin:1px;' height='12' src='/extensions/wikihiero/img/hiero_V30.png' title='V30' alt='V30' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_U23.png' title='U23' alt='U23' /></td></tr></table><table class="hiero-table"><tr> <td><img style='margin:1px;' height='15' src='/extensions/wikihiero/img/hiero_N26.png' title='N26' alt='N26' /></td><td><img style='margin:1px;' height='35' src='/extensions/wikihiero/img/hiero_D58.png' title='D58' alt='D58' /></td><td><img style='margin:1px;' height='18' src='/extensions/wikihiero/img/hiero_O49.png' title='O49' alt='O49' /><br /><img style='margin:1px;' height='16' src='/extensions/wikihiero/img/hiero_Z1.png' title='Z1' alt='Z1' /></td> <td><img style='margin:1px;' height='22' src='/extensions/wikihiero/img/hiero_F13.png' title='F13' alt='F13' /><br /><img style='margin:1px;' height='17' src='/extensions/wikihiero/img/hiero_N31.png' title='N31' alt='N31' /></td> <td><img style='margin:1px;' height='12' src='/extensions/wikihiero/img/hiero_V30.png' title='V30' alt='V30' /><br /><img style='margin:1px;' height='9' src='/extensions/wikihiero/img/hiero_N16.png' title='N16' alt='N16' /><br /><img style='margin:1px;' height='11' src='/extensions/wikihiero/img/hiero_N21.png' title='N21' alt='N21' /> <img style='margin:1px;' height='16' src='/extensions/wikihiero/img/hiero_Z1.png' title='Z1' alt='Z1' /></td> <td><img style='margin:1px;' height='24' src='/extensions/wikihiero/img/hiero_D45.png' title='D45' alt='D45' /><br /><img style='margin:1px;' height='16' src='/extensions/wikihiero/img/hiero_N25.png' title='N25' alt='N25' /></td> </tr></table> </td></tr></table>
 53+<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td> <table class="mw-hiero-table"><tr> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_M23.png' title='M23' alt='M23' /></td><td><img style='margin:1px;' height='11' src='/extensions/wikihiero/img/hiero_X1.png' title='X1' alt='X1' /><br /><img style='margin:1px;' height='15' src='/extensions/wikihiero/img/hiero_R4.png' title='R4' alt='R4' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_X8.png' title='X8' alt='X8' /></td><td><img style='margin:1px;' height='24' src='/extensions/wikihiero/img/hiero_Q2.png' title='Q2' alt='Q2' /><br /><img style='margin:1px;' height='12' src='/extensions/wikihiero/img/hiero_D4.png' title='D4' alt='D4' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_W17.png' title='W17' alt='W17' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_R14.png' title='R14' alt='R14' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_G4.png' title='G4' alt='G4' /></td><td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_R8.png' title='R8' alt='R8' /></td><td><img style='margin:1px;' height='7' src='/extensions/wikihiero/img/hiero_O29.png' title='O29' alt='O29' /><br /><img style='margin:1px;' height='12' src='/extensions/wikihiero/img/hiero_V30.png' title='V30' alt='V30' /></td> <td><img style='margin:1px;' height='38' src='/extensions/wikihiero/img/hiero_U23.png' title='U23' alt='U23' /></td></tr></table><table class="mw-hiero-table"><tr> <td><img style='margin:1px;' height='15' src='/extensions/wikihiero/img/hiero_N26.png' title='N26' alt='N26' /></td><td><img style='margin:1px;' height='35' src='/extensions/wikihiero/img/hiero_D58.png' title='D58' alt='D58' /></td><td><img style='margin:1px;' height='18' src='/extensions/wikihiero/img/hiero_O49.png' title='O49' alt='O49' /><br /><img style='margin:1px;' height='16' src='/extensions/wikihiero/img/hiero_Z1.png' title='Z1' alt='Z1' /></td> <td><img style='margin:1px;' height='22' src='/extensions/wikihiero/img/hiero_F13.png' title='F13' alt='F13' /><br /><img style='margin:1px;' height='17' src='/extensions/wikihiero/img/hiero_N31.png' title='N31' alt='N31' /></td> <td><img style='margin:1px;' height='12' src='/extensions/wikihiero/img/hiero_V30.png' title='V30' alt='V30' /><br /><img style='margin:1px;' height='9' src='/extensions/wikihiero/img/hiero_N16.png' title='N16' alt='N16' /><br /><img style='margin:1px;' height='11' src='/extensions/wikihiero/img/hiero_N21.png' title='N21' alt='N21' /> <img style='margin:1px;' height='16' src='/extensions/wikihiero/img/hiero_Z1.png' title='Z1' alt='Z1' /></td> <td><img style='margin:1px;' height='24' src='/extensions/wikihiero/img/hiero_D45.png' title='D45' alt='D45' /><br /><img style='margin:1px;' height='16' src='/extensions/wikihiero/img/hiero_N25.png' title='N25' alt='N25' /></td> </tr></table> </td></tr></table>
5454
5555 !! end
Index: trunk/extensions/wikihiero/SpecialHieroglyphs.php
@@ -79,7 +79,7 @@
8080 $this->hiero = new WikiHiero();
8181
8282 $out->addHTML( '<table><tr><td>' );
83 - $out->addHTML( '<div class="hiero-list">' );
 83+ $out->addHTML( '<div class="mw-hiero-list">' );
8484 $out->addHTML( $this->listHieroglyphs() );
8585 $out->addHTML( '</div></td><td>' );
8686 $out->addHTML( $this->getToc() );
@@ -154,7 +154,7 @@
155155 }
156156
157157 private function getToc() {
158 - $html = '<table class="toc hiero-toc">';
 158+ $html = '<table class="toc mw-hiero-toc">';
159159
160160 $syntax = wfMessage( 'wikihiero-syntax' )->text();
161161 $html .= '<tr><td colspan="5">'
Index: trunk/extensions/wikihiero/modules/ext.wikihiero.Special.css
@@ -1,10 +1,10 @@
2 -.hiero-list {
 2+.mw-hiero-list {
33 overflow: auto;
44 height: 400px;
55 margin-top: 1em;
66 border: 1px solid silver;
77 }
88
9 -.hiero-toc {
 9+.mw-hiero-toc {
1010 text-align: center;
1111 }
Index: trunk/extensions/wikihiero/modules/ext.wikihiero.css
@@ -1,13 +1,13 @@
2 -.hiero-table {
 2+.mw-hiero-table {
33 border: 0 !important;
44 border-spacing: 0 !important;
55 }
66
7 -.hiero-outer {
 7+.mw-hiero-outer {
88 display: inline;
99 }
1010
11 -.hiero-table td {
 11+.mw-hiero-table td {
1212 border: 0 !important;
1313 padding: 0 !important;
1414 text-align: center !important;
Index: trunk/extensions/wikihiero/wikihiero.body.php
@@ -28,7 +28,7 @@
2929 }
3030
3131 // D E F I N E S
32 -define( "WH_TABLE_S", '<table class="hiero-table">' );
 32+define( "WH_TABLE_S", '<table class="mw-hiero-table">' );
3333 define( "WH_TABLE_E", '</table>' );
3434 define( "WH_TD_S", '<td>' );
3535 define( "WH_TD_E", '</td>' );
@@ -146,12 +146,12 @@
147147 private function renderGlyph( $glyph, $option = '' ) {
148148 if ( $glyph == ".." ) { // Render void block
149149 $width = WH_HEIGHT;
150 - return "<table class=\"hiero-table\" style=\"width: {$width}px;\"><tr><td>&#160;</td></tr></table>";
 150+ return "<table class=\"mw-hiero-table\" style=\"width: {$width}px;\"><tr><td>&#160;</td></tr></table>";
151151 }
152152 elseif ( $glyph == "." ) // Render half-width void block
153153 {
154154 $width = WH_HEIGHT / 2;
155 - return "<table class=\"hiero-table\" style=\"width: {$width}px;\"><tr><td>&#160;</td></tr></table>";
 155+ return "<table class=\"mw-hiero-table\" style=\"width: {$width}px;\"><tr><td>&#160;</td></tr></table>";
156156 }
157157 elseif ( $glyph == '<' ) // Render open cartouche
158158 {
@@ -469,7 +469,7 @@
470470 $html .= WH_TABLE_S . "<tr>\n" . $tableContentHtml . "</tr>" . WH_TABLE_E;
471471 }
472472
473 - return "<table class='hiero-table hiero-outer' dir='ltr'><tr><td>\n$html\n</td></tr></table>";
 473+ return "<table class='mw-hiero-table mw-hiero-outer' dir='ltr'><tr><td>\n$html\n</td></tr></table>";
474474 }
475475
476476 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96593Remove mw- prefix from WikiHiero styles. A 7kb saving on Special:Hieroglyphs :Dmaxsem18:41, 8 September 2011

Status & tagging log