mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 15:56:29 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29fd78aee5 | ||
|
|
f90c2317fc | ||
|
|
bca5087426 | ||
|
|
583123ab0a | ||
|
|
12f70b28c8 | ||
|
|
31a4a201a8 | ||
|
|
5ec866aa50 | ||
|
|
cdede3240c |
16
README.md
16
README.md
@@ -1,14 +1,14 @@
|
||||
# Trilium
|
||||
Hierarchical note taking application.
|
||||
Hierarchical note taking application. Picture tells a thousand words:
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
* Notes can be arranged into arbitrarily deep hierarchy
|
||||
* Notes can have more than 1 parents - see [cloning](https://github.com/zadam/trilium/wiki/Cloning)
|
||||
* Notes can have more than 1 parents - see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes)
|
||||
* WYSIWYG (What You See Is What You Get) editing
|
||||
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation)
|
||||
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation) inspired by IDEs
|
||||
* Seamless note versioning
|
||||
* Can be deployed as web application and / or desktop application with offline access (electron based)
|
||||
* [Synchronization with](https://github.com/zadam/trilium/wiki/Synchronization) self-hosted sync server
|
||||
@@ -16,16 +16,16 @@ Hierarchical note taking application.
|
||||
|
||||
## Builds
|
||||
|
||||
* If you want to install Trilium on server, follow [this page](https://github.com/zadam/trilium/wiki/Installation-on-server)
|
||||
* If you want to use Trilium on the desktop, download binary release from [releases], unzip the package and run ```trilium``` executable.
|
||||
* If you want to install Trilium on server, follow [this page](https://github.com/zadam/trilium/wiki/Installation-as-webapp)
|
||||
* If you want to use Trilium on the desktop, download binary release for your platfor from [latest release](https://github.com/zadam/trilium/releases/latest), unzip the package and run ```trilium``` executable.
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Desktop (electron) builds are available for Linux and Windows.
|
||||
Desktop (electron) builds are available for Linux and Windows, both for 64 bits.
|
||||
|
||||
Requirements for web based installation are outlined in (https://github.com/zadam/trilium/wiki/Installation-on-server).
|
||||
Requirements for web based installation are [outlined here](https://github.com/zadam/trilium/wiki/Installation-as-webapp).
|
||||
|
||||
Currently only recent Chrome and Firefox are supported (tested) browsers. Other modern browsers should work as well.
|
||||
Currently only recent Chrome and Firefox are supported (tested) browsers. Other modern browsers (not IE) might work as well.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
./set-build.sh
|
||||
echo 'module.exports = { build_date:"'`date --iso-8601=seconds`'", build_revision: "'`git log -1 --format="%H"`'" };' > services/build.js
|
||||
|
||||
echo "Deleting dist"
|
||||
|
||||
@@ -16,9 +16,3 @@ cp -r ../trilium-node-binaries/scrypt/* node_modules/scrypt/bin/
|
||||
|
||||
# can't copy this before the packaging because the same file name is used for both linux and windows build
|
||||
cp ../trilium-node-binaries/scrypt.node ./dist/trilium-win32-x64/resources/app/node_modules/scrypt/build/Release/
|
||||
|
||||
echo "Packaging windows distribution..."
|
||||
|
||||
# possibly use zip: zip -r myfiles.zip mydir
|
||||
|
||||
tar cfJ dist/win.tar.xz dist/trilium-win32-x64
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Script generates certificate by default into the ~/trilium-data/cert where it is expected by Trilium
|
||||
# If directory is given in argument, certificate will be created there.
|
||||
|
||||
11
bin/package.sh
Executable file
11
bin/package.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION=`jq -r ".version" package.json`
|
||||
|
||||
cd dist
|
||||
|
||||
echo "Packaging windows electron distribution..."
|
||||
7z a trilium-windows-${VERSION}.7z trilium-win32-x64
|
||||
|
||||
echo "Packaging linux electron distribution..."
|
||||
7z a trilium-linux-${VERSION}.7z trilium-linux-x64
|
||||
52
bin/release.sh
Executable file
52
bin/release.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
echo "Missing argument of new version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=$1
|
||||
|
||||
if ! [[ ${VERSION} =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-.+)?$ ]] ;
|
||||
then
|
||||
echo "Version ${VERSION} isn't in format X.Y.Z"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
echo "There are uncommitted changes"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jq '.version = "'$VERSION'"' package.json|sponge package.json
|
||||
|
||||
TAG=v$VERSION
|
||||
|
||||
git commit -m "$VERSION"
|
||||
git push
|
||||
|
||||
git tag $TAG
|
||||
git push origin $TAG
|
||||
|
||||
echo "Releasing Trilium $VERSION"
|
||||
|
||||
build
|
||||
|
||||
package
|
||||
|
||||
LINUX_BUILD=trilium-linux-$VERSION.7z
|
||||
WINDOWS_BUILD=trilium-windows-$VERSION.7z
|
||||
|
||||
github-release release \
|
||||
--tag $TAG \
|
||||
--name "$TAG release"
|
||||
|
||||
github-release upload \
|
||||
--tag $TAG \
|
||||
--name "$LINUX_BUILD" \
|
||||
--file "dist/$LINUX_BUILD"
|
||||
|
||||
github-release upload \
|
||||
--tag $TAG \
|
||||
--name "$WINDOWS_BUILD" \
|
||||
--file "dist/$WINDOWS_BUILD"
|
||||
@@ -6,6 +6,8 @@ const noteEditor = (function() {
|
||||
const protectButton = $("#protect-button");
|
||||
const unprotectButton = $("#unprotect-button");
|
||||
const noteDetailWrapperEl = $("#note-detail-wrapper");
|
||||
const noteIdDisplayEl = $("#note-id-display");
|
||||
|
||||
let editor = null;
|
||||
|
||||
let currentNote = null;
|
||||
@@ -79,18 +81,11 @@ const noteEditor = (function() {
|
||||
}
|
||||
|
||||
function setNoteBackgroundIfProtected(note) {
|
||||
if (note.detail.is_protected) {
|
||||
$("#note-detail-wrapper").addClass("protected");
|
||||
protectButton.hide();
|
||||
unprotectButton.show();
|
||||
}
|
||||
else {
|
||||
$("#note-detail-wrapper").removeClass("protected");
|
||||
protectButton.show();
|
||||
unprotectButton.hide();
|
||||
}
|
||||
const isProtected = !!note.detail.is_protected;
|
||||
|
||||
noteTree.setCurrentNoteTreeBasedOnProtectedStatus();
|
||||
noteDetailWrapperEl.toggleClass("protected", isProtected);
|
||||
protectButton.toggle(!isProtected);
|
||||
unprotectButton.toggle(isProtected);
|
||||
}
|
||||
|
||||
let isNewNoteCreated = false;
|
||||
@@ -108,6 +103,8 @@ const noteEditor = (function() {
|
||||
noteTitleEl.focus().select();
|
||||
}
|
||||
|
||||
noteIdDisplayEl.html(noteId);
|
||||
|
||||
await protected_session.ensureProtectedSession(currentNote.detail.is_protected, false);
|
||||
|
||||
if (currentNote.detail.is_protected) {
|
||||
@@ -129,6 +126,7 @@ const noteEditor = (function() {
|
||||
noteChangeDisabled = false;
|
||||
|
||||
setNoteBackgroundIfProtected(currentNote);
|
||||
noteTree.setNoteTreeBackgroundBasedOnProtectedStatus(noteId);
|
||||
|
||||
showAppIfHidden();
|
||||
}
|
||||
|
||||
@@ -157,21 +157,17 @@ const noteTree = (function() {
|
||||
function getExtraClasses(note) {
|
||||
assertArguments(note);
|
||||
|
||||
let extraClasses = '';
|
||||
const extraClasses = [];
|
||||
|
||||
if (note.is_protected) {
|
||||
extraClasses += ",protected";
|
||||
extraClasses.push("protected");
|
||||
}
|
||||
|
||||
if (childToParents[note.note_id].length > 1) {
|
||||
extraClasses += ",multiple-parents";
|
||||
extraClasses.push("multiple-parents");
|
||||
}
|
||||
|
||||
if (extraClasses.startsWith(",")) {
|
||||
extraClasses = extraClasses.substr(1);
|
||||
}
|
||||
|
||||
return extraClasses;
|
||||
return extraClasses.join(" ");
|
||||
}
|
||||
|
||||
function prepareNoteTreeInner(parentNoteId) {
|
||||
@@ -617,8 +613,14 @@ const noteTree = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function setCurrentNoteTreeBasedOnProtectedStatus() {
|
||||
getCurrentClones().map(node => node.toggleClass("protected", !!node.data.is_protected));
|
||||
function setNoteTreeBackgroundBasedOnProtectedStatus(noteId) {
|
||||
getNodesByNoteId(noteId).map(node => node.toggleClass("protected", !!node.data.is_protected));
|
||||
}
|
||||
|
||||
function setProtected(noteId, isProtected) {
|
||||
getNodesByNoteId(noteId).map(node => node.data.is_protected = isProtected);
|
||||
|
||||
setNoteTreeBackgroundBasedOnProtectedStatus(noteId);
|
||||
}
|
||||
|
||||
function getAutocompleteItems(parentNoteId, notePath, titlePath) {
|
||||
@@ -776,7 +778,8 @@ const noteTree = (function() {
|
||||
reload,
|
||||
collapseTree,
|
||||
scrollToCurrentNote,
|
||||
setCurrentNoteTreeBasedOnProtectedStatus,
|
||||
setNoteTreeBackgroundBasedOnProtectedStatus,
|
||||
setProtected,
|
||||
getCurrentNode,
|
||||
activateNode,
|
||||
getCurrentNotePath,
|
||||
|
||||
@@ -115,6 +115,8 @@ const protected_session = (function() {
|
||||
|
||||
await noteEditor.saveNoteToServer(note);
|
||||
|
||||
noteTree.setProtected(note.detail.note_id, note.detail.is_protected);
|
||||
|
||||
noteEditor.setNoteBackgroundIfProtected(note);
|
||||
}
|
||||
|
||||
@@ -129,6 +131,8 @@ const protected_session = (function() {
|
||||
|
||||
await noteEditor.saveNoteToServer(note);
|
||||
|
||||
noteTree.setProtected(note.detail.note_id, note.detail.is_protected);
|
||||
|
||||
noteEditor.setNoteBackgroundIfProtected(note);
|
||||
}
|
||||
|
||||
|
||||
@@ -177,6 +177,10 @@ div.ui-tooltip {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#note-id-display {
|
||||
color: lightgrey;
|
||||
}
|
||||
|
||||
#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background-color:#fff;opacity:1;transition:opacity 2s ease}
|
||||
#loader{display:block;position:relative;left:50%;top:50%;width:150px;height:150px;margin:-75px 0 0 -75px;border-radius:50%;border:3px solid transparent;border-top-color:#777;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}
|
||||
#loader:before{content:"";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-radius:50%;border:3px solid transparent;border-top-color:#aaa;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite}
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = { build_date:"2017-12-23T14:02:07-05:00", build_revision: "51215cba1bd2da8a539e86dbd31004cf9adb3f93" };
|
||||
module.exports = { build_date:"2017-12-25T10:07:19-05:00", build_revision: "583123ab0a5df7dca5b19f2c67ab8ef853e72673" };
|
||||
|
||||
@@ -104,8 +104,6 @@ async function protectNote(note, dataKey, protect, sourceId) {
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
console.log("Updating...");
|
||||
|
||||
await sql.execute("UPDATE notes SET note_title = ?, note_text = ?, is_protected = ? WHERE note_id = ?",
|
||||
[note.note_title, note.note_text, note.is_protected, note.note_id]);
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo 'module.exports = { build_date:"'`date --iso-8601=seconds`'", build_revision: "'`git log -1 --format="%H"`'" };' > services/build.js
|
||||
@@ -95,6 +95,8 @@
|
||||
|
||||
<input autocomplete="off" value="" id="note-title" style="font-size: x-large; border: 0; flex-grow: 100;" tabindex="1">
|
||||
|
||||
<span id="note-id-display" title="Note ID"></span>
|
||||
|
||||
<button class="btn btn-xs" style="margin: 10px;" onclick="noteHistory.showCurrentNoteHistory();">Note history</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -171,9 +173,10 @@
|
||||
<form id="protected-session-password-form">
|
||||
<div class="form-group">
|
||||
<label for="protected-session-password">To proceed with requested action you need to enter protected session by entering password:</label>
|
||||
<input id="protected-session-password" style="width: 250px;" type="password">
|
||||
<button class="btn btn-sm">Show</button>
|
||||
<input id="protected-session-password" class="form-control" type="password">
|
||||
</div>
|
||||
|
||||
<button class="btn btn-sm">Enter protected session</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user