Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -21,18 +21,18 @@ |
22 | 22 | 'articlefeedback-field-objective-tip', |
23 | 23 | 'articlefeedback-field-wellwritten-label', |
24 | 24 | 'articlefeedback-field-wellwritten-tip', |
25 | | - 'articlefeedback-pitch-takesurvey-title', |
26 | 25 | 'articlefeedback-pitch-reject', |
27 | 26 | 'articlefeedback-pitch-or', |
28 | | - 'articlefeedback-pitch-takesurvey-message', |
29 | | - 'articlefeedback-pitch-takesurvey-accept', |
30 | | - 'articlefeedback-pitch-createaccount-title', |
31 | | - 'articlefeedback-pitch-createaccount-message', |
32 | | - 'articlefeedback-pitch-createaccount-accept', |
33 | | - 'articlefeedback-pitch-createaccount-login', |
34 | | - 'articlefeedback-pitch-makefirstedit-title', |
35 | | - 'articlefeedback-pitch-makefirstedit-message', |
36 | | - 'articlefeedback-pitch-makefirstedit-accept', |
| 27 | + 'articlefeedback-pitch-survey-title', |
| 28 | + 'articlefeedback-pitch-survey-message', |
| 29 | + 'articlefeedback-pitch-survey-accept', |
| 30 | + 'articlefeedback-pitch-join-title', |
| 31 | + 'articlefeedback-pitch-join-message', |
| 32 | + 'articlefeedback-pitch-join-accept', |
| 33 | + 'articlefeedback-pitch-join-login', |
| 34 | + 'articlefeedback-pitch-edit-title', |
| 35 | + 'articlefeedback-pitch-edit-message', |
| 36 | + 'articlefeedback-pitch-edit-accept', |
37 | 37 | 'articlefeedback-survey-title', |
38 | 38 | 'articlefeedback-survey-message-success', |
39 | 39 | 'articlefeedback-survey-message-error', |
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | .end() |
232 | 232 | .each( function() { |
233 | 233 | for ( var key in context.options.pitches ) { |
234 | | - $( $.articleFeedback.tpl.pitch ) |
| 234 | + var $pitch = $( $.articleFeedback.tpl.pitch ) |
235 | 235 | .attr( 'rel', key ) |
236 | 236 | .find( '.articleFeedback-title' ) |
237 | 237 | .text( mw.msg( context.options.pitches[key].title ) ) |
— | — | @@ -263,12 +263,12 @@ |
264 | 264 | $pitch.fadeOut(); |
265 | 265 | } ) |
266 | 266 | .end() |
267 | | - .appendTo( $(this) ); |
| 267 | + .appendTo( $(this) ); |
268 | 268 | if ( |
269 | 269 | typeof context.options.pitches[key].altAccept == 'string' |
270 | 270 | && typeof context.options.pitches[key].altAction == 'function' |
271 | 271 | ) { |
272 | | - $(this) |
| 272 | + $pitch |
273 | 273 | .find( '.articleFeedback-accept' ) |
274 | 274 | .after( '<button class="articleFeedback-altAccept"></button>' ) |
275 | 275 | .after( |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | // Display success/error message |
152 | 152 | that.alert( success ? 'success' : 'error' ); |
153 | 153 | // Mute for 30 days |
154 | | - mutePitch( 'takesurvey', 30 ); |
| 154 | + mutePitch( 'survey', 30 ); |
155 | 155 | }, |
156 | 156 | 'error': function( XMLHttpRequest, textStatus, errorThrown ) { |
157 | 157 | // Take the dialog out of "loading" state |
— | — | @@ -195,13 +195,28 @@ |
196 | 196 | } |
197 | 197 | }, |
198 | 198 | 'pitches': { |
199 | | - 'createaccount': { |
| 199 | + 'survey': { |
200 | 200 | 'condition': function() { |
201 | | - // If user is logged in, return false |
202 | | - return ( isPitchMuted( 'createaccount' ) || !mediaWiki.user.anonymous() ) |
203 | | - ? false : lottery( 0.5 ); |
| 201 | + // If this pitch isn't muted, show this 1/3 of the time |
| 202 | + return !isPitchMuted( 'survey' ) ? lottery( 0.333 ) : false; |
204 | 203 | }, |
205 | 204 | 'action': function() { |
| 205 | + survey.load(); |
| 206 | + // Hide the pitch immediately |
| 207 | + return true; |
| 208 | + }, |
| 209 | + 'title': 'articlefeedback-pitch-survey-title', |
| 210 | + 'message': 'articlefeedback-pitch-survey-message', |
| 211 | + 'accept': 'articlefeedback-pitch-survey-accept', |
| 212 | + 'reject': 'articlefeedback-pitch-reject' |
| 213 | + }, |
| 214 | + 'join': { |
| 215 | + 'condition': function() { |
| 216 | + // If this pitch isn't muted and the user is anonymous, show this 1/2 of the time |
| 217 | + return ( !isPitchMuted( 'join' ) && mediaWiki.user.anonymous() ) |
| 218 | + ? lottery( 0.5 ) : false; |
| 219 | + }, |
| 220 | + 'action': function() { |
206 | 221 | // Go to account creation page |
207 | 222 | window.location = |
208 | 223 | mediaWiki.config.get( 'wgScript' ) + '?' + $.param( { |
— | — | @@ -210,15 +225,15 @@ |
211 | 226 | 'returnto': mediaWiki.config.get( 'wgPageName' ) |
212 | 227 | } ); |
213 | 228 | // Mute for 1 day |
214 | | - mutePitch( 'createaccount', 1 ); |
| 229 | + mutePitch( 'join', 1 ); |
215 | 230 | return false; |
216 | 231 | }, |
217 | | - 'title': 'articlefeedback-pitch-createaccount-title', |
218 | | - 'message': 'articlefeedback-pitch-createaccount-message', |
219 | | - 'accept': 'articlefeedback-pitch-createaccount-accept', |
| 232 | + 'title': 'articlefeedback-pitch-join-title', |
| 233 | + 'message': 'articlefeedback-pitch-join-message', |
| 234 | + 'accept': 'articlefeedback-pitch-join-accept', |
220 | 235 | 'reject': 'articlefeedback-pitch-reject', |
221 | 236 | // Special alternative action for going to login page |
222 | | - 'altAccept': 'articlefeedback-pitch-createaccount-login', |
| 237 | + 'altAccept': 'articlefeedback-pitch-join-login', |
223 | 238 | 'altAction': function() { |
224 | 239 | // Go to login page |
225 | 240 | window.location = |
— | — | @@ -227,15 +242,14 @@ |
228 | 243 | 'returnto': mediaWiki.config.get( 'wgPageName' ) |
229 | 244 | } ); |
230 | 245 | // Mute for 1 day |
231 | | - mutePitch( 'createaccount', 1 ); |
| 246 | + mutePitch( 'join', 1 ); |
232 | 247 | return false; |
233 | 248 | } |
234 | 249 | }, |
235 | | - 'makefirstedit': { |
| 250 | + 'edit': { |
236 | 251 | 'condition': function() { |
237 | | - // If user is not logged in, return false |
238 | | - return ( isPitchMuted( 'makefirstedit' ) || mediaWiki.user.anonymous() ) |
239 | | - ? false : lottery( 0.5 ); |
| 252 | + // If this pitch isn't muted, show this always |
| 253 | + return !isPitchMuted( 'edit' ); |
240 | 254 | }, |
241 | 255 | 'action': function() { |
242 | 256 | // Go to edit page |
— | — | @@ -245,28 +259,13 @@ |
246 | 260 | 'action': 'edit' |
247 | 261 | } ); |
248 | 262 | // Mute for 7 days |
249 | | - mutePitch( 'makefirstedit', 7 ); |
| 263 | + mutePitch( 'edit', 7 ); |
250 | 264 | return false; |
251 | 265 | }, |
252 | | - 'title': 'articlefeedback-pitch-makefirstedit-title', |
253 | | - 'message': 'articlefeedback-pitch-makefirstedit-message', |
254 | | - 'accept': 'articlefeedback-pitch-makefirstedit-accept', |
| 266 | + 'title': 'articlefeedback-pitch-edit-title', |
| 267 | + 'message': 'articlefeedback-pitch-edit-message', |
| 268 | + 'accept': 'articlefeedback-pitch-edit-accept', |
255 | 269 | 'reject': 'articlefeedback-pitch-reject' |
256 | | - }, |
257 | | - 'takesurvey': { |
258 | | - 'condition': function() { |
259 | | - // If already taken survey, return false |
260 | | - return !isPitchMuted( 'takesurvey' ); |
261 | | - }, |
262 | | - 'action': function() { |
263 | | - survey.load(); |
264 | | - // Hide the pitch immediately |
265 | | - return true; |
266 | | - }, |
267 | | - 'title': 'articlefeedback-pitch-takesurvey-title', |
268 | | - 'message': 'articlefeedback-pitch-takesurvey-message', |
269 | | - 'accept': 'articlefeedback-pitch-takesurvey-accept', |
270 | | - 'reject': 'articlefeedback-pitch-reject' |
271 | 270 | } |
272 | 271 | } |
273 | 272 | }; |
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php |
— | — | @@ -46,16 +46,16 @@ |
47 | 47 | 'articlefeedback-field-wellwritten-tip' => 'Do you feel that this page is well-organized and well-written?', |
48 | 48 | 'articlefeedback-pitch-reject' => 'Maybe later', |
49 | 49 | 'articlefeedback-pitch-or' => 'or', |
50 | | - 'articlefeedback-pitch-takesurvey-title' => 'Would you like to take a survey?', |
51 | | - 'articlefeedback-pitch-takesurvey-message' => '-- message --', |
52 | | - 'articlefeedback-pitch-takesurvey-accept' => 'Start survey', |
53 | | - 'articlefeedback-pitch-createaccount-title' => 'Would you like to create an account?', |
54 | | - 'articlefeedback-pitch-createaccount-message' => '-- message --', |
55 | | - 'articlefeedback-pitch-createaccount-accept' => 'Create account', |
56 | | - 'articlefeedback-pitch-createaccount-login' => 'Log in', |
57 | | - 'articlefeedback-pitch-makefirstedit-title' => 'Would you like to edit this page?', |
58 | | - 'articlefeedback-pitch-makefirstedit-message' => '-- message --', |
59 | | - 'articlefeedback-pitch-makefirstedit-accept' => 'Start editing', |
| 50 | + 'articlefeedback-pitch-survey-title' => 'Would you like to take a survey?', |
| 51 | + 'articlefeedback-pitch-survey-message' => '-- message --', |
| 52 | + 'articlefeedback-pitch-survey-accept' => 'Start survey', |
| 53 | + 'articlefeedback-pitch-join-title' => 'Would you like to create an account?', |
| 54 | + 'articlefeedback-pitch-join-message' => '-- message --', |
| 55 | + 'articlefeedback-pitch-join-accept' => 'Create account', |
| 56 | + 'articlefeedback-pitch-join-login' => 'Log in', |
| 57 | + 'articlefeedback-pitch-edit-title' => 'Would you like to edit this page?', |
| 58 | + 'articlefeedback-pitch-edit-message' => '-- message --', |
| 59 | + 'articlefeedback-pitch-edit-accept' => 'Start editing', |
60 | 60 | 'articlefeedback-expert-assessment-question' => 'Do you have knowledge in this topic?', |
61 | 61 | 'articlefeedback-expert-assessment-level-1-label' => 'Marginal', |
62 | 62 | 'articlefeedback-expert-assessment-level-2-label' => 'Competent', |