Index: trunk/extensions/Reviews/Reviews.i18n.php |
— | — | @@ -61,6 +61,7 @@ |
62 | 62 | // Review control |
63 | 63 | 'reviews-submission-submit' => 'Submit', |
64 | 64 | 'reviews-submission-saving' => 'Saving', |
| 65 | + 'reviews-submission-success' => 'Your review has been submitted!', |
65 | 66 | 'reviews-submission-title' => 'A title for your review:', |
66 | 67 | 'reviews-submission-text' => 'The review text:', |
67 | 68 | 'reviews-submission-rating' => 'Overall rating:', |
Index: trunk/extensions/Reviews/Reviews.php |
— | — | @@ -161,6 +161,7 @@ |
162 | 162 | 'reviews-submission-text', |
163 | 163 | 'reviews-submission-rating', |
164 | 164 | 'reviews-submission-ratings', |
| 165 | + 'reviews-submission-success', |
165 | 166 | ), |
166 | 167 | 'dependencies' => array( |
167 | 168 | 'ext.reviews', 'jquery.ui.button', 'jquery.ui.stars', |
Index: trunk/extensions/Reviews/resources/jquery.reviewControl.css |
— | — | @@ -40,3 +40,16 @@ |
41 | 41 | .review-ratingdiv > p { |
42 | 42 | line-height: 1.4em; |
43 | 43 | } |
| 44 | + |
| 45 | +.reviews-submission-success { |
| 46 | + color: darkgreen; |
| 47 | + font-wieght: bold; |
| 48 | +} |
| 49 | + |
| 50 | +.reviews-submission-submitdiv { |
| 51 | + |
| 52 | +} |
| 53 | + |
| 54 | +.review-save, .reviews-submission-success { |
| 55 | + float: left; |
| 56 | +} |
Index: trunk/extensions/Reviews/resources/jquery.reviewControl.js |
— | — | @@ -100,6 +100,13 @@ |
101 | 101 | _this.save(); |
102 | 102 | } ); |
103 | 103 | |
| 104 | + this.successMessage = $( '<p>' ) |
| 105 | + .text( mw.msg( 'reviews-submission-success' ) ) |
| 106 | + .attr( { |
| 107 | + 'class': 'reviews-submission-success', |
| 108 | + 'style': 'display: none;' |
| 109 | + } ); |
| 110 | + |
104 | 111 | $this.html( '' ); |
105 | 112 | |
106 | 113 | $this.append( |
— | — | @@ -120,8 +127,13 @@ |
121 | 128 | ); |
122 | 129 | |
123 | 130 | $this.append( this.ratingsInput ); |
124 | | - $this.append( this.button ); |
125 | 131 | |
| 132 | + $this.append( $( '<div>' ).html( this.button ).append( this.successMessage ).attr( { |
| 133 | + 'class': 'reviews-submission-submitdiv' |
| 134 | + } ) ); |
| 135 | + |
| 136 | + $this.append( '<hr style="display: block; clear: both; visibility: hidden;" />' ); |
| 137 | + |
126 | 138 | this.ratingInput.stars( { |
127 | 139 | inputType: 'select', |
128 | 140 | cancelShow: false, |
— | — | @@ -157,7 +169,11 @@ |
158 | 170 | |
159 | 171 | this.review.save( function( success ) { |
160 | 172 | if ( success ) { |
161 | | - // TODO |
| 173 | + _this.successMessage.fadeIn( 'slow', function() { |
| 174 | +// setTimeout( function() { |
| 175 | +// _this.successMessage.fadeOut( 'slow' ); |
| 176 | +// }, 60000 ); |
| 177 | + } ); |
162 | 178 | } |
163 | 179 | else { |
164 | 180 | alert( 'Review could not be saved' ); // TODO |