Compare commits

..

9 Commits

Author SHA1 Message Date
zadam d0e5ad5b7e release 0.61.1-beta
Publish Docker image / Push Docker image to multiple registries (push) Failing after 36s
2023-07-24 23:47:57 +02:00
zadam b4631e927c Merge remote-tracking branch 'origin/master' 2023-07-24 23:47:27 +02:00
zadam b7bc843a37 fix demo document statistics, closes #4117 2023-07-24 23:46:02 +02:00
zadam 98d65f8767 Merge pull request #4114 from SiriusXT/master
Fix bugs in highlights,v0.61.0-beta
2023-07-24 22:58:20 +02:00
zadam 0599891ec0 Merge pull request #4001 from dymani/reopen-in-place
Reopen recently closed tab/split in place
2023-07-24 22:52:14 +02:00
zadam cc06701565 swiftshader deletion is no longer needed 2023-07-24 22:33:36 +02:00
SnnBcd xt 40683985cd Fix bugs in highlights 2023-07-22 19:13:03 +00:00
dymani 50ec17433d Fix move pane button after reopen split 2023-06-03 05:59:53 +08:00
dymani 2c8eb82d42 Reopen recently closed tab/split in place 2023-06-03 05:54:33 +08:00
11 changed files with 60 additions and 14 deletions
-3
View File
@@ -24,9 +24,6 @@ mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
cp 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
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
cp -r dump-db $BUILD_DIR/
-3
View File
@@ -22,9 +22,6 @@ rm -rf $BUILD_DIR
mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
# removing software WebGL binaries because they are pretty huge and not necessary
rm -r $BUILD_DIR/swiftshader
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
cp -r dump-db $BUILD_DIR/
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.61.0-beta",
"version": "0.61.1-beta",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {
+32 -5
View File
@@ -20,7 +20,7 @@ export default class TabManager extends Component {
this.activeNtxId = null;
// elements are arrays of note contexts for each tab (one main context + subcontexts [splits])
// elements are arrays of {contexts, position}, storing note contexts for each tab (one main context + subcontexts [splits]), and the original position of the tab
this.recentlyClosedTabs = [];
this.tabsUpdate = new SpacedUpdate(async () => {
@@ -448,21 +448,23 @@ export default class TabManager extends Component {
removeNoteContexts(noteContextsToRemove) {
const ntxIdsToRemove = noteContextsToRemove.map(nc => nc.ntxId);
const position = this.noteContexts.findIndex(nc => ntxIdsToRemove.includes(nc.ntxId));
this.children = this.children.filter(nc => !ntxIdsToRemove.includes(nc.ntxId));
this.addToRecentlyClosedTabs(noteContextsToRemove);
this.addToRecentlyClosedTabs(noteContextsToRemove, position);
this.triggerEvent('noteContextRemoved', {ntxIds: ntxIdsToRemove});
this.tabsUpdate.scheduleUpdate();
}
addToRecentlyClosedTabs(noteContexts) {
addToRecentlyClosedTabs(noteContexts, position) {
if (noteContexts.length === 1 && noteContexts[0].isEmpty()) {
return;
}
this.recentlyClosedTabs.push(noteContexts);
this.recentlyClosedTabs.push({contexts: noteContexts, position: position});
}
tabReorderEvent({ntxIdsInOrder}) {
@@ -574,7 +576,8 @@ export default class TabManager extends Component {
closeLastEmptyTab = this.noteContexts[0];
}
const noteContexts = this.recentlyClosedTabs.pop();
const lastClosedTab = this.recentlyClosedTabs.pop();
const noteContexts = lastClosedTab.contexts;
for (const noteContext of noteContexts) {
this.child(noteContext);
@@ -582,6 +585,30 @@ export default class TabManager extends Component {
await this.triggerEvent('newNoteContextCreated', {noteContext});
}
// restore last position of contexts stored in tab manager
const ntxsInOrder = [
...this.noteContexts.slice(0, lastClosedTab.position),
...this.noteContexts.slice(-noteContexts.length),
...this.noteContexts.slice(lastClosedTab.position, -noteContexts.length),
]
await this.noteContextReorderEvent({ntxIdsInOrder: ntxsInOrder.map(nc => nc.ntxId)});
let mainNtx = noteContexts.find(nc => nc.isMainContext());
if (mainNtx) {
// reopened a tab, need to reorder new tab widget in tab row
await this.triggerEvent('contextsReopened', {
mainNtxId: mainNtx.ntxId,
tabPosition: ntxsInOrder.filter(nc => nc.isMainContext()).findIndex(nc => nc.ntxId === mainNtx.ntxId)
});
} else {
// reopened a single split, need to reorder the pane widget in split note container
await this.triggerEvent('contextsReopened', {
ntxId: ntxsInOrder[lastClosedTab.position].ntxId,
// this is safe since lastClosedTab.position can never be 0 in this case
afterNtxId: ntxsInOrder[lastClosedTab.position - 1].ntxId
});
}
const noteContextToActivate = noteContexts.length === 1
? noteContexts[0]
: noteContexts.find(nc => nc.isMainContext());
@@ -304,6 +304,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.createLink = linkService.createLink;
/** @deprecated - use api.createLink() instead */
this.createNoteLink = linkService.createLink;
/**
* Adds given text to the editor cursor
*
@@ -44,4 +44,8 @@ export default class MovePaneButton extends OnClickButtonWidget {
async noteContextReorderEvent() {
this.refresh();
}
async contextsReopenedEvent() {
this.refresh();
}
}
@@ -136,6 +136,15 @@ export default class SplitNoteContainer extends FlexContainer {
}
}
contextsReopenedEvent({ntxId, afterNtxId}) {
if (ntxId === undefined || afterNtxId === undefined) {
// no single split reopened
return;
}
this.$widget.find(`[data-ntx-id="${ntxId}"]`)
.insertAfter(this.$widget.find(`[data-ntx-id="${afterNtxId}"]`));
}
async refresh() {
this.toggleExt(true);
}
+1 -1
View File
@@ -85,7 +85,7 @@ export default class HighlightsListWidget extends RightPanelWidget {
const optionsHighlightsList = JSON.parse(options.get('highlightsList'));
if (note.isLabelTruthy('hideHighlightWidget') || !optionsHighlightsList) {
if (note.isLabelTruthy('hideHighlightWidget') || !optionsHighlightsList.length) {
this.toggleInt(false);
this.triggerCommand("reEvaluateRightPaneVisibility");
return;
+9
View File
@@ -620,6 +620,15 @@ export default class TabRowWidget extends BasicWidget {
this.updateTabById(newMainNtxId);
}
contextsReopenedEvent({mainNtxId, tabPosition}) {
if (mainNtxId === undefined || tabPosition === undefined) {
// no tab reopened
return;
}
const tabEl = this.getTabById(mainNtxId)[0];
tabEl.parentNode.insertBefore(tabEl, this.tabEls[tabPosition]);
}
updateTabById(ntxId) {
const $tab = this.getTabById(ntxId);
+1 -1
View File
@@ -1 +1 @@
module.exports = { buildDate:"2023-07-22T17:51:08+02:00", buildRevision: "98b0baefe2fca32d4507ea8f690574968e602c10" };
module.exports = { buildDate:"2023-07-24T23:47:57+02:00", buildRevision: "b4631e927c5848fdb48a8182b112b0f815192dcf" };