r77894 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77893‎ | r77894 | r77895 >
Date:17:47, 6 December 2010
Author:tparscal
Status:deferred
Tags:
Comment:
Using different strategy for mode switching, uses less repeditive markup - also not using attribute selector in CSS anymore (doesn't work in IE6)
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.css (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -49,6 +49,7 @@
5050 'articlefeedback-beta-form-panel-submit',
5151 'articlefeedback-beta-report-tab-label',
5252 'articlefeedback-beta-report-panel-title',
 53+ 'articlefeedback-beta-report-panel-description',
5354 'articlefeedback-beta-field-wellsourced-label',
5455 'articlefeedback-beta-field-wellsourced-tip',
5556 'articlefeedback-beta-field-complete-label',
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.css
@@ -3,6 +3,7 @@
44 */
55
66 .articleFeedback {
 7+ position: relative;
78 display: inline-block;
89 width: 45em; /* 1em extra space to resolve rounding errors*/
910 }
@@ -15,14 +16,26 @@
1617 padding-bottom: 1px;
1718 }
1819
 20+.articleFeedback-dialog {
 21+ display: none;
 22+ position: absolute;
 23+ top: 0;
 24+ left: 0;
 25+ height: 13.5em;
 26+ width: 44em;
 27+ background-color: #f3f3f3;
 28+ border: 1px solid #cccccc;
 29+ padding-bottom: 1px;
 30+}
 31+
 32+.articleFeedback-dialog .articleFeedback-buffer {
 33+ padding: 0.75em 1em;
 34+}
 35+
1936 .articleFeedback-panel, .articleFeedback-tabs {
2037 float: left;
2138 }
2239
23 -.articleFeedback-panel[rel=report] {
24 - display: none;
25 -}
26 -
2740 .articleFeedback-tabs {
2841 width: 8em;
2942 height: 13.5em;
@@ -48,7 +61,7 @@
4962 background-image: url(images/tab-fade.png);
5063 }
5164
52 -.articleFeedback-tab[rel=form] {
 65+.articleFeedback-tab-form {
5366 margin-top: 1px;
5467 margin-bottom: 1px;
5568 }
@@ -65,15 +78,15 @@
6679 color: #0645ad;
6780 }
6881
69 -.articleFeedback-tab[rel=form] .articleFeedback-buffer {
 82+.articleFeedback-tab-form .articleFeedback-buffer {
7083 background-image: url(images/form-icon.png);
7184 }
7285
73 -.articleFeedback-tab[rel=report] .articleFeedback-buffer {
 86+.articleFeedback-tab-report .articleFeedback-buffer {
7487 background-image: url(images/report-icon.png);
7588 }
7689
77 -.articleFeedback-tab .articleFeedback-buffer:hover {
 90+.articleFeedback-tab:hover .articleFeedback-buffer {
7891 text-decoration: underline;
7992 }
8093
@@ -86,14 +99,16 @@
87100 font-size: 1.4em;
88101 }
89102
90 -.articleFeedback-instructions {
 103+.articleFeedback-instructions, .articleFeedback-description {
91104 float: left;
92105 font-weight: bold;
 106+ margin-bottom: 1em;
93107 }
94108
95109 .articleFeedback-rating {
96110 float: left;
97 - width: 16em;
 111+ width: 17em;
 112+ height: 3.5em;
98113 }
99114
100115 .articleFeedback-label {
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.js
@@ -12,68 +12,85 @@
1313 // Append HTML
1414 .append( '\
1515 <div class="articleFeedback-tabs">\
16 - <div class="articleFeedback-tab articleFeedback-tab-current" rel="form">\
 16+ <div class="articleFeedback-tab articleFeedback-tab-form articleFeedback-tab-current" rel="form">\
1717 <div class="articleFeedback-buffer"><msg key="form-tab-label" /></div>\
1818 </div>\
19 - <div class="articleFeedback-tab" rel="report">\
 19+ <div class="articleFeedback-tab articleFeedback-tab-report " rel="report">\
2020 <div class="articleFeedback-buffer"><msg key="report-tab-label" /></div>\
2121 </div>\
2222 </div>\
23 -<div class="articleFeedback-panel" rel="form">\
 23+<div class="articleFeedback-panel">\
2424 <div class="articleFeedback-buffer">\
25 - <div class="articleFeedback-title"><msg key="form-panel-title" /></div>\
26 - <div class="articleFeedback-instructions"><msg key="form-panel-instructions" /></div>\
 25+ <div class="articleFeedback-title articleFeedback-form"><msg key="form-panel-title" /></div>\
 26+ <div class="articleFeedback-title articleFeedback-report"><msg key="report-panel-title" /></div>\
 27+ <div class="articleFeedback-instructions articleFeedback-form"><msg key="form-panel-instructions" /></div>\
 28+ <div class="articleFeedback-description articleFeedback-report"><msg key="report-panel-description" /></div>\
2729 <div style="clear:both;"></div>\
2830 <div class="articleFeedback-ratings">\
2931 <div class="articleFeedback-rating" rel="wellsourced">\
3032 <span class="articleFeedback-label" title-msg="field-wellsourced-tip"><msg key="field-wellsourced-label" /></span>\
31 - <div class="articleFeedback-rating-fields"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
32 - <div class="articleFeedback-rating-labels"><label></label><label></label><label></label><label></label><label></label></div>\
 33+ <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
 34+ <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\
3335 </div>\
3436 <div class="articleFeedback-rating" rel="neutral">\
3537 <span class="articleFeedback-label" title-msg="field-neutral-tip"><msg key="field-neutral-label" /></span>\
36 - <div class="articleFeedback-rating-fields"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
37 - <div class="articleFeedback-rating-labels"><label></label><label></label><label></label><label></label><label></label></div>\
 38+ <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
 39+ <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\
3840 </div>\
3941 <div class="articleFeedback-rating" rel="complete">\
4042 <span class="articleFeedback-label" title-msg="field-complete-tip"><msg key="field-complete-label" /></span>\
41 - <div class="articleFeedback-rating-fields"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
42 - <div class="articleFeedback-rating-labels"><label></label><label></label><label></label><label></label><label></label></div>\
 43+ <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
 44+ <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\
4345 </div>\
4446 <div class="articleFeedback-rating" rel="readable">\
4547 <span class="articleFeedback-label" title-msg="field-readable-tip"><msg key="field-readable-label" /></span>\
46 - <div class="articleFeedback-rating-fields"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
47 - <div class="articleFeedback-rating-labels"><label></label><label></label><label></label><label></label><label></label></div>\
 48+ <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\
 49+ <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\
4850 </div>\
4951 <div style="clear:both;"></div>\
5052 </div>\
5153 </div>\
5254 </div>\
53 -<div class="articleFeedback-panel" rel="report">\
 55+<div class="articleFeedback-dialog" rel="survey">\
5456 <div class="articleFeedback-buffer">\
55 - <div class="articleFeedback-title"><msg key="report-panel-title" /></div>\
 57+ <div class="articleFeedback-title">Take a survey?</div>\
5658 </div>\
5759 </div>\
 60+<div class="articleFeedback-dialog" rel="register">\
 61+ <div class="articleFeedback-buffer">\
 62+ <div class="articleFeedback-title">Create an account?</div>\
 63+ </div>\
 64+</div>\
 65+<div class="articleFeedback-dialog" rel="edit">\
 66+ <div class="articleFeedback-buffer">\
 67+ <div class="articleFeedback-title">Edit a page?</div>\
 68+ </div>\
 69+</div>\
5870 ' )
5971 .localize( { 'prefix': 'articlefeedback-beta-' } )
6072 .find( '[title]' )
6173 .tipsy( { 'gravity': 'sw', 'fade': true } )
6274 .end()
 75+ // Hide report elements initially
 76+ .find( '.articleFeedback-report' )
 77+ .hide()
 78+ .end()
6379 // Setup tab behavior
6480 .find( '.articleFeedback-tab' )
6581 .click( function( e ) {
 82+ $(this).addClass( 'articleFeedback-tab-current' );
6683 context.$ui
67 - .find( '.articleFeedback-panel[rel!=' + $(this).attr( 'rel' ) +']' )
68 - .hide()
69 - .end()
70 - .find( '.articleFeedback-panel[rel=' + $(this).attr( 'rel' ) +']' )
 84+ .find( '.articleFeedback-' + $(this).attr( 'rel' ) )
7185 .show()
7286 .end()
73 - .find( '.articleFeedback-tab[rel=' + $(this).attr( 'rel' ) +']' )
74 - .addClass( 'articleFeedback-tab-current' )
75 - .end()
76 - .find( '.articleFeedback-tab[rel!=' + $(this).attr( 'rel' ) +']' )
77 - .removeClass( 'articleFeedback-tab-current' );
 87+ .find( '.articleFeedback-tab' )
 88+ .not( $(this) )
 89+ .each( function() {
 90+ $(this).removeClass( 'articleFeedback-tab-current' );
 91+ context.$ui
 92+ .find( '.articleFeedback-' + $(this).attr( 'rel' ) )
 93+ .hide();
 94+ } );
7895 e.preventDefault();
7996 return false;
8097 } );
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php
@@ -55,6 +55,7 @@
5656 'articlefeedback-beta-form-panel-submit' => 'Submit feedback',
5757 'articlefeedback-beta-report-tab-label' => 'Show results',
5858 'articlefeedback-beta-report-panel-title' => 'Feedback results',
 59+ 'articlefeedback-beta-report-panel-description' => 'Current average ratings.',
5960 'articlefeedback-beta-field-wellsourced-label' => 'Well-sourced',
6061 'articlefeedback-beta-field-wellsourced-tip' => 'Do you feel this page has sufficient citations and that those citations come from trustworthy sources?',
6162 'articlefeedback-beta-field-complete-label' => 'Complete',

Status & tagging log