()
| 2018 | |
| 2019 | // 显示历史记录弹窗 |
| 2020 | function showHistoryDialog() { |
| 2021 | if (!currentNoteId) { |
| 2022 | alert('请先选择一篇笔记'); |
| 2023 | return; |
| 2024 | } |
| 2025 | |
| 2026 | const map = readJSON(LS_KEYS.notes, {}); |
| 2027 | const list = map[currentCategoryId] || []; |
| 2028 | const note = list.find(n => n.id === currentNoteId); |
| 2029 | |
| 2030 | if (!note) { |
| 2031 | alert('找不到当前笔记'); |
| 2032 | return; |
| 2033 | } |
| 2034 | |
| 2035 | // 创建历史记录弹窗 |
| 2036 | const historyModal = createElement('div', { |
| 2037 | className: 'nsn-history-modal', |
| 2038 | style: { |
| 2039 | position: 'fixed', |
| 2040 | inset: '0', |
| 2041 | background: 'rgba(0,0,0,0.5)', |
| 2042 | zIndex: '999999999', |
| 2043 | display: 'flex', |
| 2044 | alignItems: 'center', |
| 2045 | justifyContent: 'center' |
| 2046 | } |
| 2047 | }); |
| 2048 | |
| 2049 | const modalContent = createElement('div', { |
| 2050 | className: 'nsn-history-modal-content', |
| 2051 | style: { |
| 2052 | background: '#fff', |
| 2053 | borderRadius: '12px', |
| 2054 | padding: '20px', |
| 2055 | maxWidth: '90vw', |
| 2056 | width: '800px', |
| 2057 | maxHeight: '80vh', |
| 2058 | boxShadow: '0 8px 32px rgba(0,0,0,0.3)', |
| 2059 | display: 'flex', |
| 2060 | flexDirection: 'column' |
| 2061 | } |
| 2062 | }); |
| 2063 | |
| 2064 | // 标题 |
| 2065 | const title = createElement('div', { |
| 2066 | style: { |
| 2067 | fontSize: '18px', |
| 2068 | fontWeight: '600', |
| 2069 | color: '#333', |
| 2070 | marginBottom: '16px', |
| 2071 | textAlign: 'center', |
| 2072 | borderBottom: '1px solid #e5e7eb', |
| 2073 | paddingBottom: '12px' |
| 2074 | } |
| 2075 | }, [`笔记历史记录 - ${note.title || '未命名'}`]); |
| 2076 | |
| 2077 | // 历史记录列表容器 |
nothing calls this directly
no test coverage detected