mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-04-25 03:58:37 +09:00
Add Edge extension and update release workflow
Add a complete Edge extension under edge/ (manifest, popup, CSS, JS, locales, assets, LICENSE) and a change.log. Update README with Edge/mobile notes and simplify content. Update GitHub Actions workflow to read edge/manifest.json version, package Edge builds, and include Edge asset in the release summary (also bump default release_tag). Minor update to firefox/js/oper.js and include .DS_Store change.
This commit is contained in:
+28
-3
@@ -44,6 +44,7 @@ function initProportionalEditorResize() {
|
||||
const nonEditorHeight = Math.max(0, Math.ceil(document.body.scrollHeight - initialRect.height))
|
||||
let maxScale = 1
|
||||
let currentScale = 1
|
||||
let nextScale = 1
|
||||
let dragging = false
|
||||
let dragStartX = 0
|
||||
let dragStartY = 0
|
||||
@@ -54,8 +55,21 @@ function initProportionalEditorResize() {
|
||||
return Math.min(Math.max(scale, 1), maxScale)
|
||||
}
|
||||
|
||||
const showPreviewScale = (scale) => {
|
||||
const previewScale = clampScale(scale)
|
||||
const relativeScale = previewScale / currentScale
|
||||
editor.style.transformOrigin = 'top left'
|
||||
editor.style.transform = `scale(${relativeScale})`
|
||||
}
|
||||
|
||||
const clearPreviewScale = () => {
|
||||
editor.style.transform = ''
|
||||
editor.style.transformOrigin = ''
|
||||
}
|
||||
|
||||
const applyScale = (scale) => {
|
||||
currentScale = clampScale(scale)
|
||||
nextScale = currentScale
|
||||
editor.style.width = `${Math.round(baseW * currentScale)}px`
|
||||
editor.style.height = `${Math.round(baseH * currentScale)}px`
|
||||
}
|
||||
@@ -75,6 +89,7 @@ function initProportionalEditorResize() {
|
||||
}
|
||||
|
||||
const computeMaxScale = () => {
|
||||
if (dragging) return
|
||||
// In popup mode, allow scaling up to Chrome's max popup size.
|
||||
// Do not clamp by current window.innerWidth/innerHeight, otherwise the popup can't grow to the max.
|
||||
const viewportW = 800
|
||||
@@ -94,6 +109,9 @@ function initProportionalEditorResize() {
|
||||
if (!dragging) return
|
||||
dragging = false
|
||||
handle.classList.remove('dragging')
|
||||
clearPreviewScale()
|
||||
applyScale(nextScale)
|
||||
computeMaxScale()
|
||||
persistScale()
|
||||
}
|
||||
|
||||
@@ -103,7 +121,8 @@ function initProportionalEditorResize() {
|
||||
const dy = ev.clientY - dragStartY
|
||||
const widthScale = (baseW * dragStartScale + dx) / baseW
|
||||
const heightScale = (baseH * dragStartScale + dy) / baseH
|
||||
applyScale(Math.max(widthScale, heightScale))
|
||||
nextScale = clampScale(Math.max(widthScale, heightScale))
|
||||
showPreviewScale(nextScale)
|
||||
}
|
||||
|
||||
const startDrag = (ev) => {
|
||||
@@ -112,6 +131,8 @@ function initProportionalEditorResize() {
|
||||
dragStartX = ev.clientX
|
||||
dragStartY = ev.clientY
|
||||
dragStartScale = currentScale
|
||||
nextScale = currentScale
|
||||
showPreviewScale(currentScale)
|
||||
handle.classList.add('dragging')
|
||||
if (typeof handle.setPointerCapture === 'function') {
|
||||
try {
|
||||
@@ -209,6 +230,10 @@ function updateLockNowText(lockType) {
|
||||
}
|
||||
}
|
||||
|
||||
function showRandomList(content) {
|
||||
$('#randomlist').stop(true, true).html(content).show()
|
||||
}
|
||||
|
||||
applyDayjsLocaleByUiLanguage(typeof window.getUiLanguage === 'function' ? window.getUiLanguage() : 'auto')
|
||||
|
||||
if (isFullscreenMode()) {
|
||||
@@ -994,7 +1019,7 @@ $('#search').click(function () {
|
||||
searchDom += '</div>'
|
||||
}
|
||||
window.ViewImage && ViewImage.init('.random-image')
|
||||
$("#randomlist").html(searchDom).slideDown(500);
|
||||
showRandomList(searchDom)
|
||||
hydrateV1PreviewImages(info)
|
||||
}
|
||||
},
|
||||
@@ -1073,7 +1098,7 @@ function randDom(randomData){
|
||||
}
|
||||
randomDom += '</div>'
|
||||
window.ViewImage && ViewImage.init('.random-image')
|
||||
$("#randomlist").html(randomDom).slideDown(500);
|
||||
showRandomList(randomDom)
|
||||
hydrateV1PreviewImages(info)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user