mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 02:05:53 +01:00
Merge remote-tracking branch 'upstream-next/develop' into feature/i18n
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Component from "../components/component.js";
|
||||
|
||||
import { t } from "../services/i18n.js";
|
||||
import toastService from "../services/toast.js";
|
||||
|
||||
/**
|
||||
* This is the base widget for all other widgets.
|
||||
@@ -81,7 +82,18 @@ class BasicWidget extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
this.doRender();
|
||||
try {
|
||||
this.doRender();
|
||||
} catch (e) {
|
||||
toastService.showPersistent({
|
||||
title: t("toast.widget-error.title"),
|
||||
icon: "alert",
|
||||
message: t("toast.widget-error.message", {
|
||||
title: this.widgetTitle,
|
||||
message: e.message
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
this.$widget.attr('data-component-id', this.componentId);
|
||||
this.$widget
|
||||
|
||||
@@ -16,20 +16,31 @@ const TPL = `
|
||||
min-width: 20em;
|
||||
}
|
||||
|
||||
.global-menu-button {
|
||||
background-image: url("${window.glob.assetPath}/images/icon-black.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 40% 50%;
|
||||
background-size: 45px;
|
||||
.global-menu-button {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.global-menu-button:hover {
|
||||
background-image: url("${window.glob.assetPath}/images/icon-color.svg");
|
||||
padding: 6px;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.global-menu-button > svg path {
|
||||
fill: var(--launcher-pane-text-color);
|
||||
}
|
||||
|
||||
.global-menu-button:hover { border: 0; }
|
||||
.global-menu-button:hover > svg path {
|
||||
transition: 200ms ease-in-out fill;
|
||||
}
|
||||
.global-menu-button:hover > svg path.st0 { fill:#95C980; }
|
||||
.global-menu-button:hover > svg path.st1 { fill:#72B755; }
|
||||
.global-menu-button:hover > svg path.st2 { fill:#4FA52B; }
|
||||
.global-menu-button:hover > svg path.st3 { fill:#EE8C89; }
|
||||
.global-menu-button:hover > svg path.st4 { fill:#E96562; }
|
||||
.global-menu-button:hover > svg path.st5 { fill:#E33F3B; }
|
||||
.global-menu-button:hover > svg path.st6 { fill:#EFB075; }
|
||||
.global-menu-button:hover > svg path.st7 { fill:#E99547; }
|
||||
.global-menu-button:hover > svg path.st8 { fill:#E47B19; }
|
||||
|
||||
.global-menu-button-update-available {
|
||||
position: absolute;
|
||||
@@ -89,11 +100,27 @@ const TPL = `
|
||||
left: 0;
|
||||
top: 5px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
<button type="button" data-toggle="dropdown" data-placement="right"
|
||||
aria-haspopup="true" aria-expanded="false"
|
||||
class="icon-action global-menu-button" title="${t('global_menu.menu')}">
|
||||
<svg viewBox="0 0 256 256">
|
||||
<g>
|
||||
<path class="st0" d="m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z"/>
|
||||
<path class="st1" d="m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z"/>
|
||||
<path class="st2" d="m220.5 96.2c-21.1 8.6-46.6 5.3-63.7-0.2l49.2-39.4-51.2 35.9c0.3-15.8 3.5-36.6 14.3-52.8 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.8 66z"/>
|
||||
|
||||
<path class="st3" d="m106.7 179c-5.8-21 5.2-43.8 15.5-57.2l4.8 14.2 4.5 13.4 15.9 47-12.8-47.6-3.6-13.2-3.7-13.9c15.5 6.2 35.1 18.6 40.7 38.8 0.5 1.7 0.9 3.6 1.2 5.5 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.1-3.8-7.6-1.6-3.5-2.9-6.8-3.8-10z"/>
|
||||
<path class="st4" d="m110.4 188.9c-3.4-19.8 6.9-40.5 16.6-52.9l4.5 13.4 15.9 47-12.8-47.6-3.6-13.2c13.3 5.2 29.9 15 38.1 30.4 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.2-3.8-7.7z"/>
|
||||
<path class="st5" d="m114.2 196.5c-0.7-18 8.6-35.9 17.3-47.1l15.9 47-12.8-47.6c11.6 4.4 26.1 12.4 35.2 24.8 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8z"/>
|
||||
|
||||
<path class="st6" d="m86.3 59.1c21.7 10.9 32.4 36.6 35.8 54.9l-15.2-6.6-14.5-6.3-50.6-22 48.8 24.9 13.6 6.9 14.3 7.3c-16.6 7.9-41.3 14.5-62.1 4.1-1.8-0.9-3.6-1.9-5.4-3.2-2.3-1.5-4.5-3.2-6.8-5.1-19.9-16.4-40.3-46.4-42.7-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.2 0.8 6.2 1.6 9.1 2.5 4 1.3 7.6 2.8 10.9 4.4z"/>
|
||||
<path class="st7" d="m75.4 54.8c18.9 12 28.4 35.6 31.6 52.6l-14.5-6.3-50.6-22 48.7 24.9 13.6 6.9c-14.1 6.8-34.5 13-53.3 8.2-2.3-1.5-4.5-3.2-6.8-5.1-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.1 0.8 6.2 1.6 9.1 2.6z"/>
|
||||
<path class="st8" d="m66.3 52.2c15.3 12.8 23.3 33.6 26.1 48.9l-50.6-22 48.8 24.9c-12.2 6-29.6 11.8-46.5 10-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<div class="global-menu-button-update-available"></div>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ const TPL = `
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mr-auto">${t('add_link.add_link')}</h5>
|
||||
|
||||
<button type="button" class="help-button" title="${t('add_link.help_on_links')}" data-help-page="Links">?</button>
|
||||
<button type="button" class="help-button" title="${t('add_link.help_on_links')}" data-help-page="links.md">?</button>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="${t('add_link.close')}" style="margin-left: 0 !important;">
|
||||
<span aria-hidden="true">×</span>
|
||||
|
||||
@@ -16,7 +16,7 @@ const TPL = `<div class="branch-prefix-dialog modal fade mx-auto" tabindex="-1"
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mr-auto">${t('branch_prefix.edit_branch_prefix')}</h5>
|
||||
|
||||
<button class="help-button" type="button" data-help-page="Tree-concepts#prefix" title="${t('branch_prefix.help_on_tree_prefix')}">?</button>
|
||||
<button class="help-button" type="button" data-help-page="tree-concepts.md#prefix" title="${t('branch_prefix.help_on_tree_prefix')}">?</button>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="${t('branch_prefix.close')}" style="margin-left: 0;">
|
||||
<span aria-hidden="true">×</span>
|
||||
|
||||
@@ -15,7 +15,7 @@ const TPL = `
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mr-auto">${t('clone_to.clone_notes_to')}</h5>
|
||||
|
||||
<button type="button" class="help-button" title="${t('clone_to.help_on_links')}" data-help-page="Cloning-notes">?</button>
|
||||
<button type="button" class="help-button" title="${t('clone_to.help_on_links')}" data-help-page="cloning-notes.md">?</button>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
|
||||
<span aria-hidden="true">×</span>
|
||||
|
||||
@@ -107,7 +107,7 @@ const TPL = `
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><a class="external" href="https://github.com/zadam/trilium/wiki/Text-notes#autoformat">${t('help.markdownAutoformat')}</a></h5>
|
||||
<h5 class="card-title"><a class="external" href="https://github.com/TriliumNext/Docs/blob/main/Wiki/text-notes.md#markdown--autoformat">${t('help.markdownAutoformat')}</a></h5>
|
||||
|
||||
<p class="card-text">
|
||||
<ul>
|
||||
|
||||
@@ -10,7 +10,7 @@ const TPL = `
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mr-auto">${t("protected_session_password.modal_title")}</h5>
|
||||
|
||||
<button class="help-button" type="button" data-help-page="Protected-notes" title="${t("protected_session_password.help_title")}">?</button>
|
||||
<button class="help-button" type="button" data-help-page="protected-notes.md" title="${t("protected_session_password.help_title")}">?</button>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="${t("protected_session_password.close_label")}" style="margin-left: 0;">
|
||||
<span aria-hidden="true">×</span>
|
||||
|
||||
@@ -46,7 +46,7 @@ const TPL = `
|
||||
title="${t("revisions.delete_all_revisions")}"
|
||||
style="padding: 0 10px 0 10px;" type="button">${t("revisions.delete_all_button")}</button>
|
||||
|
||||
<button class="help-button" type="button" data-help-page="Note-revisions" title="${t("revisions.help_title")}">?</button>
|
||||
<button class="help-button" type="button" data-help-page="note-revisions.md" title="${t("revisions.help_title")}">?</button>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
|
||||
<span aria-hidden="true">×</span>
|
||||
|
||||
@@ -15,7 +15,7 @@ const TPL = `
|
||||
<div class="dropdown help-dropdown">
|
||||
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
|
||||
<div class="dropdown-menu dropdown-menu-right p-4">
|
||||
<strong>${t('search_string.search_syntax')}</strong> - ${t('search_string.also_see')} <button class="btn btn-sm" type="button" data-help-page="Search">${t('search_string.complete_help')}</button>
|
||||
<strong>${t('search_string.search_syntax')}</strong> - ${t('search_string.also_see')} <button class="btn btn-sm" type="button" data-help-page="search.md">${t('search_string.complete_help')}</button>
|
||||
<p>
|
||||
<ul>
|
||||
<li>${t('search_string.full_text_search')}</li>
|
||||
|
||||
@@ -13,7 +13,7 @@ const TPL = `
|
||||
}
|
||||
</style>
|
||||
|
||||
<span class="shared-text"></span> <a class="shared-link external"></a>. For help visit <a href="https://github.com/zadam/trilium/wiki/Sharing">wiki</a>.
|
||||
<span class="shared-text"></span> <a class="shared-link external"></a>. For help visit <a href="https://github.com/TriliumNext/Docs/blob/main/Wiki/sharing.md">wiki</a>.
|
||||
</div>`;
|
||||
|
||||
export default class SharedInfoWidget extends NoteContextAwareWidget {
|
||||
|
||||
@@ -20,7 +20,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
||||
this.$switchOffName.text("Shared");
|
||||
this.$switchOffButton.attr("title", "Unshare the note");
|
||||
|
||||
this.$helpButton.attr("data-help-page", "Sharing").show();
|
||||
this.$helpButton.attr("data-help-page", "sharing.md").show();
|
||||
this.$helpButton.on('click', e => utils.openHelp($(e.target)));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export default class AttachmentDetailTypeWidget extends TypeWidget {
|
||||
this.$wrapper.empty();
|
||||
this.children = [];
|
||||
|
||||
const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments" title="' + t('attachment_detail.open_help_page') + '"><span class="bx bx-help-circle"></span></button>');
|
||||
const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments.md" title="' + t('attachment_detail.open_help_page') + '"><span class="bx bx-help-circle"></span></button>');
|
||||
utils.initHelpButtons($helpButton);
|
||||
|
||||
this.$linksWrapper.empty().append(
|
||||
|
||||
@@ -40,7 +40,7 @@ export default class AttachmentListTypeWidget extends TypeWidget {
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments" title="' + t('attachment_list.open_help_page') + '"><span class="bx bx-help-circle"></span></button>');
|
||||
const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments.md" title="' + t('attachment_list.open_help_page') + '"><span class="bx bx-help-circle"></span></button>');
|
||||
utils.initHelpButtons($helpButton);
|
||||
|
||||
const noteLink = await linkService.createLink(this.noteId); // do separately to avoid race condition between empty() and .append()
|
||||
|
||||
@@ -8,7 +8,7 @@ const TPL = `
|
||||
<h4>ETAPI</h4>
|
||||
|
||||
<p>ETAPI is a REST API used to access Trilium instance programmatically, without UI. <br/>
|
||||
See more details on <a href="https://github.com/zadam/trilium/wiki/ETAPI">wiki</a> and <a onclick="window.open('etapi/etapi.openapi.yaml')" href="etapi/etapi.openapi.yaml">ETAPI OpenAPI spec</a>.</p>
|
||||
See more details on <a href="https://github.com/TriliumNext/Docs/blob/main/Wiki/etapi.md">wiki</a> and <a onclick="window.open('etapi/etapi.openapi.yaml')" href="etapi/etapi.openapi.yaml">ETAPI OpenAPI spec</a>.</p>
|
||||
|
||||
<button type="button" class="create-etapi-token btn btn-sm">Create new ETAPI token</button>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const TPL = `
|
||||
<div class="options-section">
|
||||
<h4>Note Revisions Snapshot Interval</h4>
|
||||
|
||||
<p>Note revision snapshot time interval is time in seconds after which a new note revision will be created for the note. See <a href="https://github.com/zadam/trilium/wiki/Note-revisions" class="external">wiki</a> for more info.</p>
|
||||
<p>Note revision snapshot time interval is time in seconds after which a new note revision will be created for the note. See <a href="https://github.com/TriliumNext/Docs/blob/main/Wiki/note-revisions.md" class="external">wiki</a> for more info.</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Note revision snapshot time interval (in seconds)</label>
|
||||
|
||||
@@ -37,7 +37,7 @@ const TPL = `
|
||||
<h4>Protected Session Timeout</h4>
|
||||
|
||||
<p>Protected session timeout is a time period after which the protected session is wiped from
|
||||
the browser's memory. This is measured from the last interaction with protected notes. See <a href="https://github.com/zadam/trilium/wiki/Protected-notes" class="external">wiki</a> for more info.</p>
|
||||
the browser's memory. This is measured from the last interaction with protected notes. See <a href="https://github.com/TriliumNext/Docs/blob/main/Wiki/protected-notes.md" class="external">wiki</a> for more info.</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Protected session timeout (in seconds)</label>
|
||||
|
||||
@@ -28,7 +28,7 @@ const TPL = `
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<button class="btn btn-primary">Save</button>
|
||||
|
||||
<button class="btn" type="button" data-help-page="Synchronization">Help</button>
|
||||
<button class="btn" type="button" data-help-page="synchronization.md">Help</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@ const TPL = `
|
||||
<div class="note-detail-render-help alert alert-warning" style="margin: 50px; padding: 20px;">
|
||||
<p><strong>This help note is shown because this note of type Render HTML doesn't have required relation to function properly.</strong></p>
|
||||
|
||||
<p>Render HTML note type is used for <a class="external" href="https://github.com/zadam/trilium/wiki/Scripts">scripting</a>. In short, you have a HTML code note (optionally with some JavaScript) and this note will render it. To make it work, you need to define a <a class="external" href="https://github.com/zadam/trilium/wiki/Attributes">relation</a> called "renderNote" pointing to the HTML note to render.</p>
|
||||
<p>Render HTML note type is used for <a class="external" href="https://github.com/TriliumNext/Docs/blob/main/Wiki/scripts.md">scripting</a>. In short, you have a HTML code note (optionally with some JavaScript) and this note will render it. To make it work, you need to define a <a class="external" href="https://github.com/TriliumNext/Docs/blob/main/Wiki/attributes.md">relation</a> called "renderNote" pointing to the HTML note to render.</p>
|
||||
</div>
|
||||
|
||||
<div class="note-detail-render-content"></div>
|
||||
|
||||
Reference in New Issue
Block a user