Skip to content

Commit

Permalink
2023.03.25
Browse files Browse the repository at this point in the history
  • Loading branch information
lmm214 committed Mar 25, 2023
1 parent 833dfdf commit c14540d
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 54 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Chrome 应用商店:<https://chrome.google.com/webstore/detail/memos-bber/cbhj

## 更新日志

2023.03.25 右键菜单发送文本改为“追加模式”(不刷新已打开页面时);新增多语言支持(en、zh-cn)。

2023.03.19 上传图片重命名精确的秒;打开插件时 focus 输入框(配合右键发送文本到扩展,设置快捷键打开扩展,按下 Ctrl+Enter 记下)。

2023.03.10 修复发布后调用最新一条 Memos。
Expand Down
77 changes: 77 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"extName": {
"message": "Memos"
},
"actionTitle": {
"message": "Send Memos"
},
"extDescription": {
"message": "memos: A lightweight, self-hosted memo hub."
},
"sendTo": {
"message": "SendTo Memos "
},
"saveBtn":{
"message": "Save"
},
"placeApiUrl":{
"message": "Memos Open API Link"
},
"placeContent":{
"message": "Any thoughts..."
},
"lockPrivate":{
"message": "Only visible to you"
},
"lockProtected":{
"message": "Visible to members"
},
"lockPublic":{
"message": "Everyone can see"
},
"submitBtn":{
"message": "Save"
},
"placeHideInput":{
"message": "Default ‘Only visible to you’ Tag name"
},
"placeShowInput":{
"message": "Default ‘Everyone can see’ Tag name"
},
"picDrag":{
"message": "Drag upload the image"
},
"picCancelDrag":{
"message": "Cancel upload"
},
"picUploading":{
"message": "Upload the picture..."
},
"picSuccess":{
"message": "Upload completed"
},
"picFailed":{
"message": "Uploading failed"
},
"searchNow":{
"message": "What your search ?"
},
"archiveSuccess":{
"message": "Archive Success 😊"
},
"archiveFailed":{
"message": "Archive Failed 😭"
},
"getTabFailed":{
"message": "Get Tab Failed 😭"
},
"memoUploading":{
"message": "Sending"
},
"memoSuccess":{
"message": "Success! 😊"
},
"memoFailed":{
"message": "Failed! 😭"
}
}
76 changes: 71 additions & 5 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,80 @@
{
"extName": {
"message": "Memos"
},
"actionTitle": {
"description": "按钮标题",
"message": "发送 Memos"
},
"extDescription": {
"description": "扩展描述",
"message": "一键发送灵感时刻,珍藏你的记忆"
},
"extName": {
"description": "扩展名称",
"message": "Memos-bber"
"sendTo": {
"message": "发送至 Memos "
},
"saveBtn":{
"message": "保存"
},
"placeApiUrl":{
"message": "请填入 Memos Open API 链接"
},
"placeContent":{
"message": "现在的想法是..."
},
"lockPrivate":{
"message": "仅自己可见"
},
"lockProtected":{
"message": "登录用户可见"
},
"lockPublic":{
"message": "所有人可见"
},
"submitBtn":{
"message": "记下"
},
"placeHideInput":{
"message": "默认“仅自己可见”标签名"
},
"placeShowInput":{
"message": "默认“所有人可见”标签名"
},
"picDrag":{
"message": "拖拽到窗口上传该图片"
},
"picCancelDrag":{
"message": "取消上传"
},
"picUploading":{
"message": "图片上传中……"
},
"picSuccess":{
"message": "上传完成"
},
"picFailed":{
"message": "上传图片失败"
},
"saveSuccess":{
"message": "保存信息成功"
},
"searchNow":{
"message": "想搜点啥?"
},
"archiveSuccess":{
"message": "归档成功!😊"
},
"archiveFailed":{
"message": "归档失败 😭"
},
"getTabFailed":{
"message": "获取标签失败 😭"
},
"memoUploading":{
"message": "发送中……"
},
"memoSuccess":{
"message": "发送成功!😊"
},
"memoFailed":{
"message": "发送失败 😭"
}
}
4 changes: 3 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ input::placeholder ,.common-editor-inputer::placeholder {
input:focus::placeholder ,.common-editor-inputer:focus::placeholder {
color: #d3d3d3
}
.title{cursor: pointer;}

.body{
min-width:460px;
background-color: #f6f5f4;
Expand All @@ -31,6 +31,8 @@ input:focus::placeholder ,.common-editor-inputer:focus::placeholder {
}
a{color: #555;}
.title{
width: 100px;
cursor: pointer;
font-size: 1.125rem;
font-weight: 700;
line-height: 2.5rem;
Expand Down
12 changes: 7 additions & 5 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create(
{
type: 'normal',
title: '发送 “%s” 至 Memos ',
title: chrome.i18n.getMessage("sendTo") + '“%s”',
id: 'Memos-send',
contexts: ['all']
},
)
})
chrome.contextMenus.onClicked.addListener(info => {
chrome.storage.sync.set({open_action: "save_text",open_content:info.selectionText});
})
})
let tempCont=''
chrome.contextMenus.onClicked.addListener(info => {
tempCont += info.selectionText + '\n'
chrome.storage.sync.set({open_action: "save_text",open_content:tempCont});
})
14 changes: 14 additions & 0 deletions js/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
document.getElementById("saveKey").textContent = chrome.i18n.getMessage("saveBtn");
document.getElementById("saveTag").textContent = chrome.i18n.getMessage("saveBtn");

document.getElementById("apiUrl").placeholder = chrome.i18n.getMessage("placeApiUrl");
document.getElementById("content").placeholder = chrome.i18n.getMessage("placeContent");

document.getElementById("lockPrivate").textContent = chrome.i18n.getMessage("lockPrivate");
document.getElementById("lockProtected").textContent = chrome.i18n.getMessage("lockProtected");
document.getElementById("lockPublic").textContent = chrome.i18n.getMessage("lockPublic");

document.getElementById("content_submit_text").textContent = chrome.i18n.getMessage("submitBtn");

document.getElementById("hideInput").placeholder = chrome.i18n.getMessage("placeHideInput");
document.getElementById("showInput").placeholder = chrome.i18n.getMessage("placeShowInput");
Loading

0 comments on commit c14540d

Please sign in to comment.