6 Commits

Author SHA1 Message Date
jonny f05581f88a Adjust body min-width
Reduced minimum width for the body class and removed media query styles for mobile responsiveness.
2026-03-22 23:25:50 +08:00
jonny d237a7f1c6 Bump manifest version and add mobile portrait note
Update manifest.json version to 2026.03.22 and add a README changelog entry (20260322) noting adaptation for mobile portrait windows.
2026-03-22 20:48:23 +08:00
jonny 13cc7659ea Add responsive styles for small portrait screens
Introduce a media query for max-width:480px, portrait, touch-only devices to improve layout on small screens. Adjustments include removing body min-width, enabling wrapping and spacing for .common-tools-wrapper, forcing .common-tools-container and .btns-container to full width with flexible sizing, adding bottom margin for .mr-5 elements, and increasing minimum dimensions for #content_submit_text to improve tap targets and prevent overflow.
2026-03-22 20:45:15 +08:00
jonny e9730b5839 Lower minimum supported Memos to v0.15.0
Update compatibility range to include Memos v0.15.0 across README and locale files (en, ja, ko, zh_CN). Bump manifest version/date to 2026.03.12 and update version_name to reflect the new supported range. This extends backward compatibility to older Memos releases.
2026-03-12 18:35:06 +08:00
jonny f2f1ff2c10 Bump manifest version and update changelog
Update manifest.json to version 2026.03.11 and set version_name to "Supports 0.18.0 - 0.26.x". Also add a README changelog entry for 2026-03-10 noting remembered drag window size and removal of drag window animation. This prepares a small release update and documents the recent UI tweak.
2026-03-09 20:07:57 +08:00
jonny 5fac00b5ce - feat:记忆拖拽窗口大小和优化动画效果
Add persistent, robust scaling for the proportional editor and remove CSS transitions that interfered with instant restores. Introduces a storageKey, parseScale, applyScaleInstant and logic to restore scale synchronously from localStorage (for immediate UX) and asynchronously from chrome.storage.sync (best-effort), keeping localStorage in sync. Ensures pending RAF updates are flushed before persisting and guards against missing APIs or invalid values. Also removes transition properties in main.css so scale restores remain immediate and predictable.
2026-03-09 20:00:42 +08:00
8 changed files with 83 additions and 12 deletions
+3 -1
View File
@@ -5,8 +5,10 @@ Chrome 应用商店:<https://chrome.google.com/webstore/detail/memos-bber/cbhj
一个通过浏览器插件发布 [Memos](https://usememos.com/) 的插件。基于 iSpeak-bber 修改,原作者为 [DreamyTZK](https://www.antmoe.com/)。
## 更新日志
- 20260322 适配移动端竖屏窗口
- 20260310 记忆拖拽窗口大小,移除拖拽窗口动画
- 20260309 右键发送选中文本保持原格式,增加全屏和窗口放大功能
### 20260308 向前兼容到0.18.0,可能再往前也行,只测试到0.18.0
### 20260308 向前兼容到0.15.0,可能再往前也行,只测试到0.15.0
- 20260307 增加语言切换按钮以及韩语和日语支持,
- 2026年03月06日 右键菜单发送选中文本附带原文链接
- 2026年03月05日 向前兼容到0.24.0,可能再往前也行,因为只测试了0.24.0和0.25.0以及当前最新版本,如有更早版本需求,可issue反馈
+1 -1
View File
@@ -21,7 +21,7 @@
"message": "Save"
},
"supportedMemosVersion": {
"message": "Compatible with Memos v0.18.0 - 0.26.x"
"message": "Compatible with Memos v0.15.0 - 0.26.x"
},
"placeApiUrl":{
"message": "Memos site URL"
+1 -1
View File
@@ -21,7 +21,7 @@
"message": "保存"
},
"supportedMemosVersion": {
"message": "Memos v0.18.0 - 0.26.x に対応"
"message": "Memos v0.15.0 - 0.26.x に対応"
},
"placeApiUrl": {
"message": "Memos サイトURL"
+1 -1
View File
@@ -21,7 +21,7 @@
"message": "저장"
},
"supportedMemosVersion": {
"message": "Memos v0.18.0 - 0.26.x 호환"
"message": "Memos v0.15.0 - 0.26.x 호환"
},
"placeApiUrl": {
"message": "Memos 사이트 URL"
+1 -1
View File
@@ -21,7 +21,7 @@
"message": "保存"
},
"supportedMemosVersion": {
"message": "兼容 Memos v0.18.0 - 0.26.x"
"message": "兼容 Memos v0.15.0 - 0.26.x"
},
"placeApiUrl":{
"message": "请填入 Memos 主页网址"
+2 -4
View File
@@ -20,7 +20,7 @@ input:focus::placeholder ,.common-editor-inputer:focus::placeholder {
}
.body{
min-width:460px;
min-width:360px;
background-color: #f6f5f4;
padding:0 1rem 1rem;
font-family: eafont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,STHeiti,WenQuanYi Micro Hei,Helvetica,Arial,sans-serif;
@@ -29,6 +29,7 @@ input:focus::placeholder ,.common-editor-inputer:focus::placeholder {
line-height: 1.5;
position: relative;
}
a{color: #555;}
.title{
width: 100px;
@@ -44,9 +45,6 @@ a{color: #555;}
background-color: rgb(255,255,255);
margin-top:0.8rem;
padding: 0.6rem;
transition-property: all;
transition-timing-function: cubic-bezier(.4,0,.2,1);
transition-duration: .15s;
}
.memo-editor{
position: relative;
+71
View File
@@ -39,6 +39,8 @@ function initProportionalEditorResize() {
editor.style.minWidth = `${baseW}px`
editor.style.minHeight = `${baseH}px`
const storageKey = 'popupEditorScale'
let maxScale = 1
const computeMaxScale = () => {
// In popup mode, allow scaling up to Chrome's max popup size.
@@ -69,6 +71,15 @@ function initProportionalEditorResize() {
let rafId = 0
let pendingScale = null
const parseScale = (raw) => {
const s = typeof raw === 'number' && Number.isFinite(raw)
? raw
: typeof raw === 'string' && raw.trim() !== '' && !Number.isNaN(Number(raw))
? Number(raw)
: 1
return s > 0 ? s : 1
}
const readCurrentScale = () => {
const w = parseFloat(editor.style.width || '')
const h = parseFloat(editor.style.height || '')
@@ -83,6 +94,47 @@ function initProportionalEditorResize() {
editor.style.height = `${Math.round(baseH * s)}px`
}
const applyScaleInstant = (scale) => {
// In case CSS transitions exist (or get reintroduced), keep restores immediate.
const prevTransition = editor.style.transition
editor.style.transition = 'none'
applyScale(scale)
window.requestAnimationFrame(function () {
editor.style.transition = prevTransition
})
}
// Restore previously saved scale synchronously (localStorage) first.
// This makes the popup *feel* synchronous because it can apply before async chrome.storage returns.
let restoredFromLocal = false
let localScale = 1
try {
const raw = window.localStorage ? window.localStorage.getItem(storageKey) : null
const s = parseScale(raw)
if (s && s !== 1) {
localScale = s
restoredFromLocal = true
applyScaleInstant(s)
}
} catch (_) {
// ignore
}
// Restore from chrome.storage.sync (best-effort) and keep localStorage in sync.
try {
chrome.storage.sync.get({ [storageKey]: 1 }, function (items) {
const raw = items ? items[storageKey] : 1
const s = parseScale(raw)
const shouldApply = !restoredFromLocal || Math.abs(s - localScale) > 1e-6
if (shouldApply) applyScaleInstant(s)
try {
if (window.localStorage) window.localStorage.setItem(storageKey, String(s))
} catch (_) {}
})
} catch (_) {
// ignore
}
const scheduleApply = () => {
if (rafId) return
rafId = window.requestAnimationFrame(() => {
@@ -122,6 +174,25 @@ function initProportionalEditorResize() {
const endDrag = () => {
dragging = false
// Flush any pending RAF update before persisting.
if (pendingScale != null) {
applyScale(pendingScale)
pendingScale = null
}
// Persist current scale (best-effort).
try {
const s = readCurrentScale()
if (typeof s === 'number' && Number.isFinite(s)) {
try {
if (window.localStorage) window.localStorage.setItem(storageKey, String(s))
} catch (_) {}
chrome.storage.sync.set({ [storageKey]: s })
}
} catch (_) {
// ignore
}
}
handle.addEventListener('pointerup', endDrag)
+2 -2
View File
@@ -2,8 +2,8 @@
"manifest_version": 3,
"name": "__MSG_extName__",
"default_locale": "en",
"version": "2026.03.10",
"version_name": "Supports 0.18.0 to the latest version",
"version": "2026.03.22",
"version_name": "Supports 0.15.0 - 0.26.x",
"action": {
"default_popup": "popup.html",
"default_icon": "assets/logo_24x24.png",