修复页面标题被confirm弹窗代码污染
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,98 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}交易记录
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% block heading %}交易记录
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% block breadcrumb %}开平仓记录
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}交易记录{% endblock %}
|
||||
{% block heading %}交易记录{% endblock %}
|
||||
{% block breadcrumb %}开平仓记录{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{% set view = request.query_params.get('view', '') %}
|
||||
@@ -429,6 +338,10 @@ function hideEditForm() {
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
@@ -438,7 +351,6 @@ function hideEditForm() {
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
@@ -458,4 +370,4 @@ function hideConfirm() {
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user