r103965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103964‎ | r103965 | r103966 >
Date:21:58, 22 November 2011
Author:rmoen
Status:ok (Comments)
Tags:todo 
Comment:
escaped raw html for respond link, and simplified response toggle js, follow up to r103943
Modified paths:
  • /trunk/extensions/MoodBar/SpecialFeedbackDashboard.php (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php
@@ -203,7 +203,7 @@
204204 //only show response elements if feedback is not hidden, and user is logged in
205205 if ($feedbackItem->getProperty('hidden-state') == false
206206 && !$wgUser->isAnon() ) {
207 - $respondToThis = wfMessage('moodbar-respond-collapsed').' '.wfMessage("moodbar-respond-text");
 207+ $respondToThis = "<span>".wfMessage('moodbar-respond-collapsed')->escaped().'</span> '.wfMessage("moodbar-respond-text")->escaped();
208208 $responseElements = <<<HTML
209209 <div class="fbd-item-response">
210210 <a class="fbd-respond-link">$respondToThis</a>
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
@@ -359,7 +359,8 @@
360360 $link = $( this ).find('.fbd-respond-link');
361361 if( $link.hasClass('responder-expanded') ) {
362362
363 - $link.empty().html( mw.msg( 'moodbar-respond-collapsed' ) + ' ' + mw.msg( 'moodbar-respond-text' ) )
 363+ $link.find('span').text( mw.msg( 'moodbar-respond-collapsed' ) )
 364+ .parent()
364365 .removeClass('responder-expanded');
365366
366367 $( this ).find('.fbd-response-form').remove();
@@ -439,7 +440,8 @@
440441
441442 closeAllResponders();
442443
443 - $(this).empty().html( mw.msg( 'moodbar-respond-expanded' ) + ' ' + mw.msg( 'moodbar-respond-text' ) )
 444+ $(this).find('span').text( mw.msg( 'moodbar-respond-expanded' ) )
 445+ .parent()
444446 .addClass( 'responder-expanded' )
445447 .end();
446448

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103943Phase 2. Feedback Response front end and Dashboard ie fixes.rmoen19:28, 22 November 2011

Comments

#Comment by Raindrift (talk | contribs)   03:02, 23 November 2011

If you name your elements, they can be styled later without changing the code, and your jquery find()s become more robust to later updates to the html. not a blocker, but tagging todo for later cleanup.

Status & tagging log