Merge "Change delimiter for multiple namespaces and tags"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.Upload.Dialog.js
index 220a3fe..9d9c0a6 100644 (file)
@@ -29,6 +29,9 @@
         * @uses mw.Upload
         * @uses mw.Upload.BookletLayout
         * @extends OO.ui.ProcessDialog
+        *
+        * @constructor
+        * @param {Object} [config] Configuration options
         * @cfg {Function} [bookletClass=mw.Upload.BookletLayout] Booklet class to be
         *     used for the steps
         * @cfg {Object} [booklet] Booklet constructor configuration
@@ -57,7 +60,6 @@
         * @inheritdoc
         * @property title
         */
-       /*jshint -W024*/
        mw.Upload.Dialog.static.title = mw.msg( 'upload-dialog-title' );
 
        /**
                        flags: 'safe',
                        action: 'cancel',
                        label: mw.msg( 'upload-dialog-button-cancel' ),
-                       modes: [ 'upload', 'insert', 'info' ]
+                       modes: [ 'upload', 'insert' ]
+               },
+               {
+                       flags: 'safe',
+                       action: 'cancelupload',
+                       label: mw.msg( 'upload-dialog-button-back' ),
+                       modes: [ 'info' ]
                },
                {
                        flags: [ 'primary', 'progressive' ],
@@ -78,7 +86,7 @@
                        modes: 'insert'
                },
                {
-                       flags: [ 'primary', 'constructive' ],
+                       flags: [ 'primary', 'progressive' ],
                        label: mw.msg( 'upload-dialog-button-save' ),
                        action: 'save',
                        modes: 'info'
@@ -91,8 +99,6 @@
                }
        ];
 
-       /*jshint +W024*/
-
        /* Methods */
 
        /**
         * @return {mw.Upload.BookletLayout} An upload booklet
         */
        mw.Upload.Dialog.prototype.createUploadBooklet = function () {
+               // eslint-disable-next-line new-cap
                return new this.bookletClass( $.extend( {
                        $overlay: this.$overlay
                }, this.bookletConfig ) );
         * @inheritdoc
         */
        mw.Upload.Dialog.prototype.getBodyHeight = function () {
-               return 300;
+               return 600;
        };
 
        /**
        mw.Upload.Dialog.prototype.getSetupProcess = function ( data ) {
                return mw.Upload.Dialog.parent.prototype.getSetupProcess.call( this, data )
                        .next( function () {
-                               this.uploadBooklet.initialize();
+                               return this.uploadBooklet.initialize();
                        }, this );
        };
 
                if ( action === 'cancel' ) {
                        return new OO.ui.Process( this.close() );
                }
+               if ( action === 'cancelupload' ) {
+                       return new OO.ui.Process( this.uploadBooklet.initialize() );
+               }
 
                return mw.Upload.Dialog.parent.prototype.getActionProcess.call( this, action );
        };
                                this.uploadBooklet.clear();
                        }, this );
        };
-
 }( jQuery, mediaWiki ) );