Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -22,14 +22,15 @@ |
23 | 23 | 'articlefeedback-field-wellwritten-label', |
24 | 24 | 'articlefeedback-field-wellwritten-tip', |
25 | 25 | 'articlefeedback-pitch-takesurvey-title', |
| 26 | + 'articlefeedback-pitch-reject', |
26 | 27 | 'articlefeedback-pitch-takesurvey-message', |
27 | | - 'articlefeedback-pitch-takesurvey-action', |
| 28 | + 'articlefeedback-pitch-takesurvey-accept', |
28 | 29 | 'articlefeedback-pitch-createaccount-title', |
29 | 30 | 'articlefeedback-pitch-createaccount-message', |
30 | | - 'articlefeedback-pitch-createaccount-action', |
| 31 | + 'articlefeedback-pitch-createaccount-accept', |
31 | 32 | 'articlefeedback-pitch-makefirstedit-title', |
32 | 33 | 'articlefeedback-pitch-makefirstedit-message', |
33 | | - 'articlefeedback-pitch-makefirstedit-action', |
| 34 | + 'articlefeedback-pitch-makefirstedit-accept', |
34 | 35 | ), |
35 | 36 | 'dependencies' => array( |
36 | 37 | 'jquery.articleFeedback', |
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js |
— | — | @@ -42,7 +42,8 @@ |
43 | 43 | <div class="articleFeedback-buffer">\ |
44 | 44 | <div class="articleFeedback-title"></div>\ |
45 | 45 | <div class="articleFeedback-message"></div>\ |
46 | | - <button class="articleFeedback-action"></button>\ |
| 46 | + <button class="articleFeedback-accept"></button>\ |
| 47 | + <button class="articleFeedback-reject"></button>\ |
47 | 48 | </div>\ |
48 | 49 | </div>\ |
49 | 50 | ' |
— | — | @@ -71,7 +72,7 @@ |
72 | 73 | 'submit': function() { |
73 | 74 | var context = this; |
74 | 75 | // Lock the submit button -- TODO: lock the star inputs too |
75 | | - context.$ui.find( 'button[type=submit]' ).button( { 'disabled': true } ); |
| 76 | + context.$ui.find( '.articleFeedback-submit' ).button( { 'disabled': true } ); |
76 | 77 | |
77 | 78 | // Build data from form values |
78 | 79 | var data = {}; |
— | — | @@ -215,9 +216,20 @@ |
216 | 217 | .find( '.articleFeedback-message' ) |
217 | 218 | .text( mw.msg( context.options.pitches[key].message ) ) |
218 | 219 | .end() |
219 | | - .find( '.articleFeedback-action' ) |
220 | | - .text( mw.msg( context.options.pitches[key].action ) ) |
| 220 | + .find( '.articleFeedback-accept' ) |
| 221 | + .text( mw.msg( context.options.pitches[key].accept ) ) |
| 222 | + .click( function() { |
| 223 | + context.options.pitches[key].action(); |
| 224 | + $(this).closest( '.articleFeedback-pitch' ).fadeOut(); |
| 225 | + } ) |
| 226 | + .button() |
221 | 227 | .end() |
| 228 | + .find( '.articleFeedback-reject' ) |
| 229 | + .text( mw.msg( context.options.pitches[key].reject ) ) |
| 230 | + .click( function() { |
| 231 | + $(this).closest( '.articleFeedback-pitch' ).fadeOut(); |
| 232 | + } ) |
| 233 | + .end() |
222 | 234 | .appendTo( $(this) ); |
223 | 235 | } |
224 | 236 | } ) |
— | — | @@ -237,6 +249,14 @@ |
238 | 250 | .button() |
239 | 251 | .click( function() { |
240 | 252 | $.articleFeedback.fn.submit.call( context ); |
| 253 | + for ( key in context.options.pitches ) { |
| 254 | + if ( context.options.pitches[key].condition() ) { |
| 255 | + context.$ui |
| 256 | + .find( '.articleFeedback-pitch[rel="' + key + '"]' ) |
| 257 | + .show(); |
| 258 | + break; |
| 259 | + } |
| 260 | + } |
241 | 261 | } ) |
242 | 262 | .end() |
243 | 263 | // Hide report elements initially |
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.css |
— | — | @@ -18,11 +18,25 @@ |
19 | 19 | position: absolute; |
20 | 20 | top: 0; |
21 | 21 | left: 0; |
| 22 | + bottom: 0; |
| 23 | + right: 0; |
22 | 24 | background-color: #f9f9f9; |
23 | 25 | border: 1px solid #cccccc; |
24 | 26 | padding-bottom: 1px; |
25 | 27 | } |
26 | 28 | |
| 29 | +.articleFeedback-reject { |
| 30 | + border: none; |
| 31 | + background-color: #f9f9f9; |
| 32 | + cursor: pointer; |
| 33 | + color: #0645AD; |
| 34 | + line-height: 1.4em; |
| 35 | +} |
| 36 | + |
| 37 | +.articleFeedback-reject:hover { |
| 38 | + text-decoration: underline; |
| 39 | +} |
| 40 | + |
27 | 41 | .articleFeedback-pitch .articleFeedback-buffer { |
28 | 42 | padding: 0.75em 1em; |
29 | 43 | } |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js |
— | — | @@ -33,9 +33,13 @@ |
34 | 34 | // If already taken survey, return false |
35 | 35 | return true; |
36 | 36 | }, |
| 37 | + 'action': function() { |
| 38 | + // Do something |
| 39 | + }, |
37 | 40 | 'title': 'articlefeedback-pitch-takesurvey-title', |
38 | 41 | 'message': 'articlefeedback-pitch-takesurvey-message', |
39 | | - 'action': 'articlefeedback-pitch-takesurvey-action' |
| 42 | + 'accept': 'articlefeedback-pitch-takesurvey-accept', |
| 43 | + 'reject': 'articlefeedback-pitch-reject' |
40 | 44 | }, |
41 | 45 | 'createaccount': { |
42 | 46 | 'condition': function() { |
— | — | @@ -45,9 +49,13 @@ |
46 | 50 | } |
47 | 51 | return true; |
48 | 52 | }, |
| 53 | + 'action': function() { |
| 54 | + // Do something |
| 55 | + }, |
49 | 56 | 'title': 'articlefeedback-pitch-createaccount-title', |
50 | 57 | 'message': 'articlefeedback-pitch-createaccount-message', |
51 | | - 'action': 'articlefeedback-pitch-createaccount-action' |
| 58 | + 'accept': 'articlefeedback-pitch-createaccount-accept', |
| 59 | + 'reject': 'articlefeedback-pitch-reject' |
52 | 60 | }, |
53 | 61 | 'makefirstedit': { |
54 | 62 | 'condition': function() { |
— | — | @@ -57,9 +65,13 @@ |
58 | 66 | } |
59 | 67 | return true; |
60 | 68 | }, |
| 69 | + 'action': function() { |
| 70 | + // Do something |
| 71 | + }, |
61 | 72 | 'title': 'articlefeedback-pitch-makefirstedit-title', |
62 | 73 | 'message': 'articlefeedback-pitch-makefirstedit-message', |
63 | | - 'action': 'articlefeedback-pitch-makefirstedit-action' |
| 74 | + 'accept': 'articlefeedback-pitch-makefirstedit-accept', |
| 75 | + 'reject': 'articlefeedback-pitch-reject' |
64 | 76 | }, |
65 | 77 | } |
66 | 78 | }; |
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php |
— | — | @@ -44,15 +44,16 @@ |
45 | 45 | 'articlefeedback-field-unbiased-tip' => 'Do you feel that this page shows a fair representation of all perspectives on the issue?', |
46 | 46 | 'articlefeedback-field-wellwritten-label' => 'Well-written', |
47 | 47 | 'articlefeedback-field-wellwritten-tip' => 'Do you feel that this page is well-organized and well-written?', |
| 48 | + 'articlefeedback-pitch-reject' => 'No thanks', |
48 | 49 | 'articlefeedback-pitch-takesurvey-title' => 'Would you like to take a survey?', |
49 | 50 | 'articlefeedback-pitch-takesurvey-message' => '-- message --', |
50 | | - 'articlefeedback-pitch-takesurvey-action' => 'Start survey', |
| 51 | + 'articlefeedback-pitch-takesurvey-accept' => 'Start survey', |
51 | 52 | 'articlefeedback-pitch-createaccount-title' => 'Would you like to create an account?', |
52 | 53 | 'articlefeedback-pitch-createaccount-message' => '-- message --', |
53 | | - 'articlefeedback-pitch-createaccount-action' => 'Create account', |
| 54 | + 'articlefeedback-pitch-createaccount-accept' => 'Create account', |
54 | 55 | 'articlefeedback-pitch-makefirstedit-title' => 'Would you like to edit this article?', |
55 | 56 | 'articlefeedback-pitch-makefirstedit-message' => '-- message --', |
56 | | - 'articlefeedback-pitch-makefirstedit-action' => 'Start editing', |
| 57 | + 'articlefeedback-pitch-makefirstedit-accept' => 'Start editing', |
57 | 58 | ); |
58 | 59 | |
59 | 60 | /** Message documentation (Message documentation) |