From: Bartosz DziewoƄski Date: Wed, 17 Oct 2018 20:33:54 +0000 (+0200) Subject: mw.feedback: Remove a hack with passing message parameters X-Git-Tag: 1.34.0-rc.0~3740^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=7eb1d7d00ea488bd5e87b6d81a1d1fc14c461505;p=lhc%2Fweb%2Fwiklou.git mw.feedback: Remove a hack with passing message parameters I'm not sure what bug this is trying to work around. It mentions T49395 but that doesn't look very relevant. Maybe the real problem was confusion and bugs related to passing "raw params" (T33260#4675605). Regardless, it's no longer needed now, because this code also works. Change-Id: I580d46a5e4b7ff58989cb5fd6b7770e781fb5319 --- diff --git a/resources/src/mediawiki.feedback/feedback.js b/resources/src/mediawiki.feedback/feedback.js index d1fb98bf3a..5b73e7c19e 100644 --- a/resources/src/mediawiki.feedback/feedback.js +++ b/resources/src/mediawiki.feedback/feedback.js @@ -328,7 +328,7 @@ } }, this ) .next( function () { - var plainMsg, parsedMsg, + var $link, settings = data.settings; data.contents = data.contents || {}; @@ -350,23 +350,12 @@ this.useragentMandatory = settings.useragentCheckbox.mandatory; this.useragentFieldLayout.toggle( settings.useragentCheckbox.show ); - // HACK: Setting a link in the messages doesn't work. There is already a report - // about this, and the bug report offers a somewhat hacky work around that - // includes setting a separate message to be parsed. - // We want to make sure the user can configure both the title of the page and - // a separate url, so this must be allowed to parse correctly. - // See https://phabricator.wikimedia.org/T49395#490610 - mw.messages.set( { - 'feedback-dialog-temporary-message': - '' + this.feedbackPageName + '' - } ); - plainMsg = mw.message( 'feedback-dialog-temporary-message' ).plain(); - mw.messages.set( { 'feedback-dialog-temporary-message-parsed': plainMsg } ); - parsedMsg = mw.message( 'feedback-dialog-temporary-message-parsed' ); + $link = $( '' ) + .attr( 'href', this.feedbackPageUrl ) + .attr( 'target', '_blank' ) + .text( this.feedbackPageName ); this.feedbackMessageLabel.setLabel( - // Double-parse - $( '' ) - .append( mw.message( 'feedback-dialog-intro', parsedMsg ).parse() ) + mw.message( 'feedback-dialog-intro', $link ).parseDom() ); this.validateFeedbackForm();