r81176 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81175‎ | r81176 | r81177 >
Date:23:23, 28 January 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Renamed pitches. Adjusted order and probability of being used for each pitch.
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -21,18 +21,18 @@
2222 'articlefeedback-field-objective-tip',
2323 'articlefeedback-field-wellwritten-label',
2424 'articlefeedback-field-wellwritten-tip',
25 - 'articlefeedback-pitch-takesurvey-title',
2625 'articlefeedback-pitch-reject',
2726 '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',
3737 'articlefeedback-survey-title',
3838 'articlefeedback-survey-message-success',
3939 'articlefeedback-survey-message-error',
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -230,7 +230,7 @@
231231 .end()
232232 .each( function() {
233233 for ( var key in context.options.pitches ) {
234 - $( $.articleFeedback.tpl.pitch )
 234+ var $pitch = $( $.articleFeedback.tpl.pitch )
235235 .attr( 'rel', key )
236236 .find( '.articleFeedback-title' )
237237 .text( mw.msg( context.options.pitches[key].title ) )
@@ -263,12 +263,12 @@
264264 $pitch.fadeOut();
265265 } )
266266 .end()
267 - .appendTo( $(this) );
 267+ .appendTo( $(this) );
268268 if (
269269 typeof context.options.pitches[key].altAccept == 'string'
270270 && typeof context.options.pitches[key].altAction == 'function'
271271 ) {
272 - $(this)
 272+ $pitch
273273 .find( '.articleFeedback-accept' )
274274 .after( '<button class="articleFeedback-altAccept"></button>' )
275275 .after(
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js
@@ -150,7 +150,7 @@
151151 // Display success/error message
152152 that.alert( success ? 'success' : 'error' );
153153 // Mute for 30 days
154 - mutePitch( 'takesurvey', 30 );
 154+ mutePitch( 'survey', 30 );
155155 },
156156 'error': function( XMLHttpRequest, textStatus, errorThrown ) {
157157 // Take the dialog out of "loading" state
@@ -195,13 +195,28 @@
196196 }
197197 },
198198 'pitches': {
199 - 'createaccount': {
 199+ 'survey': {
200200 '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;
204203 },
205204 '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() {
206221 // Go to account creation page
207222 window.location =
208223 mediaWiki.config.get( 'wgScript' ) + '?' + $.param( {
@@ -210,15 +225,15 @@
211226 'returnto': mediaWiki.config.get( 'wgPageName' )
212227 } );
213228 // Mute for 1 day
214 - mutePitch( 'createaccount', 1 );
 229+ mutePitch( 'join', 1 );
215230 return false;
216231 },
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',
220235 'reject': 'articlefeedback-pitch-reject',
221236 // Special alternative action for going to login page
222 - 'altAccept': 'articlefeedback-pitch-createaccount-login',
 237+ 'altAccept': 'articlefeedback-pitch-join-login',
223238 'altAction': function() {
224239 // Go to login page
225240 window.location =
@@ -227,15 +242,14 @@
228243 'returnto': mediaWiki.config.get( 'wgPageName' )
229244 } );
230245 // Mute for 1 day
231 - mutePitch( 'createaccount', 1 );
 246+ mutePitch( 'join', 1 );
232247 return false;
233248 }
234249 },
235 - 'makefirstedit': {
 250+ 'edit': {
236251 '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' );
240254 },
241255 'action': function() {
242256 // Go to edit page
@@ -245,28 +259,13 @@
246260 'action': 'edit'
247261 } );
248262 // Mute for 7 days
249 - mutePitch( 'makefirstedit', 7 );
 263+ mutePitch( 'edit', 7 );
250264 return false;
251265 },
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',
255269 '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'
271270 }
272271 }
273272 };
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php
@@ -46,16 +46,16 @@
4747 'articlefeedback-field-wellwritten-tip' => 'Do you feel that this page is well-organized and well-written?',
4848 'articlefeedback-pitch-reject' => 'Maybe later',
4949 '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',
6060 'articlefeedback-expert-assessment-question' => 'Do you have knowledge in this topic?',
6161 'articlefeedback-expert-assessment-level-1-label' => 'Marginal',
6262 'articlefeedback-expert-assessment-level-2-label' => 'Competent',

Follow-up revisions

RevisionCommit summaryAuthorDate
r81188Follow-up r81176 for Translatewikiraymond09:36, 29 January 2011

Status & tagging log