r72895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72894‎ | r72895 | r72896 >
Date:11:12, 13 September 2010
Author:platonides
Status:ok
Tags:
Comment:
Follow up r72608.
Make more than one link work in articleassessment-featurefeedback.
Make articleassessment-results-show and articleassessment-results-show customizable (r72886)

These i18n method doesn't seem too good. It allows html injection in the message and only a few wikitext work.
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.i18n.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/js/ArticleAssessment.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.i18n.php
@@ -37,11 +37,8 @@
3838 You may wish to re-rate it.",
3939
4040 # Links get rewritten in javascript.
41 - # FIXME: These links are invalid. Translation is impossible because you cannot save pages with such links.
42 - # The parser strips the pipe and saves as "[[Show]]".
43 - # Even customization in MediaWiki namespace is impossible therefore.
44 - 'articleassessment-results-show' => "(Results hidden. [[|Show]] them.)",
45 - 'articleassessment-results-hide' => "([[|Hide results]])",
 41+ 'articleassessment-results-show' => "(Results hidden. [[#|Show]] them.)",
 42+ 'articleassessment-results-hide' => "([[#|Hide results]])",
4643 );
4744
4845 /** Message documentation (Message documentation)
Index: trunk/extensions/ArticleAssessmentPilot/js/ArticleAssessment.js
@@ -99,16 +99,16 @@
100100 .text( instructions )
101101 .end()
102102 .find( '.article-assessment-rate-feedback' )
103 - .html( feedback.replace( /\[\[([^\|\]]*)\|([^\|\]]*)\]\]/, '<a href="' + wgArticlePath + '">$2</a>' ) )
 103+ .html( feedback.replace( /\[\[([^\|\]]*)\|([^\|\]]*)\]\]/g, '<a href="' + wgArticlePath + '">$2</a>' ) )
104104 .end()
105105 .find( '#article-assessment-ratings legend' )
106106 .text( articlerating )
107107 .end()
108108 .find( '.article-assessment-show-ratings' )
109 - .html( resultsshow.replace( /\[\[\|([^\]]*)\]\]/, '<a href="#">$1</a>' ) )
 109+ .html( resultsshow.replace( /\[\[#\|([^\]]*)\]\]/, '<a href="#">$1</a>' ) )
110110 .end()
111111 .find( '.article-assessment-hide-ratings')
112 - .html( resultshide.replace( /\[\[\|([^\]]*)\]\]/, '<a href="#">$1</a>' ) )
 112+ .html( resultshide.replace( /\[\[#\|([^\]]*)\]\]/, '<a href="#">$1</a>' ) )
113113 .end();
114114 for ( var i = 0; i < settings.fieldMessages.length; i++ ) {
115115 var $field = $( settings.fieldHTML ),
@@ -392,4 +392,4 @@
393393 $( document ).ready( function () {
394394 $.ArticleAssessment.fn.init( );
395395 } ); //document ready
396 -} )( jQuery );
\ No newline at end of file
 396+} )( jQuery );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72608Fixing sql errors, and a class name error. Improving CSS to gain better cross...adam20:31, 8 September 2010
r72886FIXME: These links are invalid. Translation is impossible because you cannot ...raymond19:53, 12 September 2010

Status & tagging log