feat:完成Collabora初步集成(返回顶部、文档页数获取)

This commit is contained in:
PingChuan
2025-11-25 10:56:47 +08:00
parent 31614374a7
commit 272c3e8dce
14 changed files with 583 additions and 208 deletions
+37
View File
@@ -0,0 +1,37 @@
/**
* Collabora 缩放功能模块
*
* @encoding UTF-8
*/
import { sendUnoCommand } from '../Uno';
/**
* 放大文档(固定步长)
* @param iframeWindow - iframe 的 contentWindow
*/
export function unoZoomPlus(iframeWindow: Window): void {
sendUnoCommand(iframeWindow, '.uno:ZoomPlus', {});
}
/**
* 缩小文档(固定步长)
* @param iframeWindow - iframe 的 contentWindow
*/
export function unoZoomMinus(iframeWindow: Window): void {
sendUnoCommand(iframeWindow, '.uno:ZoomMinus', {});
}
/**
* 设置文档缩放比例
* @param iframeWindow - iframe 的 contentWindow
* @param percentage - 缩放百分比(例如:100 表示 100%)
*/
export function unoSetZoom(iframeWindow: Window, percentage: number): void {
sendUnoCommand(iframeWindow, '.uno:Zoom', {
Zoom: {
type: 'short',
value: percentage,
},
});
}