- feat:新增附件列表管理和增加按钮提示

Introduce an upload attachments panel with styles, localization and client-side management. Added new i18n keys (EN/ZH) and refactored js/i18n.js to helper setters for text/placeholder/title. popup.html and css/main.css add the upload-list UI and styles. oper.js implements rendering, drag-and-drop reorder, deletion (calls DELETE api with token), storage persistence (resourceIdList), escapeHtml sanitization, and sync change handling; it also fixes a config check (repo -> apiTokens), stores filename from upload responses, handles attachments/resources compatibility, and clears the list after sending a memo. Overall this enables reorderable, deletable uploaded attachments with proper localization and tooltips.
This commit is contained in:
jonny
2026-03-04 21:18:03 +08:00
parent dd2609e1e4
commit 59700dce59
6 changed files with 384 additions and 30 deletions
+54 -9
View File
@@ -14,39 +14,54 @@
"sendLinkTo": {
"message": "Send link to Memos"
},
"sendImageTo": {
"message": "Send image to Memos"
},
"saveBtn":{
"message": "Save"
},
"placeApiUrl":{
"message": "Memos Self Home Url"
"message": "Memos site URL"
},
"placeApiTokens":{
"message": "Memos Access Tokens"
},
"placeContent":{
"message": "Any thoughts..."
"message": "What's on your mind..."
},
"lockPrivate":{
"message": "Only visible to you"
"message": "Private"
},
"lockProtected":{
"message": "Visible to members"
"message": "Protected"
},
"lockPublic":{
"message": "Everyone can see"
"message": "Public"
},
"submitBtn":{
"message": "Save"
},
"placeHideInput":{
"message": "Default 'Only visible to you' Tag name"
"message": "Default 'Private' tag name"
},
"placeShowInput":{
"message": "Default 'Everyone can see' Tag name"
},
"uploadedListTitle": {
"message": "Uploaded files, Drag to reorder"
},
"uploadedListEmpty": {
"message": "No uploaded files"
},
"tipReorder": {
"message": "Drag to reorder"
},
"tipDeleteAttachment": {
"message": "Delete"
},
"attachmentDeleteSuccess": {
"message": "Deleted"
},
"attachmentDeleteFailed": {
"message": "Delete failed 😭"
},
"picDrag":{
"message": "Drag upload the image"
},
@@ -94,5 +109,35 @@
},
"invalidToken":{
"message": "Invalid token or url 😭"
},
"tipOpenSite": {
"message": "Open Memos"
},
"tipSettings": {
"message": "Settings"
},
"tipTags": {
"message": "Insert tag"
},
"tipTodo": {
"message": "Insert todo"
},
"tipUpload": {
"message": "Upload file"
},
"tipLink": {
"message": "Insert current tab link"
},
"tipRandom": {
"message": "Random memo"
},
"tipSearch": {
"message": "Search"
},
"tipVisibility": {
"message": "Visibility"
},
"tipSend": {
"message": "Send (Ctrl/⌘+Enter)"
}
}