Plugins: Added copyToClipboard command

This commit is contained in:
Laurent Cozic
2025-05-05 00:29:31 +01:00
parent 302577ed43
commit 067ce65532
4 changed files with 19 additions and 0 deletions
+1
View File
@@ -151,6 +151,7 @@ packages/app-desktop/app.js
packages/app-desktop/bridge.js
packages/app-desktop/checkForUpdates.js
packages/app-desktop/commands/copyDevCommand.js
packages/app-desktop/commands/copyToClipboard.js
packages/app-desktop/commands/editProfileConfig.js
packages/app-desktop/commands/emptyTrash.js
packages/app-desktop/commands/exportDeletionLog.test.js
+1
View File
@@ -125,6 +125,7 @@ packages/app-desktop/app.js
packages/app-desktop/bridge.js
packages/app-desktop/checkForUpdates.js
packages/app-desktop/commands/copyDevCommand.js
packages/app-desktop/commands/copyToClipboard.js
packages/app-desktop/commands/editProfileConfig.js
packages/app-desktop/commands/emptyTrash.js
packages/app-desktop/commands/exportDeletionLog.test.js
@@ -0,0 +1,15 @@
import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
import { clipboard } from 'electron';
export const declaration: CommandDeclaration = {
name: 'copyToClipboard',
};
export const runtime = (): CommandRuntime => {
return {
execute: async (_context, content: string) => {
if (!content || (typeof content !== 'string')) return;
clipboard.writeText(content);
},
};
};
+2
View File
@@ -1,5 +1,6 @@
// AUTO-GENERATED using `gulp buildScriptIndexes`
import * as copyDevCommand from './copyDevCommand';
import * as copyToClipboard from './copyToClipboard';
import * as editProfileConfig from './editProfileConfig';
import * as emptyTrash from './emptyTrash';
import * as exportDeletionLog from './exportDeletionLog';
@@ -24,6 +25,7 @@ import * as toggleTabMovesFocus from './toggleTabMovesFocus';
const index: any[] = [
copyDevCommand,
copyToClipboard,
editProfileConfig,
emptyTrash,
exportDeletionLog,