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) => { diff --git a/public/javascripts/init.js b/public/javascripts/init.js index de8038589..e2aa723cf 100644 --- a/public/javascripts/init.js +++ b/public/javascripts/init.js @@ -24,14 +24,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; } 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"; 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 803784683..00ffc6dc4 100644 --- a/services/notes.js +++ b/services/notes.js @@ -189,7 +189,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 6ae069d8b..58564ae16 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);