File "jetpack-sso-login.js"

Full path: /home/sbkuplnl/public_html/wp-content/plugins/woocommerce/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js
File size: 0.97 KB (997 B bytes)
MIME-type: text/plain; charset=us-ascii
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

document.addEventListener( 'DOMContentLoaded', () => {
	const body = document.querySelector( 'body' ),
		toggleSSO = document.querySelector( '.jetpack-sso-toggle' ),
		userLogin = document.getElementById( 'user_login' ),
		userPassword = document.getElementById( 'user_pass' ),
		ssoWrap = document.getElementById( 'jetpack-sso-wrap' ),
		loginForm = document.getElementById( 'loginform' ),
		overflow = document.createElement( 'div' );

	overflow.className = 'jetpack-sso-clear';

	loginForm.appendChild( overflow );
	overflow.appendChild( document.querySelector( 'p.forgetmenot' ) );
	overflow.appendChild( document.querySelector( 'p.submit' ) );

	loginForm.appendChild( ssoWrap );
	body.classList.add( 'jetpack-sso-repositioned' );

	toggleSSO.addEventListener( 'click', e => {
		e.preventDefault();
		body.classList.toggle( 'jetpack-sso-form-display' );
		if ( ! body.classList.contains( 'jetpack-sso-form-display' ) ) {
			userLogin.focus();
			userPassword.disabled = false;
		}
	} );
} );