Vanessa 2022-09-27 23:36:07 +08:00
parent aa29fc044b
commit 3adf0d6d63
7 changed files with 42 additions and 1 deletions

View file

@ -1,4 +1,6 @@
{
"copyHeadings": "Copy Headings and Bottom Blocks",
"tWithSubtitle":"Transformation with subtitles",
"clear": "Clear",
"autoDownloadUpdatePkg": "Automatically download update installation package",
"autoDownloadUpdatePkgTip": "After enabling, it will automatically check the version update every two hours. If there is an updated version, it will automatically download the installation package and prompt for installation",

View file

@ -1,4 +1,6 @@
{
"copyHeadings": "Copiar encabezados y bloques inferiores",
"tWithSubtitle": "Transformación con subtítulos",
"clear": "claro",
"autoDownloadUpdatePkg": "Descargar automáticamente el paquete de instalación de actualizaciones",
"autoDownloadUpdatePkgTip": "Después de abrir, verificará automáticamente la actualización de la versión cada dos horas. Si hay una versión actualizada, descargará automáticamente el paquete de instalación y solicitará la instalación",

View file

@ -1,4 +1,6 @@
{
"copyHeadings": "Copier les en-têtes et les blocs inférieurs",
"tWithSubtitle": "Transformation avec sous-titres",
"clear": "Effacer",
"autoDownloadUpdatePkg": "Télécharger automatiquement le package d'installation de la mise à jour",
"autoDownloadUpdatePkgTip": "Après l'ouverture, il vérifiera automatiquement la mise à jour de la version toutes les deux heures. S'il existe une version mise à jour, il téléchargera automatiquement le package d'installation et demandera l'installation",

View file

@ -1,4 +1,6 @@
{
"copyHeadings": "複製標題及下方塊",
"tWithSubtitle": "帶子標題轉換",
"clear": "清空",
"autoDownloadUpdatePkg": "自動下載更新安裝包",
"autoDownloadUpdatePkgTip": "開啟後會每隔兩小時自動檢查版本更新,如果有更新版本則自動下載安裝包並提示安裝",

View file

@ -1,4 +1,6 @@
{
"copyHeadings": "复制标题及下方块",
"tWithSubtitle": "带子标题转换",
"clear": "清空",
"autoDownloadUpdatePkg": "自动下载更新安装包",
"autoDownloadUpdatePkgTip": "开启后会每隔两小时自动检查版本更新,如果有更新版本则自动下载安装包并提示安装",

View file

@ -1171,6 +1171,33 @@ export class Gutter {
}
}]
}).element);
} else if (type === "NodeHeading" && !window.siyuan.config.readonly) {
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
const headingSubMenu = [];
if (subType !== "h1") {
headingSubMenu.push({
icon: "iconHeading1",
label: window.siyuan.languages.heading1,
click() {
protyle.toolbar.showRender(protyle, nodeElement);
}
})
}
window.siyuan.menus.menu.append(new MenuItem({
type: "submenu",
icon: "iconRefresh",
label: window.siyuan.languages.tWithSubtitle,
submenu: headingSubMenu
}).element);
window.siyuan.menus.menu.append(new MenuItem({
icon: "iconCopy",
label: window.siyuan.languages.copyHeadings,
click() {
fetchPost("/api/block/getHeadingChildrenDOM", {id: nodeElement.getAttribute("data-node-id")}, (response) => {
writeText(response.data + Constants.ZWSP);
})
}
}).element);
}
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
@ -1188,7 +1215,7 @@ export class Gutter {
const ids = protyle.path.split("/");
if (ids.length > 2) {
/// #if MOBILE
openMobileFileById(ids[ids.length - 2],[Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]);
openMobileFileById(ids[ids.length - 2], [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]);
/// #else
openFileById({
id: ids[ids.length - 2],

View file

@ -109,6 +109,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
files = event.dataTransfer.items;
}
}
// 复制标题及其下方块使用 writeText需将 textPLain 转换为 textHTML
if (textPlain.endsWith(Constants.ZWSP) && !textHTML) {
textHTML = textPlain
}
/// #if !MOBILE
if (!textHTML && !textPlain && ("clipboardData" in event)) {
if ("darwin" === window.siyuan.config.system.os) {