From: Moriel Schottlender Date: Fri, 6 Mar 2015 01:42:38 +0000 (-0800) Subject: mw.Feedback: Terms of use always appended and allows for link X-Git-Tag: 1.31.0-rc.0~12169^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=204c55c9a28e1e9a6dfe3573d41bfe7c9fd1aedf;p=lhc%2Fweb%2Fwiklou.git mw.Feedback: Terms of use always appended and allows for link Bring the terms of use link outside of the general checkbox message and have it appear regardless of whether the checkbox is shown. Also make sure it is parsed correctly if/when it has a link. Change-Id: Ic1072690e33927e472f8ba529b16fa32280a6abc --- diff --git a/resources/src/mediawiki/mediawiki.feedback.js b/resources/src/mediawiki/mediawiki.feedback.js index 227d129523..9a671c08b1 100644 --- a/resources/src/mediawiki/mediawiki.feedback.js +++ b/resources/src/mediawiki/mediawiki.feedback.js @@ -48,8 +48,7 @@ * @cfg {boolean} [showUseragentCheckbox=false] Show a Useragent agreement checkbox as part of the form. * @cfg {boolean} [useragentCheckboxMandatory=false] Make the Useragent checkbox mandatory. * @cfg {string|jQuery} [useragentCheckboxMessage] Supply a custom message for the useragent checkbox. - * defaults to a combination of 'feedback-terms' and 'feedback-termsofuse' which includes a link to the - * wiki's Term of Use page. + * defaults to the message 'feedback-terms'. */ mw.Feedback = function MwFeedback( config ) { config = config || {}; @@ -68,9 +67,7 @@ this.useragentCheckboxShow = !!config.showUseragentCheckbox; this.useragentCheckboxMandatory = !!config.useragentCheckboxMandatory; this.useragentCheckboxMessage = config.useragentCheckboxMessage || - $( '

' ) - .append( mw.msg( 'feedback-terms' ) ) - .add( $( '

' ).append( mw.message( 'feedback-termsofuse' ).parse() ) ); + $( '

' ).append( mw.msg( 'feedback-terms' ) ); // Message dialog this.thankYouDialog = new OO.ui.MessageDialog(); @@ -238,7 +235,7 @@ */ mw.Feedback.Dialog.prototype.initialize = function () { var feedbackSubjectFieldLayout, feedbackMessageFieldLayout, - feedbackFieldsetLayout; + feedbackFieldsetLayout, termsOfUseLabel; // Parent method mw.Feedback.Dialog.super.prototype.initialize.call( this ); @@ -281,10 +278,16 @@ align: 'inline' } ); + termsOfUseLabel = new OO.ui.LabelWidget( { + classes: [ 'mw-feedbackDialog-feedback-termsofuse' ], + label: $( '

' ).append( mw.msg( 'feedback-termsofuse' ) ) + } ); + this.feedbackPanel.$element.append( this.feedbackMessageLabel.$element, feedbackFieldsetLayout.$element, - this.useragentFieldLayout.$element + this.useragentFieldLayout.$element, + termsOfUseLabel.$element ); // Events @@ -346,6 +349,7 @@ if ( settings.useragentCheckbox.show ) { this.useragentFieldLayout.setLabel( settings.useragentCheckbox.message ); } + this.useragentMandatory = settings.useragentCheckbox.mandatory; this.useragentFieldLayout.toggle( settings.useragentCheckbox.show );