{"id":265,"date":"2026-04-19T17:49:21","date_gmt":"2026-04-19T09:49:21","guid":{"rendered":"https:\/\/tweakl.com\/?page_id=265"},"modified":"2026-04-19T17:49:22","modified_gmt":"2026-04-19T09:49:22","slug":"%e6%96%87%e4%bb%b6%e5%bf%ab%e4%bc%a0","status":"publish","type":"page","link":"https:\/\/tweakl.com\/index.php\/%e6%96%87%e4%bb%b6%e5%bf%ab%e4%bc%a0\/","title":{"rendered":"\u6587\u4ef6\u5feb\u4f20"},"content":{"rendered":"\n<div class=\"file-sticky-wrap\">\n        <div class=\"file-sticky-tip\">\u8bf7\u767b\u5f55\u540e\u4e0a\u4f20\u3001\u5220\u9664\u6587\u4ef6<\/div>\n    \n    <div class=\"file-sticky-list\">\n            <\/div>\n<\/div>\n\n<style>\n.file-sticky-wrap {\n    max-width: 900px;\n    margin: 30px auto;\n    padding: 0 20px;\n}\n.file-sticky-form {\n    display: flex;\n    gap: 12px;\n    margin-bottom: 24px;\n    align-items: center;\n}\n.file-sticky-input {\n    flex: 1;\n    padding: 10px 14px;\n    border: 1px solid #ddd;\n    border-radius: 8px;\n    background: #fff;\n}\n.file-sticky-btn {\n    padding: 10px 20px;\n    background: linear-gradient(135deg, #e84393, #9b59b6);\n    color: #fff;\n    border: none;\n    border-radius: 8px;\n    cursor: pointer;\n    white-space: nowrap;\n}\n.file-sticky-tip {\n    padding: 12px;\n    background: #f8f9fa;\n    border-radius: 8px;\n    text-align: center;\n    margin-bottom: 24px;\n}\n.file-sticky-list {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));\n    gap: 20px;\n}\n.file-sticky-item {\n    background: #fff;\n    padding: 20px;\n    border-radius: 12px;\n    box-shadow: 0 2px 8px rgba(0,0,0,0.05);\n    display: flex;\n    flex-direction: column;\n    gap: 16px;\n}\n.file-name {\n    font-size: 15px;\n    line-height: 1.5;\n    word-break: break-all;\n}\n.file-actions {\n    display: flex;\n    gap: 8px;\n    margin-top: auto;\n}\n.file-btn-download,\n.file-btn-delete {\n    flex: 1;\n    padding: 6px 10px;\n    border: none;\n    border-radius: 6px;\n    font-size: 13px;\n    cursor: pointer;\n    text-align: center;\n    text-decoration: none;\n}\n.file-btn-download {\n    background: #f1f3f5;\n    color: #333;\n}\n.file-btn-delete {\n    background: #fff1f0;\n    color: #ff4444;\n}\n\n\/* \u6df1\u8272\u6a21\u5f0f\u9002\u914d *\/\n.dark .file-sticky-item {\n    background: #1a1a1a;\n    color: #eee;\n}\n.dark .file-sticky-input {\n    background: #222;\n    border-color: #444;\n    color: #eee;\n}\n<\/style>\n\n<script>\ndocument.addEventListener('DOMContentLoaded', function(){\n    const ajaxUrl = 'https:\/\/tweakl.com\/wp-admin\/admin-ajax.php';\n\n    \/\/ \u4e0a\u4f20\n    const form = document.getElementById('file-sticky-form');\n    if (form) {\n        form.addEventListener('submit', function(e){\n            e.preventDefault();\n            \n            \/\/ \u4fee\u590d\u82f9\u679c\u624b\u673a\u4e0a\u4f20\u65e0\u54cd\u5e94\n            const fileInput = document.getElementById('upload-file');\n            if (!fileInput.files || fileInput.files.length === 0) {\n                alert('\u8bf7\u9009\u62e9\u6587\u4ef6');\n                return;\n            }\n\n            let fd = new FormData(this);\n            fd.append('action', 'upload_file_sticky');\n\n            \/\/ \u4fee\u590d Safari \u517c\u5bb9\u95ee\u9898\n            let xhr = new XMLHttpRequest();\n            xhr.open('POST', ajaxUrl, true);\n            xhr.onload = function() {\n                if (xhr.status >= 200 && xhr.status < 300) {\n                    location.reload();\n                }\n            };\n            xhr.send(fd);\n        });\n    }\n\n    \/\/ \u5220\u9664\n    document.querySelectorAll('.file-btn-delete').forEach(btn => {\n        btn.addEventListener('click', function(){\n            if (!confirm('\u786e\u5b9a\u5220\u9664\uff1f')) return;\n            let id = this.dataset.id;\n            let item = this.closest('.file-sticky-item');\n\n            fetch(ajaxUrl, {\n                method: 'POST',\n                headers: { 'Content-Type': 'application\/x-www-form-urlencoded' },\n                body: 'action=delete_file_sticky&id=' + id\n            }).then(() => item.remove());\n        });\n    });\n});\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-265","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/pages\/265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/comments?post=265"}],"version-history":[{"count":1,"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/pages\/265\/revisions"}],"predecessor-version":[{"id":266,"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/pages\/265\/revisions\/266"}],"wp:attachment":[{"href":"https:\/\/tweakl.com\/index.php\/wp-json\/wp\/v2\/media?parent=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}