From 3a55d081522e4d1445a18713f82b6fe96e2c70eb Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 20 Nov 2017 19:38:30 -0500 Subject: [PATCH 1/4] don't save backups with colons in filenames, doesn't work on windows --- services/backup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/backup.js b/services/backup.js index 9a30896cc..1398c4ea3 100644 --- a/services/backup.js +++ b/services/backup.js @@ -20,7 +20,7 @@ async function regularBackup() { async function backupNow() { const now = utils.nowTimestamp(); - const date_str = new Date().toISOString().substr(0, 19); + const date_str = new Date().toISOString().substr(0, 19).replace(/:/g, ''); const backupFile = dataDir.BACKUP_DIR + "/" + "backup-" + date_str + ".db"; From b998c936ba77206462eece2407db7bb5f3fd54c1 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 20 Nov 2017 19:43:48 -0500 Subject: [PATCH 2/4] don't save backups with colons in filenames, doesn't work on windows --- services/build.js | 2 +- services/notes.js | 2 +- services/sync_update.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/build.js b/services/build.js index 010010520..724935955 100644 --- a/services/build.js +++ b/services/build.js @@ -1 +1 @@ -module.exports = { build_date:"2017-11-17T00:09:29-05:00", build_revision: "a6bf04f8d4dc92445e6b4decd7dbbaa2f3e3ebaa" }; +module.exports = { build_date:"2017-11-20T08:43:54-05:00", build_revision: "2f2969b2a1fa080a7555f2dfb7ec8b933f0421fe" }; diff --git a/services/notes.js b/services/notes.js index cc676c852..cce3ab0fa 100644 --- a/services/notes.js +++ b/services/notes.js @@ -188,7 +188,7 @@ async function updateNote(noteId, newNote, ctx) { await sql.remove("links", noteId); for (const link in newNote.links) { - await sql.insert("links", link); + //await sql.insert("links", link); } await sync_table.addNoteTreeSync(noteId); diff --git a/services/sync_update.js b/services/sync_update.js index fb849b899..67aab82e3 100644 --- a/services/sync_update.js +++ b/services/sync_update.js @@ -19,7 +19,7 @@ async function updateNote(entity, links, sourceId) { for (const link of links) { delete link['lnk_id']; - await sql.insert('link', link); + //await sql.insert('link', link); } await sync_table.addNoteSync(entity.note_id, sourceId); From a61f63b098724e982be4743aee92ed501425c070 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 20 Nov 2017 19:59:42 -0500 Subject: [PATCH 3/4] load port from config file for electron --- bin/www | 3 --- index.js | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/www b/bin/www index cd21bae31..9d2f738c0 100755 --- a/bin/www +++ b/bin/www @@ -16,9 +16,6 @@ const https = require('https'); const config = require('../services/config'); const log = require('../services/log'); -/** - * Get port from environment and store in Express. - */ const port = normalizePort(config['Network']['port'] || '3000'); app.set('port', port); diff --git a/index.js b/index.js index 49c2298b0..71c1279a2 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ 'use strict'; const electron = require('electron'); const path = require('path'); +const config = require('./services/config'); const app = electron.app; @@ -23,8 +24,10 @@ function createMainWindow() { icon: path.join(__dirname, 'public/images/app-icons/png/256x256.png') }); + const port = config['Network']['port'] || '3000'; + win.setMenu(null); - win.loadURL('http://localhost:3000'); + win.loadURL('http://localhost:' + port); win.on('closed', onClosed); win.webContents.on('new-window', (e, url) => { From 34b13c793632fee72a5d1c51004c2e2a28558f62 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 20 Nov 2017 23:10:04 -0500 Subject: [PATCH 4/4] electron shortcuts fixes --- public/javascripts/init.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/javascripts/init.js b/public/javascripts/init.js index 66efd2e79..e68f586b1 100644 --- a/public/javascripts/init.js +++ b/public/javascripts/init.js @@ -25,14 +25,20 @@ $(document).bind('keydown', 'alt+t', () => { }); $(document).bind('keydown', 'f5', () => { - location.reload(); + window.location.reload(true); + + return false; +}); + +$(document).bind('keydown', 'ctrl+r', () => { + window.location.reload(true); return false; }); $(document).bind('keydown', 'ctrl+shift+i', () => { if (isElectron()) { - require('remote').getCurrentWindow().toggleDevTools(); + require('electron').remote.getCurrentWindow().toggleDevTools(); return false; }