mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 08:16:40 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416cf9a2bc | ||
|
|
92271a84b7 | ||
|
|
7d456240a8 | ||
|
|
58362405c6 | ||
|
|
0bdf900e2e | ||
|
|
90de4b8600 | ||
|
|
4e5a95a1ac | ||
|
|
77278fe09e | ||
|
|
cfbeba80db | ||
|
|
865d298631 |
30
bin/build.sh
30
bin/build.sh
@@ -1,24 +1,34 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "Deleting dist"
|
echo "Deleting existing builds"
|
||||||
|
|
||||||
rm -r dist/*
|
rm -r dist/*
|
||||||
|
|
||||||
cp -r bin/deps/sqlite/* node_modules/sqlite3/lib/binding/
|
echo "Rebuilding binaries for linux-ia32"
|
||||||
cp -r bin/deps/scrypt/* node_modules/scrypt/bin/
|
|
||||||
cp -r bin/deps/image/cjpeg.exe node_modules/mozjpeg/vendor/
|
|
||||||
cp -r bin/deps/image/pngquant.exe node_modules/pngquant-bin/vendor/
|
|
||||||
cp -r bin/deps/image/gifsicle.exe node_modules/giflossy/vendor/
|
|
||||||
|
|
||||||
./node_modules/.bin/electron-rebuild --arch=ia32
|
./node_modules/.bin/electron-rebuild --arch=ia32
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager . --out=dist --platform=linux --arch=ia32 --overwrite
|
./node_modules/.bin/electron-packager . --out=dist --platform=linux --arch=ia32 --overwrite
|
||||||
|
|
||||||
|
./node_modules/.bin/electron-packager . --out=dist --platform=win32 --arch=x64 --overwrite
|
||||||
|
|
||||||
|
# we build x64 as second so that we keep X64 binaries in node_modules for local development
|
||||||
|
echo "Rebuilding binaries for linux-x64"
|
||||||
./node_modules/.bin/electron-rebuild --arch=x64
|
./node_modules/.bin/electron-rebuild --arch=x64
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager . --out=dist --platform=linux --arch=x64 --overwrite
|
./node_modules/.bin/electron-packager . --out=dist --platform=linux --arch=x64 --overwrite
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager . --out=dist --platform=win32 --arch=x64 --overwrite
|
echo "Copying required windows binaries"
|
||||||
|
|
||||||
# can't copy this before the packaging because the same file name is used for both linux and windows build
|
WIN_RES_DIR=./dist/trilium-win32-x64/resources/app
|
||||||
cp bin/deps/scrypt/win32-x64-57/scrypt.node ./dist/trilium-win32-x64/resources/app/node_modules/scrypt/build/Release/
|
|
||||||
|
cp -r bin/deps/sqlite/* $WIN_RES_DIR/node_modules/sqlite3/lib/binding/
|
||||||
|
cp bin/deps/image/cjpeg.exe $WIN_RES_DIR/node_modules/mozjpeg/vendor/
|
||||||
|
cp bin/deps/image/pngquant.exe $WIN_RES_DIR/node_modules/pngquant-bin/vendor/
|
||||||
|
cp bin/deps/image/gifsicle.exe $WIN_RES_DIR/node_modules/giflossy/vendor/
|
||||||
|
cp bin/deps/scrypt.node $WIN_RES_DIR/node_modules/scrypt/build/Release/
|
||||||
|
|
||||||
|
echo "Cleaning up unnecessary binaries from all builds"
|
||||||
|
|
||||||
|
rm -r ./dist/trilium-linux-ia32/resources/app/bin/deps
|
||||||
|
rm -r ./dist/trilium-linux-x64/resources/app/bin/deps
|
||||||
|
rm -r ./dist/trilium-win32-x64/resources/app/bin/deps
|
||||||
BIN
bin/deps/scrypt.node
Normal file
BIN
bin/deps/scrypt.node
Normal file
Binary file not shown.
Binary file not shown.
1
db/main_images.sql
Normal file
1
db/main_images.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -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 ('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><strong>Welcome to Trilium Notes!</strong></p><p> </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> </p><p>If you need any help, visit Trilium wesite: <a href="https://github.com/zadam/trilium">https://github.com/zadam/trilium</a></p><h3>Cleanup</h3><p>Once you''re finished with experimenting and want to cleanup these pages, you can simply delete them all.</p><h3>Formatting</h3><p>Trilium supports classic formatting like <i>italic</i>, <strong>bold</strong>, <i><strong>bold and italic</strong></i>. Of course you can add links like this one pointing to <a href="http://www.google.com">google.com</a></p><h4>Lists</h4><p><strong>Ordered:</strong></p><ol><li>First Item</li><li>Second item<ol><li>First sub-item</li><li>Second sub-item</li></ol></li></ol><p> </p><p><strong>Unordered:</strong></p><ul><li>Item</li><li>Another item<ul><li>Sub-item<ul><li>Sub-sub-item</li></ul></li></ul></li></ul><h4>Block quotes</h4><blockquote><p>Whereof one cannot speak, thereof one must be silent”</p><p>– Ludwig Wittgenstein</p></blockquote><p> </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', '<figure class="image image-style-side"><img src="/api/images/ed64aET6i379/trilium-small.png"></figure><p><strong>Welcome to Trilium Notes!</strong></p><p> </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> </p><p>If you need any help, visit Trilium wesite: <a href="https://github.com/zadam/trilium">https://github.com/zadam/trilium</a></p><h3>Cleanup</h3><p>Once you''re finished with experimenting and want to cleanup these pages, you can simply delete them all.</p><h3>Formatting</h3><p>Trilium supports classic formatting like <i>italic</i>, <strong>bold</strong>, <i><strong>bold and italic</strong></i>. Of course you can add links like this one pointing to <a href="http://www.google.com">google.com</a></p><h4>Lists</h4><p><strong>Ordered:</strong></p><ol><li>First Item</li><li>Second item<ol><li>First sub-item</li><li>Second sub-item</li></ol></li></ol><p> </p><p><strong>Unordered:</strong></p><ul><li>Item</li><li>Another item<ul><li>Sub-item<ul><li>Sub-sub-item</li></ul></li></ul></li></ul><h4>Block quotes</h4><blockquote><p>Whereof one cannot speak, thereof one must be silent”</p><p>– Ludwig Wittgenstein</p></blockquote><p> </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 ('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> </p><p> </p><p> </p><p> </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 ('L1Ox40M1aEyy', '2016', '<p>No content.</p><p> </p><p> </p><p> </p><p> </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');
|
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');
|
||||||
|
|||||||
1
db/main_notes_image.sql
Normal file
1
db/main_notes_image.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
INSERT INTO notes_image (note_image_id, note_id, image_id, is_deleted, date_modified, date_created) VALUES ('2EtgRRPfk4Fi', '1Heh2acXfPNt', 'ed64aET6i379', 0, '2018-01-08T04:41:30.663Z', '2018-01-08T04:41:30.663Z');
|
||||||
11
index.js
11
index.js
@@ -2,6 +2,7 @@
|
|||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const config = require('./services/config');
|
const config = require('./services/config');
|
||||||
|
const url = require("url");
|
||||||
|
|
||||||
const app = electron.app;
|
const app = electron.app;
|
||||||
|
|
||||||
@@ -38,6 +39,16 @@ function createMainWindow() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// prevent drag & drop to navigate away from trilium
|
||||||
|
win.webContents.on('will-navigate', (ev, targetUrl) => {
|
||||||
|
const parsedUrl = url.parse(targetUrl);
|
||||||
|
|
||||||
|
// we still need to allow internal redirects from setup and migration pages
|
||||||
|
if (parsedUrl.hostname !== 'localhost' || (parsedUrl.path && parsedUrl.path !== '/')) {
|
||||||
|
ev.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"description": "Trilium Notes",
|
"description": "Trilium Notes",
|
||||||
"version": "0.3.1",
|
"version": "0.3.3",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ const noteEditor = (function() {
|
|||||||
|
|
||||||
noteTitleEl.val(currentNote.detail.note_title);
|
noteTitleEl.val(currentNote.detail.note_title);
|
||||||
|
|
||||||
editor.setData(currentNote.detail.note_text);
|
// temporary workaround for https://github.com/ckeditor/ckeditor5-enter/issues/49
|
||||||
|
editor.setData(currentNote.detail.note_text ? currentNote.detail.note_text : "<p></p>");
|
||||||
|
|
||||||
noteChangeDisabled = false;
|
noteChangeDisabled = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
module.exports = { build_date:"2018-01-07T21:56:39-05:00", build_revision: "29eb88bac3bbc1db17bb4ed75f9b8bfe16333967" };
|
module.exports = { build_date:"2018-01-12T23:30:47-05:00", build_revision: "92271a84b78c8adfa5da57392520a659e61377bc" };
|
||||||
|
|||||||
@@ -31,11 +31,15 @@ const dbReady = new Promise((resolve, reject) => {
|
|||||||
const schema = fs.readFileSync(resource_dir.DB_INIT_DIR + '/schema.sql', 'UTF-8');
|
const schema = fs.readFileSync(resource_dir.DB_INIT_DIR + '/schema.sql', 'UTF-8');
|
||||||
const notesSql = fs.readFileSync(resource_dir.DB_INIT_DIR + '/main_notes.sql', 'UTF-8');
|
const notesSql = fs.readFileSync(resource_dir.DB_INIT_DIR + '/main_notes.sql', 'UTF-8');
|
||||||
const notesTreeSql = fs.readFileSync(resource_dir.DB_INIT_DIR + '/main_notes_tree.sql', 'UTF-8');
|
const notesTreeSql = fs.readFileSync(resource_dir.DB_INIT_DIR + '/main_notes_tree.sql', 'UTF-8');
|
||||||
|
const imagesSql = fs.readFileSync(resource_dir.DB_INIT_DIR + '/main_images.sql', 'UTF-8');
|
||||||
|
const notesImageSql = fs.readFileSync(resource_dir.DB_INIT_DIR + '/main_notes_image.sql', 'UTF-8');
|
||||||
|
|
||||||
await doInTransaction(async () => {
|
await doInTransaction(async () => {
|
||||||
await executeScript(schema);
|
await executeScript(schema);
|
||||||
await executeScript(notesSql);
|
await executeScript(notesSql);
|
||||||
await executeScript(notesTreeSql);
|
await executeScript(notesTreeSql);
|
||||||
|
await executeScript(imagesSql);
|
||||||
|
await executeScript(notesImageSql);
|
||||||
|
|
||||||
const startNoteId = await getFirstValue("SELECT note_id FROM notes_tree WHERE parent_note_id = 'root' AND is_deleted = 0 ORDER BY note_position");
|
const startNoteId = await getFirstValue("SELECT note_id FROM notes_tree WHERE parent_note_id = 'root' AND is_deleted = 0 ORDER BY note_position");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user