Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@ const settings = [
type: "string",
default: "0em"
},
{
key: "DisableInlineCopyButton",
title: "Don't show inline copy code cutton",
description:
"Check this box if you don't want copy code button next to inline code.",
default: false,
type: "boolean",
enumPicker: "checkbox",
},
{
key: "AlwaysShowInlineCopyButton",
title: "Always show inline copy code button?",
description: "Check the box if you would like the copy code button to always show next to inline code. If unchecked, the copy code button will only appear when hovering over the inline code.",
default: false,
defaul "Check the box if you would like the copy code button to always show next to inline code. If unchecked, the copy code button will only appear when hovering over the inline code. Note: This option is obsolete when DisableInlineCopyButton is checked.",
t: false,
type: "boolean",
enumPicker: "checkbox"
}
Expand Down Expand Up @@ -61,10 +70,15 @@ const main = async () => {
for (const code of code_mirror) {
insertCopyCodeButton_CodeBlock();
}
// after exiting edit mode, insert the copy copy button next to inline code
const inline_code_text = added_node.querySelectorAll(".content :not(pre) > code");
for (const text of inline_code_text) {
insertCopyCodeButton_InlineCode();

if (!logseq.settings.DisableInlineCopyButton) {
// after exiting edit mode, insert the copy copy button next to inline code
const inline_code_text = added_node.querySelectorAll(
".content :not(pre) > code",
);
for (const text of inline_code_text) {
insertCopyCodeButton_InlineCode();
}
}
}
}
Expand Down