Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -30,14 +30,23 @@ |
31 | 31 | 'articlefeedbackv5-survey-disclaimerlink' => 'terms', |
32 | 32 | /* ext.articleFeedbackv5 and jquery.articleFeedbackv5 */ |
33 | 33 | /* START Messages needing translation */ |
34 | | - 'articlefeedbackv5-bucket1-title' => 'Help improve this article', |
| 34 | + 'articlefeedbackv5-bucket1-title' => 'What do $1 think?', |
| 35 | + 'articlefeedbackv5-bucket1-title-emphasis' => 'you', |
| 36 | + 'articlefeedbackv5-bucket1-tooltip-title' => 'What is This?', |
| 37 | + 'articlefeedbackv5-bucket1-tooltip-info' => 'Wikipedia\'s new Article Feedback system is designed to help you help us. We need your input to make Wikipedia the best encyclopedia in the world.', |
| 38 | + 'articlefeedbackv5-bucket1-tooltip-linktext' => 'Learn more about Article Feedback', |
35 | 39 | 'articlefeedbackv5-bucket1-question-toggle' => 'Did you find what you were looking for?', |
36 | 40 | 'articlefeedbackv5-bucket1-toggle-found-yes' => 'Yes', |
37 | 41 | 'articlefeedbackv5-bucket1-toggle-found-no' => 'No', |
| 42 | + 'articlefeedbackv5-bucket1-toggle-found-yes-full' => 'Yes, I found what I was looking for.', |
| 43 | + 'articlefeedbackv5-bucket1-toggle-found-no-full' => 'No, I did not find what I was looking for.', |
38 | 44 | 'articlefeedbackv5-bucket1-question-comment' => 'What\'s missing? Any suggestions for improvement?', |
| 45 | + 'articlefeedbackv5-bucket1-disclosure' => 'Your Feedback will be shared $1. Seee our $2 for more details.', |
| 46 | + 'articlefeedbackv5-bucket1-disclosure-shared-linktext' => 'here', |
| 47 | + 'articlefeedbackv5-bucket1-disclosure-privacy-policy-linktext' => 'privacy policy', |
39 | 48 | 'articlefeedbackv5-bucket1-form-pending' => 'Your feedback has not been submitted yet', |
40 | 49 | 'articlefeedbackv5-bucket5-form-success' => 'Saved successfully', |
41 | | - 'articlefeedbackv5-bucket1-form-submit' => 'Post Your Feedback', |
| 50 | + 'articlefeedbackv5-bucket1-form-submit' => 'Submit Your Feedback', |
42 | 51 | 'articlefeedbackv5-shared-on-feedback' => 'Your comment will be shared on this $1.', |
43 | 52 | 'articlefeedbackv5-shared-on-feedback-linktext' => 'feedback page', |
44 | 53 | 'articlefeedbackv5-transparency-terms' => 'By posting, you agree to transparency under these $1.', |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -131,70 +131,82 @@ |
132 | 132 | // The overall template |
133 | 133 | var block_tpl = '\ |
134 | 134 | <form>\ |
135 | | - <div class="title-wrap">\ |
136 | | - <h2>What do <em>you</em> think?</h2>\ |
137 | | - <a class="trigger"> </a>\ |
138 | | - <script type="text/javascript" language="javascript">\ |
139 | | - $(".articleFeedback a.trigger").tooltip();\ |
140 | | - </script>\ |
141 | | - <div class="tooltip">\ |
| 135 | + <div class="title-wrap">\ |
| 136 | + <h2 class="articleFeedbackv5-title"></h2>\ |
| 137 | + <a class="articleFeedbackv5-tooltip-trigger">?</a>\ |
| 138 | + <div class="articleFeedbackv5-tooltip">\ |
142 | 139 | <div class="tooltip-top"></div>\ |
143 | 140 | <div class="tooltip-repeat">\ |
144 | | - <h3>What is This?</h3>\ |
145 | | - <p>Wikipedia’s new Article Feedback system is designed to help you help us. We need your input to make Wikipedia the best encyclopedia in the world.</p>\ |
146 | | - <p><a target="_blank" href="#">Learn more about Article Feedback</a></p>\ |
| 141 | + <h3><html:msg key="bucket1-tooltip-title" /></h3>\ |
| 142 | + <p><html:msg key="bucket1-tooltip-info" /></p>\ |
| 143 | + <p><a target="_blank" href="#"><html:msg key="bucket1-tooltip-linktext" /></a></p>\ |
147 | 144 | </div>\ |
148 | 145 | <div class="tooltip-bottom"></div>\ |
149 | 146 | </div>\ |
150 | 147 | <div class="clear"></div>\ |
151 | 148 | </div>\ |
152 | 149 | <div class="form-row">\ |
153 | | - <p class="instructions-left">Did you find what you were looking for?</p>\ |
| 150 | + <p class="instructions-left"><html:msg key="bucket1-question-toggle" /></p>\ |
154 | 151 | <div class="buttons">\ |
155 | 152 | <div class="form-item">\ |
156 | | - <label for="find-yes">Yes, I found what I was looking for.</label>\ |
157 | | - <span class="button-placeholder">Yes</span>\ |
158 | | - <input type="radio" name="find" id="find-yes" class="query-button" />\ |
| 153 | + <label for="find-yes"><html:msg key="bucket1-toggle-found-yes-full" /></label>\ |
| 154 | + <span class="button-placeholder"><html:msg key="bucket1-toggle-found-yes" /></span>\ |
| 155 | + <input type="radio" name="toggle" id="find-yes" class="query-button" />\ |
159 | 156 | </div>\ |
160 | 157 | <div class="form-item">\ |
161 | | - <label for="find-no">No, I did not find what I was looking for.</label>\ |
162 | | - <span class="button-placeholder">No.</span>\ |
163 | | - <input type="radio" id="find-now" class="query-button last" />\ |
| 158 | + <label for="find-no"><html:msg key="bucket1-toggle-found-no-full" /></label>\ |
| 159 | + <span class="button-placeholder"><html:msg key="bucket1-toggle-found-no" /></span>\ |
| 160 | + <input type="radio" name="toggle" id="find-no" class="query-button last" />\ |
164 | 161 | </div>\ |
165 | 162 | <div class="clear"></div>\ |
166 | 163 | </div>\ |
167 | 164 | </div>\ |
168 | | - <textarea id="find-feedback" class="feedback-text">How can we improve this Article?</textarea>\ |
169 | | - <div class="articleFeedback-disclosure">\ |
170 | | - <p>Your Feedback will be shared <a href="#" target="_blank">here</a>. Seee our <a target="_blank" href="#">privacy policy</a> for more details.</p>\ |
| 165 | + <div class="articleFeedbackv5-comment">\ |
| 166 | + <textarea id="find-feedback" class="feedback-text" name="comment"></textarea>\ |
171 | 167 | </div>\ |
172 | | - <button class="articleFeedback-submit articleFeedback-visibleWith-form ui-button ui-widget ui-state-default ui-corner-all ui-button-disabled ui-state-disabled ui-button-text-only ui-button-blue" type="submit" disabled="disabled" role="button" aria-disabled="true"><span class="ui-button-text">Submit Your Feedback</span></button>\ |
| 168 | + <div class="articleFeedbackv5-disclosure">\ |
| 169 | + <p></p>\ |
| 170 | + </div>\ |
| 171 | + <button class="articleFeedbackv5-submit" type="submit" disabled="disabled"><html:msg key="bucket1-form-submit" /></button>\ |
173 | 172 | <div class="clear"></div>\ |
174 | 173 | </form>\ |
175 | 174 | '; |
176 | 175 | // Start up the block to return |
177 | 176 | var $block = $( block_tpl ); |
178 | 177 | |
| 178 | + // Set the title with emphasis |
| 179 | + $block.find('.articleFeedbackv5-title'). |
| 180 | + html( function () { |
| 181 | + var em = mw.html.element( 'em', {}, mw.msg( 'articlefeedbackv5-bucket1-title-emphasis' ) ); |
| 182 | + return mw.html.escape( mw.msg( 'articlefeedbackv5-bucket1-title' ) ) |
| 183 | + .replace( /\$1/, em.toString() ); |
| 184 | + } ); |
| 185 | + |
| 186 | + // Start out the tooltip hidden |
| 187 | + $block.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 188 | + |
179 | 189 | // Set the default comment text |
180 | 190 | $block.find( '.articleFeedbackv5-comment textarea' ) |
181 | 191 | .val( mw.msg( 'articlefeedbackv5-bucket1-question-comment' ) ); |
182 | 192 | |
183 | | - // Fill in the feedback and terms info text |
184 | | - $block.find( '.articleFeedbackv5-feedback-terms-info .articleFeedbackv5-feedback' ) |
| 193 | + // Fill in the disclosure text |
| 194 | + $block.find( '.articleFeedbackv5-disclosure p' ) |
185 | 195 | .html( $.articleFeedbackv5.buildLink( |
186 | | - mw.config.get( 'wgScript' ) + '?' + $.param( { |
187 | | - 'title': mw.config.get( 'wgPageName' ), |
188 | | - 'action': 'feedback' |
189 | | - } ), |
190 | | - 'articlefeedbackv5-shared-on-feedback-linktext', |
191 | | - 'articlefeedbackv5-shared-on-feedback' |
| 196 | + 'articlefeedbackv5-bucket1-disclosure', |
| 197 | + { |
| 198 | + href: mw.config.get( 'wgScript' ) + '?' + $.param( { |
| 199 | + title: mw.config.get( 'wgPageName' ), |
| 200 | + action: 'feedback' |
| 201 | + } ), |
| 202 | + text: 'articlefeedbackv5-bucket1-disclosure-shared-linktext', |
| 203 | + target: '_blank' |
| 204 | + }, |
| 205 | + { |
| 206 | + href: mw.util.wikiGetlink( mw.config.get( 'wgArticleFeedbackv5TermsPage' ) ), |
| 207 | + text: 'articlefeedbackv5-bucket1-disclosure-privacy-policy-linktext', |
| 208 | + target: '_blank' |
| 209 | + } |
192 | 210 | ) ); |
193 | | - $block.find( '.articleFeedbackv5-feedback-terms-info .articleFeedbackv5-terms' ) |
194 | | - .html( $.articleFeedbackv5.buildLink( |
195 | | - mw.util.wikiGetlink( mw.config.get( 'wgArticleFeedbackv5TermsPage' ) ), // TODO: Make this work |
196 | | - 'articlefeedbackv5-transparency-terms-linktext', |
197 | | - 'articlefeedbackv5-transparency-terms' |
198 | | - ) ); |
199 | 211 | |
200 | 212 | // Localize the block |
201 | 213 | $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
— | — | @@ -216,6 +228,15 @@ |
217 | 229 | * @param $block element the form block |
218 | 230 | */ |
219 | 231 | bindEvents: function ( $block ) { |
| 232 | + |
| 233 | + $block.find( '.articleFeedbackv5-tooltip-trigger' ).hover( function () { |
| 234 | + // mouse on |
| 235 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).show(); |
| 236 | + }, function () { |
| 237 | + // mouse off |
| 238 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 239 | + } ); |
| 240 | + |
220 | 241 | // Clear out the question on focus |
221 | 242 | $block.find( '.articleFeedbackv5-comment textarea' ) |
222 | 243 | .focus( function () { |
— | — | @@ -476,9 +497,11 @@ |
477 | 498 | // Fill in the Help Improve message and links |
478 | 499 | $block.find( '.articleFeedbackv5-helpimprove-note' ) |
479 | 500 | .html( $.articleFeedbackv5.buildLink( |
480 | | - mw.util.wikiGetlink( mw.config.get( 'wgArticleFeedbackv5TermsPage' ) ), // TODO: Make this work |
481 | | - 'articlefeedbackv5-bucket5-form-panel-helpimprove-privacy', |
482 | | - 'articlefeedbackv5-bucket5-form-panel-helpimprove-note' |
| 501 | + 'articlefeedbackv5-bucket5-form-panel-helpimprove-note', |
| 502 | + { |
| 503 | + href: mw.util.wikiGetlink( mw.config.get( 'wgArticleFeedbackv5TermsPage' ) ), // TODO: Make this work |
| 504 | + text: 'articlefeedbackv5-bucket5-form-panel-helpimprove-privacy' |
| 505 | + } |
483 | 506 | ) ); |
484 | 507 | |
485 | 508 | $block.find( '.articleFeedbackv5-helpimprove-email' ) |
— | — | @@ -1161,15 +1184,32 @@ |
1162 | 1185 | * Can't use .text() with mw.message(, \/* $1 *\/ link).toString(), |
1163 | 1186 | * because 'link' should not be re-escaped (which would happen if done by mw.message) |
1164 | 1187 | * |
1165 | | - * @param string href the link |
1166 | | - * @param string linktext the message key for the link text |
1167 | 1188 | * @param string fulltext the message key for the full text |
| 1189 | + * @param object link1 the first link, as { href: '#', text: 'click here' } |
| 1190 | + * @param object link2 [optional] the second link, as above |
| 1191 | + * @param object link2 [optional] the third link, as above |
1168 | 1192 | * @return string the html |
1169 | 1193 | */ |
1170 | | - $.articleFeedbackv5.buildLink = function ( href, linktext, fulltext ) { |
1171 | | - var link = mw.html.element( 'a', { href: href }, mw.msg( linktext ) ); |
1172 | | - var full = mw.html.escape( mw.msg( fulltext ) ) |
1173 | | - .replace( /\$1/, link.toString() ); |
| 1194 | + $.articleFeedbackv5.buildLink = function ( fulltext, link1, link2, link3 ) { |
| 1195 | + var full = mw.html.escape( mw.msg( fulltext ) ); |
| 1196 | + if ( link1 ) { |
| 1197 | + full = full.replace( |
| 1198 | + /\$1/, |
| 1199 | + mw.html.element( 'a', { href: link1.href }, mw.msg( link1.text ) |
| 1200 | + ).toString() ); |
| 1201 | + } |
| 1202 | + if ( link2 ) { |
| 1203 | + full = full.replace( |
| 1204 | + /\$2/, |
| 1205 | + mw.html.element( 'a', { href: link2.href }, mw.msg( link2.text ) |
| 1206 | + ).toString() ); |
| 1207 | + } |
| 1208 | + if ( link3 ) { |
| 1209 | + full = full.replace( |
| 1210 | + /\$3/, |
| 1211 | + mw.html.element( 'a', { href: link3.href }, mw.msg( link3.text ) |
| 1212 | + ).toString() ); |
| 1213 | + } |
1174 | 1214 | return full; |
1175 | 1215 | }; |
1176 | 1216 | |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -61,10 +61,19 @@ |
62 | 62 | 'styles' => 'jquery.articleFeedbackv5/jquery.articleFeedbackv5.css', |
63 | 63 | 'messages' => array( |
64 | 64 | 'articlefeedbackv5-bucket1-title', |
| 65 | + 'articlefeedbackv5-bucket1-title-emphasis', |
| 66 | + 'articlefeedbackv5-bucket1-tooltip-title', |
| 67 | + 'articlefeedbackv5-bucket1-tooltip-info', |
| 68 | + 'articlefeedbackv5-bucket1-tooltip-linktext', |
65 | 69 | 'articlefeedbackv5-bucket1-question-toggle', |
66 | 70 | 'articlefeedbackv5-bucket1-toggle-found-yes', |
| 71 | + 'articlefeedbackv5-bucket1-toggle-found-yes-full', |
67 | 72 | 'articlefeedbackv5-bucket1-toggle-found-no', |
| 73 | + 'articlefeedbackv5-bucket1-toggle-found-no-full', |
68 | 74 | 'articlefeedbackv5-bucket1-question-comment', |
| 75 | + 'articlefeedbackv5-bucket1-disclosure', |
| 76 | + 'articlefeedbackv5-bucket1-disclosure-shared-linktext', |
| 77 | + 'articlefeedbackv5-bucket1-disclosure-privacy-policy-linktext', |
69 | 78 | 'articlefeedbackv5-bucket1-form-pending', |
70 | 79 | 'articlefeedbackv5-bucket1-form-success', |
71 | 80 | 'articlefeedbackv5-bucket1-form-submit', |