mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	Merge branch 'stable'
This commit is contained in:
		
						commit
						51ad89ce63
					
				
							
								
								
									
										3
									
								
								bin/www
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								bin/www
									
									
									
									
									
								
							@ -16,9 +16,6 @@ const https = require('https');
 | 
				
			|||||||
const config = require('../services/config');
 | 
					const config = require('../services/config');
 | 
				
			||||||
const log = require('../services/log');
 | 
					const log = require('../services/log');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Get port from environment and store in Express.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
const port = normalizePort(config['Network']['port'] || '3000');
 | 
					const port = normalizePort(config['Network']['port'] || '3000');
 | 
				
			||||||
app.set('port', port);
 | 
					app.set('port', port);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										5
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								index.js
									
									
									
									
									
								
							@ -1,6 +1,7 @@
 | 
				
			|||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
const electron = require('electron');
 | 
					const electron = require('electron');
 | 
				
			||||||
const path = require('path');
 | 
					const path = require('path');
 | 
				
			||||||
 | 
					const config = require('./services/config');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const app = electron.app;
 | 
					const app = electron.app;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -23,8 +24,10 @@ function createMainWindow() {
 | 
				
			|||||||
        icon: path.join(__dirname, 'public/images/app-icons/png/256x256.png')
 | 
					        icon: path.join(__dirname, 'public/images/app-icons/png/256x256.png')
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const port = config['Network']['port'] || '3000';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    win.setMenu(null);
 | 
					    win.setMenu(null);
 | 
				
			||||||
    win.loadURL('http://localhost:3000');
 | 
					    win.loadURL('http://localhost:' + port);
 | 
				
			||||||
    win.on('closed', onClosed);
 | 
					    win.on('closed', onClosed);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    win.webContents.on('new-window', (e, url) => {
 | 
					    win.webContents.on('new-window', (e, url) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -24,14 +24,20 @@ $(document).bind('keydown', 'alt+t', () => {
 | 
				
			|||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(document).bind('keydown', 'f5', () => {
 | 
					$(document).bind('keydown', 'f5', () => {
 | 
				
			||||||
    location.reload();
 | 
					    window.location.reload(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return false;
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$(document).bind('keydown', 'ctrl+r', () => {
 | 
				
			||||||
 | 
					    window.location.reload(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(document).bind('keydown', 'ctrl+shift+i', () => {
 | 
					$(document).bind('keydown', 'ctrl+shift+i', () => {
 | 
				
			||||||
    if (isElectron()) {
 | 
					    if (isElectron()) {
 | 
				
			||||||
        require('remote').getCurrentWindow().toggleDevTools();
 | 
					        require('electron').remote.getCurrentWindow().toggleDevTools();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -20,7 +20,7 @@ async function regularBackup() {
 | 
				
			|||||||
async function backupNow() {
 | 
					async function backupNow() {
 | 
				
			||||||
    const now = utils.nowTimestamp();
 | 
					    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";
 | 
					    const backupFile = dataDir.BACKUP_DIR + "/" + "backup-" + date_str + ".db";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -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" };
 | 
				
			||||||
 | 
				
			|||||||
@ -189,7 +189,7 @@ async function updateNote(noteId, newNote, ctx) {
 | 
				
			|||||||
        await sql.remove("links", noteId);
 | 
					        await sql.remove("links", noteId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (const link in newNote.links) {
 | 
					        for (const link in newNote.links) {
 | 
				
			||||||
            await sql.insert("links", link);
 | 
					            //await sql.insert("links", link);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        await sync_table.addNoteTreeSync(noteId);
 | 
					        await sync_table.addNoteTreeSync(noteId);
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@ async function updateNote(entity, links, sourceId) {
 | 
				
			|||||||
            for (const link of links) {
 | 
					            for (const link of links) {
 | 
				
			||||||
                delete link['lnk_id'];
 | 
					                delete link['lnk_id'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                await sql.insert('link', link);
 | 
					                //await sql.insert('link', link);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            await sync_table.addNoteSync(entity.note_id, sourceId);
 | 
					            await sync_table.addNoteSync(entity.note_id, sourceId);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user