You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-24 23:26:50 +02:00
@ -309,40 +309,4 @@ export default class CommandService extends BaseService {
|
||||
const command = this.commandByName(commandName, { mustExist: false });
|
||||
return !!command;
|
||||
}
|
||||
|
||||
public static isEditorCommand(commandName: string) {
|
||||
return (commandName.indexOf('editor.') === 0 ||
|
||||
// These commands are grandfathered in, but in the future
|
||||
// all editor commands should start with "editor."
|
||||
commandName === 'insertText' ||
|
||||
commandName === 'scrollToHash' ||
|
||||
commandName === 'textCopy' ||
|
||||
commandName === 'textCut' ||
|
||||
commandName === 'textPaste' ||
|
||||
commandName === 'textSelectAll' ||
|
||||
commandName === 'textBold' ||
|
||||
commandName === 'textItalic' ||
|
||||
commandName === 'textLink' ||
|
||||
commandName === 'textCode' ||
|
||||
commandName === 'attachFile' ||
|
||||
commandName === 'textNumberedList' ||
|
||||
commandName === 'textBulletedList' ||
|
||||
commandName === 'textCheckbox' ||
|
||||
commandName === 'textHeading' ||
|
||||
commandName === 'textHorizontalRule' ||
|
||||
commandName === 'insertDateTime' ||
|
||||
commandName === 'selectedText' ||
|
||||
commandName === 'replaceSelection'
|
||||
);
|
||||
}
|
||||
|
||||
public editorCommandDeclarations(): CommandDeclaration[] {
|
||||
const output = [];
|
||||
|
||||
for (const name in this.commands_) {
|
||||
if (CommandService.isEditorCommand(name)) { output.push(this.commands_[name].declaration); }
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user