login-gate.js 弹窗文案可按页面改(MB_GATE_TITLE / MB_GATE_TEXT)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
box.className = 'mbg-m';
|
||||
box.setAttribute('role', 'dialog');
|
||||
box.setAttribute('aria-modal', 'true');
|
||||
box.innerHTML = '<div class="mbg-c"><h3>登录后才能使用</h3><p>你已退出登录。登录后就能记录、评论和点赞,之前的孕期资料和记录都还在。</p>' +
|
||||
box.innerHTML = '<div class="mbg-c"><h3>' + (window.MB_GATE_TITLE || '登录后才能使用') + '</h3><p>' + (window.MB_GATE_TEXT || '你已退出登录。登录后就能记录、评论和点赞,之前的孕期资料和记录都还在。') + '</p>' +
|
||||
'<div class="mbg-b"><button type="button" class="mbg-x">再看看</button><button type="button" class="mbg-ok">去登录</button></div></div>';
|
||||
box.addEventListener('click', function (e) {
|
||||
if (e.target.closest('.mbg-ok')) { hide(); G.login(); return; }
|
||||
@@ -111,6 +111,7 @@
|
||||
/* 其他应用(数胎动、体重……)引本文件时自己指定:
|
||||
window.MB_GATE_SEL = '.save-btn,.add-record'; 点了要拦的按钮(CSS 选择器)
|
||||
window.MB_GATE_IN = '.note-input'; 一聚焦就提示的输入框
|
||||
window.MB_GATE_TEXT = '登录后就能兑换好物…'; 弹窗正文(可选,标题用 MB_GATE_TITLE)
|
||||
或在自己的提交函数里:if (window.mbGate && mbGate.need()) return; */
|
||||
function selFor(map, cus) { return window[cus] || map[page()] || ''; }
|
||||
document.addEventListener('click', function (e) {
|
||||
|
||||
Reference in New Issue
Block a user