mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
Compare commits
21 Commits
v0.28.1-be
...
v0.28.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a9a49b739 | ||
|
|
2ac560c56e | ||
|
|
c23387c0fb | ||
|
|
0ff250fe15 | ||
|
|
52b1e58b26 | ||
|
|
484715e440 | ||
|
|
9d42c3d802 | ||
|
|
c654172d33 | ||
|
|
e17b26c883 | ||
|
|
24d02d9cf5 | ||
|
|
7208a311ac | ||
|
|
ad7355372b | ||
|
|
f18b5babad | ||
|
|
9831ec0ca9 | ||
|
|
596544eca3 | ||
|
|
1f853024ee | ||
|
|
0308b13460 | ||
|
|
06b8a82f70 | ||
|
|
91ca07929d | ||
|
|
afabaa5fdb | ||
|
|
a6fd3fa77c |
@@ -11,6 +11,8 @@ cp -r bin/deps/linux-x64/sqlite/* node_modules/sqlite3/lib/binding/
|
||||
|
||||
mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
|
||||
|
||||
cp src/public/images/app-icons/png/128x128.png $BUILD_DIR/icon.png
|
||||
|
||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||
rm -r $BUILD_DIR/swiftshader
|
||||
|
||||
|
||||
BIN
db/demo.tar
BIN
db/demo.tar
Binary file not shown.
11
db/migrations/0124__readd_font_sizes.sql
Normal file
11
db/migrations/0124__readd_font_sizes.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
||||
SELECT 'mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'mainFontSize');
|
||||
|
||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
||||
SELECT 'treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'treeFontSize');
|
||||
|
||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
||||
SELECT 'detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'detailFontSize');
|
||||
5
issue_template.md
Normal file
5
issue_template.md
Normal file
@@ -0,0 +1,5 @@
|
||||
For bug reports, please mention **version of the application** and include **log files** from following location:
|
||||
|
||||
* `/home/[user]/.local/share/trilium-data/log` for Linux
|
||||
* `C:\Users\[user]\AppData\Roaming\trilium-data\log` for Windows Vista and up
|
||||
* `/Users/[user]/Library/Application Support/trilium-data/log` for Mac OS
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.28.1-beta",
|
||||
"version": "0.28.3",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
|
||||
@@ -160,7 +160,7 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {
|
||||
$input.autocomplete({
|
||||
appendTo: document.querySelector('body'),
|
||||
hint: false,
|
||||
autoselect: true,
|
||||
autoselect: false,
|
||||
openOnFocus: true,
|
||||
minLength: 0,
|
||||
tabAutocomplete: false
|
||||
|
||||
@@ -623,7 +623,10 @@ async function createNote(node, parentNoteId, target, isProtected, saveSelection
|
||||
|
||||
await node.getLastChild().setActive(true);
|
||||
|
||||
const parentNoteEntity = await treeCache.getNote(node.data.noteId);
|
||||
|
||||
node.folder = true;
|
||||
node.icon = await treeBuilder.getIcon(parentNoteEntity); // icon might change into folder
|
||||
node.renderTitle();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -44,7 +44,8 @@ html, body {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
/* for some reason detail overflows a little bit so we subtract few pixels */
|
||||
height: calc(100% - 25px);
|
||||
/* large left padding is necessary for ckeditor gutter in detail-only (smartphone) layout */
|
||||
padding-left: 35px;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ span.fancytree-active.fancytree-focused .fancytree-title {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
span.fancytree-active:not(.fancytree-focused) .fancytree-title {
|
||||
span.fancytree-active:not(.fancytree-focused) .fancytree-title, span.fancytree-selected .fancytree-title {
|
||||
color: var(--hover-item-text-color) !important;
|
||||
background-color: var(--hover-item-background-color) !important;
|
||||
border-color: #ddd !important;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const path = require('path');
|
||||
const {APP_PNG_ICON_DIR, ELECTRON_APP_ROOT_DIR} = require("./resource_dir");
|
||||
const {ELECTRON_APP_ROOT_DIR} = require("./resource_dir");
|
||||
const log = require("./log");
|
||||
const os = require('os');
|
||||
const fs = require('fs');
|
||||
@@ -11,7 +11,7 @@ const utils = require('./utils');
|
||||
const template = `[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Trilium Notes
|
||||
Icon=#APP_PNG_ICON_DIR#/128x128.png
|
||||
Icon=#APP_ROOT_DIR#/icon.png
|
||||
Exec=#EXE_PATH#
|
||||
Categories=Office
|
||||
Terminal=false
|
||||
@@ -50,7 +50,7 @@ function installLocalAppIcon() {
|
||||
|
||||
function getDesktopFileContent() {
|
||||
return template
|
||||
.replace("#APP_PNG_ICON_DIR#", escapePath(APP_PNG_ICON_DIR))
|
||||
.replace("#APP_ROOT_DIR#", escapePath(ELECTRON_APP_ROOT_DIR))
|
||||
.replace("#EXE_PATH#", escapePath(getExePath()));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const build = require('./build');
|
||||
const packageJson = require('../../package');
|
||||
const {TRILIUM_DATA_DIR} = require('./data_dir');
|
||||
|
||||
const APP_DB_VERSION = 123;
|
||||
const APP_DB_VERSION = 124;
|
||||
const SYNC_VERSION = 4;
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -11,6 +11,7 @@ const repository = require('./repository');
|
||||
const axios = require('axios');
|
||||
const cloningService = require('./cloning');
|
||||
const messagingService = require('./messaging');
|
||||
const appInfo = require('./app_info');
|
||||
|
||||
/**
|
||||
* This is the main backend API interface for scripts. It's published in the local "api" object.
|
||||
@@ -234,6 +235,11 @@ function BackendScriptApi(startNote, currentNote, originEntity) {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.refreshTree = () => messagingService.sendMessageToAllClients({ type: 'refresh-tree' });
|
||||
|
||||
/**
|
||||
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
||||
*/
|
||||
this.getAppInfo = () => appInfo
|
||||
}
|
||||
|
||||
module.exports = BackendScriptApi;
|
||||
@@ -1 +1 @@
|
||||
module.exports = { buildDate:"2019-01-16T23:58:10+01:00", buildRevision: "299bbff2f45299afc1402fed875f92bf6dec168d" };
|
||||
module.exports = { buildDate:"2019-01-22T23:01:32+01:00", buildRevision: "2ac560c56e2d347fccc0ad51b8d62999408a7f74" };
|
||||
|
||||
@@ -8,6 +8,10 @@ const repository = require('./repository');
|
||||
const Branch = require('../entities/branch');
|
||||
|
||||
async function cloneNoteToParent(noteId, parentNoteId, prefix) {
|
||||
if (await isNoteDeleted(noteId) || await isNoteDeleted(parentNoteId)) {
|
||||
return { success: false, message: 'Note is deleted.' };
|
||||
}
|
||||
|
||||
const validationResult = await treeService.validateParentChild(parentNoteId, noteId);
|
||||
|
||||
if (!validationResult.success) {
|
||||
@@ -27,6 +31,10 @@ async function cloneNoteToParent(noteId, parentNoteId, prefix) {
|
||||
}
|
||||
|
||||
async function ensureNoteIsPresentInParent(noteId, parentNoteId, prefix) {
|
||||
if (await isNoteDeleted(noteId) || await isNoteDeleted(parentNoteId)) {
|
||||
return { success: false, message: 'Note is deleted.' };
|
||||
}
|
||||
|
||||
const validationResult = await treeService.validateParentChild(parentNoteId, noteId);
|
||||
|
||||
if (!validationResult.success) {
|
||||
@@ -61,6 +69,10 @@ async function toggleNoteInParent(present, noteId, parentNoteId, prefix) {
|
||||
async function cloneNoteAfter(noteId, afterBranchId) {
|
||||
const afterNote = await treeService.getBranch(afterBranchId);
|
||||
|
||||
if (await isNoteDeleted(noteId) || await isNoteDeleted(afterNote.parentNoteId)) {
|
||||
return { success: false, message: 'Note is deleted.' };
|
||||
}
|
||||
|
||||
const validationResult = await treeService.validateParentChild(afterNote.parentNoteId, noteId);
|
||||
|
||||
if (!validationResult.result) {
|
||||
@@ -84,6 +96,12 @@ async function cloneNoteAfter(noteId, afterBranchId) {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
async function isNoteDeleted(noteId) {
|
||||
const note = await repository.getNote(noteId);
|
||||
|
||||
return note.isDeleted;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
cloneNoteToParent,
|
||||
ensureNoteIsPresentInParent,
|
||||
|
||||
@@ -101,6 +101,26 @@ async function fixEmptyRelationTargets(errorList) {
|
||||
}
|
||||
}
|
||||
|
||||
async function fixUndeletedBranches() {
|
||||
const undeletedBranches = await sql.getRows(`
|
||||
SELECT
|
||||
branchId, noteId
|
||||
FROM
|
||||
branches
|
||||
JOIN notes USING(noteId)
|
||||
WHERE
|
||||
notes.isDeleted = 1
|
||||
AND branches.isDeleted = 0`);
|
||||
|
||||
for (const {branchId, noteId} of undeletedBranches) {
|
||||
const branch = await repository.getBranch(branchId);
|
||||
branch.isDeleted = true;
|
||||
await branch.save();
|
||||
|
||||
log.info(`Branch ${branchId} has been deleted since associated note ${noteId} is deleted.`);
|
||||
}
|
||||
}
|
||||
|
||||
async function runAllChecks() {
|
||||
const errorList = [];
|
||||
|
||||
@@ -125,16 +145,7 @@ async function runAllChecks() {
|
||||
notes.noteId IS NULL`,
|
||||
"Missing notes records for following branch ID > note ID", errorList);
|
||||
|
||||
await runCheck(`
|
||||
SELECT
|
||||
branchId
|
||||
FROM
|
||||
branches
|
||||
JOIN notes USING(noteId)
|
||||
WHERE
|
||||
notes.isDeleted = 1
|
||||
AND branches.isDeleted = 0`,
|
||||
"Branch is not deleted even though main note is deleted for following branch IDs", errorList);
|
||||
await fixUndeletedBranches();
|
||||
|
||||
await runCheck(`
|
||||
SELECT
|
||||
|
||||
@@ -49,6 +49,10 @@ async function initNotSyncedOptions(initialized, startNotePath = 'root', syncSer
|
||||
await optionService.createOption('syncServerTimeout', 5000, false);
|
||||
await optionService.createOption('syncProxy', syncProxy, false);
|
||||
|
||||
await optionService.createOption('mainFontSize', '100', false);
|
||||
await optionService.createOption('treeFontSize', '100', false);
|
||||
await optionService.createOption('detailFontSize', '110', false);
|
||||
|
||||
await optionService.createOption('initialized', initialized ? 'true' : 'false', false);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ const RESOURCE_DIR = path.resolve(__dirname, "../..");
|
||||
// where "trilium" executable is
|
||||
const ELECTRON_APP_ROOT_DIR = path.resolve(RESOURCE_DIR, "../..");
|
||||
const DB_INIT_DIR = path.resolve(RESOURCE_DIR, "db");
|
||||
const APP_PNG_ICON_DIR = path.resolve(RESOURCE_DIR, "src/public/images/app-icons/png");
|
||||
|
||||
if (!fs.existsSync(DB_INIT_DIR)) {
|
||||
log.error("Could not find DB initialization directory: " + DB_INIT_DIR);
|
||||
@@ -25,6 +24,5 @@ module.exports = {
|
||||
RESOURCE_DIR,
|
||||
MIGRATIONS_DIR,
|
||||
DB_INIT_DIR,
|
||||
ELECTRON_APP_ROOT_DIR,
|
||||
APP_PNG_ICON_DIR
|
||||
ELECTRON_APP_ROOT_DIR
|
||||
};
|
||||
@@ -111,6 +111,12 @@ async function sortNotesAlphabetically(parentNoteId) {
|
||||
}
|
||||
|
||||
async function setNoteToParent(noteId, prefix, parentNoteId) {
|
||||
const parentNote = await repository.getNote(parentNoteId);
|
||||
|
||||
if (parentNote && parentNote.isDeleted) {
|
||||
throw new Error(`Cannot move note to deleted parent note ${parentNoteId}`);
|
||||
}
|
||||
|
||||
// case where there might be more such branches is ignored. It's expected there should be just one
|
||||
const branch = await repository.getEntity("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ? AND prefix = ?", [noteId, prefix]);
|
||||
|
||||
@@ -126,6 +132,12 @@ async function setNoteToParent(noteId, prefix, parentNoteId) {
|
||||
await branch.save();
|
||||
}
|
||||
else if (parentNoteId) {
|
||||
const note = await repository.getNote(noteId);
|
||||
|
||||
if (note.isDeleted) {
|
||||
throw new Error(`Cannot create a branch for ${noteId} which is deleted.`);
|
||||
}
|
||||
|
||||
await new Branch({
|
||||
noteId: noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
<input type="file" id="import-upload" style="display: none" />
|
||||
|
||||
<div id="search-box">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<input name="search-text" placeholder="Search text, labels" style="flex-grow: 100; margin-left: 5px; margin-right: 5px;" autocomplete="off">
|
||||
<div style="display: flex; align-items: center; flex-wrap: wrap;">
|
||||
<input name="search-text" placeholder="Search text, labels" style="flex-grow: 100; margin-left: 5px; margin-right: 5px; flex-basis: 5em; min-width: 0;" autocomplete="off">
|
||||
<button id="do-search-button" class="btn btn-sm icon-button jam jam-search" title="Search (enter)"></button>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user