还没有组件
还没有图片
还没有音乐
还没有便签
还没有文件
还没有组件
还没有图片
还没有音乐
还没有便签
还没有文件
'; } return `
`; } // 没有默认内容:显示占位 return `
`; } return `
`; }).join(''); } function renderImages() { const grid = document.getElementById('grid-image'); const empty = document.getElementById('empty-image'); const imgs = filterByCat(store.image, 'image'); if (!imgs.length) { grid.innerHTML=''; empty.style.display='block'; return; } empty.style.display = 'none'; grid.innerHTML = imgs.map(img => `
`).join(''); } function renderMusic() { const grid = document.getElementById('grid-music'); const empty = document.getElementById('empty-music'); const songs = filterByCat(store.music, 'music'); if (!songs.length) { grid.innerHTML=''; empty.style.display='block'; return; } empty.style.display = 'none'; grid.innerHTML = songs.map(s => `
`).join(''); } function renderNotes() { const grid = document.getElementById('grid-note'); const empty = document.getElementById('empty-note'); const notes = filterByCat(store.note, 'note'); if (!notes.length) { grid.innerHTML=''; empty.style.display='block'; return; } empty.style.display = 'none'; grid.innerHTML = notes.map(n => `
`).join(''); } function renderFiles() { const list = document.getElementById('list-file'); const empty = document.getElementById('empty-file'); const files = filterByCat(store.file, 'file'); if (!files.length) { list.innerHTML=''; empty.style.display='block'; return; } empty.style.display = 'none'; list.innerHTML = files.map(f => `
`).join(''); } function fileIcon(name) { const ext = name.split('.').pop().toLowerCase(); const map = { pdf:'📄', doc:'📝', docx:'📝', xls:'📊', xlsx:'📊', ppt:'🪧', pptx:'🪧', txt:'📃', json:'📋', png:'🖼', jpg:'🖼', jpeg:'🖼', gif:'🖼', mp3:'🎵', mp4:'🎬', zip:'📦', rar:'📦' }; return map[ext] || '📎'; } function openWidgetDetail(id) { const w = store.widget.find(x => x.id === id); if (!w) return; currentDetail = { type: 'widget', id }; showingCode = false; document.getElementById('dw-title').textContent = w.name; document.getElementById('dw-sub').textContent = '.' + w.tag; document.getElementById('dw-frame').srcdoc = wrap(w.code); document.getElementById('dw-code').value = w.code; document.getElementById('dw-frame').style.display = 'block'; document.getElementById('dw-code').style.display = 'none'; openDetail('detail-widget'); } function toggleWidgetCode() { showingCode = !showingCode; document.getElementById('dw-frame').style.display = showingCode ? 'none' : 'block'; document.getElementById('dw-code').style.display = showingCode ? 'block' : 'none'; } function openRegexDetail(id) { const r = store.regex.find(x => x.id === id); if (!r) return; currentDetail = { type: 'regex', id }; document.getElementById('drx-title').textContent = r.name; document.getElementById('drx-sub').textContent = r.pattern.substring(0, 80) + (r.pattern.length > 80 ? '…' : ''); const input = r.defaultContent || ''; document.getElementById('rx-content-input').value = input; document.getElementById('drx-frame').srcdoc = (input.trim() && r.replace) ? applyRegex(r, input) : ''; openDetail('detail-regex'); } function applyRegex(r, input) { try { const regex = new RegExp(r.pattern, r.flags || 'gs'); return input.replace(regex, function() { const groups = Array.from(arguments); return r.replace.replace(/\$(\d+)/g, (_, n) => groups[+n] !== undefined ? groups[+n] : ''); }); } catch(e) { return `