From 12b6902a492cc335581010b79f7fc63bcf8f3877 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 30 Oct 2017 21:29:36 +0000 Subject: [PATCH] Fixed RN text field and gave different OneDrive token to demo --- CliClient/app/app.js | 6 +++++ CliClient/app/onedrive-api-node-utils.js | 2 +- CliClient/package-lock.json | 2 +- CliClient/package.json | 2 +- CliClient/publish.sh | 1 + CliClientDemo/index.js | 2 +- CliClientDemo/package-lock.json | 24 +++++++++---------- CliClientDemo/package.json | 4 ++-- README.md | 2 +- .../lib/components/screens/note.js | 4 ++++ ReactNativeClient/lib/models/setting.js | 15 ++++++------ ReactNativeClient/lib/parameters.js | 14 ++++++++++- joplin.sublime-project | 5 ++-- 13 files changed, 54 insertions(+), 29 deletions(-) diff --git a/CliClient/app/app.js b/CliClient/app/app.js index 3ce70c3343..7576bb4107 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -177,6 +177,12 @@ class Application { continue; } + if (arg == '--is-demo') { + Setting.setConstant('isDemo', true); + argv.splice(0, 1); + continue; + } + if (arg == '--update-geolocation-disabled') { Note.updateGeolocationEnabled_ = false; argv.splice(0, 1); diff --git a/CliClient/app/onedrive-api-node-utils.js b/CliClient/app/onedrive-api-node-utils.js index ed22868907..29f0bb85cf 100644 --- a/CliClient/app/onedrive-api-node-utils.js +++ b/CliClient/app/onedrive-api-node-utils.js @@ -43,7 +43,7 @@ class OneDriveApiNodeUtils { this.api().setAuth(null); - const port = await netUtils.findAvailablePort(this.possibleOAuthDancePorts()); + const port = await netUtils.findAvailablePort(this.possibleOAuthDancePorts(), 0); if (!port) throw new Error(_('All potential ports are in use - please report the issue at %s', 'https://github.com/laurent22/joplin')); let authCodeUrl = this.api().authCodeUrl('http://localhost:' + port); diff --git a/CliClient/package-lock.json b/CliClient/package-lock.json index 0425d2a508..8121d15b72 100644 --- a/CliClient/package-lock.json +++ b/CliClient/package-lock.json @@ -1,6 +1,6 @@ { "name": "joplin", - "version": "0.10.61", + "version": "0.10.63", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/CliClient/package.json b/CliClient/package.json index 2b1c24afc2..0aaf3b9a1a 100644 --- a/CliClient/package.json +++ b/CliClient/package.json @@ -18,7 +18,7 @@ ], "owner": "Laurent Cozic" }, - "version": "0.10.61", + "version": "0.10.63", "bin": { "joplin": "./main.js" }, diff --git a/CliClient/publish.sh b/CliClient/publish.sh index 5fb1449518..4fb7d0673f 100755 --- a/CliClient/publish.sh +++ b/CliClient/publish.sh @@ -2,6 +2,7 @@ set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR" npm version patch #$SCRIPT_DIR/update-package-md5.sh touch "$SCRIPT_DIR/app/main.js" diff --git a/CliClientDemo/index.js b/CliClientDemo/index.js index 9114e71aa6..2bccfac51c 100644 --- a/CliClientDemo/index.js +++ b/CliClientDemo/index.js @@ -24,7 +24,7 @@ const opt = { stdio: [process.stdin, process.stdout, process.stderr] }; -const app = spawn(joplinPath, ['--profile', profileDir], opt); +const app = spawn(joplinPath, ['--is-demo', '--profile', profileDir], opt); app.on('close', (code) => { process.exit(code); diff --git a/CliClientDemo/package-lock.json b/CliClientDemo/package-lock.json index 48d373f8d3..301c406de6 100644 --- a/CliClientDemo/package-lock.json +++ b/CliClientDemo/package-lock.json @@ -1,6 +1,6 @@ { "name": "demo-joplin", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -577,9 +577,9 @@ } }, "joplin": { - "version": "0.10.58", - "resolved": "https://registry.npmjs.org/joplin/-/joplin-0.10.58.tgz", - "integrity": "sha512-4GPW+XMtX3Nol3llNBejn8xiVRpgMdWlzonY89GCeIJIFuIYzG3KZjoCz2ihY2c2oKl3nrfbR+I1GJmo2bJGTg==", + "version": "0.10.63", + "resolved": "https://registry.npmjs.org/joplin/-/joplin-0.10.63.tgz", + "integrity": "sha512-4he0I31I/PDWmw8gPNmlsPqCwHJfe+7jqOCKXYSMjhbm90Nxe/kPv96pog3FMLYPaCOXGu57LQlboD2szh+DkA==", "requires": { "app-module-path": "2.2.0", "babel-plugin-transform-runtime": "6.23.0", @@ -610,7 +610,7 @@ "string-to-stream": "1.1.0", "strip-ansi": "4.0.0", "tcp-port-used": "0.1.2", - "tkwidgets": "0.5.16", + "tkwidgets": "0.5.19", "uuid": "3.1.0", "word-wrap": "1.2.3", "yargs-parser": "7.0.0" @@ -1848,9 +1848,9 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, "string-kit": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/string-kit/-/string-kit-0.6.2.tgz", - "integrity": "sha512-cKHH+s3kZHaoIwxM1BzhPY2fcYa/rNubUkMKyrOjNjrDgroGPyJDLflTYRRXhx6orfdOi0M2sYsuBa80oedeLA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/string-kit/-/string-kit-0.6.3.tgz", + "integrity": "sha512-G2T92klsuE+S9mqdKQyWurFweNQV5X+FRzSKTqYHRdaVUN/4dL6urbYJJ+xb9ep/4XWm+4RNT8j3acncNhFRBg==", "requires": { "xregexp": "3.2.0" } @@ -1955,7 +1955,7 @@ "get-pixels": "3.3.0", "ndarray": "1.0.18", "nextgen-events": "0.10.2", - "string-kit": "0.6.2", + "string-kit": "0.6.3", "tree-kit": "0.5.26" } }, @@ -1965,9 +1965,9 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "tkwidgets": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/tkwidgets/-/tkwidgets-0.5.16.tgz", - "integrity": "sha512-rXZF92F90FjXggpnag4XADzZvHfsfiRNERQ8jAPM17qCVeZX93Tv7MgYZRNSWS+cwYRhKsY0vpHbnhVcxucjmw==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/tkwidgets/-/tkwidgets-0.5.19.tgz", + "integrity": "sha512-Etskz52RInmmB1aGD9cIodIZ33Gwf0yPP3+lh6ceANgS4N8LpquQajDRyahjZnvwDhfYdo1N87eEKzXBJbLQDg==", "requires": { "chalk": "2.3.0", "node-emoji": "git+https://github.com/laurent22/node-emoji.git#9fa01eac463e94dde1316ef8c53089eeef4973b5", diff --git a/CliClientDemo/package.json b/CliClientDemo/package.json index 11b049bf7b..0bfedbf1a2 100644 --- a/CliClientDemo/package.json +++ b/CliClientDemo/package.json @@ -1,6 +1,6 @@ { "name": "demo-joplin", - "version": "1.0.3", + "version": "1.0.4", "description": "Demo for Joplin CLI", "bin": { "demo-joplin": "./index.js" @@ -25,7 +25,7 @@ }, "dependencies": { "fs-extra": "^4.0.2", - "joplin": "^0.10.58" + "joplin": "^0.10.63" }, "author": "Laurent Cozic", "license": "MIT" diff --git a/README.md b/README.md index cb11ca352c..c724bbad45 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Notes exported from Evernote via .enex files [can be imported](#importing-notes- The notes can be [synchronised](#synchronisation) with various targets including the file system (for example with a network directory) or with Microsoft OneDrive. When synchronising the notes, notebooks, tags and other metadata are saved to plain text files which can be easily inspected, backed up and moved around. -The application is still under development but is out of Beta and should be suitable for every day use. +The application is still under development but is out of Beta and should be suitable for every day use. The UI of the terminal client is built on top of the great [terminal-kit](https://github.com/cronvel/terminal-kit) library, and the Android client front end is done using [React Native](https://facebook.github.io/react-native/). ![Joplin Terminal Screenshot](https://github.com/laurent22/joplin/blob/master/docs/images/ScreenshotTerminal.png) diff --git a/ReactNativeClient/lib/components/screens/note.js b/ReactNativeClient/lib/components/screens/note.js index 8db05e74a2..74cb23d608 100644 --- a/ReactNativeClient/lib/components/screens/note.js +++ b/ReactNativeClient/lib/components/screens/note.js @@ -427,6 +427,9 @@ class NoteScreenComponent extends BaseScreenComponent { bodyComponent = { onCheckboxChange(newBody) }}/> } else { const focusBody = !isNew && !!note.title; + + // Note: blurOnSubmit is necessary to get multiline to work. + // See https://github.com/facebook/react-native/issues/12717#issuecomment-327001997 bodyComponent = ( this.body_changeText(text)} + blurOnSubmit={false} /> ); } diff --git a/ReactNativeClient/lib/models/setting.js b/ReactNativeClient/lib/models/setting.js index a1de6315e4..e99d744a3a 100644 --- a/ReactNativeClient/lib/models/setting.js +++ b/ReactNativeClient/lib/models/setting.js @@ -376,13 +376,14 @@ Setting.metadata_ = { // Contains constants that are set by the application and // cannot be modified by the user: Setting.constants_ = { - 'env': 'SET_ME', - 'appName': 'joplin', - 'appId': 'SET_ME', // Each app should set this identifier - 'appType': 'SET_ME', // 'cli' or 'mobile' - 'resourceDir': '', - 'profileDir': '', - 'tempDir': '', + env: 'SET_ME', + isDemo: false, + appName: 'joplin', + appId: 'SET_ME', // Each app should set this identifier + appType: 'SET_ME', // 'cli' or 'mobile' + resourceDir: '', + profileDir: '', + tempDir: '', } export { Setting }; \ No newline at end of file diff --git a/ReactNativeClient/lib/parameters.js b/ReactNativeClient/lib/parameters.js index e4f85775e3..0ceaabfcfe 100644 --- a/ReactNativeClient/lib/parameters.js +++ b/ReactNativeClient/lib/parameters.js @@ -7,6 +7,10 @@ parameters_.dev = { id: 'cbabb902-d276-4ea4-aa88-062a5889d6dc', secret: 'YSvrgQMqw9NzVqgiLfuEky1', }, + oneDriveDemo: { + id: '606fd4d7-4dfb-4310-b8b7-a47d96aa22b6', + secret: 'qabchuPYL7931$ePDEQ3~_$', + }, }; parameters_.prod = { @@ -14,10 +18,18 @@ parameters_.prod = { id: 'e09fc0de-c958-424f-83a2-e56a721d331b', secret: 'JA3cwsqSGHFtjMwd5XoF5L5', }, + oneDriveDemo: { + id: '606fd4d7-4dfb-4310-b8b7-a47d96aa22b6', + secret: 'qabchuPYL7931$ePDEQ3~_$', + }, }; function parameters() { - return parameters_[Setting.value('env')]; + let output = parameters_[Setting.value('env')]; + if (Setting.value('isDemo')) { + output.oneDrive = output.oneDriveDemo; + } + return output; } export { parameters } \ No newline at end of file diff --git a/joplin.sublime-project b/joplin.sublime-project index 03d5cd99f9..365362801d 100755 --- a/joplin.sublime-project +++ b/joplin.sublime-project @@ -32,9 +32,10 @@ "ReactNativeClient/android/.gradle", "ReactNativeClient/android/local.properties", "ReactNativeClient/ios", - "src/node_modules", + "node_modules", "_vieux", - "tests/logs" + "tests/logs", + "_mydocs/mdtest/Pages/Countries", ], "path": "." },