1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-09-16 08:56:40 +02:00

Added more shortcuts and improved existing ones. Fixed bg color issue in status bar.

This commit is contained in:
Laurent Cozic
2017-10-24 22:52:13 +01:00
parent 372b70270d
commit 900aee82f0
6 changed files with 59 additions and 30 deletions

View File

@@ -310,8 +310,8 @@ class AppGui {
action: 'todo toggle $n', action: 'todo toggle $n',
} }
shortcuts['c'] = { shortcuts['tc'] = {
description: _('Toggle console between maximized/minimized/hidden/visible.'), description: _('[t]oggle [c]onsole between maximized/minimized/hidden/visible.'),
action: () => { action: () => {
if (!this.consoleIsShown()) { if (!this.consoleIsShown()) {
this.showConsole(); this.showConsole();
@@ -327,8 +327,8 @@ class AppGui {
canRunAlongOtherCommands: true, canRunAlongOtherCommands: true,
} }
shortcuts['m'] = { shortcuts['tm'] = {
description: _('Toggle note metadata.'), description: _('[t]oggle note [m]etadata.'),
action: () => { action: () => {
this.toggleNoteMetadata(); this.toggleNoteMetadata();
}, },
@@ -375,20 +375,30 @@ class AppGui {
} }
shortcuts['nn'] = { shortcuts['nn'] = {
description: _('Create a new note'), description: _('Create a [n]ew [n]ote'),
action: { type: 'prompt', initialText: 'mknote ""', cursorPosition: -2 }, action: { type: 'prompt', initialText: 'mknote ""', cursorPosition: -2 },
} }
shortcuts['nt'] = { shortcuts['nt'] = {
description: _('Create a new todo'), description: _('Create a [n]ew [t]odo'),
action: { type: 'prompt', initialText: 'mktodo ""', cursorPosition: -2 }, action: { type: 'prompt', initialText: 'mktodo ""', cursorPosition: -2 },
} }
shortcuts['nb'] = { shortcuts['nb'] = {
description: _('Create a new notebook'), description: _('Create a [n]ew [n]otebook'),
action: { type: 'prompt', initialText: 'mkbook ""', cursorPosition: -2 }, action: { type: 'prompt', initialText: 'mkbook ""', cursorPosition: -2 },
} }
shortcuts['cp'] = {
description: _('Copy the note to a notebook.'),
action: { type: 'prompt', initialText: 'cp $n ""', cursorPosition: -2 },
}
shortcuts['mv'] = {
description: _('Move the note to a notebook.'),
action: { type: 'prompt', initialText: 'mv $n ""', cursorPosition: -2 },
}
return shortcuts; return shortcuts;
} }

View File

@@ -8,15 +8,15 @@ import { Note } from 'lib/models/note.js';
class Command extends BaseCommand { class Command extends BaseCommand {
usage() { usage() {
return 'mv <note-pattern> [notebook]'; return 'mv <note> [notebook]';
} }
description() { description() {
return _('Moves the notes matching <note-pattern> to [notebook].'); return _('Moves the notes matching <note> to [notebook].');
} }
async action(args) { async action(args) {
const pattern = args['note-pattern']; const pattern = args['note'];
const destination = args['notebook']; const destination = args['notebook'];
const folder = await Folder.loadByField('title', destination); const folder = await Folder.loadByField('title', destination);

View File

@@ -78,7 +78,7 @@ class StatusBarWidget extends BaseWidget {
this.innerClear(); this.innerClear();
const textStyle = chalk.bgBlueBright.white; const textStyle = this.promptActive ? (s) => s : chalk.bgBlueBright.white;
this.term.drawHLine(this.absoluteInnerX, this.absoluteInnerY, this.innerWidth, textStyle(' ')); this.term.drawHLine(this.absoluteInnerX, this.absoluteInnerY, this.innerWidth, textStyle(' '));
@@ -101,7 +101,6 @@ class StatusBarWidget extends BaseWidget {
cancelable: true, cancelable: true,
history: this.history, history: this.history,
default: this.promptState_.initialText, default: this.promptState_.initialText,
style: this.term.innerStyle.bgBrightBlue.white, // NOTE: Need to use TK style for this as inputField is not compatible with chalk
}; };
if ('cursorPosition' in this.promptState_) options.cursorPosition = this.promptState_.cursorPosition; if ('cursorPosition' in this.promptState_) options.cursorPosition = this.promptState_.cursorPosition;

View File

@@ -33,10 +33,10 @@ msgstr ""
msgid "Set a todo as completed / not completed" msgid "Set a todo as completed / not completed"
msgstr "" msgstr ""
msgid "Toggle console between maximized/minimized/hidden/visible." msgid "[t]oggle [c]onsole between maximized/minimized/hidden/visible."
msgstr "" msgstr ""
msgid "Toggle note metadata." msgid "[t]oggle note [m]etadata."
msgstr "" msgstr ""
msgid "Enter command line mode" msgid "Enter command line mode"
@@ -51,13 +51,19 @@ msgstr ""
msgid "Exit the application." msgid "Exit the application."
msgstr "" msgstr ""
msgid "Create a new note" msgid "Create a [n]ew [n]ote"
msgstr "" msgstr ""
msgid "Create a new todo" msgid "Create a [n]ew [t]odo"
msgstr "" msgstr ""
msgid "Create a new notebook" msgid "Create a [n]ew [n]otebook"
msgstr ""
msgid "Copy the note to a notebook."
msgstr ""
msgid "Move the note to a notebook."
msgstr "" msgstr ""
msgid "Press Ctrl+D or type \"exit\" to exit the application" msgid "Press Ctrl+D or type \"exit\" to exit the application"
@@ -365,7 +371,7 @@ msgstr ""
msgid "Creates a new todo." msgid "Creates a new todo."
msgstr "" msgstr ""
msgid "Moves the notes matching <note-pattern> to [notebook]." msgid "Moves the notes matching <note> to [notebook]."
msgstr "" msgstr ""
msgid "Deletes the given notebook." msgid "Deletes the given notebook."

View File

@@ -35,10 +35,10 @@ msgstr "Veuillez d'abord sélectionner un carnet."
msgid "Set a todo as completed / not completed" msgid "Set a todo as completed / not completed"
msgstr "Tâches non-complétées et récentes" msgstr "Tâches non-complétées et récentes"
msgid "Toggle console between maximized/minimized/hidden/visible." msgid "[t]oggle [c]onsole between maximized/minimized/hidden/visible."
msgstr "" msgstr ""
msgid "Toggle note metadata." msgid "[t]oggle note [m]etadata."
msgstr "" msgstr ""
msgid "Enter command line mode" msgid "Enter command line mode"
@@ -56,17 +56,25 @@ msgid "Exit the application."
msgstr "Quitter le logiciel." msgstr "Quitter le logiciel."
#, fuzzy #, fuzzy
msgid "Create a new note" msgid "Create a [n]ew [n]ote"
msgstr "Créer une note." msgstr "Créer une note."
#, fuzzy #, fuzzy
msgid "Create a new todo" msgid "Create a [n]ew [t]odo"
msgstr "Créer une nouvelle tâche." msgstr "Créer une nouvelle tâche."
#, fuzzy #, fuzzy
msgid "Create a new notebook" msgid "Create a [n]ew [n]otebook"
msgstr "Créer un carnet." msgstr "Créer un carnet."
#, fuzzy
msgid "Copy the note to a notebook."
msgstr "Impossible de copier la note dans le carnet \"%s\""
#, fuzzy
msgid "Move the note to a notebook."
msgstr "Impossible de déplacer la note vers le carnet \"%s\""
msgid "Press Ctrl+D or type \"exit\" to exit the application" msgid "Press Ctrl+D or type \"exit\" to exit the application"
msgstr "" msgstr ""
@@ -406,7 +414,7 @@ msgid "Creates a new todo."
msgstr "Créer une nouvelle tâche." msgstr "Créer une nouvelle tâche."
#, fuzzy #, fuzzy
msgid "Moves the notes matching <note-pattern> to [notebook]." msgid "Moves the notes matching <note> to [notebook]."
msgstr "Supprime les objets correspondants à <motif>." msgstr "Supprime les objets correspondants à <motif>."
#, fuzzy #, fuzzy

View File

@@ -33,10 +33,10 @@ msgstr ""
msgid "Set a todo as completed / not completed" msgid "Set a todo as completed / not completed"
msgstr "" msgstr ""
msgid "Toggle console between maximized/minimized/hidden/visible." msgid "[t]oggle [c]onsole between maximized/minimized/hidden/visible."
msgstr "" msgstr ""
msgid "Toggle note metadata." msgid "[t]oggle note [m]etadata."
msgstr "" msgstr ""
msgid "Enter command line mode" msgid "Enter command line mode"
@@ -51,13 +51,19 @@ msgstr ""
msgid "Exit the application." msgid "Exit the application."
msgstr "" msgstr ""
msgid "Create a new note" msgid "Create a [n]ew [n]ote"
msgstr "" msgstr ""
msgid "Create a new todo" msgid "Create a [n]ew [t]odo"
msgstr "" msgstr ""
msgid "Create a new notebook" msgid "Create a [n]ew [n]otebook"
msgstr ""
msgid "Copy the note to a notebook."
msgstr ""
msgid "Move the note to a notebook."
msgstr "" msgstr ""
msgid "Press Ctrl+D or type \"exit\" to exit the application" msgid "Press Ctrl+D or type \"exit\" to exit the application"
@@ -365,7 +371,7 @@ msgstr ""
msgid "Creates a new todo." msgid "Creates a new todo."
msgstr "" msgstr ""
msgid "Moves the notes matching <note-pattern> to [notebook]." msgid "Moves the notes matching <note> to [notebook]."
msgstr "" msgstr ""
msgid "Deletes the given notebook." msgid "Deletes the given notebook."