Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.css |
— | — | @@ -1,51 +1,51 @@ |
2 | 2 | /* |
3 | | - * Styles for Article Assessment |
| 3 | + * Styles for Article Feedback |
4 | 4 | */ |
5 | 5 | |
6 | | -.article-assessment-wrapper #article-assessment-rate, |
7 | | -.article-assessment-wrapper #article-assessment-ratings { |
| 6 | +.articleFeedback-wrapper #articleFeedback-rate, |
| 7 | +.articleFeedback-wrapper #articleFeedback-ratings { |
8 | 8 | background: #f7f7f7; |
9 | 9 | float: left; |
10 | 10 | } |
11 | 11 | |
12 | | -.article-assessment-wrapper #article-assessment-rate { |
| 12 | +.articleFeedback-wrapper #articleFeedback-rate { |
13 | 13 | width: 650px; |
14 | 14 | margin-right: 10px; |
15 | 15 | } |
16 | | -.article-assessment-wrapper legend { |
| 16 | +.articleFeedback-wrapper legend { |
17 | 17 | font-weight: bold; |
18 | 18 | } |
19 | | -.article-assessment-wrapper .field-wrapper { |
| 19 | +.articleFeedback-wrapper .field-wrapper { |
20 | 20 | float: left; |
21 | 21 | width: 270px; |
22 | 22 | padding-right: 28px; |
23 | 23 | } |
24 | | -.article-assessment-wrapper .rating-field { |
| 24 | +.articleFeedback-wrapper .rating-field { |
25 | 25 | float: right; |
26 | 26 | width: 125px; |
27 | 27 | line-height: 24px; |
28 | 28 | padding-right: 5px; |
29 | 29 | } |
30 | | -.article-assessment-wrapper .rating-field-label{ |
| 30 | +.articleFeedback-wrapper .rating-field-label{ |
31 | 31 | float: left; |
32 | 32 | font-weight: bold; |
33 | 33 | line-height: 24px; |
34 | 34 | } |
35 | | -.article-assessment-wrapper .rating-field-label { |
| 35 | +.articleFeedback-wrapper .rating-field-label { |
36 | 36 | margin-right: 10px; |
37 | 37 | } |
38 | | -.article-assessment-wrapper .rating-field-hint { |
| 38 | +.articleFeedback-wrapper .rating-field-hint { |
39 | 39 | width: 11px; |
40 | 40 | height: 24px; |
41 | 41 | display: block; |
42 | 42 | float: right; |
43 | 43 | background: url(images/question.png) 0 50% no-repeat; |
44 | 44 | } |
45 | | -.article-assessment-wrapper .rating-field-hint:hover { |
| 45 | +.articleFeedback-wrapper .rating-field-hint:hover { |
46 | 46 | background: url(images/question-hover.png) 0 50% no-repeat; |
47 | 47 | } |
48 | 48 | |
49 | | -.article-assessment-wrapper .article-assessment-flash { |
| 49 | +.articleFeedback-wrapper .articleFeedback-flash { |
50 | 50 | float: left; |
51 | 51 | font-size: 11px; |
52 | 52 | padding: 1px 5px; |
— | — | @@ -53,25 +53,25 @@ |
54 | 54 | text-align: left; |
55 | 55 | display: block; |
56 | 56 | } |
57 | | -.article-assessment-wrapper .article-assessment-stale-msg { |
| 57 | +.articleFeedback-wrapper .articleFeedback-stale-msg { |
58 | 58 | background: #d6f3ff; |
59 | 59 | border: 2px solid #5dc9f4; |
60 | 60 | } |
61 | | -.article-assessment-wrapper .article-assessment-success-msg { |
| 61 | +.articleFeedback-wrapper .articleFeedback-success-msg { |
62 | 62 | background: #e8e8e8; |
63 | 63 | border: 2px solid #006505; |
64 | 64 | } |
65 | | -.article-assessment-wrapper .article-assessment-error-msg { |
| 65 | +.articleFeedback-wrapper .articleFeedback-error-msg { |
66 | 66 | background: #e8e8e8; |
67 | 67 | border: 2px solid #a91100; |
68 | 68 | } |
69 | | -.article-assessment-wrapper .article-assessment-rating-field-name { |
| 69 | +.articleFeedback-wrapper .articleFeedback-rating-field-name { |
70 | 70 | float: left; |
71 | 71 | width: 110px; |
72 | 72 | font-weight: bold; |
73 | 73 | font-size: 11px; |
74 | 74 | } |
75 | | -.article-assessment-wrapper .article-assessment-rating-field-value-wrapper { |
| 75 | +.articleFeedback-wrapper .articleFeedback-rating-field-value-wrapper { |
76 | 76 | background: url(images/rating-base.png) 0 0 no-repeat; |
77 | 77 | width: 120px; |
78 | 78 | height: 13px; |
— | — | @@ -81,56 +81,56 @@ |
82 | 82 | text-indent: -9999px; |
83 | 83 | margin-top: 4px; |
84 | 84 | } |
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 { |
89 | 89 | font-size: 11px; |
90 | 90 | font-style: italic; |
91 | 91 | } |
92 | | -.article-assessment-wrapper .article-assessment-rate-instructions { |
| 92 | +.articleFeedback-wrapper .articleFeedback-rate-instructions { |
93 | 93 | float: left; |
94 | 94 | } |
95 | | -.article-assessment-wrapper .article-assessment-rate-feedback { |
| 95 | +.articleFeedback-wrapper .articleFeedback-rate-feedback { |
96 | 96 | float: right; |
97 | 97 | } |
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 { |
99 | 99 | background: url(images/rating-bar.png) 0 0 no-repeat; |
100 | 100 | height: 9px; |
101 | 101 | float: right; |
102 | 102 | display: block; |
103 | 103 | } |
104 | | -.article-assessment-wrapper .article-assessment-rating-fields { |
| 104 | +.articleFeedback-wrapper .articleFeedback-rating-fields { |
105 | 105 | margin: 8px 0; |
106 | 106 | } |
107 | | -.article-assessment-wrapper .article-assessment-rating-fields .field-wrapper { |
| 107 | +.articleFeedback-wrapper .articleFeedback-rating-fields .field-wrapper { |
108 | 108 | margin-bottom: 5px; |
109 | 109 | } |
110 | | -.article-assessment-rating-count { |
| 110 | +.articleFeedback-rating-count { |
111 | 111 | font-size: 11px; |
112 | 112 | margin-left: 5px; |
113 | 113 | float: left; |
114 | 114 | } |
115 | | -.article-assessment-submit input { |
| 115 | +.articleFeedback-submit input { |
116 | 116 | margin: 2px 0; |
117 | 117 | float: right; |
118 | 118 | } |
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 { |
120 | 120 | background: urlimages/rating-base-disabled.png) 0 0 no-repeat; |
121 | 121 | } |
122 | | -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-field-value { |
| 122 | +.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-field-value { |
123 | 123 | display: none; |
124 | 124 | } |
125 | | -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-count { |
| 125 | +.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-count { |
126 | 126 | visibility: hidden; |
127 | 127 | |
128 | 128 | } |
129 | | -.article-assessment-wrapper .article-assessment-ratings-disabled .article-assessment-rating-field-name { |
| 129 | +.articleFeedback-wrapper .articleFeedback-ratings-disabled .articleFeedback-rating-field-name { |
130 | 130 | color: #9f9f9f; |
131 | 131 | } |
132 | 132 | |
133 | 133 | /* Simple Survey Dialog Styling */ |
134 | | -#article-assessment-dialog.loading { |
| 134 | +#articleFeedback-dialog.loading { |
135 | 135 | display: block; |
136 | 136 | height: 24px; |
137 | 137 | width: 24px; |
— | — | @@ -138,49 +138,49 @@ |
139 | 139 | text-indent: -9999px; |
140 | 140 | margin: 0 auto; |
141 | 141 | } |
142 | | -#article-assessment-dialog textarea { |
| 142 | +#articleFeedback-dialog textarea { |
143 | 143 | margin-left: -2em; |
144 | 144 | padding-right: 2em; |
145 | 145 | } |
146 | | -.article-assessment-error-msg { |
| 146 | +.articleFeedback-error-msg { |
147 | 147 | padding: 20px 0; |
148 | 148 | } |
149 | 149 | |
150 | 150 | |
151 | 151 | /* 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 { |
158 | 158 | content: "."; |
159 | 159 | display: block; |
160 | 160 | height: 0; |
161 | 161 | clear: both; |
162 | 162 | visibility: hidden; |
163 | 163 | } |
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 { |
170 | 170 | display: inline-block; |
171 | 171 | } |
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 { |
178 | 178 | height: 1%; |
179 | 179 | } |
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 { |
186 | 186 | display: block; |
187 | 187 | } |
\ No newline at end of file |
Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.css |
___________________________________________________________________ |
Added: svn:mergeinfo |
188 | 188 | 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 @@ |
2 | 2 | ( function( $ ) { |
3 | | - $.ArticleAssessment = { |
| 3 | + $.ArticleFeedback = { |
4 | 4 | 'config': { |
5 | 5 | 'authtoken': '', |
6 | 6 | 'userID': '', |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | 'readability' |
18 | 18 | ], |
19 | 19 | 'fieldHintSuffix': '-tooltip', |
20 | | - 'fieldPrefix': 'articleassessment-rating-', |
| 20 | + 'fieldPrefix': 'articlefeedback-rating-', |
21 | 21 | 'fieldHTML': '<div class="field-wrapper"> \ |
22 | 22 | <label class="rating-field-label"></label> \ |
23 | 23 | <select class="rating-field"> \ |
— | — | @@ -27,45 +27,45 @@ |
28 | 28 | <option value="5">5</option> \ |
29 | 29 | </select> \ |
30 | 30 | </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"> \ |
34 | 34 | <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> \ |
38 | 38 | </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"> \ |
41 | 41 | <input type="submit" value="Submit" /> \ |
42 | 42 | </div> \ |
43 | 43 | </fieldset> \ |
44 | | - <fieldset id="article-assessment-ratings"> \ |
| 44 | + <fieldset id="articleFeedback-ratings"> \ |
45 | 45 | <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> \ |
49 | 49 | </div> \ |
50 | 50 | </fieldset> \ |
51 | 51 | </form> \ |
52 | 52 | </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> \ |
57 | 57 | </span> \ |
58 | | - <span class="article-assessment-rating-count"></span> \ |
| 58 | + <span class="articleFeedback-rating-count"></span> \ |
59 | 59 | </div>' |
60 | 60 | }, |
61 | 61 | |
62 | 62 | 'fn' : { |
63 | 63 | 'init': function( $$options ) { |
64 | 64 | // 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; |
67 | 67 | // if this is an anon user, get a unique identifier for them |
68 | 68 | // load up the stored ratings and update the markup if the cookie exists |
69 | | - var userToken = $.cookie( 'mwArticleAssessmentUserToken' ); |
| 69 | + var userToken = $.cookie( 'mwArticleFeedbackUserToken' ); |
70 | 70 | if ( typeof userToken == 'undefined' || userToken == null ) { |
71 | 71 | function randomString( string_length ) { |
72 | 72 | var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | } |
80 | 80 | userToken = randomString( 32 ); |
81 | 81 | $.cookie( |
82 | | - 'mwArticleAssessmentUserToken', |
| 82 | + 'mwArticleFeedbackUserToken', |
83 | 83 | userToken, |
84 | 84 | { 'expires': 30, 'path': '/' } |
85 | 85 | ); |
— | — | @@ -88,57 +88,57 @@ |
89 | 89 | } |
90 | 90 | // setup our markup using the template variables in settings |
91 | 91 | 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' ); |
99 | 99 | $structure |
100 | | - .find( '#article-assessment-rate legend' ) |
| 100 | + .find( '#articleFeedback-rate legend' ) |
101 | 101 | .html( yourfeedback ) |
102 | 102 | .end() |
103 | | - .find( '.article-assessment-rate-instructions' ) |
| 103 | + .find( '.articleFeedback-rate-instructions' ) |
104 | 104 | .html( instructions ) |
105 | 105 | .end() |
106 | | - .find( '.article-assessment-rate-feedback' ) |
| 106 | + .find( '.articleFeedback-rate-feedback' ) |
107 | 107 | .html( feedback ) |
108 | 108 | .find( '.feedbacklink' ) |
109 | 109 | .wrap( '<a href="#"></a>' ) |
110 | 110 | .parent() |
111 | | - .click( $.ArticleAssessment.fn.showFeedback ) |
| 111 | + .click( $.ArticleFeedback.fn.showFeedback ) |
112 | 112 | .end() |
113 | 113 | .end() |
114 | 114 | .end() |
115 | | - .find( '#article-assessment-ratings legend' ) |
| 115 | + .find( '#articleFeedback-ratings legend' ) |
116 | 116 | .html( articlerating ) |
117 | 117 | .end() |
118 | | - .find( '.article-assessment-show-ratings' ) |
| 118 | + .find( '.articleFeedback-show-ratings' ) |
119 | 119 | .html( resultsshow ) |
120 | 120 | .find( '.showlink' ) |
121 | 121 | .wrap( '<a href="#"></a>' ) |
122 | 122 | .parent() |
123 | | - .click( $.ArticleAssessment.fn.showRatings ) |
| 123 | + .click( $.ArticleFeedback.fn.showRatings ) |
124 | 124 | .end() |
125 | 125 | .end() |
126 | 126 | .end() |
127 | | - .find( '.article-assessment-hide-ratings' ) |
| 127 | + .find( '.articleFeedback-hide-ratings' ) |
128 | 128 | .html( resultshide ) |
129 | 129 | .find ( '.hidelink' ) |
130 | 130 | .wrap( '<a href="#"></a>' ) |
131 | 131 | .parent() |
132 | | - .click( $.ArticleAssessment.fn.hideRatings ) |
| 132 | + .click( $.ArticleFeedback.fn.hideRatings ) |
133 | 133 | .end() |
134 | 134 | .end() |
135 | 135 | .end() |
136 | | - .find( '.article-assessment-submit input' ) |
| 136 | + .find( '.articleFeedback-submit input' ) |
137 | 137 | .val( submitbutton ) |
138 | 138 | .end(); |
139 | 139 | // hide the feedback link if we need to |
140 | | - if( $.cookie( 'mwArticleAssessmentHideFeedbackLink' ) ) { |
| 140 | + if( $.cookie( 'mwArticleFeedbackHideFeedbackLink' ) ) { |
141 | 141 | $structure |
142 | | - .find( '.article-assessment-rate-feedback' ) |
| 142 | + .find( '.articleFeedback-rate-feedback' ) |
143 | 143 | .hide(); |
144 | 144 | } |
145 | 145 | for ( var i = 0; i < settings.fieldMessages.length; i++ ) { |
— | — | @@ -150,10 +150,10 @@ |
151 | 151 | settings.fieldPrefix + settings.fieldMessages[i] + |
152 | 152 | settings.fieldHintSuffix |
153 | 153 | ), |
154 | | - count = mediaWiki.msg( 'articleassessment-noratings', 0, 0 ); |
| 154 | + count = mediaWiki.msg( 'articlefeedback-noratings', 0, 0 ); |
155 | 155 | // initialize the field html |
156 | 156 | $field |
157 | | - .attr( 'id', 'articleassessment-rate-' + field ) |
| 157 | + .attr( 'id', 'articlefeedback-rate-' + field ) |
158 | 158 | .find( 'label' ) |
159 | 159 | .attr( 'for', 'rating_' + field ) |
160 | 160 | .attr( 'original-title', hint ) |
— | — | @@ -164,43 +164,43 @@ |
165 | 165 | .attr( 'name', 'rating[' + field + ']' ); |
166 | 166 | // initialize the rating html |
167 | 167 | $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' ) |
170 | 170 | .html( label ) |
171 | 171 | .end() |
172 | | - .find( '.article-assessment-rating-count' ) |
| 172 | + .find( '.articleFeedback-rating-count' ) |
173 | 173 | .html( count ); |
174 | 174 | // append the field and rating html |
175 | 175 | $structure |
176 | | - .find( '.article-assessment-rating-fields' ) |
| 176 | + .find( '.articleFeedback-rating-fields' ) |
177 | 177 | .append( $field ) |
178 | 178 | .end() |
179 | | - .find( '#article-assessment-ratings' ) |
| 179 | + .find( '#articleFeedback-ratings' ) |
180 | 180 | .append( $rating ); |
181 | 181 | } |
182 | 182 | // store our settings and configuration for later |
183 | | - $structure.find( '#article-assessment' ) |
| 183 | + $structure.find( '#articleFeedback' ) |
184 | 184 | .data( |
185 | | - 'articleAssessment-context', |
| 185 | + 'articleFeedback-context', |
186 | 186 | { 'settings': settings, 'config': config } |
187 | 187 | ); |
188 | 188 | $( '#catlinks' ).before( $structure ); |
189 | 189 | // Hide the ratings initially |
190 | | - $.ArticleAssessment.fn.hideRatings(); |
| 190 | + $.ArticleFeedback.fn.hideRatings(); |
191 | 191 | |
192 | 192 | |
193 | 193 | // set the height of our smaller fieldset to match the taller |
194 | 194 | 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() ); |
199 | 199 | } else { |
200 | | - $( '#article-assessment-rate' ) |
201 | | - .css( 'minHeight', $( '#article-assessment-ratings' ).height() ); |
| 200 | + $( '#articleFeedback-rate' ) |
| 201 | + .css( 'minHeight', $( '#articleFeedback-ratings' ).height() ); |
202 | 202 | } |
203 | 203 | // attempt to fetch the ratings |
204 | | - $.ArticleAssessment.fn.getRatingData(); |
| 204 | + $.ArticleFeedback.fn.getRatingData(); |
205 | 205 | |
206 | 206 | // initialize the star plugin |
207 | 207 | $( '.rating-field' ).each( function() { |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | .removeClass( 'ui-stars-star-stale' ) |
218 | 218 | .removeClass( 'ui-stars-star-rated' ); |
219 | 219 | // enable our submit button if it's still disabled |
220 | | - $( '#article-assessment input:disabled' ) |
| 220 | + $( '#articleFeedback input:disabled' ) |
221 | 221 | .removeAttr( 'disabled' ); |
222 | 222 | } ); |
223 | 223 | } |
— | — | @@ -230,29 +230,29 @@ |
231 | 231 | .tipsy( { gravity : 'se', opacity: '0.9' } ) ); |
232 | 232 | } ); |
233 | 233 | // 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; } ); |
236 | 236 | // prevent the submit button for being active until all ratings are filled out |
237 | | - $( '#article-assessment input[type=submit]' ) |
| 237 | + $( '#articleFeedback input[type=submit]' ) |
238 | 238 | .attr( 'disabled', 'disabled' ); |
239 | 239 | }, |
240 | 240 | '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' ) |
244 | 244 | .hide() |
245 | 245 | .end() |
246 | | - .find( '.article-assessment-hide-ratings' ) |
| 246 | + .find( '.articleFeedback-hide-ratings' ) |
247 | 247 | .show(); |
248 | 248 | return false; |
249 | 249 | }, |
250 | 250 | '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' ) |
254 | 254 | .hide() |
255 | 255 | .end() |
256 | | - .find( '.article-assessment-show-ratings' ) |
| 256 | + .find( '.articleFeedback-show-ratings' ) |
257 | 257 | .show(); |
258 | 258 | return false; |
259 | 259 | |
— | — | @@ -260,10 +260,10 @@ |
261 | 261 | |
262 | 262 | // Request the ratings data for the current article |
263 | 263 | 'getRatingData': function() { |
264 | | - var config = $( '#article-assessment' ).data( 'articleAssessment-context' ).config; |
| 264 | + var config = $( '#articleFeedback' ).data( 'articleFeedback-context' ).config; |
265 | 265 | var requestData = { |
266 | 266 | 'action': 'query', |
267 | | - 'list': 'articleassessment', |
| 267 | + 'list': 'articlefeedback', |
268 | 268 | 'aapageid': config.pageID, |
269 | 269 | 'aauserrating': 1, |
270 | 270 | 'format': 'json' |
— | — | @@ -276,30 +276,30 @@ |
277 | 277 | url: wgScriptPath + '/api.php', |
278 | 278 | data: requestData, |
279 | 279 | dataType: 'json', |
280 | | - success: $.ArticleAssessment.fn.afterGetRatingData, |
| 280 | + success: $.ArticleFeedback.fn.afterGetRatingData, |
281 | 281 | 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' } ); |
284 | 284 | } |
285 | 285 | } ); |
286 | 286 | }, |
287 | 287 | 'afterGetRatingData' : function( data ) { |
288 | | - var settings = $( '#article-assessment' ).data( 'articleAssessment-context' ).settings, |
| 288 | + var settings = $( '#articleFeedback' ).data( 'articleFeedback-context' ).settings, |
289 | 289 | userHasRated = false; |
290 | 290 | // 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], |
295 | 295 | $rating = $( '#' + rating.ratingdesc ), |
296 | 296 | count = rating.count, |
297 | 297 | total = ( rating.total / count ).toFixed( 1 ), |
298 | | - label = mediaWiki.msg( 'articleassessment-noratings', total, count ); |
| 298 | + label = mediaWiki.msg( 'articlefeedback-noratings', total, count ); |
299 | 299 | $rating |
300 | | - .find( '.article-assessment-rating-field-value' ) |
| 300 | + .find( '.articleFeedback-rating-field-value' ) |
301 | 301 | .text( total ) |
302 | 302 | .end() |
303 | | - .find( '.article-assessment-rating-count' ) |
| 303 | + .find( '.articleFeedback-rating-count' ) |
304 | 304 | .html( label ); |
305 | 305 | if( rating.userrating ) { |
306 | 306 | userHasRated = true; |
— | — | @@ -310,23 +310,23 @@ |
311 | 311 | } |
312 | 312 | // show the ratings if the user has rated |
313 | 313 | if( userHasRated ) { |
314 | | - $.ArticleAssessment.fn.showRatings(); |
| 314 | + $.ArticleFeedback.fn.showRatings(); |
315 | 315 | } |
316 | 316 | // 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' ) { |
318 | 318 | // add the stale star class to each on star |
319 | 319 | $( '.ui-stars-star-on' ) |
320 | 320 | .addClass( 'ui-stars-star-stale' ); |
321 | 321 | // 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' } ); |
324 | 324 | } else { |
325 | 325 | // if it's not a stale rating, we want to make the stars blue |
326 | 326 | $( '.ui-stars-star-on' ).addClass( 'ui-stars-star-rated' ); |
327 | 327 | } |
328 | 328 | } |
329 | 329 | // initialize the ratings |
330 | | - $( '.article-assessment-rating-field-value' ).each( function() { |
| 330 | + $( '.articleFeedback-rating-field-value' ).each( function() { |
331 | 331 | $(this) |
332 | 332 | .css( { |
333 | 333 | 'width': 120 - ( 120 * ( parseFloat( $(this).text() ) / 5 ) ) + 'px' |
— | — | @@ -334,13 +334,13 @@ |
335 | 335 | } ); |
336 | 336 | }, |
337 | 337 | 'submitRating': function() { |
338 | | - var config = $( '#article-assessment' ).data( 'articleAssessment-context' ).config; |
| 338 | + var config = $( '#articleFeedback' ).data( 'articleFeedback-context' ).config; |
339 | 339 | // clear out the stale message |
340 | | - $.ArticleAssessment.fn.flashNotice( ); |
| 340 | + $.ArticleFeedback.fn.flashNotice( ); |
341 | 341 | |
342 | 342 | // lock the star inputs & submit |
343 | 343 | $( '.rating-field' ).stars( 'disable' ); |
344 | | - $( '#article-assessment input' ).attr( 'disabled', 'disabled' ); |
| 344 | + $( '#articleFeedback input' ).attr( 'disabled', 'disabled' ); |
345 | 345 | // get our results for submitting |
346 | 346 | var results = {}; |
347 | 347 | $( '.rating-field input' ).each( function() { |
— | — | @@ -353,7 +353,7 @@ |
354 | 354 | url: wgScriptPath + '/api.php', |
355 | 355 | type: 'POST', |
356 | 356 | data: { |
357 | | - 'action': 'articleassessment', |
| 357 | + 'action': 'articlefeedback', |
358 | 358 | 'revid': config.revID, |
359 | 359 | 'pageid': config.pageID, |
360 | 360 | 'r1' : results['wellsourced'], |
— | — | @@ -364,66 +364,66 @@ |
365 | 365 | 'format': 'json' |
366 | 366 | }, |
367 | 367 | dataType: 'json', |
368 | | - success: $.ArticleAssessment.fn.afterSubmitRating, |
| 368 | + success: $.ArticleFeedback.fn.afterSubmitRating, |
369 | 369 | 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' } ); |
372 | 372 | } |
373 | 373 | } ); |
374 | 374 | }, |
375 | 375 | 'afterSubmitRating': function ( data ) { |
376 | 376 | // update the ratings |
377 | | - $.ArticleAssessment.fn.getRatingData(); |
| 377 | + $.ArticleFeedback.fn.getRatingData(); |
378 | 378 | // set the stars to rated status |
379 | 379 | $( '.ui-stars-star-on' ).addClass( 'ui-stars-star-rated' ); |
380 | 380 | // unlock the stars & submit |
381 | 381 | $( '.rating-field' ).stars( 'enable' ); |
382 | | - $( '#article-assessment input:disabled' ).removeAttr( 'disabled' ); |
| 382 | + $( '#articleFeedback input:disabled' ).removeAttr( 'disabled' ); |
383 | 383 | // update the results |
384 | 384 | |
385 | 385 | // show the results |
386 | | - $.ArticleAssessment.fn.showRatings(); |
| 386 | + $.ArticleFeedback.fn.showRatings(); |
387 | 387 | // 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' } ); |
390 | 390 | }, |
391 | 391 | // places a message on the interface |
392 | 392 | 'flashNotice': function( text, options ) { |
393 | 393 | if ( arguments.length == 0 ) { |
394 | 394 | // clear existing messages, but don't add a new one |
395 | | - $( '#article-assessment .article-assessment-flash' ).remove(); |
| 395 | + $( '#articleFeedback .articleFeedback-flash' ).remove(); |
396 | 396 | } else { |
397 | 397 | // clear and add a new message |
398 | | - $( '#article-assessment .article-assessment-flash' ).remove(); |
| 398 | + $( '#articleFeedback .articleFeedback-flash' ).remove(); |
399 | 399 | var className = options['class']; |
400 | 400 | // create our new message |
401 | 401 | $msg = $( '<div />' ) |
402 | | - .addClass( 'article-assessment-flash' ) |
| 402 | + .addClass( 'articleFeedback-flash' ) |
403 | 403 | .html( text ); |
404 | 404 | // if the class option was passed, add it |
405 | 405 | if( options['class'] ) { |
406 | 406 | $msg.addClass( options['class'] ); |
407 | 407 | } |
408 | 408 | // place our new message on the page |
409 | | - $( '#article-assessment .article-assessment-submit' ) |
| 409 | + $( '#articleFeedback .articleFeedback-submit' ) |
410 | 410 | .append( $msg ); |
411 | 411 | } |
412 | 412 | }, |
413 | 413 | 'showFeedback': function() { |
414 | | - var $dialogDiv = $( '#article-assessment-dialog' ); |
| 414 | + var $dialogDiv = $( '#articleFeedback-dialog' ); |
415 | 415 | if ( $dialogDiv.size() == 0 ) { |
416 | | - $dialogDiv = $( '<div id="article-assessment-dialog" class="loading" />' ) |
| 416 | + $dialogDiv = $( '<div id="articleFeedback-dialog" class="loading" />' ) |
417 | 417 | .dialog( { |
418 | 418 | width: 600, |
419 | 419 | height: 400, |
420 | 420 | bgiframe: true, |
421 | 421 | autoOpen: true, |
422 | 422 | modal: true, |
423 | | - title: mediaWiki.msg( 'articleassessment-survey-title' ), |
| 423 | + title: mediaWiki.msg( 'articlefeedback-survey-title' ), |
424 | 424 | close: function() { |
425 | 425 | $(this) |
426 | 426 | .dialog( 'option', 'height', 400 ) |
427 | | - .find( '.article-assessment-success-msg, .article-assessment-error-msg' ) |
| 427 | + .find( '.articleFeedback-success-msg, .articleFeedback-error-msg' ) |
428 | 428 | .remove() |
429 | 429 | .end() |
430 | 430 | .find( 'form' ) |
— | — | @@ -433,7 +433,7 @@ |
434 | 434 | $dialogDiv.load( |
435 | 435 | wgScript + '?title=Special:SimpleSurvey&survey=articlerating&raw=1', |
436 | 436 | function() { |
437 | | - $(this).find( 'form' ).bind( 'submit', $.ArticleAssessment.fn.submitFeedback ); |
| 437 | + $(this).find( 'form' ).bind( 'submit', $.ArticleFeedback.fn.submitFeedback ); |
438 | 438 | $(this).removeClass( 'loading' ); |
439 | 439 | } |
440 | 440 | ); |
— | — | @@ -442,7 +442,7 @@ |
443 | 443 | return false; |
444 | 444 | }, |
445 | 445 | 'submitFeedback': function() { |
446 | | - var $dialogDiv = $( '#article-assessment-dialog' ); |
| 446 | + var $dialogDiv = $( '#articleFeedback-dialog' ); |
447 | 447 | $dialogDiv |
448 | 448 | .find( 'form' ) |
449 | 449 | .hide() |
— | — | @@ -479,8 +479,8 @@ |
480 | 480 | var success = $( data ).find( '.simplesurvey-success' ).size() > 0; |
481 | 481 | // TODO: Style success-msg, error-msg |
482 | 482 | 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' ) ) |
485 | 485 | .appendTo( $dialogDiv ); |
486 | 486 | $dialogDiv.removeClass( 'loading' ); |
487 | 487 | |
— | — | @@ -490,17 +490,17 @@ |
491 | 491 | |
492 | 492 | if ( success ) { |
493 | 493 | // Hide the dialog link |
494 | | - $( '#article-assessment .article-assessment-rate-feedback' ).hide(); |
| 494 | + $( '#articleFeedback .articleFeedback-rate-feedback' ).hide(); |
495 | 495 | // set a cookie to keep the dialog link hidden |
496 | | - $.cookie( 'mwArticleAssessmentHideFeedbackLink', true, { 'expires': 30, 'path': '/' } ); |
| 496 | + $.cookie( 'mwArticleFeedbackHideFeedbackLink', true, { 'expires': 30, 'path': '/' } ); |
497 | 497 | |
498 | 498 | } |
499 | 499 | }, |
500 | 500 | error: function( XMLHttpRequest, textStatus, errorThrown ) { |
501 | 501 | // TODO: Duplicates code, factor out, maybe |
502 | 502 | 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' ) ) |
505 | 505 | .appendTo( $dialogDiv ); |
506 | 506 | $dialogDiv.removeClass( 'loading' ); |
507 | 507 | $dialogDiv.dialog( 'option', 'height', $msgDiv.height() + 100 ); |
— | — | @@ -511,6 +511,6 @@ |
512 | 512 | } |
513 | 513 | }; |
514 | 514 | $( document ).ready( function () { |
515 | | - $.ArticleAssessment.fn.init( ); |
| 515 | + $.ArticleFeedback.fn.init( ); |
516 | 516 | } ); //document ready |
517 | 517 | } )( jQuery ); |
Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-alpha/ext.articleFeedback-alpha.js |
___________________________________________________________________ |
Added: svn:mergeinfo |
518 | 518 | Merged /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js:r76964-76966 |