Compare commits

...

27 Commits

Author SHA1 Message Date
azivner
695f0e5879 release 0.1.0 2017-12-26 22:59:46 -05:00
azivner
ae337e4500 don't open dev tools for search page in electron 2017-12-26 22:24:47 -05:00
azivner
19ffa14f10 hide logout button in electron since it doesn't do anything 2017-12-26 22:19:42 -05:00
azivner
bf3f26fde8 using textarea instead of pre for note source since that's easier to copy to clipboard 2017-12-26 20:54:41 -05:00
azivner
dece400207 release 0.0.11 2017-12-26 19:57:44 -05:00
azivner
baab745462 some visual tweaks 2017-12-26 19:54:43 -05:00
azivner
0d3b3ec7c5 alt+s toggles search instead of just showing it 2017-12-26 19:16:04 -05:00
azivner
7aff20bb0d added show note source 2017-12-26 18:15:29 -05:00
azivner
5acf84aece Calling project "Trilium Notes" in some places as it is more self explanatory 2017-12-26 12:55:40 -05:00
azivner
c58a0df76d added list of wiki pages into README 2017-12-26 11:08:23 -05:00
azivner
20c14a1920 fix collapse tree keyboard shortcut 2017-12-26 11:00:04 -05:00
azivner
04063d8a9c sql console reports successful execution (useful when query doesn't produce any result set like in update/delete) 2017-12-26 10:21:33 -05:00
azivner
dd69e0135b added collapse sub-tree in context menu 2017-12-26 10:00:08 -05:00
azivner
ab6e78f726 keyboard shortcut titles on buttons 2017-12-26 09:44:16 -05:00
azivner
9029d18178 fix go to external link by double clicking 2017-12-26 09:10:54 -05:00
azivner
e9a1791e3d fix unwanted movement with navigation keys 2017-12-25 21:47:32 -05:00
azivner
70e13c8a20 release 0.0.10 2017-12-25 21:06:39 -05:00
azivner
7e1cc729f9 have to add changed files to index before committing 2017-12-25 21:06:35 -05:00
azivner
87e7828440 release scripts fixes 2017-12-25 21:05:08 -05:00
azivner
29fd78aee5 fix version setting in release script 2017-12-25 20:45:59 -05:00
azivner
f90c2317fc release script, moved all scripts to bin directory 2017-12-25 15:01:33 -05:00
azivner
bca5087426 fix links 2017-12-25 12:50:16 -05:00
azivner
583123ab0a classes in extraClasses need to be separated by space, not comma 2017-12-25 09:59:48 -05:00
azivner
12f70b28c8 display current note ID in editor (useful in Electron which doesn't have address bar) 2017-12-25 09:46:11 -05:00
azivner
31a4a201a8 fix setting "protected" class and background on note tree 2017-12-25 09:30:37 -05:00
azivner
5ec866aa50 fixed links in readme 2017-12-25 08:37:40 -05:00
azivner
cdede3240c updated build script to package both linux and windows distribution packages with xz and 7zip 2017-12-24 23:14:19 -05:00
27 changed files with 293 additions and 98 deletions

View File

@@ -1,12 +1,12 @@
# Trilium
Hierarchical note taking application.
# Trilium Notes
Trilium Notes is a hierarchical note taking application. Picture tells a thousand words:
![](https://raw.githubusercontent.com/wiki/zadam/trilium/images/screenshot.png)
## 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)
* Seamless note versioning
@@ -16,17 +16,28 @@ 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-based) 64-bit builds are available for Linux and Windows.
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
See [wiki](https://github.com/zadam/trilium/wiki/Home) for complete list of available pages.
List of documentation pages:
* [Installation as webapp](https://github.com/zadam/trilium/wiki/Installation-as-webapp)
* [Note navigation](https://github.com/zadam/trilium/wiki/Note-navigation)
* [Tree manipulation](https://github.com/zadam/trilium/wiki/Tree-manipulation)
* [Links](https://github.com/zadam/trilium/wiki/Links)
* [Cloning notes](https://github.com/zadam/trilium/wiki/Cloning-notes)
* [Protected notes](https://github.com/zadam/trilium/wiki/Protected-notes)
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization)
* [Document](https://github.com/zadam/trilium/wiki/Document)
* [Keyboard shortcuts](https://github.com/zadam/trilium/wiki/Keyboard-shortcuts)
* [Troubleshooting](https://github.com/zadam/trilium/wiki/Troubleshooting)

View File

@@ -1,6 +1,4 @@
#!/bin/bash
./set-build.sh
#!/usr/bin/env bash
echo "Deleting dist"
@@ -16,9 +14,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

View File

@@ -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
View 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

70
bin/release.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/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
echo "Releasing Trilium $VERSION"
jq '.version = "'$VERSION'"' package.json|sponge package.json
git add package.json
echo 'module.exports = { build_date:"'`date --iso-8601=seconds`'", build_revision: "'`git log -1 --format="%H"`'" };' > services/build.js
git add services/build.js
TAG=v$VERSION
echo "Committing package.json version change"
git commit -m "release $VERSION"
git push
echo "Tagging commit with $TAG"
git tag $TAG
git push origin $TAG
bin/build.sh
bin/package.sh
LINUX_BUILD=trilium-linux-$VERSION.7z
WINDOWS_BUILD=trilium-windows-$VERSION.7z
echo "Creating release in GitHub"
github-release release \
--tag $TAG \
--name "$TAG release"
echo "Uploading linux build"
github-release upload \
--tag $TAG \
--name "$LINUX_BUILD" \
--file "dist/$LINUX_BUILD"
echo "Uploading windows build"
github-release upload \
--tag $TAG \
--name "$WINDOWS_BUILD" \
--file "dist/$WINDOWS_BUILD"
echo "Release finished!"

View File

@@ -1,5 +1,5 @@
INSERT INTO notes (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified) VALUES ('root', 'root', 'root', 0, 0, '2017-12-22T11:41:07.000Z', '2017-12-22T11:41:07.000Z');
INSERT INTO notes (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified) VALUES ('1Heh2acXfPNt', 'Trilium Demo', '<p>Welcome to Trilium!</p><p>&nbsp;</p><p>This is initial document provided by default Trilium to showcase some of its features and also give you some ideas how you might structure your notes. You can play with it, modify note content and tree structure as you wish.</p><p>&nbsp;</p><p>If you need any help, visit Trilium wesite: <a href="https://github.com/zadam/trilium">https://github.com/zadam/trilium</a></p><p>&nbsp;</p><p>Once you''re finished with experimenting and want to cleanup these pages, you can simply delete them all.</p>', 0, 0, '2017-12-23T00:46:39.304Z', '2017-12-23T04:08:45.445Z');
INSERT INTO notes (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified) VALUES ('1Heh2acXfPNt', 'Trilium Demo', '<p>Welcome to Trilium Notes!</p><p>&nbsp;</p><p>This is initial document provided by default Trilium to showcase some of its features and also give you some ideas how you might structure your notes. You can play with it, modify note content and tree structure as you wish.</p><p>&nbsp;</p><p>If you need any help, visit Trilium wesite: <a href="https://github.com/zadam/trilium">https://github.com/zadam/trilium</a></p><p>&nbsp;</p><p>Once you''re finished with experimenting and want to cleanup these pages, you can simply delete them all.</p>', 0, 0, '2017-12-23T00:46:39.304Z', '2017-12-23T04:08:45.445Z');
INSERT INTO notes (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified) VALUES ('3RkyK9LI18dO', 'Journal', '<p>Expand note on the left pane to see content.</p>', 0, 0, '2017-12-23T01:20:04.181Z', '2017-12-23T18:07:55.377Z');
INSERT INTO notes (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified) VALUES ('L1Ox40M1aEyy', '2016', '<p>No content.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>', 0, 0, '2017-12-23T01:20:45.365Z', '2017-12-23T16:40:43.129Z');
INSERT INTO notes (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified) VALUES ('HJusZTbBU494', '2017', '<p>No content.</p>', 0, 0, '2017-12-23T01:20:50.709Z', '2017-12-23T16:41:03.119Z');

View File

@@ -1,7 +1,7 @@
{
"name": "trilium",
"description": "Trilium",
"version": "0.0.9",
"description": "Trilium Notes",
"version": "0.1.0",
"scripts": {
"start": "node ./bin/www",
"test-electron": "xo",

View File

@@ -69,7 +69,9 @@ const contextMenu = (function() {
{title: "Copy / clone <kbd>Ctrl+C</kbd>", cmd: "copy", uiIcon: "ui-icon-copy"},
{title: "Cut <kbd>Ctrl+X</kbd>", cmd: "cut", uiIcon: "ui-icon-scissors"},
{title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"},
{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"}
{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"},
{title: "----"},
{title: "Collapse sub-tree <kbd>Alt+-</kbd>", cmd: "collapse-sub-tree", uiIcon: "ui-icon-minus"}
],
beforeOpen: (event, ui) => {
const node = $.ui.fancytree.getNode(ui.target);
@@ -120,6 +122,9 @@ const contextMenu = (function() {
else if (ui.cmd === "delete") {
treeChanges.deleteNode(node);
}
else if (ui.cmd === "collapse-sub-tree") {
noteTree.collapseTree(node);
}
else {
messaging.logError("Unknown command: " + ui.cmd);
}

View File

@@ -13,7 +13,7 @@ const editTreePrefix = (function() {
await dialogEl.dialog({
modal: true,
width: 800
width: 500
});
const currentNode = noteTree.getCurrentNode();

View File

@@ -29,7 +29,7 @@ const noteHistory = (function() {
for (const item of historyItems) {
const dateModified = parseDate(item.date_modified_from);
$("#note-history-list").append($('<option>', {
listEl.append($('<option>', {
value: item.note_history_id,
text: formatDateTime(dateModified)
}));
@@ -42,6 +42,9 @@ const noteHistory = (function() {
listEl.val(noteHistoryId).trigger('change');
}
else {
titleEl.text("No history for this note yet...");
}
}
$(document).bind('keydown', 'alt+h', e => {

View File

@@ -0,0 +1,57 @@
"use strict";
const noteSource = (function() {
const dialogEl = $("#note-source-dialog");
const noteSourceEl = $("#note-source");
function showDialog() {
glob.activeDialog = dialogEl;
dialogEl.dialog({
modal: true,
width: 800,
height: 500
});
const noteText = noteEditor.getCurrentNote().detail.note_text;
noteSourceEl.text(formatHtml(noteText));
}
function formatHtml(str) {
const div = document.createElement('div');
div.innerHTML = str.trim();
return formatNode(div, 0).innerHTML.trim();
}
function formatNode(node, level) {
const indentBefore = new Array(level++ + 1).join(' ');
const indentAfter = new Array(level - 1).join(' ');
let textNode;
for (let i = 0; i < node.children.length; i++) {
textNode = document.createTextNode('\n' + indentBefore);
node.insertBefore(textNode, node.children[i]);
formatNode(node.children[i], level);
if (node.lastElementChild === node.children[i]) {
textNode = document.createTextNode('\n' + indentAfter);
node.appendChild(textNode);
}
}
return node;
}
$(document).bind('keydown', 'ctrl+u', e => {
showDialog();
e.preventDefault();
});
return {
showDialog
};
})();

View File

@@ -28,6 +28,9 @@ const sqlConsole = (function() {
showError(result.error);
return;
}
else {
showMessage("Query was executed successfully.");
}
const rows = result.rows;

View File

@@ -49,7 +49,7 @@ $(document).bind('keydown', 'ctrl+f', () => {
const searchInPage = require('electron-in-page-search').default;
const remote = require('electron').remote;
const inPageSearch = searchInPage(remote.getCurrentWebContents(), { openDevToolsOfSearchWindow: true });
const inPageSearch = searchInPage(remote.getCurrentWebContents());
inPageSearch.openSearchWindow();
@@ -164,4 +164,6 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
messaging.logError(message);
return false;
};
};
$("#logout-button").toggle(!isElectron());

View File

@@ -42,18 +42,20 @@ const link = (function() {
e.preventDefault();
const linkEl = $(e.target);
const notePath = linkEl.attr("note-path") ? linkEl.attr("note-path") : getNotePathFromLink(linkEl.attr('href'));
const address = linkEl.attr("note-path") ? linkEl.attr("note-path") : linkEl.attr('href');
if (!notePath) {
if (!address) {
return;
}
if (notePath.startsWith('http')) {
window.open(notePath, '_blank');
if (address.startsWith('http')) {
window.open(address, '_blank');
return;
}
const notePath = getNotePathFromLink(address);
noteTree.activateNode(notePath);
// this is quite ugly hack, but it seems like we can't close the tooltip otherwise
@@ -84,8 +86,8 @@ const link = (function() {
// when click on link popup, in case of internal link, just go the the referenced note instead of default behavior
// of opening the link in new window/tab
$(document).on('click', "a[action='note']", goToLink);
$(document).on('click', 'div.popover-content a, div.ui-tooltip-content', goToLink);
$(document).on('dblclick', '#note-detail a, div.ui-tooltip-content', goToLink);
$(document).on('click', 'div.popover-content a, div.ui-tooltip-content a', goToLink);
$(document).on('dblclick', '#note-detail a', goToLink);
return {
getNodePathFromLabel,

View File

@@ -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();
}

View File

@@ -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) {
@@ -433,20 +429,31 @@ const noteTree = (function() {
"f2": node => {
editTreePrefix.showDialog(node);
},
"alt+-": node => {
collapseTree(node);
},
// code below shouldn't be necessary normally, however there's some problem with interaction with context menu plugin
// after opening context menu, standard shortcuts don't work, but they are detected here
// so we essentially takeover the standard handling with our implementation.
"left": node => {
node.navigate($.ui.keyCode.LEFT, true);
return false;
},
"right": node => {
node.navigate($.ui.keyCode.RIGHT, true);
return false;
},
"up": node => {
node.navigate($.ui.keyCode.UP, true);
return false;
},
"down": node => {
node.navigate($.ui.keyCode.DOWN, true);
return false;
}
};
@@ -527,9 +534,9 @@ const noteTree = (function() {
});
return false;
// Handle Ctrl-C, -X and -V
// Handle Ctrl+C, +X and +V
case 67:
if (event.ctrlKey) { // Ctrl-C
if (event.ctrlKey) { // Ctrl+C
contextMenu.copy(node);
showMessage("Note copied into clipboard.");
@@ -538,7 +545,7 @@ const noteTree = (function() {
}
break;
case 88:
if (event.ctrlKey) { // Ctrl-X
if (event.ctrlKey) { // Ctrl+X
contextMenu.cut(node);
showMessage("Note cut into clipboard.");
@@ -547,7 +554,7 @@ const noteTree = (function() {
}
break;
case 86:
if (event.ctrlKey) { // Ctrl-V
if (event.ctrlKey) { // Ctrl+V
contextMenu.pasteInto(node);
showMessage("Note pasted from clipboard into current note.");
@@ -599,13 +606,17 @@ const noteTree = (function() {
$(() => loadTree().then(noteTree => initFancyTree(noteTree)));
function collapseTree() {
treeEl.fancytree("getRootNode").visit(node => {
node.setExpanded(false);
});
function collapseTree(node = null) {
if (!node) {
node = treeEl.fancytree("getRootNode");
}
node.setExpanded(false);
node.visit(node => node.setExpanded(false));
}
$(document).bind('keydown', 'alt+c', collapseTree);
$(document).bind('keydown', 'alt+c', () => collapseTree()); // don't use shortened form since collapseTree() accepts argument
function scrollToCurrentNote() {
const node = getCurrentNode();
@@ -617,8 +628,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 +793,8 @@ const noteTree = (function() {
reload,
collapseTree,
scrollToCurrentNote,
setCurrentNoteTreeBasedOnProtectedStatus,
setNoteTreeBackgroundBasedOnProtectedStatus,
setProtected,
getCurrentNode,
activateNode,
getCurrentNotePath,

View File

@@ -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);
}

View File

@@ -8,14 +8,10 @@ const searchTree = (function() {
resetSearchButton.click(resetSearch);
function showSearch() {
searchBoxEl.show();
searchInputEl.focus();
}
function toggleSearch() {
if (searchBoxEl.is(":hidden")) {
showSearch();
searchBoxEl.show();
searchInputEl.focus();
}
else {
resetSearch();
@@ -52,7 +48,11 @@ const searchTree = (function() {
}
}).focus();
$(document).bind('keydown', 'alt+s', showSearch);
$(document).bind('keydown', 'alt+s', e => {
toggleSearch();
e.preventDefault();
});
return {
toggleSearch

View File

@@ -52,7 +52,7 @@ const treeChanges = (function() {
}
async function deleteNode(node) {
if (!confirm('Are you sure you want to delete note "' + node.title + '"?')) {
if (!confirm('Are you sure you want to delete note "' + node.title + '" and all its sub-notes?')) {
return;
}
@@ -83,6 +83,8 @@ const treeChanges = (function() {
}
noteTree.reload();
showMessage("Note has been deleted.");
}
async function moveNodeUpInHierarchy(node) {

View File

@@ -168,8 +168,7 @@ div.ui-tooltip {
}
/* Allow to use <kbd> elements inside the title to define shortcut hints. */
.ui-menu kbd {
margin-left: 30px;
.ui-menu kbd, button kbd {
float: right;
color: black;
border: none;
@@ -177,6 +176,21 @@ div.ui-tooltip {
box-shadow: none;
}
.ui-menu kbd {
margin-left: 30px;
}
#note-id-display {
color: lightgrey;
margin-left: 10px;
}
#note-source {
height: 98%;
width: 100%;
overflow: scroll;
}
#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}

View File

@@ -67,7 +67,7 @@ router.delete('/:noteTreeId', auth.checkApiAuth, async (req, res, next) => {
router.get('/', auth.checkApiAuth, async (req, res, next) => {
const search = '%' + req.query.search + '%';
const result = await sql.getAll("SELECT note_id FROM notes WHERE note_title liKE ? OR note_text LIKE ?", [search, search]);
const result = await sql.getAll("SELECT note_id FROM notes WHERE note_title LIKE ? OR note_text LIKE ?", [search, search]);
const noteIdList = [];

View File

@@ -1 +1 @@
module.exports = { build_date:"2017-12-23T14:02:07-05:00", build_revision: "51215cba1bd2da8a539e86dbd31004cf9adb3f93" };
module.exports = { build_date:"2017-12-26T22:59:46-05:00", build_revision: "ae337e45009c3938dddcbb3452b271f97eb80bce" };

View File

@@ -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]);

View File

@@ -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

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Trilium</title>
<title>Trilium Notes</title>
</head>
<body>
<div id="loader-wrapper"><div id="loader"></div></div>
@@ -12,12 +12,12 @@
<div id="header-title">
<img src="images/app-icons/png/24x24.png">
Trilium
Trilium Notes
</div>
<div style="flex-grow: 100;">
<button class="btn btn-xs" onclick="jumpToNote.showDialog();">Jump to note</button>
<button class="btn btn-xs" onclick="recentNotes.showDialog();">Recent notes</button>
<button class="btn btn-xs" onclick="jumpToNote.showDialog();" title="CTRL+J">Jump to note</button>
<button class="btn btn-xs" onclick="recentNotes.showDialog();" title="CTRL+E">Recent notes</button>
<button class="btn btn-xs" onclick="recentChanges.showDialog();">Recent changes</button>
<button class="btn btn-xs" onclick="eventLog.showDialog();">Event log</button>
</div>
@@ -29,7 +29,7 @@
<button class="btn btn-xs" onclick="settings.showDialog();">Settings</button>
<form action="logout" method="POST" style="display: inline;">
<form action="logout" id="logout-button" method="POST" style="display: inline;">
<input type="submit" class="btn btn-xs" value="Logout">
</form>
</div>
@@ -45,7 +45,7 @@
<img src="images/icons/list.png" alt="Collapse note tree"/>
</a>
<a onclick="noteTree.scrollToCurrentNote()" title="Scroll to current note" class="icon-action">
<a onclick="noteTree.scrollToCurrentNote()" title="Scroll to current note. Shortcut CTRL+." class="icon-action">
<img src="images/icons/crosshair.png" alt="Scroll to current note"/>
</a>
@@ -95,7 +95,9 @@
<input autocomplete="off" value="" id="note-title" style="font-size: x-large; border: 0; flex-grow: 100;" tabindex="1">
<button class="btn btn-xs" style="margin: 10px;" onclick="noteHistory.showCurrentNoteHistory();">Note history</button>
<span id="note-id-display" title="Note ID"></span>
<button class="btn btn-xs" title="ALT+H" style="margin: 10px;" onclick="noteHistory.showCurrentNoteHistory();">Note history</button>
</div>
</div>
@@ -111,13 +113,13 @@
<br/><br/>
<p>
<button class="btn btn-sm" id="recent-notes-jump-to">Jump to (enter)</button>
<button class="btn btn-sm" id="recent-notes-jump-to">Jump to <kbd>enter</kbd></button>
&nbsp;
<button class="btn btn-sm" id="recent-notes-add-link">Add link (l)</button>
<button class="btn btn-sm" id="recent-notes-add-link">Add link <kbd>l</kbd></button>
<button class="btn btn-sm" id="recent-notes-add-current-as-child">Add current as child (c)</button>
<button class="btn btn-sm" id="recent-notes-add-current-as-child">Add current as child <kbd>c</kbd></button>
<button class="btn btn-sm" id="recent-notes-add-recent-as-child">Add recent as child (r)</button>
<button class="btn btn-sm" id="recent-notes-add-recent-as-child">Add recent as child <kbd>r</kbd></button>
</p>
</div>
@@ -163,17 +165,18 @@
<input id="jump-to-note-autocomplete" style="width: 100%;">
</div>
<button name="action" value="jump" class="btn btn-sm">Jump</button>
<button name="action" value="jump" class="btn btn-sm">Jump <kbd>enter</kbd></button>
</form>
</div>
<div id="protected-session-password-dialog" title="Protected session" style="display: none;">
<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>
<label for="protected-session-password">To proceed with requested action you need to start protected session by entering password:</label>
<input id="protected-session-password" class="form-control" type="password">
</div>
<button class="btn btn-sm">Start protected session <kbd>enter</kbd></button>
</form>
</div>
@@ -315,7 +318,7 @@
<div id="sql-console-dialog" title="SQL console" style="display: none; padding: 20px;">
<textarea style="width: 100%; height: 100px" id="sql-console-query"></textarea>
<button class="btn btn-danger" id="sql-console-execute">Execute</button>
<button class="btn btn-danger" id="sql-console-execute">Execute <kbd>CTRL+ENTER</kbd></button>
<table id="sql-console-results" class="table table-striped" style="overflow: scroll; width: 100%;">
<thead></thead>
@@ -323,6 +326,10 @@
</table>
</div>
<div id="note-source-dialog" title="Note source" style="display: none; padding: 20px;">
<textarea id="note-source" readonly="readonly"></textarea>
</div>
<div id="tooltip" style="display: none;"></div>
<script type="text/javascript">
@@ -387,6 +394,7 @@
<script src="javascripts/dialogs/event_log.js"></script>
<script src="javascripts/dialogs/edit_tree_prefix.js"></script>
<script src="javascripts/dialogs/sql_console.js"></script>
<script src="javascripts/dialogs/note_source.js"></script>
<script src="javascripts/link.js"></script>
<script src="javascripts/sync.js"></script>

View File

@@ -6,7 +6,7 @@
</head>
<body>
<div style="width: 500px; margin: auto;">
<h1>Trilium setup</h1>
<h1>Trilium Notes setup</h1>
<div class="alert alert-warning" id="alert" style="display: none;">
</div>