Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 31f2d8b428 | |||
| 5d6dd10dfa | |||
| d0f7b07260 | |||
| 0be768ca8e | |||
| 68ecb16303 | |||
| 82d928f497 |
13
README.md
13
README.md
@@ -141,6 +141,19 @@ xian-favor/
|
||||
|
||||
## 版本历史
|
||||
|
||||
- **v2.3.1** (2026-04-16): 日期放到标题后面,不增加卡片高度
|
||||
- 日期紧跟标题,同一行显示
|
||||
- 格式紧凑:`04-16 11:09→04-16 12:00`
|
||||
- **v2.3.0** (2026-04-16): 卡片显示创建和更新日期
|
||||
- 每个收藏卡片底部显示日期
|
||||
- 格式:04-16 11:09(月-日 时:分)
|
||||
- 有更新时显示:创建 → 更新
|
||||
- 字体更小更淡,不影响卡片高度
|
||||
- **v2.2.0** (2026-04-16): 快捷添加按钮,一键选择类型
|
||||
- 顶部按钮栏分离为4个快捷添加按钮(文本、链接、待办、专栏)
|
||||
- 点击直接进入对应类型的添加弹窗
|
||||
- 弹窗标题显示类型图标和名称
|
||||
- 不再需要下拉选择类型,操作更快捷
|
||||
- **v2.1.0** (2026-04-16): 待办截止时间支持日期+时间
|
||||
- 截止日期改为日期时间选择器
|
||||
- 列表显示友好格式:今天 18:30、明天 09:00 等
|
||||
|
||||
@@ -539,11 +539,11 @@ INDEX_TEMPLATE = '''
|
||||
.content { padding: 20px; }
|
||||
.card { margin-bottom: 8px; transition: transform 0.2s; }
|
||||
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
|
||||
.card-body { padding: 10px 15px; }
|
||||
.card-body { padding: 8px 12px; }
|
||||
.tag { margin-right: 5px; }
|
||||
.item-card { font-size: 14px; }
|
||||
.item-card h6 { font-size: 14px; margin-bottom: 4px; }
|
||||
.item-card p { margin-bottom: 4px; }
|
||||
.item-card h6 { font-size: 14px; margin-bottom: 2px; }
|
||||
.item-card p { margin-bottom: 2px; }
|
||||
.item-card .text-muted.small { font-size: 12px; }
|
||||
.type-text { border-left: 4px solid #17a2b8; }
|
||||
.type-link { border-left: 4px solid #28a745; }
|
||||
@@ -1090,6 +1090,17 @@ INDEX_TEMPLATE = '''
|
||||
<script>
|
||||
const API_BASE = '/api';
|
||||
let currentFilter = { type: '', status: '' };
|
||||
let currentPage = 1;
|
||||
const pageSize = 20;
|
||||
|
||||
// 工具函数 - 必须先定义
|
||||
function debounce(fn, delay) {
|
||||
let timer;
|
||||
return function(...args) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => fn.apply(this, args), delay);
|
||||
};
|
||||
}
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
@@ -1179,6 +1190,9 @@ function renderItems(items) {
|
||||
<h6 class="card-title text-truncate mb-1 ${item.type === 'todo' && item.status === 'completed' ? 'text-muted' : ''}">
|
||||
${getTypeIcon(item.type)} ${item.title || truncate(item.content || item.url, 30)}
|
||||
${item.type === 'todo' && item.status === 'completed' ? ' ✓' : ''}
|
||||
<span style="font-size:10px; opacity:0.5; margin-left:8px;">
|
||||
${formatShortDate(item.created_at)}${item.updated_at && item.updated_at !== item.created_at ? '→' + formatShortDate(item.updated_at) : ''}
|
||||
</span>
|
||||
</h6>
|
||||
<p class="card-text text-muted small mb-0 text-truncate" style="font-size:12px;">
|
||||
${item.url ? truncate(item.url, 50) : item.content ? truncate(item.content, 50) : item.note ? truncate(item.note, 50) : ''}
|
||||
@@ -1628,6 +1642,17 @@ function truncate(str, len) {
|
||||
return str && str.length > len ? str.substring(0, len) + '...' : str || '';
|
||||
}
|
||||
|
||||
// 简短日期格式(用于卡片显示)
|
||||
function formatShortDate(dateStr) {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hour = String(date.getHours()).padStart(2, '0');
|
||||
const min = String(date.getMinutes()).padStart(2, '0');
|
||||
return `${month}-${day} ${hour}:${min}`;
|
||||
}
|
||||
|
||||
function formatDate(dateStr) {
|
||||
return new Date(dateStr).toLocaleString('zh-CN');
|
||||
}
|
||||
@@ -2182,14 +2207,6 @@ async function sendItemEmail() {
|
||||
}
|
||||
}
|
||||
|
||||
function debounce(fn, delay) {
|
||||
let timer;
|
||||
return function(...args) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => fn.apply(this, args), delay);
|
||||
};
|
||||
}
|
||||
|
||||
// ============ 提醒功能 ============
|
||||
|
||||
let reminderData = null;
|
||||
|
||||
Reference in New Issue
Block a user