# Feedback
'feedback-bugornote' => 'If you are ready to describe a technical problem in detail please [$1 report a bug].
-Otherwise, you can use the easy form below. Your comment will be added to the page "[$3 $2]", along with your username and what browser you are using.',
+Otherwise, you can use the easy form below. Your comment will be added to the page "[$3 $2]", along with your username.',
'feedback-subject' => 'Subject:',
'feedback-message' => 'Message:',
'feedback-cancel' => 'Cancel',
},
submit: function () {
- var fb = this;
-
- // get the values to submit
- var subject = this.subjectInput.value;
-
- var message = '<small>User agent: ' + mw.html.escape( navigator.userAgent ) + '</small>\n\n'
- + this.messageInput.value;
- if ( message.indexOf( '~~~' ) === -1 ) {
- message += ' ~~~~';
- }
-
- this.displaySubmitting();
+ var subject, message,
+ fb = this;
- var ok = function ( result ) {
+ function ok( result ) {
if ( result.edit !== undefined ) {
if ( result.edit.result === 'Success' ) {
fb.displayThanks();
// edit failed
fb.displayError( 'feedback-error2' );
}
- };
+ }
- var err = function ( code, info ) {
+ function err( code, info ) {
// ajax request failed
fb.displayError( 'feedback-error3' );
- };
+ }
+
+ // Get the values to submit.
+ subject = this.subjectInput.value;
+
+ // We used to include "mw.html.escape( navigator.userAgent )" but there are legal issues
+ // with posting this without their explicit consent
+ message = this.messageInput.value;
+ if ( message.indexOf( '~~~' ) === -1 ) {
+ message += ' ~~~~';
+ }
+
+ this.displaySubmitting();
this.api.newSection( this.title, subject, message, ok, err );
- }, // close submit button function
+ },
/**
* Modify the display form, and then open it, focusing interface on the subject.