1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Merge branch 'master' of github.com:laurent22/joplin

This commit is contained in:
Laurent Cozic
2018-02-15 18:19:11 +00:00
7 changed files with 36 additions and 38 deletions

View File

@@ -992,7 +992,6 @@ describe('Synchronizer', function() {
it('should create remote items with UTF-8 content', asyncTest(async () => { it('should create remote items with UTF-8 content', asyncTest(async () => {
let folder = await Folder.save({ title: "Fahrräder" }); let folder = await Folder.save({ title: "Fahrräder" });
await Note.save({ title: "Fahrräder", body: "Fahrräder", parent_id: folder.id }); await Note.save({ title: "Fahrräder", body: "Fahrräder", parent_id: folder.id });
let all = await allItems(); let all = await allItems();
await synchronizer().start(); await synchronizer().start();

View File

@@ -51,12 +51,12 @@ SyncTargetRegistry.addClass(SyncTargetFilesystem);
SyncTargetRegistry.addClass(SyncTargetOneDrive); SyncTargetRegistry.addClass(SyncTargetOneDrive);
SyncTargetRegistry.addClass(SyncTargetNextcloud); SyncTargetRegistry.addClass(SyncTargetNextcloud);
const syncTargetId_ = SyncTargetRegistry.nameToId('nextcloud'); //const syncTargetId_ = SyncTargetRegistry.nameToId('nextcloud');
//const syncTargetId_ = SyncTargetRegistry.nameToId('memory'); const syncTargetId_ = SyncTargetRegistry.nameToId('memory');
//const syncTargetId_ = SyncTargetRegistry.nameToId('filesystem'); //const syncTargetId_ = SyncTargetRegistry.nameToId('filesystem');
const syncDir = __dirname + '/../tests/sync'; const syncDir = __dirname + '/../tests/sync';
const sleepTime = syncTargetId_ == SyncTargetRegistry.nameToId('filesystem') ? 1001 : 10;//400; const sleepTime = syncTargetId_ == SyncTargetRegistry.nameToId('filesystem') ? 1001 : 1;//400;
console.info('Testing with sync target: ' + SyncTargetRegistry.idToName(syncTargetId_)); console.info('Testing with sync target: ' + SyncTargetRegistry.idToName(syncTargetId_));
@@ -75,6 +75,8 @@ BaseItem.loadClass('MasterKey', MasterKey);
Setting.setConstant('appId', 'net.cozic.joplin-cli'); Setting.setConstant('appId', 'net.cozic.joplin-cli');
Setting.setConstant('appType', 'cli'); Setting.setConstant('appType', 'cli');
Setting.autoSaveEnabled = false;
function syncTargetId() { function syncTargetId() {
return syncTargetId_; return syncTargetId_;
} }

View File

@@ -18,15 +18,15 @@ Three types of applications are available: for the **desktop** (Windows, macOS a
Operating System | Download Operating System | Download
-----------------|-------- -----------------|--------
Windows | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.62/Joplin-Setup-1.0.62.exe'><img alt='Get it on Windows' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeWindows.png'/></a> Windows | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.63/Joplin-Setup-1.0.63.exe'><img alt='Get it on Windows' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeWindows.png'/></a>
macOS | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.62/Joplin-1.0.62.dmg'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeMacOS.png'/></a> macOS | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.63/Joplin-1.0.63.dmg'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeMacOS.png'/></a>
Linux | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.62/Joplin-1.0.62-x86_64.AppImage'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeLinux.png'/></a> Linux | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.63/Joplin-1.0.63-x86_64.AppImage'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeLinux.png'/></a>
## Mobile applications ## Mobile applications
Operating System | Download | Alt. Download Operating System | Download | Alt. Download
-----------------|----------|---------------- -----------------|----------|----------------
Android | <a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeAndroid.png'/></a> | or [Download APK File](https://github.com/laurent22/joplin-android/releases/download/android-v1.0.95/joplin-v1.0.95.apk) Android | <a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeAndroid.png'/></a> | or [Download APK File](https://github.com/laurent22/joplin-android/releases/download/android-v1.0.97/joplin-v1.0.97.apk)
iOS | <a href='https://itunes.apple.com/us/app/joplin/id1315599797'><img alt='Get it on the App Store' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeIOS.png'/></a> | - iOS | <a href='https://itunes.apple.com/us/app/joplin/id1315599797'><img alt='Get it on the App Store' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeIOS.png'/></a> | -
## Terminal application ## Terminal application

View File

@@ -90,8 +90,8 @@ android {
applicationId "net.cozic.joplin" applicationId "net.cozic.joplin"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 2097273 versionCode 2097275
versionName "1.0.95" versionName "1.0.97"
ndk { ndk {
abiFilters "armeabi-v7a", "x86" abiFilters "armeabi-v7a", "x86"
} }

View File

@@ -18,7 +18,7 @@ class FileApiDriverMemory {
} }
decodeContent_(content) { decodeContent_(content) {
return Buffer.from(content, 'base64').toString('ascii'); return Buffer.from(content, 'base64').toString('utf-8');
} }
itemIndexByPath(path) { itemIndexByPath(path) {
@@ -49,14 +49,13 @@ class FileApiDriverMemory {
return Promise.resolve(item ? Object.assign({}, item) : null); return Promise.resolve(item ? Object.assign({}, item) : null);
} }
setTimestamp(path, timestampMs) { async setTimestamp(path, timestampMs) {
let item = this.itemByPath(path); let item = this.itemByPath(path);
if (!item) return Promise.reject(new Error('File not found: ' + path)); if (!item) return Promise.reject(new Error('File not found: ' + path));
item.updated_time = timestampMs; item.updated_time = timestampMs;
return Promise.resolve();
} }
list(path, options) { async list(path, options) {
let output = []; let output = [];
for (let i = 0; i < this.items_.length; i++) { for (let i = 0; i < this.items_.length; i++) {
@@ -95,11 +94,10 @@ class FileApiDriverMemory {
return output; return output;
} }
mkdir(path) { async mkdir(path) {
let index = this.itemIndexByPath(path); let index = this.itemIndexByPath(path);
if (index >= 0) return Promise.resolve(); if (index >= 0) return;
this.items_.push(this.newItem(path, true)); this.items_.push(this.newItem(path, true));
return Promise.resolve();
} }
async put(path, content, options = null) { async put(path, content, options = null) {
@@ -116,10 +114,9 @@ class FileApiDriverMemory {
this.items_[index].content = this.encodeContent_(content); this.items_[index].content = this.encodeContent_(content);
this.items_[index].updated_time = time.unix(); this.items_[index].updated_time = time.unix();
} }
return Promise.resolve();
} }
delete(path) { async delete(path) {
let index = this.itemIndexByPath(path); let index = this.itemIndexByPath(path);
if (index >= 0) { if (index >= 0) {
let item = Object.assign({}, this.items_[index]); let item = Object.assign({}, this.items_[index]);
@@ -128,20 +125,17 @@ class FileApiDriverMemory {
this.deletedItems_.push(item); this.deletedItems_.push(item);
this.items_.splice(index, 1); this.items_.splice(index, 1);
} }
return Promise.resolve();
} }
move(oldPath, newPath) { async move(oldPath, newPath) {
let sourceItem = this.itemByPath(oldPath); let sourceItem = this.itemByPath(oldPath);
if (!sourceItem) return Promise.reject(new Error('Path not found: ' + oldPath)); if (!sourceItem) return Promise.reject(new Error('Path not found: ' + oldPath));
this.delete(newPath); // Overwrite if newPath already exists this.delete(newPath); // Overwrite if newPath already exists
sourceItem.path = newPath; sourceItem.path = newPath;
return Promise.resolve();
} }
format() { async format() {
this.items_ = []; this.items_ = [];
return Promise.resolve();
} }
async delta(path, options = null) { async delta(path, options = null) {
@@ -159,9 +153,8 @@ class FileApiDriverMemory {
return output; return output;
} }
clearRoot() { async clearRoot() {
this.items_ = []; this.items_ = [];
return Promise.resolve();
} }
} }

View File

@@ -429,7 +429,7 @@ class Setting extends BaseModel {
// } // }
// } // }
static saveAll() { static async saveAll() {
if (!this.saveTimeoutId_) return Promise.resolve(); if (!this.saveTimeoutId_) return Promise.resolve();
this.logger().info('Saving settings...'); this.logger().info('Saving settings...');
@@ -444,12 +444,14 @@ class Setting extends BaseModel {
queries.push(Database.insertQuery(this.tableName(), s)); queries.push(Database.insertQuery(this.tableName(), s));
} }
return BaseModel.db().transactionExecBatch(queries).then(() => { await BaseModel.db().transactionExecBatch(queries);
this.logger().info('Settings have been saved.'); this.logger().info('Settings have been saved.');
});
} }
static scheduleSave() { static scheduleSave() {
if (!Setting.autoSaveEnabled) return;
if (this.saveTimeoutId_) clearTimeout(this.saveTimeoutId_); if (this.saveTimeoutId_) clearTimeout(this.saveTimeoutId_);
this.saveTimeoutId_ = setTimeout(() => { this.saveTimeoutId_ = setTimeout(() => {
@@ -521,4 +523,6 @@ Setting.constants_ = {
openDevTools: false, openDevTools: false,
} }
Setting.autoSaveEnabled = true;
module.exports = Setting; module.exports = Setting;

View File

@@ -218,15 +218,15 @@
<tbody> <tbody>
<tr> <tr>
<td>Windows</td> <td>Windows</td>
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.62/Joplin-Setup-1.0.62.exe'><img alt='Get it on Windows' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeWindows.png'/></a></td> <td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.63/Joplin-Setup-1.0.63.exe'><img alt='Get it on Windows' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeWindows.png'/></a></td>
</tr> </tr>
<tr> <tr>
<td>macOS</td> <td>macOS</td>
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.62/Joplin-1.0.62.dmg'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeMacOS.png'/></a></td> <td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.63/Joplin-1.0.63.dmg'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeMacOS.png'/></a></td>
</tr> </tr>
<tr> <tr>
<td>Linux</td> <td>Linux</td>
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.62/Joplin-1.0.62-x86_64.AppImage'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeLinux.png'/></a></td> <td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.63/Joplin-1.0.63-x86_64.AppImage'><img alt='Get it on macOS' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeLinux.png'/></a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -243,7 +243,7 @@
<tr> <tr>
<td>Android</td> <td>Android</td>
<td><a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeAndroid.png'/></a></td> <td><a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="40px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeAndroid.png'/></a></td>
<td>or <a href="https://github.com/laurent22/joplin-android/releases/download/android-v1.0.95/joplin-v1.0.95.apk">Download APK File</a></td> <td>or <a href="https://github.com/laurent22/joplin-android/releases/download/android-v1.0.97/joplin-v1.0.97.apk">Download APK File</a></td>
</tr> </tr>
<tr> <tr>
<td>iOS</td> <td>iOS</td>
@@ -391,14 +391,14 @@ $$
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/hr.png" alt=""></td> <td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/hr.png" alt=""></td>
<td>Croatian</td> <td>Croatian</td>
<td>hr_HR</td> <td>hr_HR</td>
<td>Hrvoje Mandić <a href="&#109;&#x61;&#105;&#108;&#116;&#x6f;&#58;&#x74;&#114;&#x62;&#x75;&#104;&#x6f;&#x6d;&#x40;&#x6e;&#101;&#x74;&#46;&#104;&#x72;">&#x74;&#114;&#x62;&#x75;&#104;&#x6f;&#x6d;&#x40;&#x6e;&#101;&#x74;&#46;&#104;&#x72;</a></td> <td>Hrvoje Mandić <a href="&#109;&#x61;&#105;&#108;&#x74;&#x6f;&#58;&#116;&#114;&#x62;&#x75;&#104;&#x6f;&#109;&#64;&#x6e;&#x65;&#x74;&#x2e;&#x68;&#x72;">&#116;&#114;&#x62;&#x75;&#104;&#x6f;&#109;&#64;&#x6e;&#x65;&#x74;&#x2e;&#x68;&#x72;</a></td>
<td>72%</td> <td>72%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/de.png" alt=""></td> <td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/de.png" alt=""></td>
<td>Deutsch</td> <td>Deutsch</td>
<td>de_DE</td> <td>de_DE</td>
<td>Tobias Strobel <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#x6f;&#x3a;&#x67;&#x69;&#x74;&#x40;&#x73;&#x74;&#x72;&#111;&#x62;&#x65;&#108;&#116;&#x6f;&#x62;&#105;&#x61;&#115;&#46;&#100;&#101;">&#x67;&#x69;&#x74;&#x40;&#x73;&#x74;&#x72;&#111;&#x62;&#x65;&#108;&#116;&#x6f;&#x62;&#105;&#x61;&#115;&#46;&#100;&#101;</a></td> <td>Tobias Strobel <a href="&#109;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#58;&#x67;&#105;&#116;&#x40;&#x73;&#116;&#x72;&#111;&#98;&#101;&#108;&#x74;&#x6f;&#x62;&#x69;&#x61;&#x73;&#46;&#x64;&#x65;">&#x67;&#105;&#116;&#x40;&#x73;&#116;&#x72;&#111;&#98;&#101;&#108;&#x74;&#x6f;&#x62;&#x69;&#x61;&#x73;&#46;&#x64;&#x65;</a></td>
<td>91%</td> <td>91%</td>
</tr> </tr>
<tr> <tr>
@@ -454,14 +454,14 @@ $$
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/ru.png" alt=""></td> <td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/ru.png" alt=""></td>
<td>Русский</td> <td>Русский</td>
<td>ru_RU</td> <td>ru_RU</td>
<td>Artyom Karlov <a href="&#109;&#x61;&#105;&#x6c;&#116;&#111;&#58;&#97;&#x72;&#116;&#121;&#x6f;&#109;&#x2e;&#107;&#97;&#114;&#x6c;&#111;&#118;&#x40;&#x67;&#109;&#x61;&#x69;&#x6c;&#x2e;&#99;&#111;&#x6d;">&#97;&#x72;&#116;&#121;&#x6f;&#109;&#x2e;&#107;&#97;&#114;&#x6c;&#111;&#118;&#x40;&#x67;&#109;&#x61;&#x69;&#x6c;&#x2e;&#99;&#111;&#x6d;</a></td> <td>Artyom Karlov <a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#x3a;&#97;&#114;&#116;&#121;&#111;&#x6d;&#x2e;&#107;&#97;&#x72;&#108;&#111;&#x76;&#64;&#x67;&#x6d;&#x61;&#x69;&#108;&#46;&#99;&#111;&#109;">&#97;&#114;&#116;&#121;&#111;&#x6d;&#x2e;&#107;&#97;&#x72;&#108;&#111;&#x76;&#64;&#x67;&#x6d;&#x61;&#x69;&#108;&#46;&#99;&#111;&#109;</a></td>
<td>94%</td> <td>94%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cn.png" alt=""></td> <td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cn.png" alt=""></td>
<td>中文 (简体)</td> <td>中文 (简体)</td>
<td>zh_CN</td> <td>zh_CN</td>
<td>RCJacH <a href="&#x6d;&#97;&#105;&#x6c;&#116;&#111;&#x3a;&#82;&#x43;&#x4a;&#97;&#99;&#72;&#64;&#x6f;&#117;&#x74;&#108;&#x6f;&#111;&#x6b;&#46;&#x63;&#111;&#x6d;">&#82;&#x43;&#x4a;&#97;&#99;&#72;&#64;&#x6f;&#117;&#x74;&#108;&#x6f;&#111;&#x6b;&#46;&#x63;&#111;&#x6d;</a></td> <td>RCJacH <a href="&#x6d;&#x61;&#x69;&#108;&#116;&#x6f;&#x3a;&#x52;&#x43;&#74;&#97;&#x63;&#72;&#64;&#111;&#x75;&#116;&#x6c;&#111;&#111;&#107;&#x2e;&#99;&#x6f;&#109;">&#x52;&#x43;&#74;&#97;&#x63;&#72;&#64;&#111;&#x75;&#116;&#x6c;&#111;&#111;&#107;&#x2e;&#99;&#x6f;&#109;</a></td>
<td>75%</td> <td>75%</td>
</tr> </tr>
<tr> <tr>