r77648 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77647‎ | r77648 | r77649 >
Date:13:33, 3 December 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Part 3 of r77646: reapply r76964, r76965, r76966
Modified paths:
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.css (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.css
@@ -1,51 +1,51 @@
22 /*
3 - * Styles for Article Assessment
 3+ * Styles for Article Feedback
44 */
55
6 -.article-assessment-wrapper #article-assessment-rate,
7 -.article-assessment-wrapper #article-assessment-ratings {
 6+.articleFeedback-wrapper #articleFeedback-rate,
 7+.articleFeedback-wrapper #articleFeedback-ratings {
88 background: #f7f7f7;
99 float: left;
1010 }
1111
12 -.article-assessment-wrapper #article-assessment-rate {
 12+.articleFeedback-wrapper #articleFeedback-rate {
1313 width: 650px;
1414 margin-right: 10px;
1515 }
16 -.article-assessment-wrapper legend {
 16+.articleFeedback-wrapper legend {
1717 font-weight: bold;
1818 }
19 -.article-assessment-wrapper .field-wrapper {
 19+.articleFeedback-wrapper .field-wrapper {
2020 float: left;
2121 width: 270px;
2222 padding-right: 28px;
2323 }
24 -.article-assessment-wrapper .rating-field {
 24+.articleFeedback-wrapper .rating-field {
2525 float: right;
2626 width: 125px;
2727 line-height: 24px;
2828 padding-right: 5px;
2929 }
30 -.article-assessment-wrapper .rating-field-label{
 30+.articleFeedback-wrapper .rating-field-label{
3131 float: left;
3232 font-weight: bold;
3333 line-height: 24px;
3434 }
35 -.article-assessment-wrapper .rating-field-label {
 35+.articleFeedback-wrapper .rating-field-label {
3636 margin-right: 10px;
3737 }
38 -.article-assessment-wrapper .rating-field-hint {
 38+.articleFeedback-wrapper .rating-field-hint {
3939 width: 11px;
4040 height: 24px;
4141 display: block;
4242 float: right;
4343 background: url(images/question.png) 0 50% no-repeat;
4444 }
45 -.article-assessment-wrapper .rating-field-hint:hover {
 45+.articleFeedback-wrapper .rating-field-hint:hover {
4646 background: url(images/question-hover.png) 0 50% no-repeat;
4747 }
4848
49 -.article-assessment-wrapper .article-assessment-flash {
 49+.articleFeedback-wrapper .articleFeedback-flash {
5050 float: left;
5151 font-size: 11px;
5252 padding: 1px 5px;
@@ -53,25 +53,25 @@
5454 text-align: left;
5555 display: block;
5656 }
57 -.article-assessment-wrapper .article-assessment-stale-msg {
 57+.articleFeedback-wrapper .articleFeedback-stale-msg {
5858 background: #d6f3ff;
5959 border: 2px solid #5dc9f4;
6060 }
61 -.article-assessment-wrapper .article-assessment-success-msg {
 61+.articleFeedback-wrapper .articleFeedback-success-msg {
6262 background: #e8e8e8;
6363 border: 2px solid #006505;
6464 }
65 -.article-assessment-wrapper .article-assessment-error-msg {
 65+.articleFeedback-wrapper .articleFeedback-error-msg {
6666 background: #e8e8e8;
6767 border: 2px solid #a91100;
6868 }
69 -.article-assessment-wrapper .article-assessment-rating-field-name {
 69+.articleFeedback-wrapper .articleFeedback-rating-field-name {
7070 float: left;
7171 width: 110px;
7272 font-weight: bold;
7373 font-size: 11px;
7474 }
75 -.article-assessment-wrapper .article-assessment-rating-field-value-wrapper {
 75+.articleFeedback-wrapper .articleFeedback-rating-field-value-wrapper {
7676 background: url(images/rating-base.png) 0 0 no-repeat;
7777 width: 120px;
7878 height: 13px;
@@ -81,56 +81,56 @@
8282 text-indent: -9999px;
8383 margin-top: 4px;
8484 }
85 -.article-assessment-wrapper .article-assessment-rate-instructions,
86 -.article-assessment-wrapper .article-assessment-rate-feedback,
87 -.article-assessment-wrapper .article-assessment-show-ratings,
88 -.article-assessment-wrapper .article-assessment-hide-ratings {
 85+.articleFeedback-wrapper .articleFeedback-rate-instructions,
 86+.articleFeedback-wrapper .articleFeedback-rate-feedback,
 87+.articleFeedback-wrapper .articleFeedback-show-ratings,
 88+.articleFeedback-wrapper .articleFeedback-hide-ratings {
8989 font-size: 11px;
9090 font-style: italic;
9191 }
92 -.article-assessment-wrapper .article-assessment-rate-instructions {
 92+.articleFeedback-wrapper .articleFeedback-rate-instructions {
9393 float: left;
9494 }
95 -.article-assessment-wrapper .article-assessment-rate-feedback {
 95+.articleFeedback-wrapper .articleFeedback-rate-feedback {
9696 float: right;
9797 }
98 -.article-assessment-wrapper .article-assessment-rating-field-value-wrapper .article-assessment-rating-field-value {
 98+.articleFeedback-wrapper .articleFeedback-rating-field-value-wrapper .articleFeedback-rating-field-value {
9999 background: url(images/rating-bar.png) 0 0 no-repeat;
100100 height: 9px;
101101 float: right;
102102 display: block;
103103 }
104 -.article-assessment-wrapper .article-assessment-rating-fields {
 104+.articleFeedback-wrapper .articleFeedback-rating-fields {
105105 margin: 8px 0;
106106 }
107 -.article-assessment-wrapper .article-assessment-rating-fields .field-wrapper {
 107+.articleFeedback-wrapper .articleFeedback-rating-fields .field-wrapper {
108108 margin-bottom: 5px;
109109 }
110 -.article-assessment-rating-count {
 110+.articleFeedback-rating-count {
111111 font-size: 11px;
112112 margin-left: 5px;
113113 float: left;
114114 }
115 -.article-assessment-submit input {
 115+.articleFeedback-submit input {
116116 margin: 2px 0;
117117 float: right;
118118 }
119 -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-field-value-wrapper {
 119+.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-field-value-wrapper {
120120 background: urlimages/rating-base-disabled.png) 0 0 no-repeat;
121121 }
122 -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-field-value {
 122+.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-field-value {
123123 display: none;
124124 }
125 -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-count {
 125+.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-count {
126126 visibility: hidden;
127127
128128 }
129 -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-field-name {
 129+.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-field-name {
130130 color: #9f9f9f;
131131 }
132132
133133 /* Simple Survey Dialog Styling */
134 -#article-assessment-dialog.loading {
 134+#articleFeedback-dialog.loading {
135135 display: block;
136136 height: 24px;
137137 width: 24px;
@@ -138,49 +138,49 @@
139139 text-indent: -9999px;
140140 margin: 0 auto;
141141 }
142 -#article-assessment-dialog textarea {
 142+#articleFeedback-dialog textarea {
143143 margin-left: -2em;
144144 padding-right: 2em;
145145 }
146 -.article-assessment-error-msg {
 146+.articleFeedback-error-msg {
147147 padding: 20px 0;
148148 }
149149
150150
151151 /* Self Clearing Floats */
152 -.article-assessment-wrapper .article-assessment-information:after,
153 -.article-assessment-wrapper .field-wrapper:after,
154 -.article-assessment-wrapper .article-assessment-rating-fields:after,
155 -.article-assessment-rating:after,
156 -.article-assessment-wrapper .article-assessment-submit:after,
157 -.article-assessment-wrapper .rating-fields:after {
 152+.articleFeedback-wrapper .articleFeedback-information:after,
 153+.articleFeedback-wrapper .field-wrapper:after,
 154+.articleFeedback-wrapper .articleFeedback-rating-fields:after,
 155+.articleFeedback-rating:after,
 156+.articleFeedback-wrapper .articleFeedback-submit:after,
 157+.articleFeedback-wrapper .rating-fields:after {
158158 content: ".";
159159 display: block;
160160 height: 0;
161161 clear: both;
162162 visibility: hidden;
163163 }
164 -.article-assessment-wrapper .field-wrapper,
165 -.article-assessment-wrapper .article-assessment-information,
166 -.article-assessment-wrapper .article-assessment-rating-fields,
167 -.article-assessment-rating,
168 -.article-assessment-wrapper .article-assessment-submit,
169 -.article-assessment-wrapper .rating-fields {
 164+.articleFeedback-wrapper .field-wrapper,
 165+.articleFeedback-wrapper .articleFeedback-information,
 166+.articleFeedback-wrapper .articleFeedback-rating-fields,
 167+.articleFeedback-rating,
 168+.articleFeedback-wrapper .articleFeedback-submit,
 169+.articleFeedback-wrapper .rating-fields {
170170 display: inline-block;
171171 }
172 -* html .article-assessment-wrapper .field-wrapper,
173 -* html .article-assessment-wrapper .article-assessment-information,
174 -* html .article-assessment-wrapper .article-assessment-rating-fields,
175 -* html .article-assessment-rating,
176 -* html .article-assessment-wrapper .article-assessment-submit,
177 -* html .article-assessment-wrapper .rating-fields {
 172+* html .articleFeedback-wrapper .field-wrapper,
 173+* html .articleFeedback-wrapper .articleFeedback-information,
 174+* html .articleFeedback-wrapper .articleFeedback-rating-fields,
 175+* html .articleFeedback-rating,
 176+* html .articleFeedback-wrapper .articleFeedback-submit,
 177+* html .articleFeedback-wrapper .rating-fields {
178178 height: 1%;
179179 }
180 -.article-assessment-wrapper .field-wrapper,
181 -.article-assessment-wrapper .article-assessment-information,
182 -.article-assessment-wrapper .article-assessment-rating-fields,
183 -.article-assessment-rating,
184 -.article-assessment-wrapper .article-assessment-submit,
185 -.article-assessment-wrapper .rating-fields {
 180+.articleFeedback-wrapper .field-wrapper,
 181+.articleFeedback-wrapper .articleFeedback-information,
 182+.articleFeedback-wrapper .articleFeedback-rating-fields,
 183+.articleFeedback-rating,
 184+.articleFeedback-wrapper .articleFeedback-submit,
 185+.articleFeedback-wrapper .rating-fields {
186186 display: block;
187187 }
\ No newline at end of file
Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.css
___________________________________________________________________
Added: svn:mergeinfo
188188 Merged /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.css:r76964-76966
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.js
@@ -1,5 +1,5 @@
22 ( function( $ ) {
3 - $.ArticleAssessment = {
 3+ $.ArticleFeedback = {
44 'config': {
55 'authtoken': '',
66 'userID': '',
@@ -16,7 +16,7 @@
1717 'readability'
1818 ],
1919 'fieldHintSuffix': '-tooltip',
20 - 'fieldPrefix': 'articleassessment-rating-',
 20+ 'fieldPrefix': 'articlefeedback-rating-',
2121 'fieldHTML': '<div class="field-wrapper"> \
2222 <label class="rating-field-label"></label> \
2323 <select class="rating-field"> \
@@ -27,45 +27,45 @@
2828 <option value="5">5</option> \
2929 </select> \
3030 </div>',
31 - 'structureHTML': '<div class="article-assessment-wrapper nonopopups"> \
32 - <form action="rate" method="post" id="article-assessment"> \
33 - <fieldset id="article-assessment-rate"> \
 31+ 'structureHTML': '<div class="articleFeedback-wrapper nonopopups"> \
 32+ <form action="rate" method="post" id="articleFeedback"> \
 33+ <fieldset id="articleFeedback-rate"> \
3434 <legend></legend> \
35 - <div class="article-assessment-information"> \
36 - <span class="article-assessment-rate-instructions"></span> \
37 - <span class="article-assessment-rate-feedback"></span> \
 35+ <div class="articleFeedback-information"> \
 36+ <span class="articleFeedback-rate-instructions"></span> \
 37+ <span class="articleFeedback-rate-feedback"></span> \
3838 </div> \
39 - <div class="article-assessment-rating-fields"></div> \
40 - <div class="article-assessment-submit"> \
 39+ <div class="articleFeedback-rating-fields"></div> \
 40+ <div class="articleFeedback-submit"> \
4141 <input type="submit" value="Submit" /> \
4242 </div> \
4343 </fieldset> \
44 - <fieldset id="article-assessment-ratings"> \
 44+ <fieldset id="articleFeedback-ratings"> \
4545 <legend></legend> \
46 - <div class="article-assessment-information"> \
47 - <span class="article-assessment-show-ratings"></span> \
48 - <span class="article-assessment-hide-ratings"></span> \
 46+ <div class="articleFeedback-information"> \
 47+ <span class="articleFeedback-show-ratings"></span> \
 48+ <span class="articleFeedback-hide-ratings"></span> \
4949 </div> \
5050 </fieldset> \
5151 </form> \
5252 </div>',
53 - 'ratingHTML': '<div class="article-assessment-rating"> \
54 - <span class="article-assessment-rating-field-name"></span> \
55 - <span class="article-assessment-rating-field-value-wrapper"> \
56 - <span class="article-assessment-rating-field-value">0%</span> \
 53+ 'ratingHTML': '<div class="articleFeedback-rating"> \
 54+ <span class="articleFeedback-rating-field-name"></span> \
 55+ <span class="articleFeedback-rating-field-value-wrapper"> \
 56+ <span class="articleFeedback-rating-field-value">0%</span> \
5757 </span> \
58 - <span class="article-assessment-rating-count"></span> \
 58+ <span class="articleFeedback-rating-count"></span> \
5959 </div>'
6060 },
6161
6262 'fn' : {
6363 'init': function( $$options ) {
6464 // merge options with the config
65 - var settings = $.extend( {}, $.ArticleAssessment.settings, $$options );
66 - var config = $.ArticleAssessment.config;
 65+ var settings = $.extend( {}, $.ArticleFeedback.settings, $$options );
 66+ var config = $.ArticleFeedback.config;
6767 // if this is an anon user, get a unique identifier for them
6868 // load up the stored ratings and update the markup if the cookie exists
69 - var userToken = $.cookie( 'mwArticleAssessmentUserToken' );
 69+ var userToken = $.cookie( 'mwArticleFeedbackUserToken' );
7070 if ( typeof userToken == 'undefined' || userToken == null ) {
7171 function randomString( string_length ) {
7272 var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
@@ -78,7 +78,7 @@
7979 }
8080 userToken = randomString( 32 );
8181 $.cookie(
82 - 'mwArticleAssessmentUserToken',
 82+ 'mwArticleFeedbackUserToken',
8383 userToken,
8484 { 'expires': 30, 'path': '/' }
8585 );
@@ -88,57 +88,57 @@
8989 }
9090 // setup our markup using the template variables in settings
9191 var $structure = $( settings.structureHTML ),
92 - instructions = mediaWiki.msg( 'articleassessment-pleaserate' ),
93 - feedback = mediaWiki.msg( 'articleassessment-featurefeedback' ),
94 - yourfeedback = mediaWiki.msg( 'articleassessment-yourfeedback'),
95 - articlerating = mediaWiki.msg( 'articleassessment-articlerating' ),
96 - resultshide = mediaWiki.msg( 'articleassessment-results-hide' ),
97 - resultsshow = mediaWiki.msg( 'articleassessment-results-show' );
98 - submitbutton = mediaWiki.msg( 'articleassessment-submit' );
 92+ instructions = mediaWiki.msg( 'articlefeedback-pleaserate' ),
 93+ feedback = mediaWiki.msg( 'articlefeedback-featurefeedback' ),
 94+ yourfeedback = mediaWiki.msg( 'articlefeedback-yourfeedback'),
 95+ articlerating = mediaWiki.msg( 'articlefeedback-articlerating' ),
 96+ resultshide = mediaWiki.msg( 'articlefeedback-results-hide' ),
 97+ resultsshow = mediaWiki.msg( 'articlefeedback-results-show' );
 98+ submitbutton = mediaWiki.msg( 'articlefeedback-submit' );
9999 $structure
100 - .find( '#article-assessment-rate legend' )
 100+ .find( '#articleFeedback-rate legend' )
101101 .html( yourfeedback )
102102 .end()
103 - .find( '.article-assessment-rate-instructions' )
 103+ .find( '.articleFeedback-rate-instructions' )
104104 .html( instructions )
105105 .end()
106 - .find( '.article-assessment-rate-feedback' )
 106+ .find( '.articleFeedback-rate-feedback' )
107107 .html( feedback )
108108 .find( '.feedbacklink' )
109109 .wrap( '<a href="#"></a>' )
110110 .parent()
111 - .click( $.ArticleAssessment.fn.showFeedback )
 111+ .click( $.ArticleFeedback.fn.showFeedback )
112112 .end()
113113 .end()
114114 .end()
115 - .find( '#article-assessment-ratings legend' )
 115+ .find( '#articleFeedback-ratings legend' )
116116 .html( articlerating )
117117 .end()
118 - .find( '.article-assessment-show-ratings' )
 118+ .find( '.articleFeedback-show-ratings' )
119119 .html( resultsshow )
120120 .find( '.showlink' )
121121 .wrap( '<a href="#"></a>' )
122122 .parent()
123 - .click( $.ArticleAssessment.fn.showRatings )
 123+ .click( $.ArticleFeedback.fn.showRatings )
124124 .end()
125125 .end()
126126 .end()
127 - .find( '.article-assessment-hide-ratings' )
 127+ .find( '.articleFeedback-hide-ratings' )
128128 .html( resultshide )
129129 .find ( '.hidelink' )
130130 .wrap( '<a href="#"></a>' )
131131 .parent()
132 - .click( $.ArticleAssessment.fn.hideRatings )
 132+ .click( $.ArticleFeedback.fn.hideRatings )
133133 .end()
134134 .end()
135135 .end()
136 - .find( '.article-assessment-submit input' )
 136+ .find( '.articleFeedback-submit input' )
137137 .val( submitbutton )
138138 .end();
139139 // hide the feedback link if we need to
140 - if( $.cookie( 'mwArticleAssessmentHideFeedbackLink' ) ) {
 140+ if( $.cookie( 'mwArticleFeedbackHideFeedbackLink' ) ) {
141141 $structure
142 - .find( '.article-assessment-rate-feedback' )
 142+ .find( '.articleFeedback-rate-feedback' )
143143 .hide();
144144 }
145145 for ( var i = 0; i < settings.fieldMessages.length; i++ ) {
@@ -150,10 +150,10 @@
151151 settings.fieldPrefix + settings.fieldMessages[i] +
152152 settings.fieldHintSuffix
153153 ),
154 - count = mediaWiki.msg( 'articleassessment-noratings', 0, 0 );
 154+ count = mediaWiki.msg( 'articlefeedback-noratings', 0, 0 );
155155 // initialize the field html
156156 $field
157 - .attr( 'id', 'articleassessment-rate-' + field )
 157+ .attr( 'id', 'articlefeedback-rate-' + field )
158158 .find( 'label' )
159159 .attr( 'for', 'rating_' + field )
160160 .attr( 'original-title', hint )
@@ -164,43 +164,43 @@
165165 .attr( 'name', 'rating[' + field + ']' );
166166 // initialize the rating html
167167 $rating
168 - .attr( 'id', 'articleassessment-rating-' + field )
169 - .find( '.article-assessment-rating-field-name' )
 168+ .attr( 'id', 'articlefeedback-rating-' + field )
 169+ .find( '.articleFeedback-rating-field-name' )
170170 .html( label )
171171 .end()
172 - .find( '.article-assessment-rating-count' )
 172+ .find( '.articleFeedback-rating-count' )
173173 .html( count );
174174 // append the field and rating html
175175 $structure
176 - .find( '.article-assessment-rating-fields' )
 176+ .find( '.articleFeedback-rating-fields' )
177177 .append( $field )
178178 .end()
179 - .find( '#article-assessment-ratings' )
 179+ .find( '#articleFeedback-ratings' )
180180 .append( $rating );
181181 }
182182 // store our settings and configuration for later
183 - $structure.find( '#article-assessment' )
 183+ $structure.find( '#articleFeedback' )
184184 .data(
185 - 'articleAssessment-context',
 185+ 'articleFeedback-context',
186186 { 'settings': settings, 'config': config }
187187 );
188188 $( '#catlinks' ).before( $structure );
189189 // Hide the ratings initially
190 - $.ArticleAssessment.fn.hideRatings();
 190+ $.ArticleFeedback.fn.hideRatings();
191191
192192
193193 // set the height of our smaller fieldset to match the taller
194194 if (
195 - $( '#article-assessment-rate' ).height() >
196 - $( '#article-assessment-ratings' ).height() ) {
197 - $( '#article-assessment-ratings' )
198 - .css( 'minHeight', $( '#article-assessment-rate' ).height() );
 195+ $( '#articleFeedback-rate' ).height() >
 196+ $( '#articleFeedback-ratings' ).height() ) {
 197+ $( '#articleFeedback-ratings' )
 198+ .css( 'minHeight', $( '#articleFeedback-rate' ).height() );
199199 } else {
200 - $( '#article-assessment-rate' )
201 - .css( 'minHeight', $( '#article-assessment-ratings' ).height() );
 200+ $( '#articleFeedback-rate' )
 201+ .css( 'minHeight', $( '#articleFeedback-ratings' ).height() );
202202 }
203203 // attempt to fetch the ratings
204 - $.ArticleAssessment.fn.getRatingData();
 204+ $.ArticleFeedback.fn.getRatingData();
205205
206206 // initialize the star plugin
207207 $( '.rating-field' ).each( function() {
@@ -216,7 +216,7 @@
217217 .removeClass( 'ui-stars-star-stale' )
218218 .removeClass( 'ui-stars-star-rated' );
219219 // enable our submit button if it's still disabled
220 - $( '#article-assessment input:disabled' )
 220+ $( '#articleFeedback input:disabled' )
221221 .removeAttr( 'disabled' );
222222 } );
223223 }
@@ -230,29 +230,29 @@
231231 .tipsy( { gravity : 'se', opacity: '0.9' } ) );
232232 } );
233233 // bind submit event to the form
234 - $( '#article-assessment' )
235 - .submit( function() { $.ArticleAssessment.fn.submitRating(); return false; } );
 234+ $( '#articleFeedback' )
 235+ .submit( function() { $.ArticleFeedback.fn.submitRating(); return false; } );
236236 // prevent the submit button for being active until all ratings are filled out
237 - $( '#article-assessment input[type=submit]' )
 237+ $( '#articleFeedback input[type=submit]' )
238238 .attr( 'disabled', 'disabled' );
239239 },
240240 'showRatings': function() {
241 - $( '#article-assessment-ratings' )
242 - .removeClass( 'article-assessment-ratings-disabled' )
243 - .find( '.article-assessment-show-ratings' )
 241+ $( '#articleFeedback-ratings' )
 242+ .removeClass( 'articleFeedback-ratings-disabled' )
 243+ .find( '.articleFeedback-show-ratings' )
244244 .hide()
245245 .end()
246 - .find( '.article-assessment-hide-ratings' )
 246+ .find( '.articleFeedback-hide-ratings' )
247247 .show();
248248 return false;
249249 },
250250 'hideRatings': function() {
251 - $( '#article-assessment-ratings' )
252 - .addClass( 'article-assessment-ratings-disabled' )
253 - .find( '.article-assessment-hide-ratings' )
 251+ $( '#articleFeedback-ratings' )
 252+ .addClass( 'articleFeedback-ratings-disabled' )
 253+ .find( '.articleFeedback-hide-ratings' )
254254 .hide()
255255 .end()
256 - .find( '.article-assessment-show-ratings' )
 256+ .find( '.articleFeedback-show-ratings' )
257257 .show();
258258 return false;
259259
@@ -260,10 +260,10 @@
261261
262262 // Request the ratings data for the current article
263263 'getRatingData': function() {
264 - var config = $( '#article-assessment' ).data( 'articleAssessment-context' ).config;
 264+ var config = $( '#articleFeedback' ).data( 'articleFeedback-context' ).config;
265265 var requestData = {
266266 'action': 'query',
267 - 'list': 'articleassessment',
 267+ 'list': 'articlefeedback',
268268 'aapageid': config.pageID,
269269 'aauserrating': 1,
270270 'format': 'json'
@@ -276,30 +276,30 @@
277277 url: wgScriptPath + '/api.php',
278278 data: requestData,
279279 dataType: 'json',
280 - success: $.ArticleAssessment.fn.afterGetRatingData,
 280+ success: $.ArticleFeedback.fn.afterGetRatingData,
281281 error: function( XMLHttpRequest, textStatus, errorThrown ) {
282 - $.ArticleAssessment.fn.flashNotice( mediaWiki.msg( 'articleassessment-error' ),
283 - { 'class': 'article-assessment-error-msg' } );
 282+ $.ArticleFeedback.fn.flashNotice( mediaWiki.msg( 'articlefeedback-error' ),
 283+ { 'class': 'articleFeedback-error-msg' } );
284284 }
285285 } );
286286 },
287287 'afterGetRatingData' : function( data ) {
288 - var settings = $( '#article-assessment' ).data( 'articleAssessment-context' ).settings,
 288+ var settings = $( '#articleFeedback' ).data( 'articleFeedback-context' ).settings,
289289 userHasRated = false;
290290 // add the correct data to the markup
291 - if ( typeof data.query != 'undefined' && typeof data.query.articleassessment != 'undefined' &&
292 - typeof data.query.articleassessment[0] != 'undefined' ) {
293 - for ( var r in data.query.articleassessment[0].ratings ) {
294 - var rating = data.query.articleassessment[0].ratings[r],
 291+ if ( typeof data.query != 'undefined' && typeof data.query.articlefeedback != 'undefined' &&
 292+ typeof data.query.articlefeedback[0] != 'undefined' ) {
 293+ for ( var r in data.query.articlefeedback[0].ratings ) {
 294+ var rating = data.query.articlefeedback[0].ratings[r],
295295 $rating = $( '#' + rating.ratingdesc ),
296296 count = rating.count,
297297 total = ( rating.total / count ).toFixed( 1 ),
298 - label = mediaWiki.msg( 'articleassessment-noratings', total, count );
 298+ label = mediaWiki.msg( 'articlefeedback-noratings', total, count );
299299 $rating
300 - .find( '.article-assessment-rating-field-value' )
 300+ .find( '.articleFeedback-rating-field-value' )
301301 .text( total )
302302 .end()
303 - .find( '.article-assessment-rating-count' )
 303+ .find( '.articleFeedback-rating-count' )
304304 .html( label );
305305 if( rating.userrating ) {
306306 userHasRated = true;
@@ -310,23 +310,23 @@
311311 }
312312 // show the ratings if the user has rated
313313 if( userHasRated ) {
314 - $.ArticleAssessment.fn.showRatings();
 314+ $.ArticleFeedback.fn.showRatings();
315315 }
316316 // if the rating is more than 5 revisions old, mark it as stale
317 - if ( typeof data.query.articleassessment[0].stale != 'undefined' ) {
 317+ if ( typeof data.query.articlefeedback[0].stale != 'undefined' ) {
318318 // add the stale star class to each on star
319319 $( '.ui-stars-star-on' )
320320 .addClass( 'ui-stars-star-stale' );
321321 // add the stale message
322 - var msg = mediaWiki.msg( 'articleassessment-stalemessage-norevisioncount' );
323 - $.ArticleAssessment.fn.flashNotice( msg, { 'class': 'article-assessment-stale-msg' } );
 322+ var msg = mediaWiki.msg( 'articlefeedback-stalemessage-norevisioncount' );
 323+ $.ArticleFeedback.fn.flashNotice( msg, { 'class': 'articleFeedback-stale-msg' } );
324324 } else {
325325 // if it's not a stale rating, we want to make the stars blue
326326 $( '.ui-stars-star-on' ).addClass( 'ui-stars-star-rated' );
327327 }
328328 }
329329 // initialize the ratings
330 - $( '.article-assessment-rating-field-value' ).each( function() {
 330+ $( '.articleFeedback-rating-field-value' ).each( function() {
331331 $(this)
332332 .css( {
333333 'width': 120 - ( 120 * ( parseFloat( $(this).text() ) / 5 ) ) + 'px'
@@ -334,13 +334,13 @@
335335 } );
336336 },
337337 'submitRating': function() {
338 - var config = $( '#article-assessment' ).data( 'articleAssessment-context' ).config;
 338+ var config = $( '#articleFeedback' ).data( 'articleFeedback-context' ).config;
339339 // clear out the stale message
340 - $.ArticleAssessment.fn.flashNotice( );
 340+ $.ArticleFeedback.fn.flashNotice( );
341341
342342 // lock the star inputs & submit
343343 $( '.rating-field' ).stars( 'disable' );
344 - $( '#article-assessment input' ).attr( 'disabled', 'disabled' );
 344+ $( '#articleFeedback input' ).attr( 'disabled', 'disabled' );
345345 // get our results for submitting
346346 var results = {};
347347 $( '.rating-field input' ).each( function() {
@@ -353,7 +353,7 @@
354354 url: wgScriptPath + '/api.php',
355355 type: 'POST',
356356 data: {
357 - 'action': 'articleassessment',
 357+ 'action': 'articlefeedback',
358358 'revid': config.revID,
359359 'pageid': config.pageID,
360360 'r1' : results['wellsourced'],
@@ -364,66 +364,66 @@
365365 'format': 'json'
366366 },
367367 dataType: 'json',
368 - success: $.ArticleAssessment.fn.afterSubmitRating,
 368+ success: $.ArticleFeedback.fn.afterSubmitRating,
369369 error: function( XMLHttpRequest, textStatus, errorThrown ) {
370 - $.ArticleAssessment.fn.flashNotice( mediaWiki.msg( 'articleassessment-error' ),
371 - { 'class': 'article-assessment-error-msg' } );
 370+ $.ArticleFeedback.fn.flashNotice( mediaWiki.msg( 'articlefeedback-error' ),
 371+ { 'class': 'articleFeedback-error-msg' } );
372372 }
373373 } );
374374 },
375375 'afterSubmitRating': function ( data ) {
376376 // update the ratings
377 - $.ArticleAssessment.fn.getRatingData();
 377+ $.ArticleFeedback.fn.getRatingData();
378378 // set the stars to rated status
379379 $( '.ui-stars-star-on' ).addClass( 'ui-stars-star-rated' );
380380 // unlock the stars & submit
381381 $( '.rating-field' ).stars( 'enable' );
382 - $( '#article-assessment input:disabled' ).removeAttr( 'disabled' );
 382+ $( '#articleFeedback input:disabled' ).removeAttr( 'disabled' );
383383 // update the results
384384
385385 // show the results
386 - $.ArticleAssessment.fn.showRatings();
 386+ $.ArticleFeedback.fn.showRatings();
387387 // say thank you
388 - $.ArticleAssessment.fn.flashNotice( mediaWiki.msg( 'articleassessment-thanks' ),
389 - { 'class': 'article-assessment-success-msg' } );
 388+ $.ArticleFeedback.fn.flashNotice( mediaWiki.msg( 'articlefeedback-thanks' ),
 389+ { 'class': 'articleFeedback-success-msg' } );
390390 },
391391 // places a message on the interface
392392 'flashNotice': function( text, options ) {
393393 if ( arguments.length == 0 ) {
394394 // clear existing messages, but don't add a new one
395 - $( '#article-assessment .article-assessment-flash' ).remove();
 395+ $( '#articleFeedback .articleFeedback-flash' ).remove();
396396 } else {
397397 // clear and add a new message
398 - $( '#article-assessment .article-assessment-flash' ).remove();
 398+ $( '#articleFeedback .articleFeedback-flash' ).remove();
399399 var className = options['class'];
400400 // create our new message
401401 $msg = $( '<div />' )
402 - .addClass( 'article-assessment-flash' )
 402+ .addClass( 'articleFeedback-flash' )
403403 .html( text );
404404 // if the class option was passed, add it
405405 if( options['class'] ) {
406406 $msg.addClass( options['class'] );
407407 }
408408 // place our new message on the page
409 - $( '#article-assessment .article-assessment-submit' )
 409+ $( '#articleFeedback .articleFeedback-submit' )
410410 .append( $msg );
411411 }
412412 },
413413 'showFeedback': function() {
414 - var $dialogDiv = $( '#article-assessment-dialog' );
 414+ var $dialogDiv = $( '#articleFeedback-dialog' );
415415 if ( $dialogDiv.size() == 0 ) {
416 - $dialogDiv = $( '<div id="article-assessment-dialog" class="loading" />' )
 416+ $dialogDiv = $( '<div id="articleFeedback-dialog" class="loading" />' )
417417 .dialog( {
418418 width: 600,
419419 height: 400,
420420 bgiframe: true,
421421 autoOpen: true,
422422 modal: true,
423 - title: mediaWiki.msg( 'articleassessment-survey-title' ),
 423+ title: mediaWiki.msg( 'articlefeedback-survey-title' ),
424424 close: function() {
425425 $(this)
426426 .dialog( 'option', 'height', 400 )
427 - .find( '.article-assessment-success-msg, .article-assessment-error-msg' )
 427+ .find( '.articleFeedback-success-msg, .articleFeedback-error-msg' )
428428 .remove()
429429 .end()
430430 .find( 'form' )
@@ -433,7 +433,7 @@
434434 $dialogDiv.load(
435435 wgScript + '?title=Special:SimpleSurvey&survey=articlerating&raw=1',
436436 function() {
437 - $(this).find( 'form' ).bind( 'submit', $.ArticleAssessment.fn.submitFeedback );
 437+ $(this).find( 'form' ).bind( 'submit', $.ArticleFeedback.fn.submitFeedback );
438438 $(this).removeClass( 'loading' );
439439 }
440440 );
@@ -442,7 +442,7 @@
443443 return false;
444444 },
445445 'submitFeedback': function() {
446 - var $dialogDiv = $( '#article-assessment-dialog' );
 446+ var $dialogDiv = $( '#articleFeedback-dialog' );
447447 $dialogDiv
448448 .find( 'form' )
449449 .hide()
@@ -479,8 +479,8 @@
480480 var success = $( data ).find( '.simplesurvey-success' ).size() > 0;
481481 // TODO: Style success-msg, error-msg
482482 var $msgDiv = $( '<div />' )
483 - .addClass( success ? 'article-assessment-success-msg' : 'article-assessment-error-msg' )
484 - .html( mediaWiki.msg( success? 'articleassessment-survey-thanks' : 'articleassessment-error' ) )
 483+ .addClass( success ? 'articleFeedback-success-msg' : 'articleFeedback-error-msg' )
 484+ .html( mediaWiki.msg( success? 'articlefeedback-survey-thanks' : 'articlefeedback-error' ) )
485485 .appendTo( $dialogDiv );
486486 $dialogDiv.removeClass( 'loading' );
487487
@@ -490,17 +490,17 @@
491491
492492 if ( success ) {
493493 // Hide the dialog link
494 - $( '#article-assessment .article-assessment-rate-feedback' ).hide();
 494+ $( '#articleFeedback .articleFeedback-rate-feedback' ).hide();
495495 // set a cookie to keep the dialog link hidden
496 - $.cookie( 'mwArticleAssessmentHideFeedbackLink', true, { 'expires': 30, 'path': '/' } );
 496+ $.cookie( 'mwArticleFeedbackHideFeedbackLink', true, { 'expires': 30, 'path': '/' } );
497497
498498 }
499499 },
500500 error: function( XMLHttpRequest, textStatus, errorThrown ) {
501501 // TODO: Duplicates code, factor out, maybe
502502 var $msgDiv = $( '<div />' )
503 - .addClass( 'article-assessment-error-msg' )
504 - .html( mediaWiki.msg( 'articleassessment-error' ) )
 503+ .addClass( 'articleFeedback-error-msg' )
 504+ .html( mediaWiki.msg( 'articlefeedback-error' ) )
505505 .appendTo( $dialogDiv );
506506 $dialogDiv.removeClass( 'loading' );
507507 $dialogDiv.dialog( 'option', 'height', $msgDiv.height() + 100 );
@@ -511,6 +511,6 @@
512512 }
513513 };
514514 $( document ).ready( function () {
515 - $.ArticleAssessment.fn.init( );
 515+ $.ArticleFeedback.fn.init( );
516516 } ); //document ready
517517 } )( jQuery );
Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.js
___________________________________________________________________
Added: svn:mergeinfo
518518 Merged /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js:r76964-76966

Follow-up revisions

RevisionCommit summaryAuthorDate
r81550followup to r77648 -- automatically added hidden categories such as Uploaded_...neilk01:05, 5 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76964Part 2 of 2 - Renaming ArticleAssessmentPilot to ArticleFeedback - this commi...tparscal21:28, 18 November 2010
r76965Renamed article-feedback-wrapper to articleFeedback-wrapper, following a came...tparscal21:30, 18 November 2010
r76966Renamed article-feedback to articleFeedback, following a camelCase conventiontparscal21:32, 18 November 2010
r77646Remove ArticleFeedback alpha CSS and JS files. This is the first step towards...catrope13:20, 3 December 2010

Comments

#Comment by NeilK (talk | contribs)   01:11, 5 February 2011

I made a typo when committing -- ignore the followup revision

Status & tagging log