Merge "ApiLogin: Remove the first example of outdated flow"
[lhc/web/wiklou.git] / resources / src / mediawiki.feedback / feedback.js
index d1fb98b..306d93a 100644 (file)
                        padded: true
                } );
 
-               this.$spinner = $( '<div>' )
-                       .addClass( 'feedback-spinner' );
-
                // Feedback form
                this.feedbackMessageLabel = new OO.ui.LabelWidget( {
                        classes: [ 'mw-feedbackDialog-welcome-message' ]
                                }
                        }, this )
                        .next( function () {
-                               var plainMsg, parsedMsg,
+                               var $link,
                                        settings = data.settings;
                                data.contents = data.contents || {};
 
                                this.messagePosterPromise = settings.messagePosterPromise;
                                this.setBugReportLink( settings.bugsTaskSubmissionLink );
                                this.feedbackPageTitle = settings.title;
-                               this.feedbackPageName = settings.title.getNameText();
+                               this.feedbackPageName = settings.title.getMainText();
 
                                // Useragent checkbox
                                if ( settings.useragentCheckbox.show ) {
                                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':
-                                               '<a href="' + this.feedbackPageUrl + '" target="_blank">' + this.feedbackPageName + '</a>'
-                               } );
-                               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 = $( '<a>' )
+                                       .attr( 'href', this.feedbackPageUrl )
+                                       .attr( 'target', '_blank' )
+                                       .text( this.feedbackPageName );
                                this.feedbackMessageLabel.setLabel(
-                                       // Double-parse
-                                       $( '<span>' )
-                                               .append( mw.message( 'feedback-dialog-intro', parsedMsg ).parse() )
+                                       mw.message( 'feedback-dialog-intro', $link ).parseDom()
                                );
 
                                this.validateFeedbackForm();