|
|
@ -1,24 +1,22 @@
|
|
|
|
import $ from 'jquery';
|
|
|
|
import $ from 'jquery';
|
|
|
|
import {hideElem, showElem} from '../utils/dom.js';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function initUserAuthOauth2() {
|
|
|
|
export function initUserAuthOauth2() {
|
|
|
|
const $oauth2LoginNav = $('#oauth2-login-navigator');
|
|
|
|
const outer = document.getElementById('oauth2-login-navigator');
|
|
|
|
if ($oauth2LoginNav.length === 0) return;
|
|
|
|
if (!outer) return;
|
|
|
|
|
|
|
|
const inner = document.getElementById('oauth2-login-navigator-inner');
|
|
|
|
$oauth2LoginNav.find('.oauth-login-image').on('click', () => {
|
|
|
|
|
|
|
|
const oauthLoader = $('#oauth2-login-loader');
|
|
|
|
for (const link of outer.querySelectorAll('.oauth-login-link')) {
|
|
|
|
const oauthNav = $('#oauth2-login-navigator');
|
|
|
|
link.addEventListener('click', () => {
|
|
|
|
|
|
|
|
inner.classList.add('gt-invisible');
|
|
|
|
hideElem(oauthNav);
|
|
|
|
outer.classList.add('is-loading');
|
|
|
|
oauthLoader.removeClass('disabled');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
// recover previous content to let user try again
|
|
|
|
// recover previous content to let user try again
|
|
|
|
// usually redirection will be performed before this action
|
|
|
|
// usually redirection will be performed before this action
|
|
|
|
oauthLoader.addClass('disabled');
|
|
|
|
outer.classList.remove('is-loading');
|
|
|
|
showElem(oauthNav);
|
|
|
|
inner.classList.remove('gt-invisible');
|
|
|
|
}, 5000);
|
|
|
|
}, 5000);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function initUserAuthLinkAccountView() {
|
|
|
|
export function initUserAuthLinkAccountView() {
|
|
|
|