diff --git a/BUILD.md b/BUILD.md index 282e03855..5376788b2 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,8 +1,20 @@ -# Electron application +# General information + +- All the applications share the same library, which, for historical reasons, is in ReactNativeClient/lib. This library is copied to the relevant directories when builing each app. +- The translations are built by running CliClient/build-translation.sh. For this reasons, it's generally better to get the CLI app to build first so that everything is setup correctly. + +## macOS dependencies + + brew install yarn node xgettext + echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile + source ~/.bash_profile + +## Linux and Windows dependencies - Install yarn - https://yarnpkg.com/lang/en/docs/install/ - Install node v8.x (check with `node --version`) - https://nodejs.org/en/ -- Then run these commands: + +# Building the Electron application ``` cd ElectronClient/app @@ -17,10 +29,10 @@ That will create the executable file in the `dist` directory. From `/ElectronClient` you can also run `run.sh` to run the app for testing. -# Mobile application +# Building the Mobile application From `/ReactNativeClient`, run `npm install`, then `react-native run-ios` or `react-native run-android`. -# Terminal application +# Building the Terminal application -From `/CliClient`, run `npm install` then run `run.sh`. If you get an error about `xgettext`, comment out the command `node build-translation.js --silent` in build.sh +From `/CliClient`, run `npm install` then run `run.sh`. If you get an error about `xgettext`, comment out the command `node build-translation.js --silent` in build.sh \ No newline at end of file diff --git a/CliClient/app/app-gui.js b/CliClient/app/app-gui.js index 6276f7bc4..39ec44a8b 100644 --- a/CliClient/app/app-gui.js +++ b/CliClient/app/app-gui.js @@ -321,6 +321,9 @@ class AppGui { action: async () => { if (this.widget('folderList').hasFocus) { const item = this.widget('folderList').selectedJoplinItem; + + if (!item) return; + if (item.type_ === BaseModel.TYPE_FOLDER) { await this.processCommand('rmbook ' + item.id); } else if (item.type_ === BaseModel.TYPE_TAG) { @@ -339,6 +342,10 @@ class AppGui { } }; + shortcuts['BACKSPACE'] = { + alias: 'DELETE', + }; + shortcuts[' '] = { friendlyName: 'SPACE', description: () => _('Set a to-do as completed / not completed'), @@ -765,7 +772,10 @@ class AppGui { // ------------------------------------------------------------------------- const shortcutKey = this.currentShortcutKeys_.join(''); - const cmd = shortcutKey in this.shortcuts_ ? this.shortcuts_[shortcutKey] : null; + let cmd = shortcutKey in this.shortcuts_ ? this.shortcuts_[shortcutKey] : null; + + // If this command is an alias to another command, resolve to the actual command + if (cmd && cmd.alias) cmd = this.shortcuts_[cmd.alias]; let processShortcutKeys = !this.app().currentCommand() && cmd; if (cmd && cmd.canRunAlongOtherCommands) processShortcutKeys = true; diff --git a/CliClient/app/build-translation.js b/CliClient/app/build-translation.js index f8d529cb8..5f878133b 100644 --- a/CliClient/app/build-translation.js +++ b/CliClient/app/build-translation.js @@ -68,8 +68,8 @@ function buildLocale(inputFile, outputFile) { } async function removePoHeaderDate(filePath) { - await execCommand('sed -i -e\'/POT-Creation-Date:/d\' "' + filePath + '"'); - await execCommand('sed -i -e\'/PO-Revision-Date:/d\' "' + filePath + '"'); + await execCommand('sed -i "" -e\'/POT-Creation-Date:/d\' "' + filePath + '"'); + await execCommand('sed -i "" -e\'/PO-Revision-Date:/d\' "' + filePath + '"'); } async function createPotFile(potFilePath, sources) { diff --git a/ElectronClient/app/gui/MainScreen.jsx b/ElectronClient/app/gui/MainScreen.jsx index 6042871e9..bd8e79c1e 100644 --- a/ElectronClient/app/gui/MainScreen.jsx +++ b/ElectronClient/app/gui/MainScreen.jsx @@ -185,7 +185,7 @@ class MainScreenComponent extends React.Component { this.setState({ promptOptions: { - label: _('Set or clear alarm:'), + label: _('Set alarm:'), inputType: 'datetime', buttons: ['ok', 'cancel', 'clear'], value: note.todo_due ? new Date(note.todo_due) : null,