1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +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
commit feccc6150e
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 () => {
let folder = await Folder.save({ title: "Fahrräder" });
await Note.save({ title: "Fahrräder", body: "Fahrräder", parent_id: folder.id });
let all = await allItems();
await synchronizer().start();

View File

@ -51,12 +51,12 @@ SyncTargetRegistry.addClass(SyncTargetFilesystem);
SyncTargetRegistry.addClass(SyncTargetOneDrive);
SyncTargetRegistry.addClass(SyncTargetNextcloud);
const syncTargetId_ = SyncTargetRegistry.nameToId('nextcloud');
//const syncTargetId_ = SyncTargetRegistry.nameToId('memory');
//const syncTargetId_ = SyncTargetRegistry.nameToId('nextcloud');
const syncTargetId_ = SyncTargetRegistry.nameToId('memory');
//const syncTargetId_ = SyncTargetRegistry.nameToId('filesystem');
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_));
@ -75,6 +75,8 @@ BaseItem.loadClass('MasterKey', MasterKey);
Setting.setConstant('appId', 'net.cozic.joplin-cli');
Setting.setConstant('appType', 'cli');
Setting.autoSaveEnabled = false;
function syncTargetId() {
return syncTargetId_;
}

View File

@ -18,15 +18,15 @@ Three types of applications are available: for the **desktop** (Windows, macOS a
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>
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>
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>
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.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.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
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> | -
## Terminal application

View File

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

View File

@ -18,7 +18,7 @@ class FileApiDriverMemory {
}
decodeContent_(content) {
return Buffer.from(content, 'base64').toString('ascii');
return Buffer.from(content, 'base64').toString('utf-8');
}
itemIndexByPath(path) {
@ -49,14 +49,13 @@ class FileApiDriverMemory {
return Promise.resolve(item ? Object.assign({}, item) : null);
}
setTimestamp(path, timestampMs) {
async setTimestamp(path, timestampMs) {
let item = this.itemByPath(path);
if (!item) return Promise.reject(new Error('File not found: ' + path));
item.updated_time = timestampMs;
return Promise.resolve();
}
list(path, options) {
async list(path, options) {
let output = [];
for (let i = 0; i < this.items_.length; i++) {
@ -95,11 +94,10 @@ class FileApiDriverMemory {
return output;
}
mkdir(path) {
async mkdir(path) {
let index = this.itemIndexByPath(path);
if (index >= 0) return Promise.resolve();
if (index >= 0) return;
this.items_.push(this.newItem(path, true));
return Promise.resolve();
}
async put(path, content, options = null) {
@ -116,10 +114,9 @@ class FileApiDriverMemory {
this.items_[index].content = this.encodeContent_(content);
this.items_[index].updated_time = time.unix();
}
return Promise.resolve();
}
delete(path) {
async delete(path) {
let index = this.itemIndexByPath(path);
if (index >= 0) {
let item = Object.assign({}, this.items_[index]);
@ -128,20 +125,17 @@ class FileApiDriverMemory {
this.deletedItems_.push(item);
this.items_.splice(index, 1);
}
return Promise.resolve();
}
move(oldPath, newPath) {
async move(oldPath, newPath) {
let sourceItem = this.itemByPath(oldPath);
if (!sourceItem) return Promise.reject(new Error('Path not found: ' + oldPath));
this.delete(newPath); // Overwrite if newPath already exists
sourceItem.path = newPath;
return Promise.resolve();
}
format() {
async format() {
this.items_ = [];
return Promise.resolve();
}
async delta(path, options = null) {
@ -159,9 +153,8 @@ class FileApiDriverMemory {
return output;
}
clearRoot() {
async clearRoot() {
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();
this.logger().info('Saving settings...');
@ -444,12 +444,14 @@ class Setting extends BaseModel {
queries.push(Database.insertQuery(this.tableName(), s));
}
return BaseModel.db().transactionExecBatch(queries).then(() => {
this.logger().info('Settings have been saved.');
});
await BaseModel.db().transactionExecBatch(queries);
this.logger().info('Settings have been saved.');
}
static scheduleSave() {
if (!Setting.autoSaveEnabled) return;
if (this.saveTimeoutId_) clearTimeout(this.saveTimeoutId_);
this.saveTimeoutId_ = setTimeout(() => {
@ -521,4 +523,6 @@ Setting.constants_ = {
openDevTools: false,
}
Setting.autoSaveEnabled = true;
module.exports = Setting;

View File

@ -218,15 +218,15 @@
<tbody>
<tr>
<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>
<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>
<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>
</tbody>
</table>
@ -243,7 +243,7 @@
<tr>
<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>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>
<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>Croatian</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>
</tr>
<tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/de.png" alt=""></td>
<td>Deutsch</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>
</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>Русский</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>
</tr>
<tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cn.png" alt=""></td>
<td>中文 (简体)</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>
</tr>
<tr>