2 * Message dialog used as a backdrop for the browser popup window.
7 function AuthMessageDialog() {
8 AuthMessageDialog.super.apply( this, arguments );
10 OO.inheritClass( AuthMessageDialog, OO.ui.MessageDialog );
12 AuthMessageDialog.static.name = 'authMessageDialog';
13 AuthMessageDialog.static.size = 'medium';
14 AuthMessageDialog.static.title = null;
15 AuthMessageDialog.static.message = null;
16 AuthMessageDialog.static.actions = [
19 label: OO.ui.deferMsg( 'userlogin-authpopup-retry' ),
20 flags: [ 'primary', 'progressive' ]
24 label: OO.ui.deferMsg( 'userlogin-authpopup-cancel' ),
29 AuthMessageDialog.prototype.getBodyHeight = function () {
30 // Leaving 200px on the top and bottom of the user's screen feels about right.
31 // Keep the height to at least 500px though (which is the same as the width).
32 // This height is also clamped by the browser window height.
33 return Math.max( document.body.clientHeight - 400, 500 );
36 AuthMessageDialog.prototype.getActionProcess = function ( action ) {
37 // We emit the event immediately, outside the async process, because of iOS Safari, which only
38 // allows window.open() when it occurs immediately in response to a user-initiated event like
39 // 'click', not async.
40 this.emit( action || 'cancel' );
41 // Unlike in normal OOUI windows, none of the actions closes the dialog.
42 // It may be closed from the outside by the module in response to this event.
43 return new OO.ui.Process( () => {} );
46 module.exports = AuthMessageDialog;