1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Electron: Resolves #755: Added note properties dialog box to view and edit created time, updated time, source URL and geolocation

This commit is contained in:
Laurent Cozic
2018-09-16 19:37:31 +01:00
parent 1b784fe3b0
commit 4e8372174b
11 changed files with 465 additions and 23 deletions

View File

@ -100,7 +100,12 @@ class Note extends BaseItem {
static geolocationUrl(note) {
if (!('latitude' in note) || !('longitude' in note)) throw new Error('Latitude or longitude is missing');
if (!Number(note.latitude) && !Number(note.longitude)) throw new Error(_('This note does not have geolocation information.'));
return sprintf('https://www.openstreetmap.org/?lat=%s&lon=%s&zoom=20', note.latitude, note.longitude)
return this.geoLocationUrlFromLatLong(note.latitude, note.longitude);
//return sprintf('https://www.openstreetmap.org/?lat=%s&lon=%s&zoom=20', note.latitude, note.longitude);
}
static geoLocationUrlFromLatLong(lat, long) {
return sprintf('https://www.openstreetmap.org/?lat=%s&lon=%s&zoom=20', lat, long)
}
static modelType() {
@ -465,17 +470,6 @@ class Note extends BaseItem {
return note;
}
// Not used?
// static async delete(id, options = null) {
// let r = await super.delete(id, options);
// this.dispatch({
// type: 'NOTE_DELETE',
// id: id,
// });
// }
static async batchDelete(ids, options = null) {
const result = await super.batchDelete(ids, options);
for (let i = 0; i < ids.length; i++) {