feat(auth): rebuild the sign-in surfaces on the shared sign-card contract
The login/register page and the auth modal had drifted into a parallel system: floating-input fields, a sign-page-card shell and a bespoke jio-auth-modal wrapper that none of the theme's own sign CSS targeted. The reference card rules (.sign, .sign-img, .sign-content, .line-form-input, .scale-placeholder, .social_loginbar, .title-h-left, #u_sign .modal-dialog, .qrcode-signin-container) have been in main.css all along, so the fix is to render the reference DOM instead of re-styling a second one. auth-content.php now emits one .sign.jio-panel.blur-bg.relative card with a .tab-content of #tab-sign-in / #tab-sign-up / #tab-resetpassword / #tab-qrcode-signin / #tab-bind panes. Each pane opens with a .title-h-left.fa-2x heading plus a .muted-color.px12 link, fields are .relative.line-form.mb10 > .line-form-input + .scale-placeholder + .line-form-line, the verification trigger is the .yztx.abs-right captchsubmit button, and submits are .but.radius.jb-blue|jb-green.padding-lg.btn-block. Social entries come from the shared render_social_buttons() separator + .social_loginbar, and the OAuth bind pane uses the oauth-data-box avatar card. The modal shell is #u_sign.modal > .modal-dialog > .sign-content > .sign-img.absolute.hide-sm + .sign, and the page shell is the reference .container.sign-page > .row.sign-row.gutters-5 > .col-md-6(.col-md-offset-6/ .col-md-offset-3).sign-col with a .fixed.lazyload background and a blurred fixed footer. auth.js drives .in instead of .is-open, toggles the new password/signin-mode/invite-gate controls and no longer touches the retired markup. The page also drops two footer-hook removals that targeted functions which no longer exist, and opts out of the fixed-nav offset. The sign page's custom theme setting now actually applies: Router answers jio_forced_theme_mode, jioData.themeForced wins over the stored cookie in theme.js, theme-toggle positions are suppressed, and the page marks html/body dark or white accordingly. sign.css shrinks from ~114 lines of bespoke component styling to a thin positioning layer, and the retired classes are gone rather than kept. Verification: php -l on every changed PHP file, node --check on both JS files, node --test across widget-system, navigation and front-submit (873 passing), and tools/audit-psr4-paths.php / audit-admin-contracts.php both at 0 errors. assets/js/runtime/main.min.js was rebuilt because theme.js gained the forced theme branch.
This commit is contained in:
1 parent
d40906b4a3
commit
41366e7fc4
15 files changed
+664
-281
No files matched your search
+136
-102
@@ -1,114 +1,148 @@
|
||||
/* Shared authentication contract: modal and /sign/. */
|
||||
.sign {
|
||||
max-width: 330px;
|
||||
margin: auto;
|
||||
padding: 30px 0;
|
||||
color: var(--main-color, #4e5358);
|
||||
/* Authentication surfaces: modal (#u_sign) and the /sign/ page.
|
||||
*
|
||||
* Card, line inputs, tab panes, social bar and title rules come from the shared
|
||||
* theme stylesheet; this file only positions the shells around them.
|
||||
*/
|
||||
#u_sign.jio-auth-modal {
|
||||
z-index: 100050;
|
||||
}
|
||||
|
||||
.sign [hidden] { display: none !important; }
|
||||
.sign button { font: inherit; }
|
||||
.sign-logo { margin-bottom: 24px; text-align: center; }
|
||||
.sign-logo img { max-width: 180px; max-height: 70px; }
|
||||
.sign-logo .sign-logo-dark { display: none; }
|
||||
.dark-theme .sign-logo .sign-logo-light { display: none; }
|
||||
.dark-theme .sign-logo .sign-logo-dark { display: inline-block; }
|
||||
.sign-logo__text { font-size: 22px; font-weight: 700; color: inherit; }
|
||||
.sign-panel { animation: auth-panel-in .24s ease both; }
|
||||
|
||||
@keyframes auth-panel-in {
|
||||
from { opacity: 0; transform: translateY(5px); }
|
||||
to { opacity: 1; transform: none; }
|
||||
#u_sign.jio-auth-modal.in {
|
||||
display: block;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.sign-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 23px; }
|
||||
.sign-header h2 { margin: 0; font-size: 22px; line-height: 1.4; color: var(--key-color, #333); }
|
||||
.sign-header span { font-size: 12px; color: var(--muted-2-color, #999); }
|
||||
.sign-header button,
|
||||
.sign-options button,
|
||||
.sign-mode-switch { padding: 0; border: 0; background: none; color: var(--focus-color, #f04494); cursor: pointer; }
|
||||
.sign-form { display: grid; gap: 17px; }
|
||||
#u_sign.jio-auth-modal .modal-dialog {
|
||||
opacity: 0;
|
||||
transform: translateY(-12px);
|
||||
transition: opacity 0.2s ease, transform 0.25s ease;
|
||||
}
|
||||
|
||||
.floating-input { position: relative; min-height: 42px; border-bottom: 1px solid var(--main-border-color, rgba(50, 50, 50, .12)); }
|
||||
.floating-input::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--focus-color, #f04494); transform: scaleX(0); transition: transform .25s; }
|
||||
.floating-input:focus-within::after { transform: scaleX(1); }
|
||||
.floating-input input { width: 100%; height: 42px; padding: 13px 4px 2px; border: 0; outline: 0; background: transparent; color: inherit; font-size: 14px; box-shadow: none !important; }
|
||||
.floating-input label { position: absolute; top: 12px; left: 4px; color: var(--muted-color, #777); font-size: 14px; font-weight: 400; pointer-events: none; transition: all .18s; }
|
||||
.floating-input input:focus + label,
|
||||
.floating-input input:not(:placeholder-shown) + label,
|
||||
.floating-input.is-filled label { top: 0; font-size: 10px; color: var(--focus-color, #f04494); }
|
||||
.floating-input.has-action input { padding-right: 94px; }
|
||||
.floating-input .password-show,
|
||||
.floating-input .send-code { position: absolute; right: 0; bottom: 6px; z-index: 2; border: 0; background: none; color: var(--muted-2-color, #999); cursor: pointer; }
|
||||
.floating-input .send-code { color: var(--focus-color, #f04494); font-size: 12px; }
|
||||
.floating-input .send-code:disabled { color: var(--muted-2-color, #999); cursor: default; }
|
||||
#u_sign.jio-auth-modal.in .modal-dialog {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.sign-options { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2-color, #999); font-size: 12px; }
|
||||
.sign-options label { margin: 0; font-weight: 400; }
|
||||
.sign-submit { width: 100%; min-height: 42px; padding: 10px 16px; border: 0; border-radius: 5px; color: #fff; cursor: pointer; transition: opacity .2s, transform .2s; }
|
||||
.sign-submit:hover { opacity: .88; transform: translateY(-1px); }
|
||||
.sign-submit:disabled { opacity: .55; cursor: wait; transform: none; }
|
||||
.sign-submit.jb-blue { background: linear-gradient(135deg, #59c3ff, #2b70ff); }
|
||||
.sign-submit.jb-green { background: linear-gradient(135deg, #50e3a4, #16a085); }
|
||||
.sign-mode-switch { justify-self: center; font-size: 12px; }
|
||||
.sign-notice { margin-bottom: 16px; padding: 10px 12px; border-radius: 5px; background: rgba(255, 86, 86, .08); color: #e55353; font-size: 12px; }
|
||||
.sign-hint { margin-top: -10px; color: var(--muted-2-color, #999); font-size: 11px; }
|
||||
.sign-agreement { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--muted-2-color, #999); font-size: 11px; font-weight: 400; }
|
||||
.sign-agreement a { color: var(--focus-color, #f04494); }
|
||||
.sign-agreement-implicit { justify-content: center; text-align: center; }
|
||||
#u_sign .sign-img {
|
||||
inset: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.social-login { margin-top: 24px; text-align: center; }
|
||||
.social-login > span { display: flex; align-items: center; gap: 10px; color: var(--muted-2-color, #999); font-size: 11px; }
|
||||
.social-login > span::before,
|
||||
.social-login > span::after { content: ""; flex: 1; height: 1px; background: var(--main-border-color, rgba(50, 50, 50, .08)); }
|
||||
.social-login-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 13px; margin-top: 14px; }
|
||||
.social-login-item { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50px; background: var(--body-bg-color, #f5f6f7); color: #fff; text-decoration: none; cursor: pointer; }
|
||||
.social-login-item:hover { transform: translateY(-2px); color: var(--focus-color, #f04494); }
|
||||
.oauth-button-lg .social-login-item { width: auto; padding: 0 14px; }
|
||||
.oauth-button-lg .social-login-item i,
|
||||
.oauth-button-lg .social-login-item svg { margin-right: 6px; font-size: 1.2em; }
|
||||
.social-login-item.weibo { background: #ea5d5c; }
|
||||
.social-login-item.weixingzh,
|
||||
.social-login-item.weixin { background: #24b76a; }
|
||||
.social-login-item.qq { background: #1296db; }
|
||||
.social-login-item.github { background: #505050; }
|
||||
.social-login-item.gitee { background: #c2292f; }
|
||||
.social-login-item.google { background: var(--main-shadow, rgba(116, 116, 116, .08)); color: var(--main-color, #4e5358); }
|
||||
.auth-qrcode { display: grid; place-items: center; width: 180px; min-height: 180px; margin: 20px auto; background: #fff; color: #38b766; text-align: center; }
|
||||
.auth-qrcode [data-auth-qr-content] { display: grid; place-items: center; width: 100%; min-height: 180px; }
|
||||
.auth-qrcode i { font-size: 46px; }
|
||||
.auth-qrcode span { color: #777; font-size: 12px; }
|
||||
#u_sign .sign-img img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: var(--main-radius);
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.jio-auth-modal { position: fixed; inset: 0; z-index: 100050; display: none; place-items: center; padding: 18px; }
|
||||
.jio-auth-modal.is-open { display: grid; }
|
||||
.auth-modal-backdrop { position: absolute; inset: 0; background: rgba(14, 18, 24, .62); backdrop-filter: blur(2px); }
|
||||
#u_sign .modal-dialog { position: relative; z-index: 1; width: 400px; max-width: calc(100vw - 30px); margin: 0; }
|
||||
#u_sign.has-sign-img .modal-dialog { width: 800px; }
|
||||
#u_sign .modal-content { position: relative; min-height: 300px; max-height: calc(100vh - 36px); overflow-x: hidden; overflow-y: auto; border: 0; border-radius: 8px; background: var(--main-bg-color, #fff); box-shadow: 0 12px 50px rgba(0, 0, 0, .22); }
|
||||
.auth-modal-close { position: absolute; top: 13px; right: 15px; z-index: 4; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .04); color: var(--muted-color, #777); cursor: pointer; }
|
||||
#u_sign .sign-img { position: absolute; inset: 0 45% 0 0; overflow: hidden; padding: 0; }
|
||||
#u_sign .sign-img img { display: block; width: 100%; height: 100%; border-radius: 8px 0 0 8px; object-fit: cover; }
|
||||
#u_sign .sign-img + .sign { max-width: unset; margin-left: 55%; padding: 34px 44px; }
|
||||
#u_sign .sign > .close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 15px;
|
||||
z-index: 3;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.page-template-user-sign { min-height: 100vh; background: var(--body-bg-color, #f5f6f7); }
|
||||
.sign-page-background { position: fixed; inset: 0; z-index: 0; background-position: center; background-size: cover; }
|
||||
.sign-topbar { position: fixed; top: 0; right: 0; left: 0; z-index: 3; display: flex; justify-content: space-between; padding: 15px 24px; background: rgba(255, 255, 255, .75); backdrop-filter: blur(12px); }
|
||||
.sign-page { position: relative; z-index: 1; display: flex; align-items: center; min-height: 100vh; padding: 76px max(5vw, 20px) 56px; }
|
||||
.sign-page.sign-card-position-left { justify-content: flex-start; }
|
||||
.sign-page.sign-card-position-center { justify-content: center; }
|
||||
.sign-page.sign-card-position-right { justify-content: flex-end; }
|
||||
.sign-page-card { width: 400px; max-width: 100%; padding: 0 35px; border-radius: 8px; background: var(--main-bg-color, #fff); box-shadow: 0 10px 40px rgba(0, 0, 0, .12); }
|
||||
.sign-page-footer { position: fixed; right: 0; bottom: 12px; left: 0; z-index: 2; text-align: center; color: var(--muted-2-color, #999); font-size: 12px; }
|
||||
.white-theme { --main-bg-color: #fff; --body-bg-color: #f5f6f7; --main-color: #4e5358; --key-color: #333; }
|
||||
.dark-theme { --main-bg-color: #24272b; --body-bg-color: #17191c; --main-color: #d7d9dc; --key-color: #fff; --main-border-color: rgba(255, 255, 255, .12); }
|
||||
body.auth-modal-open { overflow: hidden; }
|
||||
body.auth-modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ---- /sign/ page shell ---- */
|
||||
.page-template-user-sign {
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.page-template-user-sign > .fixed {
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.sign-page {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
min-height: 500px;
|
||||
padding-top: 70px;
|
||||
padding-bottom: 60px;
|
||||
}
|
||||
|
||||
.sign-row {
|
||||
min-height: calc(100vh - 130px);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.sign-page .sign {
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.sign-col {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sign-page-footer {
|
||||
top: auto;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.sign .sign-passw {
|
||||
border: 0;
|
||||
background: none;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sign .oauth-data-box .muted-box {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.sign .oauth-data-box .avatar-img {
|
||||
--this-size: 60px;
|
||||
}
|
||||
|
||||
.sign [data-auth-qr-content] {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
min-height: 180px;
|
||||
}
|
||||
|
||||
.sign .qrcode-signin-container button[data-auth-refresh-qr] {
|
||||
border: 0;
|
||||
background: none;
|
||||
padding: 10px;
|
||||
color: var(--focus-color);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sign [data-invite-feedback].is-error {
|
||||
color: #ff5473;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
#u_sign .modal-dialog,
|
||||
#u_sign.has-sign-img .modal-dialog {
|
||||
width: auto;
|
||||
margin: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
#u_sign .modal-dialog,
|
||||
#u_sign.has-sign-img .modal-dialog { width: 400px; }
|
||||
#u_sign .sign-img { display: none; }
|
||||
#u_sign .sign-img + .sign { max-width: 340px; margin-left: auto; padding: 30px 0; }
|
||||
#u_sign .modal-content { padding: 0 24px; }
|
||||
.sign-page { justify-content: center !important; padding-right: 14px; padding-left: 14px; }
|
||||
.sign-page-card { padding: 0 24px; }
|
||||
.sign-page {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.sign-row {
|
||||
min-height: calc(100vh - 110px);
|
||||
}
|
||||
|
||||
.sign-page .sign {
|
||||
width: 340px;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
+58
-26
@@ -156,7 +156,7 @@
|
||||
function isRootActive(root) {
|
||||
if (!root || root.dataset.activeTab !== 'oauth' || document.visibilityState !== 'visible') return false;
|
||||
if (root.dataset.surface !== 'modal') return document.documentElement.contains(root);
|
||||
return !!modal && modal.classList.contains('is-open') && modal.contains(root);
|
||||
return !!modal && modal.classList.contains('in') && modal.contains(root);
|
||||
}
|
||||
|
||||
function stopQr(root) {
|
||||
@@ -329,6 +329,8 @@
|
||||
root.querySelectorAll('[data-auth-panel]').forEach(function (item) {
|
||||
var active = item === panel;
|
||||
item.hidden = !active;
|
||||
item.classList.toggle('active', active);
|
||||
item.classList.toggle('in', active);
|
||||
item.setAttribute('aria-hidden', active ? 'false' : 'true');
|
||||
});
|
||||
root.querySelectorAll('[data-auth-tab]').forEach(function (item) {
|
||||
@@ -340,8 +342,12 @@
|
||||
url.searchParams.set('tab', tab);
|
||||
window.history.replaceState({}, '', url.toString());
|
||||
}
|
||||
var focus = panel.querySelector('input:not([type="hidden"]), button, a[href], [tabindex]:not([tabindex="-1"])');
|
||||
if (focus) window.setTimeout(function () { focus.focus(); }, 30);
|
||||
// Only prompt for input on a real user switch; the initial boot should not
|
||||
// steal focus (and scroll) on the modal or the full page.
|
||||
if (updateUrl) {
|
||||
var focus = panel.querySelector('input:not([type="hidden"]), button, a[href], [tabindex]:not([tabindex="-1"])');
|
||||
if (focus) window.setTimeout(function () { focus.focus(); }, 30);
|
||||
}
|
||||
if (tab === 'oauth') loadQr(root, false);
|
||||
}
|
||||
|
||||
@@ -369,11 +375,13 @@
|
||||
}
|
||||
|
||||
function setBusy(form, busy) {
|
||||
var button = form.querySelector('.sign-submit');
|
||||
var button = form.querySelector('button[type="submit"]');
|
||||
if (!button) return;
|
||||
button.disabled = busy;
|
||||
var spinner = button.querySelector('.fa-spinner');
|
||||
if (spinner) spinner.hidden = !busy;
|
||||
var label = button.querySelector('[data-submit-label]');
|
||||
if (label) label.hidden = busy;
|
||||
}
|
||||
|
||||
function startCountdown(button, seconds) {
|
||||
@@ -483,14 +491,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
function toggleLoginMode(root, button) {
|
||||
var password = root.querySelector('[data-auth-password-fields]');
|
||||
var code = root.querySelector('[data-auth-code-fields]');
|
||||
if (!password || !code) return;
|
||||
var showCode = code.hidden;
|
||||
code.hidden = !showCode;
|
||||
password.hidden = showCode;
|
||||
button.textContent = showCode ? '使用账号密码登录' : '使用验证码登录';
|
||||
function switchSigninMode(root, mode) {
|
||||
root.querySelectorAll('[data-signin-panel]').forEach(function (panel) {
|
||||
var active = panel.dataset.signinPanel === mode;
|
||||
panel.hidden = !active;
|
||||
panel.classList.toggle('active', active);
|
||||
panel.classList.toggle('in', active);
|
||||
});
|
||||
}
|
||||
|
||||
function setOAuthRedirect(root, redirect) {
|
||||
@@ -538,9 +545,6 @@
|
||||
}
|
||||
|
||||
function initRoot(root) {
|
||||
root.querySelectorAll('input').forEach(function (input) {
|
||||
if (!input.hasAttribute('placeholder')) input.setAttribute('placeholder', ' ');
|
||||
});
|
||||
root.querySelectorAll('form').forEach(function (form) { form.noValidate = true; });
|
||||
root.querySelectorAll('[data-auth-tab]').forEach(function (tab) {
|
||||
tab.setAttribute('role', 'tab');
|
||||
@@ -556,7 +560,7 @@
|
||||
var initial = root.dataset.initialTab || 'signin';
|
||||
if (initial === 'oauth' && window.matchMedia && window.matchMedia('(max-width: 767px)').matches) initial = 'signin';
|
||||
var mayActivateQr = initial !== 'oauth' || document.visibilityState === 'visible';
|
||||
if (root.dataset.surface === 'modal' && (!modal || !modal.classList.contains('is-open'))) mayActivateQr = false;
|
||||
if (root.dataset.surface === 'modal' && (!modal || !modal.classList.contains('in'))) mayActivateQr = false;
|
||||
if (!mayActivateQr) initial = 'signin';
|
||||
activate(root, initial, false);
|
||||
root.addEventListener('click', function (event) {
|
||||
@@ -568,12 +572,15 @@
|
||||
}
|
||||
var password = event.target.closest('[data-password-show]');
|
||||
if (password) {
|
||||
var input = password.closest('.floating-input').querySelector('input');
|
||||
var field = password.closest('.line-form') || password.parentElement;
|
||||
var input = field ? field.querySelector('input') : null;
|
||||
if (!input) return;
|
||||
var visible = input.type === 'password';
|
||||
input.type = visible ? 'text' : 'password';
|
||||
password.setAttribute('aria-label', visible ? '隐藏密码' : '显示密码');
|
||||
password.setAttribute('aria-pressed', visible ? 'true' : 'false');
|
||||
password.querySelector('i').className = visible ? 'fa fas fa-eye-slash' : 'fa fas fa-eye';
|
||||
var glyph = password.querySelector('i');
|
||||
if (glyph) glyph.className = visible ? 'fa fas fa-eye-slash' : 'fa fas fa-eye';
|
||||
return;
|
||||
}
|
||||
var send = event.target.closest('[data-send-code]');
|
||||
@@ -582,10 +589,33 @@
|
||||
sendCode(send);
|
||||
return;
|
||||
}
|
||||
var mode = event.target.closest('[data-login-mode]');
|
||||
var mode = event.target.closest('[data-signin-mode]');
|
||||
if (mode) {
|
||||
event.preventDefault();
|
||||
toggleLoginMode(root, mode);
|
||||
switchSigninMode(root, mode.dataset.signinMode);
|
||||
return;
|
||||
}
|
||||
var inviteGate = event.target.closest('[data-invite-gate]');
|
||||
if (inviteGate) {
|
||||
event.preventDefault();
|
||||
var gateInput = root.querySelector('[data-invite-gate-input]');
|
||||
var gatePanel = root.querySelector('[data-invite-gate-panel]');
|
||||
var formPanel = root.querySelector('[data-invite-form-panel]');
|
||||
if (!gateInput || !formPanel) return;
|
||||
var code = gateInput.value.trim();
|
||||
if (!code) {
|
||||
gateInput.setAttribute('aria-invalid', 'true');
|
||||
notify('请输入邀请码', 'warning');
|
||||
return;
|
||||
}
|
||||
gateInput.setAttribute('aria-invalid', 'false');
|
||||
var hiddenInvite = formPanel.querySelector('[data-invite-value]');
|
||||
if (hiddenInvite) hiddenInvite.value = code;
|
||||
if (gatePanel) { gatePanel.hidden = true; gatePanel.classList.remove('active', 'in'); }
|
||||
formPanel.hidden = false;
|
||||
formPanel.classList.add('active', 'in');
|
||||
var focus = formPanel.querySelector('input:not([type="hidden"])');
|
||||
if (focus) window.setTimeout(function () { focus.focus(); }, 30);
|
||||
return;
|
||||
}
|
||||
var refreshQr = event.target.closest('[data-auth-refresh-qr]');
|
||||
@@ -639,9 +669,10 @@
|
||||
return;
|
||||
}
|
||||
lastModalTrigger = trigger || document.activeElement;
|
||||
modal.classList.add('is-open');
|
||||
modal.style.display = 'block';
|
||||
modal.classList.add('in');
|
||||
modal.setAttribute('aria-hidden', 'false');
|
||||
document.body.classList.add('auth-modal-open');
|
||||
document.body.classList.add('auth-modal-open', 'modal-open');
|
||||
var root = modal.querySelector('[data-jio-auth]');
|
||||
if (root) {
|
||||
var targetRedirect = redirect || window.location.href;
|
||||
@@ -654,12 +685,13 @@
|
||||
}
|
||||
|
||||
function closeModal(storeDismissal) {
|
||||
if (!modal || !modal.classList.contains('is-open')) return;
|
||||
if (!modal || !modal.classList.contains('in')) return;
|
||||
var root = modal.querySelector('[data-jio-auth]');
|
||||
if (root) stopQr(root);
|
||||
modal.classList.remove('is-open');
|
||||
modal.classList.remove('in');
|
||||
modal.style.display = '';
|
||||
modal.setAttribute('aria-hidden', 'true');
|
||||
document.body.classList.remove('auth-modal-open');
|
||||
document.body.classList.remove('auth-modal-open', 'modal-open');
|
||||
if (storeDismissal && Number(modal.dataset.autoExpires) > 0) {
|
||||
var until = Date.now() + Number(modal.dataset.autoExpires) * 3600000;
|
||||
window.localStorage.setItem('jioAuthAutoUntil', String(until));
|
||||
@@ -670,7 +702,7 @@
|
||||
}
|
||||
|
||||
function handleModalKeydown(event) {
|
||||
if (!modal || !modal.classList.contains('is-open')) return;
|
||||
if (!modal || !modal.classList.contains('in')) return;
|
||||
if (event.key === 'Escape') {
|
||||
event.preventDefault();
|
||||
closeModal(true);
|
||||
|
||||
@@ -165,9 +165,14 @@
|
||||
if (themeInitialized) return;
|
||||
themeInitialized = true;
|
||||
|
||||
var forced = window.jioData && window.jioData.themeForced;
|
||||
var stored = getStoredTheme();
|
||||
var configuredMode = (window.jioData && window.jioData.themeMode) || "light";
|
||||
if (stored === "dark" || stored === "light") {
|
||||
if (forced === "dark" || forced === "light") {
|
||||
// A surface can pin the theme (the sign page's custom theme mode); a
|
||||
// stored preference must not override it.
|
||||
applyTheme(forced);
|
||||
} else if (stored === "dark" || stored === "light") {
|
||||
applyTheme(stored);
|
||||
} else {
|
||||
applyTheme(resolveConfiguredTheme(configuredMode));
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"jio-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("jio-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.JioModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.jioData||window2.jio||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/jio/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["CoLine truncated
|
||||
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"jio-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("jio-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.JioModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.jioData||window2.jio||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/jio/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["CoLine truncated
|
||||
Reference in new issue
Block a user