From 0b9ecc9e0f84f55939e0853ec35b0941f67c1d55 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 20 Dec 2011 08:21:54 +0000 Subject: [PATCH] Remove trailing whitespace and a few superfluous empty lines. --- resources/mediawiki/mediawiki.feedback.js | 94 +++++++++++------------ 1 file changed, 44 insertions(+), 50 deletions(-) diff --git a/resources/mediawiki/mediawiki.feedback.js b/resources/mediawiki/mediawiki.feedback.js index 8a9435ec7d..3dce004e16 100644 --- a/resources/mediawiki/mediawiki.feedback.js +++ b/resources/mediawiki/mediawiki.feedback.js @@ -1,4 +1,4 @@ -/** +/** * mediawiki.Feedback * * @author Ryan Kaldari, 2010 @@ -6,40 +6,38 @@ * @since 1.19 * * This is a way of getting simple feedback from users. It's useful - * for testing new features -- users can give you feedback without + * for testing new features -- users can give you feedback without * the difficulty of opening a whole new talk page. For this reason, * it also tends to collect a wider range of both positive and negative - * comments. However you do need to tend to the feedback page. It will - * get long relatively quickly, and you often get multiple messages + * comments. However you do need to tend to the feedback page. It will + * get long relatively quickly, and you often get multiple messages * reporting the same issue. * * It takes the form of thing on your page which, when clicked, opens a small - * dialog box. Submitting that dialog box appends its contents to a + * dialog box. Submitting that dialog box appends its contents to a * wiki page that you specify, as a new section. * * Not compatible with LiquidThreads. - * + * * Minimal example in how to use it: - * + * * var feedback = new mw.Feedback(); - * $( '#myButton' ).click( function() { feedback.launch(); } ); - * - * You can also launch the feedback form with a prefilled subject and body. - * See the docs for the launch() method. + * $( '#myButton' ).click( function() { feedback.launch(); } ); + * + * You can also launch the feedback form with a prefilled subject and body. + * See the docs for the launch() method. */ ( function( mw, $, undefined ) { - /** * Thingy for collecting user feedback on a wiki page * @param {Array} options -- optional, all properties optional. - * api: {mw.Api} if omitted, will just create a standard API + * api: {mw.Api} if omitted, will just create a standard API * title: {mw.Title} the title of the page where you collect feedback. Defaults to "Feedback". * dialogTitleMessageKey: {String} message key for the title of the dialog box * bugsLink: {mw.Uri|String} url where bugs can be posted * bugsListLink: {mw.Uri|String} url where bugs can be listed */ mw.Feedback = function( options ) { - if ( options === undefined ) { options = {}; } @@ -72,7 +70,6 @@ setup: function() { var _this = this; - var $feedbackPageLink = $( '' ) .attr( { 'href': _this.title.getUrl(), 'target': '_blank' } ) .css( { 'white-space': 'nowrap' } ); @@ -81,40 +78,40 @@ var $bugsListLink = $( '' ).attr( { 'href': _this.bugsListLink, 'target': '_blank' } ); - this.$dialog = - $( '
' ).append( + this.$dialog = + $( '
' ).append( $( '
' ).append( - $( '' ).append( - $( '

' ).msg( - 'feedback-bugornote', + $( '' ).append( + $( '

' ).msg( + 'feedback-bugornote', $bugNoteLink, - _this.title.getNameText(), - $feedbackPageLink.clone() + _this.title.getNameText(), + $feedbackPageLink.clone() ) ), - $( '
' ).append( - mw.msg( 'feedback-subject' ), - $( '
' ), - $( '' ) + $( '
' ).append( + mw.msg( 'feedback-subject' ), + $( '
' ), + $( '' ) ), - $( '
' ).append( - mw.msg( 'feedback-message' ), - $( '
' ), - $( '' ) + $( '
' ).append( + mw.msg( 'feedback-message' ), + $( '
' ), + $( '' ) ) ), - $( '
' ).append( + $( '
' ).append( $( '

' ).msg( 'feedback-bugcheck', $bugsListLink ) ), - $( '

' ).append( - mw.msg( 'feedback-adding' ), - $( '
' ), - $( '' ) + $( '
' ).append( + mw.msg( 'feedback-adding' ), + $( '
' ), + $( '' ) ), $( '
' ).msg( - 'feedback-thanks', _this.title.getNameText(), $feedbackPageLink.clone() + 'feedback-thanks', _this.title.getNameText(), $feedbackPageLink.clone() ), - $( '
' ).append( + $( '
' ).append( $( '
' ) ) ); @@ -128,7 +125,7 @@ title: mw.msg( this.dialogTitleMessageKey ), modal: true, buttons: _this.buttons - }); + }); this.subjectInput = this.$dialog.find( 'input.feedback-subject' ).get(0); this.messageInput = this.$dialog.find( 'textarea.feedback-message' ).get(0); @@ -138,10 +135,10 @@ display: function( s ) { this.$dialog.dialog( { buttons:{} } ); // hide the buttons this.$dialog.find( '.feedback-mode' ).hide(); // hide everything - this.$dialog.find( '.feedback-' + s ).show(); // show the desired div + this.$dialog.find( '.feedback-' + s ).show(); // show the desired div }, - displaySubmitting: function() { + displaySubmitting: function() { this.display( 'submitting' ); }, @@ -158,7 +155,7 @@ var _this = this; this.display( 'thanks' ); var closeButton = {}; - closeButton[ mw.msg( 'feedback-close' ) ] = function() { _this.$dialog.dialog( 'close' ); }; + closeButton[ mw.msg( 'feedback-close' ) ] = function() { _this.$dialog.dialog( 'close' ); }; this.$dialog.dialog( { buttons: closeButton } ); }, @@ -172,8 +169,8 @@ var _this = this; this.subjectInput.value = (contents && contents.subject) ? contents.subject : ''; this.messageInput.value = (contents && contents.message) ? contents.message : ''; - - this.display( 'form' ); + + this.display( 'form' ); // Set up buttons for dialog box. We have to do it the hard way since the json keys are localized var formButtons = {}; @@ -184,10 +181,10 @@ displayError: function( message ) { this.display( 'error' ); - this.$dialog.find( '.feedback-error-msg' ).msg( message ); + this.$dialog.find( '.feedback-error-msg' ).msg( message ); }, - cancel: function() { + cancel: function() { this.$dialog.dialog( 'close' ); }, @@ -220,12 +217,10 @@ var err = function( code, info ) { displayError( 'feedback-error3' ); // ajax request failed }; - - this.api.newSection( this.title, subject, message, ok, err ); + 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. * @param {Object} optional prefilled contents for the feedback form. Object with properties: @@ -236,9 +231,8 @@ this.displayForm( contents ); this.$dialog.dialog( 'open' ); this.subjectInput.focus(); - } + } }; - } )( window.mediaWiki, jQuery ); -- 2.20.1