+
+ X_OAUTH2_authWindow = X_Window( {
+ 'url' : X_URL_create( pair[ 'authorizeEndpoint' ],
+ {
+ 'response_type' : 'code',
+ 'client_id' : pair[ 'clientID' ],
+ 'redirect_uri' : pair[ 'redirectURI' ],
+ 'scope' : ( pair[ 'scopes' ] || [] ).join( ' ' )
+ }
+ ),
+ 'name' : 'oauthauthorize',
+ 'params' : 'width=' + w
+ + ',height=' + h
+ + ',left=' + ( screen.width - w ) / 2
+ + ',top=' + ( screen.height - h ) / 2
+ + ',menubar=no,toolbar=no'
+ } )[ 'listen' ]( X_EVENT_UNLOAD, this, X_OAuth2_detectAuthPopup );