r104187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104186‎ | r104187 | r104188 >
Date:18:43, 24 November 2011
Author:jeroendedauw
Status:reverted
Tags:
Comment:
Follow up to r104176;
Modified paths:
  • /trunk/extensions/Reviews/resources/jquery.reviewControl.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Reviews/resources/jquery.reviewControl.js
@@ -24,14 +24,17 @@
2525
2626 this.buildRatingsControl = function() {
2727 var ratings = this.review.fields.ratings;
28 - var $tr = $( '<tr />' ).html( '' );
 28+ var $tr = $( '<tr>' ).html( '' );
2929
3030 for ( rating in ratings ) {
3131 if ( ratings.hasOwnProperty( rating ) ) {
32 - $tr.append( $( '<td />' ).append(
33 - $( '<div class="review-ratings-div" />' )
34 - .attr( 'id', this.fieldName( 'ratingdiv' + rating ) )
35 - .attr( 'data-type', rating )
 32+ $tr.append( $( '<td>' ).append(
 33+ $( '<div>' )
 34+ .attr( {
 35+ 'id': this.fieldName( 'ratingdiv' + rating ),
 36+ 'data-type': rating,
 37+ 'class': 'review-ratings-div'
 38+ } )
3639 .html( reviews.htmlSelect(
3740 { 1: 1, 2: 2, 3: 3, 4: 4, 5: 5 }, // TODO
3841 ratings[rating],
@@ -40,7 +43,7 @@
4144 'id': this.fieldName( 'rating' + rating ),
4245 'class': 'review-specificratinginput'
4346 }
44 - ) ).prepend( $( '<label />' ).attr( {
 47+ ) ).prepend( $( '<label>' ).attr( {
4548 'for': this.fieldName( 'ratingdiv' + rating ),
4649 'class': 'review-ratings-label'
4750 } ).text( rating ) )
@@ -49,18 +52,18 @@
5053 }
5154 }
5255
53 - this.ratingsInput = $( '<div />' ).attr( { 'class': 'review-ratings-table-div' } ).html( $( '<table />' ).html( $tr ) );
 56+ this.ratingsInput = $( '<div>' ).attr( { 'class': 'review-ratings-table-div' } ).html( $( '<table>' ).html( $tr ) );
5457 };
5558
5659 this.buildInterface = function() {
57 - this.titleInput = $( '<input />' ).attr( {
 60+ this.titleInput = $( '<input>' ).attr( {
5861 'type': 'text',
5962 'size': 45,
6063 'name': this.fieldName( 'title' ),
6164 'class': 'review-titleinput'
6265 } ).val( this.review.fields.title );
6366
64 - this.textInput = $( '<textarea />' ).attr( {
 67+ this.textInput = $( '<textarea>' ).attr( {
6568 'name': this.fieldName( 'text' ),
6669 'class': 'review-textinput'
6770 } ).text( this.review.fields.text );
@@ -75,14 +78,15 @@
7679 }
7780 );
7881
79 - this.ratingInput = $( '<div />' ).attr( {
 82+ this.ratingInput = $( '<div>' ).attr( {
8083 'id': this.fieldName( 'ratingdiv' ),
8184 'class': 'review-ratingdiv'
8285 } ).html( this.ratingInput );
8386
8487 this.buildRatingsControl();
8588
86 - this.button = $( '<button class="review-save" />' )
 89+ this.button = $( '<button>' )
 90+ .attr( { 'class': 'review-save' } )
8791 .button( { 'label': mw.msg( 'reviews-submission-submit' ) } )
8892 .click( function() {
8993 _this.save();
@@ -91,17 +95,17 @@
9296 $this.html( '' );
9397
9498 $this.append(
95 - $( '<label />' ).attr( { 'for': this.fieldName( 'title' ) } ).text( mw.msg( 'reviews-submission-title' ) + ' ' ),
 99+ $( '<label>' ).attr( { 'for': this.fieldName( 'title' ) } ).text( mw.msg( 'reviews-submission-title' ) + ' ' ),
96100 this.titleInput
97 - ).append( '<br />' );
 101+ ).append( '<br>' );
98102
99103 $this.append(
100 - $( '<label />' ).attr( { 'for': this.fieldName( 'text' ) } ).text( mw.msg( 'reviews-submission-text' ) ).append( '<br />' ),
 104+ $( '<label>' ).attr( { 'for': this.fieldName( 'text' ) } ).text( mw.msg( 'reviews-submission-text' ) ).append( '<br />' ),
101105 this.textInput
102 - ).append( '<br />' );
 106+ ).append( '<br>' );
103107
104108 $this.append(
105 - this.ratingInput.prepend( $( '<label />' ).attr( {
 109+ this.ratingInput.prepend( $( '<label>' ).attr( {
106110 'for': this.fieldName( 'rating' ),
107111 'class': 'review-rating-label'
108112 } ).text( mw.msg( 'reviews-submission-rating' ) ) )

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104176work on reviews controljeroendedauw16:07, 24 November 2011

Status & tagging log