Skip to content

Commit

Permalink
separator
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC committed Sep 19, 2024
1 parent 361973d commit eb81057
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions app/src/menus/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export class MenuItem {
if (options.disabled) {
this.element.setAttribute("disabled", "disabled");
}
if (options.id) {
this.element.setAttribute("data-id", options.id);
}
if (options.type === "separator") {
this.element.classList.add("b3-menu__separator");
return;
Expand All @@ -207,9 +210,6 @@ export class MenuItem {
}
});
}
if (options.id) {
this.element.setAttribute("data-id", options.id);
}
if (options.type === "readonly") {
this.element.classList.add("b3-menu__item--readonly");
}
Expand Down
32 changes: 16 additions & 16 deletions app/src/protyle/gutter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ export class Gutter {
}
}).element);

window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator1", type: "separator"}).element);
const appearanceElement = new MenuItem({
label: window.siyuan.languages.appearance,
icon: "iconFont",
Expand Down Expand Up @@ -813,7 +813,7 @@ export class Gutter {
this.genWidths(selectsElement, protyle);
// this.genHeights(selectsElement, protyle);
if (!window.siyuan.config.readonly) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator2", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "quickMakeCard",
label: window.siyuan.languages.quickMakeCard,
Expand Down Expand Up @@ -1276,7 +1276,7 @@ export class Gutter {
}).element);
}
if (type === "NodeSuperBlock" && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator3", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "superBlock",
label: window.siyuan.languages.cancel + " " + window.siyuan.languages.superBlock,
Expand All @@ -1288,7 +1288,7 @@ export class Gutter {
}
}).element);
} else if (type === "NodeCodeBlock" && !protyle.disabled && !nodeElement.getAttribute("data-subtype")) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator4", type: "separator"}).element);
const linewrap = nodeElement.getAttribute("linewrap");
const ligatures = nodeElement.getAttribute("ligatures");
const linenumber = nodeElement.getAttribute("linenumber");
Expand Down Expand Up @@ -1361,7 +1361,7 @@ export class Gutter {
}]
}).element);
} else if (type === "NodeCodeBlock" && !protyle.disabled && ["echarts", "mindmap"].includes(nodeElement.getAttribute("data-subtype"))) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator5", type: "separator"}).element);
const height = (nodeElement as HTMLElement).style.height;
let html = nodeElement.outerHTML;
window.siyuan.menus.menu.append(new MenuItem({
Expand Down Expand Up @@ -1401,7 +1401,7 @@ export class Gutter {
}
const cellElement = hasClosestByMatchTag(range.startContainer, "TD") || hasClosestByMatchTag(range.startContainer, "TH");
if (cellElement) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator6", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "table",
type: "submenu",
Expand All @@ -1411,7 +1411,7 @@ export class Gutter {
}).element);
}
} else if (type === "NodeAttributeView" && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator7", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "exportCSV",
icon: "iconDatabase",
Expand All @@ -1426,7 +1426,7 @@ export class Gutter {
}
}).element);
} else if ((type === "NodeVideo" || type === "NodeAudio") && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator8", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "assetSubMenu",
type: "submenu",
Expand All @@ -1435,7 +1435,7 @@ export class Gutter {
submenu: videoMenu(protyle, nodeElement, type)
}).element);
} else if (type === "NodeIFrame" && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator9", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "assetSubMenu",
type: "submenu",
Expand All @@ -1444,7 +1444,7 @@ export class Gutter {
submenu: iframeMenu(protyle, nodeElement)
}).element);
} else if (type === "NodeHTMLBlock" && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator10", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "HTML",
icon: "iconHTML5",
Expand All @@ -1454,7 +1454,7 @@ export class Gutter {
}
}).element);
} else if (type === "NodeBlockQueryEmbed" && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator11", type: "separator"}).element);
const breadcrumb = nodeElement.getAttribute("breadcrumb");
window.siyuan.menus.menu.append(new MenuItem({
id: "assetSubMenu",
Expand Down Expand Up @@ -1517,7 +1517,7 @@ export class Gutter {
}]
}).element);
} else if (type === "NodeHeading" && !protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator12", type: "separator"}).element);
const headingSubMenu = [];
if (subType !== "h1") {
headingSubMenu.push(this.genHeadingTransform(protyle, id, 1));
Expand Down Expand Up @@ -1600,7 +1600,7 @@ export class Gutter {
}
}).element);
}
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator13", type: "separator"}).element);
if (!protyle.options.backlinkData) {
window.siyuan.menus.menu.append(new MenuItem({
id: "enter",
Expand Down Expand Up @@ -1675,7 +1675,7 @@ export class Gutter {
}
}).element);

window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator14", type: "separator"}).element);

if (type !== "NodeThematicBreak") {
window.siyuan.menus.menu.append(new MenuItem({
Expand Down Expand Up @@ -1729,7 +1729,7 @@ export class Gutter {
this.genWidths([nodeElement], protyle);
// this.genHeights([nodeElement], protyle);
}
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator15", type: "separator"}).element);
if (!["NodeThematicBreak", "NodeBlockQueryEmbed", "NodeIFrame", "NodeHTMLBlock", "NodeWidget", "NodeVideo", "NodeAudio"].includes(type) &&
getContenteditableElement(nodeElement)?.textContent.trim() !== "" &&
(type !== "NodeCodeBlock" || (type === "NodeCodeBlock" && !nodeElement.getAttribute("data-subtype")))) {
Expand Down Expand Up @@ -1763,7 +1763,7 @@ export class Gutter {
makeCard(protyle.app, [id]);
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator16", type: "separator"}).element);
}

if (protyle?.app?.plugins) {
Expand Down

0 comments on commit eb81057

Please sign in to comment.