r110301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110300‎ | r110301 | r110302 >
Date:16:26, 30 January 2012
Author:gregchiasson
Status:resolved (Comments)
Tags:aft 
Comment:
AFT5 - re-commenting out the AFT5 special page calls, because those keep getting uncommented. Mostly this commit is for tweaking the HTML/CSS to make long comments with 'more' links match the mockups.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
@@ -166,6 +166,15 @@
167167 clear: left;
168168 padding-right: 160px;
169169 }
 170+
 171+.articleFeedbackv5-feedback blockquote .articleFeedbackv5-comment-full {
 172+ display: none;
 173+}
 174+
 175+.articleFeedbackv5-comment-toggle {
 176+ margin-left: 7px;
 177+}
 178+
170179 .articleFeedbackv5-feedback .articleFeedbackv5-comment-details {
171180 padding-top: 30px;
172181 float: right;
@@ -202,6 +211,13 @@
203212 #articleFeedbackv5-special-add-feedback:after {
204213 clear:both;
205214 }
 215+#articleFeedbackv5-show-feedback {
 216+ width: 100%;
 217+ float: none;
 218+ margin: 0;
 219+ padding: 0;
 220+}
 221+
206222 #articleFeedbackv5-show-feedback .articleFeedbackv5-abuse-link {
207223
208224 }
@@ -327,10 +343,6 @@
328344 background-size: 11px 7px;
329345 }
330346
331 -.articleFeedbackv5-comment-full {
332 - display: none;
333 -}
334 -
335347 a.helpful-active {
336348 background: url(images/bg-button.png) !important;
337349 color: white !important;
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -533,7 +533,7 @@
534534 if ( resetContents ) {
535535 $( '#articleFeedbackv5-show-feedback' ).empty();
536536 }
537 - var $newList = $( '<div></div>' ).html( data['articlefeedbackv5-view-feedback'].feedback );
 537+ $newList = $( '#articleFeedbackv5-show-feedback' ).append( data['articlefeedbackv5-view-feedback'].feedback );
538538 $newList.find( '.articleFeedbackv5-feedback' ).each( function () {
539539 var id = $( this ).attr( 'rel' );
540540 if ( id in $.articleFeedbackv5special.activity ) {
@@ -553,7 +553,6 @@
554554 $.articleFeedbackv5special.markHidden( $( this ) );
555555 }
556556 } );
557 - $( '#articleFeedbackv5-show-feedback' ).append( $newList );
558557 $( '#articleFeedbackv5-feedback-count-total' ).text( data['articlefeedbackv5-view-feedback'].count );
559558 $.articleFeedbackv5special.listControls.continue = data['articlefeedbackv5-view-feedback'].continue;
560559 } else {
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php
@@ -271,14 +271,14 @@
272272 $wgHooks['ArticleSaveComplete'][] = 'ArticleFeedbackv5Hooks::trackEditSuccess';
273273
274274 // API Registration
275 -$wgAPIListModules['articlefeedbackv5-view-ratings'] = 'ApiViewRatingsArticleFeedbackv5';
276 -$wgAPIListModules['articlefeedbackv5-view-feedback'] = 'ApiViewFeedbackArticleFeedbackv5';
277 -$wgAPIModules['articlefeedbackv5-flag-feedback'] = 'ApiFlagFeedbackArticleFeedbackv5';
 275+#$wgAPIListModules['articlefeedbackv5-view-ratings'] = 'ApiViewRatingsArticleFeedbackv5';
 276+#$wgAPIListModules['articlefeedbackv5-view-feedback'] = 'ApiViewFeedbackArticleFeedbackv5';
 277+#$wgAPIModules['articlefeedbackv5-flag-feedback'] = 'ApiFlagFeedbackArticleFeedbackv5';
278278 $wgAPIModules['articlefeedbackv5'] = 'ApiArticleFeedbackv5';
279279
280280 // Special Page
281 -$wgSpecialPages['ArticleFeedbackv5'] = 'SpecialArticleFeedbackv5';
282 -$wgSpecialPageGroups['ArticleFeedbackv5'] = 'other';
 281+#$wgSpecialPages['ArticleFeedbackv5'] = 'SpecialArticleFeedbackv5';
 282+#$wgSpecialPageGroups['ArticleFeedbackv5'] = 'other';
283283
284284 $wgAvailableRights[] = 'aftv5-hide-feedback';
285285 $wgAvailableRights[] = 'aftv5-delete-feedback';
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -590,32 +590,35 @@
591591
592592 $short = $wgLang->truncate( $text, 500 );
593593
594 - $rv = Html::openElement( 'blockquote',
595 - array(
596 - 'class' => 'articleFeedbackv5-comment-short',
597 - 'id' => "articleFeedbackv5-comment-short-$feedbackId"
598 - ) )
599 - . htmlspecialchars( $short )
600 - . Html::closeElement( 'blockquote' );
 594+ $rv = Html::openElement( 'blockquote' )
 595+ . Html::element( 'span',
 596+ array(
 597+ 'class' => 'articleFeedbackv5-comment-short',
 598+ 'id' => "articleFeedbackv5-comment-short-$feedbackId"
 599+ ),
 600+ htmlspecialchars( $short )
 601+ );
601602
602603 // If the short string is the same size as the
603604 // original, no truncation happened, so no
604605 // controls are needed.
605606 if ( $short != $text ) {
606607 // Show the short text, with the 'show more' control.
607 - $rv .= Html::openElement( 'blockquote',
608 - array(
609 - 'class' => 'articleFeedbackv5-comment-full',
610 - 'id' => "articleFeedbackv5-comment-full-$feedbackId"
611 - ) )
612 - . htmlspecialchars( $text )
613 - . Html::closeElement( 'blockquote' )
 608+ $rv .= Html::element( 'span',
 609+ array(
 610+ 'class' => 'articleFeedbackv5-comment-full',
 611+ 'id' => "articleFeedbackv5-comment-full-$feedbackId"
 612+ ),
 613+ htmlspecialchars( $text )
 614+ )
614615 . Html::element( 'a', array(
615616 'class' => 'articleFeedbackv5-comment-toggle',
616617 'id' => "articleFeedbackv5-comment-toggle-$feedbackId"
617618 ), wfMessage( 'articlefeedbackv5-comment-more' )->escaped() );
618619 }
619620
 621+ $rv .= Html::closeElement( 'blockquote' );
 622+
620623 return $rv;
621624 }
622625

Follow-up revisions

RevisionCommit summaryAuthorDate
r110365Readd var keyword that disappeared in r110301catrope07:56, 31 January 2012
r110399AFT5 fix double-escaping from r110301 and r110012gregchiasson16:21, 31 January 2012

Comments

#Comment by Catrope (talk | contribs)   07:57, 31 January 2012
+			htmlspecialchars( $short )

This double-escapes $short: it's escaped by htmlspecialchars() and again by Html::element().

OK otherwise.

Status & tagging log