r105367 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105366‎ | r105367 | r105368 >
Date:22:12, 6 December 2011
Author:jeroendedauw
Status:reverted (Comments)
Tags:
Comment:
show success message
Modified paths:
  • /trunk/extensions/Reviews/Reviews.i18n.php (modified) (history)
  • /trunk/extensions/Reviews/Reviews.php (modified) (history)
  • /trunk/extensions/Reviews/resources/jquery.reviewControl.css (modified) (history)
  • /trunk/extensions/Reviews/resources/jquery.reviewControl.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Reviews/Reviews.i18n.php
@@ -61,6 +61,7 @@
6262 // Review control
6363 'reviews-submission-submit' => 'Submit',
6464 'reviews-submission-saving' => 'Saving',
 65+ 'reviews-submission-success' => 'Your review has been submitted!',
6566 'reviews-submission-title' => 'A title for your review:',
6667 'reviews-submission-text' => 'The review text:',
6768 'reviews-submission-rating' => 'Overall rating:',
Index: trunk/extensions/Reviews/Reviews.php
@@ -161,6 +161,7 @@
162162 'reviews-submission-text',
163163 'reviews-submission-rating',
164164 'reviews-submission-ratings',
 165+ 'reviews-submission-success',
165166 ),
166167 'dependencies' => array(
167168 'ext.reviews', 'jquery.ui.button', 'jquery.ui.stars',
Index: trunk/extensions/Reviews/resources/jquery.reviewControl.css
@@ -40,3 +40,16 @@
4141 .review-ratingdiv > p {
4242 line-height: 1.4em;
4343 }
 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 @@
101101 _this.save();
102102 } );
103103
 104+ this.successMessage = $( '<p>' )
 105+ .text( mw.msg( 'reviews-submission-success' ) )
 106+ .attr( {
 107+ 'class': 'reviews-submission-success',
 108+ 'style': 'display: none;'
 109+ } );
 110+
104111 $this.html( '' );
105112
106113 $this.append(
@@ -120,8 +127,13 @@
121128 );
122129
123130 $this.append( this.ratingsInput );
124 - $this.append( this.button );
125131
 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+
126138 this.ratingInput.stars( {
127139 inputType: 'select',
128140 cancelShow: false,
@@ -157,7 +169,11 @@
158170
159171 this.review.save( function( success ) {
160172 if ( success ) {
161 - // TODO
 173+ _this.successMessage.fadeIn( 'slow', function() {
 174+// setTimeout( function() {
 175+// _this.successMessage.fadeOut( 'slow' );
 176+// }, 60000 );
 177+ } );
162178 }
163179 else {
164180 alert( 'Review could not be saved' ); // TODO

Comments

#Comment by Siebrand (talk | contribs)   08:33, 8 December 2011

Please add message documentation for the newly added messages. Thanks.

Status & tagging log