Merge remote-tracking branch 'origin/develop' into feature/client_typescript_port1

; Conflicts:
;	package-lock.json
This commit is contained in:
Elian Doran
2024-12-19 19:05:51 +02:00
64 changed files with 953 additions and 551 deletions

View File

@@ -227,7 +227,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
.attr('data-ribbon-component-name', ribbonWidget.name)
.append($('<span class="ribbon-tab-title-icon">')
.addClass(ret.icon)
.attr("data-title", ret.title)
.attr("title", ret.title)
.attr('data-toggle-command', ribbonWidget.toggleCommand))
.append(" ")
.append($('<span class="ribbon-tab-title-label">').text(ret.title));

View File

@@ -12,7 +12,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t("about.title")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('about.close')}"></button>
</div>
<div class="modal-body">
<table class="table table-borderless text-nowrap">

View File

@@ -45,8 +45,8 @@ const TPL = `
<h4>${t('bulk_actions.affected_notes')}: <span class="affected-note-count">0</span></h4>
<div class="form-check">
<input class="include-descendants form-check-input" type="checkbox" value="">
<label class="form-check-label">${t('bulk_actions.include_descendants')}</label>
<input id="include-descendants" class="include-descendants form-check-input" type="checkbox" value="">
<label for="include-descendants" class="form-check-label">${t('bulk_actions.include_descendants')}</label>
</div>
<h4>${t('bulk_actions.available_actions')}</h4>

View File

@@ -15,7 +15,7 @@ const TPL = `
<div class="modal-header">
<h5 class="modal-title flex-grow-1">${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.html">?</button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('clone_to.close')}"></button>
</div>
<form class="clone-to-form">
<div class="modal-body">

View File

@@ -9,7 +9,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t('confirm.confirmation')}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('confirm.close')}"></button>
</div>
<div class="modal-body">
<div class="confirm-dialog-content"></div>

View File

@@ -11,17 +11,17 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">${t('delete_notes.delete_notes_preview')}</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('delete_notes.close')}"></button>
</div>
<div class="modal-body">
<div class="form-checkbox">
<input class="delete-all-clones form-check-input" value="1" type="checkbox">
<label class="form-check-label">${t('delete_notes.delete_all_clones_description')}</label>
<input id="delete-all-clones" class="delete-all-clones form-check-input" value="1" type="checkbox">
<label for="delete-all-clones" class="form-check-label">${t('delete_notes.delete_all_clones_description')}</label>
</div>
<div class="form-checkbox" style="margin-bottom: 1rem">
<input class="erase-notes form-check-input" value="1" type="checkbox">
<label class="form-check-label">${t('delete_notes.erase_notes_warning')}</label>
<input id="erase-notes" class="erase-notes form-check-input" value="1" type="checkbox">
<label for="erase-notes" class="form-check-label">${t('delete_notes.erase_notes_warning')}</label>
</div>
<div class="delete-notes-list-wrapper">

View File

@@ -11,7 +11,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t('include_note.dialog_title')}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('include_note.close')}"></button>
</div>
<form class="include-note-form">
<div class="modal-body">

View File

@@ -12,7 +12,7 @@ const TPL = `<div class="jump-to-note-dialog modal mx-auto" tabindex="-1" role="
<div class="input-group">
<input class="jump-to-note-autocomplete form-control" placeholder="${t('jump_to_note.search_placeholder')}">
</div>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('jump_to_note.close')}"></button>
</div>
<div class="modal-body">
<div class="algolia-autocomplete-container jump-to-note-results"></div>

View File

@@ -12,7 +12,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t("markdown_import.dialog_title")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("markdown_import.close")}"></button>
</div>
<div class="modal-body">
<p>${t("markdown_import.modal_body_text")}</p>

View File

@@ -13,7 +13,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title me-auto">${t("move_to.dialog_title")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("move_to.close")}"></button>
</div>
<form class="move-to-form">
<div class="modal-body">

View File

@@ -24,7 +24,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t("note_type_chooser.modal_title")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("note_type_chooser.close")}"></button>
</div>
<div class="modal-body">
${t("note_type_chooser.modal_body")}

View File

@@ -8,7 +8,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t("password_not_set.title")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("password_not_set.close")}"></button>
</div>
<div class="modal-body">
${t("password_not_set.body1")}

View File

@@ -9,7 +9,7 @@ const TPL = `
<form class="prompt-dialog-form">
<div class="modal-header">
<h5 class="prompt-title modal-title">${t("prompt.title")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('prompt.close')}"></button>
</div>
<div class="modal-body"></div>
<div class="modal-footer">

View File

@@ -14,8 +14,8 @@ const TPL = `
</div>
<form class="protected-session-password-form">
<div class="modal-body">
<label class="col-form-label">${t("protected_session_password.form_label")}</label>
<input class="form-control protected-session-password" type="password">
<label for="protected-session-password" class="col-form-label">${t("protected_session_password.form_label")}asbd</label>
<input id="protected-session-password" class="form-control protected-session-password" type="password">
</div>
<div class="modal-footer">
<button class="btn btn-primary">${t("protected_session_password.start_button")}</button>

View File

@@ -18,7 +18,7 @@ const TPL = `
<div class="modal-header">
<h5 class="modal-title flex-grow-1">${t('recent_changes.title')}</h5>
<button class="erase-deleted-notes-now-button btn btn-sm" style="padding: 0 10px">${t('recent_changes.erase_notes_button')}</button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('recent_changes.close')}"></button>
</div>
<div class="modal-body">
<div class="recent-changes-content"></div>

View File

@@ -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.html" title="${t("revisions.help_title")}">?</button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("revisions.close")}"></button>
</div>
<div class="modal-body" style="display: flex; height: 80vh;">
<div class="dropdown">

View File

@@ -8,44 +8,44 @@ const TPL = `<div class="sort-child-notes-dialog modal mx-auto" tabindex="-1" ro
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t("sort_child_notes.sort_children_by")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("sort_child_notes.close")}"></button>
</div>
<form class="sort-child-notes-form">
<div class="modal-body">
<h5>${t("sort_child_notes.sorting_criteria")}</h5>
<div class="form-check">
<input class="form-check-input" type="radio" name="sort-by" value="title" checked>
<label class="form-check-label">${t("sort_child_notes.title")}</label>
<input id="sort-by-title" class="form-check-input" type="radio" name="sort-by" value="title" checked>
<label for="sort-by-title" class="form-check-label">${t("sort_child_notes.title")}</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="sort-by" value="dateCreated">
<label class="form-check-label">${t("sort_child_notes.date_created")}</label>
<input id="sort-by-dateCreated" class="form-check-input" type="radio" name="sort-by" value="dateCreated">
<label for="sort-by-dateCreated" class="form-check-label">${t("sort_child_notes.date_created")}</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="sort-by" value="dateModified">
<label class="form-check-label">${t("sort_child_notes.date_modified")}</label>
<input id="sort-by-dateModified" class="form-check-input" type="radio" name="sort-by" value="dateModified">
<label for="sort-by-dateModified" class="form-check-label">${t("sort_child_notes.date_modified")}</label>
</div>
<br/>
<h5>${t("sort_child_notes.sorting_direction")}</h5>
<div class="form-check">
<input class="form-check-input" type="radio" name="sort-direction" value="asc" checked>
<label class="form-check-label">${t("sort_child_notes.ascending")}</label>
<input id="sort-direction-asc" class="form-check-input" type="radio" name="sort-direction" value="asc" checked>
<label for="sort-direction-asc" class="form-check-label">${t("sort_child_notes.ascending")}</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="sort-direction" value="desc">
<label class="form-check-label">${t("sort_child_notes.descending")}</label>
<input id="sort-direction-desc" class="form-check-input" type="radio" name="sort-direction" value="desc">
<label for="sort-direction-desc" class="form-check-label">${t("sort_child_notes.descending")}</label>
</div>
<br />
<h5>${t("sort_child_notes.folders")}</h5>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="sort-folders-first" value="1">
<label class="form-check-label">${t("sort_child_notes.sort_folders_at_top")}</label>
<input id="sort-folders-first" class="form-check-input" type="checkbox" name="sort-folders-first" value="1">
<label for="sort-folders-first" class="form-check-label">${t("sort_child_notes.sort_folders_at_top")}</label>
</div>
<br />
<h5>${t("sort_child_notes.natural_sort")}</h5>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="sort-natural" value="1">
<label class="form-check-label">${t("sort_child_notes.sort_with_respect_to_different_character_sorting")}</label>
<input id="sort-natural" class="form-check-input" type="checkbox" name="sort-natural" value="1">
<label for="sort-natural" class="form-check-label">${t("sort_child_notes.sort_with_respect_to_different_character_sorting")}</label>
</div>
<br />
<div class="form-check">

View File

@@ -11,7 +11,7 @@ const TPL = `
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${t("upload_attachments.upload_attachments_to_note")}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t('upload_attachments.close')}"></button>
</div>
<form class="upload-attachment-form">
<div class="modal-body">

View File

@@ -76,7 +76,7 @@ export default class QuickSearchWidget extends BasicWidget {
});
shortcutService.bindElShortcut(this.$searchString, 'down', () => {
this.$dropdownMenu.find('.dropdown-item:first').focus();
this.$dropdownMenu.find('.dropdown-item:not(.disabled):first').focus();
});
shortcutService.bindElShortcut(this.$searchString, 'esc', () => {

View File

@@ -96,7 +96,6 @@ export default class SyncStatusWidget extends BasicWidget {
return;
}
console.log("Align ", this.settings.titlePlacement);
bootstrap.Tooltip.getOrCreateInstance(this.$widget.find(`.sync-status-${className}`), {
html: true,
placement: this.settings.titlePlacement,

View File

@@ -116,7 +116,6 @@ const TAB_ROW_TPL = `
.tab-row-widget .note-tab,
.tab-row-widget .note-tab * {
user-select: none;
cursor: default;
}
@@ -140,7 +139,7 @@ const TAB_ROW_TPL = `
pointer-events: all;
color: var(--inactive-tab-text-color);
--tab-background-color: var(--workspace-tab-background-color);
background-color: var(--tab-background-color, var(--inactive-tab-background-color));
background-color: var(--tab-background-color, var(--inactive-tab-background-color));
}
.tab-row-widget .note-tab[active] .note-tab-wrapper {
@@ -177,6 +176,7 @@ const TAB_ROW_TPL = `
bottom: 0;
right: 0;
left: 0;
z-index: 1000;
}
.tab-row-widget .note-tab .note-tab-close {

View File

@@ -22,7 +22,6 @@ export default class TemplateSwitchWidget extends SwitchWidget {
this.$switchOffButton.attr("title", t("template_switch.toggle-off-hint"));
this.$helpButton.attr("data-help-page", "template.html").show();
this.$helpButton.on('click', e => utils.openHelp($(e.target)));
}
async switchOn() {

View File

@@ -2,7 +2,7 @@ import libraryLoader from '../../services/library_loader.js';
import TypeWidget from './type_widget.js';
import utils from '../../services/utils.js';
import linkService from '../../services/link.js';
import server from '../../services/server.js';
const TPL = `
<div class="canvas-widget note-detail-canvas note-detail-printable note-detail">
<style>
@@ -115,6 +115,11 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
this.reactHandlers; // used to control react state
this.libraryChanged = false;
// these 2 variables are needed to compare the library state (all library items) after loading to the state when the library changed. So we can find attachments to be deleted.
//every libraryitem is saved on its own json file in the attachments of the note.
this.librarycache = [];
this.attachmentMetadata=[]
}
static getType() {
@@ -236,23 +241,47 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
fileArray.push(file);
}
Promise.all(
(await note.getAttachmentsByRole('canvasLibraryItem'))
.map(async attachment => {
const blob = await attachment.getBlob();
return {
blob, // Save the blob for libraryItems
metadata: { // metadata to use in the cache variables for comparing old library state and new one. We delete unnecessary items later, calling the server directly
attachmentId: attachment.attachmentId,
title: attachment.title,
},
};
})
).then(results => {
if (note.noteId !== this.currentNoteId) {
// current note changed in the course of the async operation
return;
}
// Extract libraryItems from the blobs
const libraryItems = results
.map(result => result.blob.getJsonContentSafely())
.filter(item => !!item);
// Extract metadata for each attachment
const metadata = results.map(result => result.metadata);
// Update the library and save to independent variables
this.excalidrawApi.updateLibrary({ libraryItems, merge: false });
// save state of library to compare it to the new state later.
this.librarycache = libraryItems;
this.attachmentMetadata = metadata;
});
// Update the scene
this.excalidrawApi.updateScene(sceneData);
this.excalidrawApi.addFiles(fileArray);
this.excalidrawApi.history.clear();
}
Promise.all(
(await note.getAttachmentsByRole('canvasLibraryItem'))
.map(attachment => attachment.getBlob())
).then(blobs => {
if (note.noteId !== this.currentNoteId) {
// current note changed in the course of the async operation
return;
}
const libraryItems = blobs.map(blob => blob.getJsonContentSafely()).filter(item => !!item);
this.excalidrawApi.updateLibrary({libraryItems, merge: false});
});
// set initial scene version
if (this.currentSceneVersion === this.SCENE_VERSION_INITIAL) {
@@ -313,19 +342,54 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
// there's no separate method to get library items, so have to abuse this one
const libraryItems = await this.excalidrawApi.updateLibrary({merge: true});
// excalidraw saves the library as a own state. the items are saved to libraryItems. then we compare the library right now with a libraryitemcache. The cache is filled when we first load the Library into the note.
//We need the cache to delete old attachments later in the server.
const libraryItemsMissmatch = this.librarycache.filter(obj1 => !libraryItems.some(obj2 => obj1.id === obj2.id));
// before we saved the metadata of the attachments in a cache. the title of the attachment is a combination of libraryitem ´s ID und it´s name.
// we compare the library items in the libraryitemmissmatch variable (this one saves all libraryitems that are different to the state right now. E.g. you delete 1 item, this item is saved as mismatch)
// then we combine its id and title and search the according attachmentID.
const matchingItems = this.attachmentMetadata.filter(meta => {
// Loop through the second array and check for a match
return libraryItemsMissmatch.some(item => {
// Combine the `name` and `id` from the second array
const combinedTitle = `${item.id}${item.name}`;
return meta.title === combinedTitle;
});
});
// we save the attachment ID`s in a variable and delete every attachmentID. Now the items that the user deleted will be deleted.
const attachmentIds = matchingItems.map(item => item.attachmentId);
//delete old attachments that are no longer used
for (const item of attachmentIds){
await server.remove(`attachments/${item}`);
}
let position = 10;
// prepare data to save to server e.g. new library items.
for (const libraryItem of libraryItems) {
attachments.push({
role: 'canvasLibraryItem',
title: libraryItem.id,
title: libraryItem.id + libraryItem.name,
mime: 'application/json',
content: JSON.stringify(libraryItem),
position: position
});
position += 10;
}
}
return {

View File

@@ -28,8 +28,8 @@ const TPL = `
<div class="form-group row">
<div class="col-6">
<label>${t("highlighting.color-scheme")}</label>
<select class="theme-select form-select"></select>
<label for="highlighting-color-scheme-select">${t("highlighting.color-scheme")}</label>
<select id="highlighting-color-scheme-select" class="theme-select form-select"></select>
</div>
<div class="col-6 side-checkbox">

View File

@@ -8,8 +8,8 @@ const TPL = `
<div class="form-group row">
<div class="col-12">
<label>${t("electron_integration.zoom-factor")}</label>
<input type="number" class="zoom-factor-select form-control options-number-input" min="0.3" max="2.0" step="0.1"/>
<label for="zoom-factor-select">${t("electron_integration.zoom-factor")}</label>
<input id="zoom-factor-select" type="number" class="zoom-factor-select form-control options-number-input" min="0.3" max="2.0" step="0.1"/>
<p>${t("zoom_factor.description")}</p>
</div>
</div>

View File

@@ -36,15 +36,15 @@ const TPL = `
<div class="form-group row">
<div class="col-6">
<label>${t("fonts.font_family")}</label>
<select class="main-font-family form-select"></select>
<label for="main-font-family">${t("fonts.font_family")}</label>
<select id="main-font-family" class="main-font-family form-select"></select>
</div>
<div class="col-6">
<label>${t("fonts.size")}</label>
<label for="main-font-size">${t("fonts.size")}</label>
<div class="input-group">
<input type="number" class="main-font-size form-control options-number-input" min="50" max="200" step="10"/>
<input id="main-font-size" type="number" class="main-font-size form-control options-number-input" min="50" max="200" step="10"/>
<span class="input-group-text">%</span>
</div>
</div>
@@ -54,15 +54,15 @@ const TPL = `
<div class="form-group row">
<div class="col-4">
<label>${t("fonts.font_family")}</label>
<select class="tree-font-family form-select"></select>
<label for="tree-font-family">${t("fonts.font_family")}</label>
<select id="tree-font-family" class="tree-font-family form-select"></select>
</div>
<div class="col-6">
<label>${t("fonts.size")}</label>
<label for="tree-font-size">${t("fonts.size")}</label>
<div class="input-group">
<input type="number" class="tree-font-size form-control options-number-input" min="50" max="200" step="10"/>
<input id="tree-font-size" type="number" class="tree-font-size form-control options-number-input" min="50" max="200" step="10"/>
<span class="input-group-text">%</span>
</div>
</div>
@@ -72,15 +72,15 @@ const TPL = `
<div class="form-group row">
<div class="col-4">
<label>${t("fonts.font_family")}</label>
<select class="detail-font-family form-select"></select>
<label for="detail-font-family">${t("fonts.font_family")}</label>
<select id="detail-font-family" class="detail-font-family form-select"></select>
</div>
<div class="col-6">
<label>${t("fonts.size")}</label>
<label for="detail-font-size">${t("fonts.size")}</label>
<div class="input-group">
<input type="number" class="detail-font-size form-control options-number-input" min="50" max="200" step="10"/>
<input id="detail-font-size" type="number" class="detail-font-size form-control options-number-input" min="50" max="200" step="10"/>
<span class="input-group-text">%</span>
</div>
</div>
@@ -90,15 +90,15 @@ const TPL = `
<div class="form-group row">
<div class="col-4">
<label>${t("fonts.font_family")}</label>
<select class="monospace-font-family form-select"></select>
<label for="monospace-font-family">${t("fonts.font_family")}</label>
<select id="monospace-font-family" class="monospace-font-family form-select"></select>
</div>
<div class="col-6">
<label>${t("fonts.size")}</label>
<label for="monospace-font-size">${t("fonts.size")}</label>
<div class="input-group">
<input type="number" class="monospace-font-size form-control options-number-input" min="50" max="200" step="10"/>
<input id="monospace-font-size" type="number" class="monospace-font-size form-control options-number-input" min="50" max="200" step="10"/>
<span class="input-group-text">%</span>
</div>
</div>

View File

@@ -9,13 +9,13 @@ const TPL = `
<div class="form-group row">
<div class="col-6">
<label>${t("i18n.language")}</label>
<select class="locale-select form-select"></select>
<label for="locale-select">${t("i18n.language")}</label>
<select id="locale-select" class="locale-select form-select"></select>
</div>
<div class="col-6">
<label>${t("i18n.first-day-of-the-week")}</label>
<select class="first-day-of-week-select form-select">
<label for="first-day-of-week-select">${t("i18n.first-day-of-the-week")}</label>
<select id="first-day-of-week-select" class="first-day-of-week-select form-select">
<option value="0">${t("i18n.sunday")}</option>
<option value="1">${t("i18n.monday")}</option>
</select>

View File

@@ -12,8 +12,8 @@ const TPL = `
<div class="form-group row">
<div class="col-6">
<label>${t("max_content_width.max_width_label")}</label>
<input type="number" min="${MIN_VALUE}" step="10" class="max-content-width form-control options-number-input">
<label for="max-content-width">${t("max_content_width.max_width_label")}</label>
<input id="max-content-width" type="number" min="${MIN_VALUE}" step="10" class="max-content-width form-control options-number-input">
</div>
</div>

View File

@@ -31,8 +31,8 @@ const TPL = `
<div class="form-group row">
<div class="col-6">
<label>${t("theme.theme_label")}</label>
<select class="theme-select form-select"></select>
<label for="theme-select">${t("theme.theme_label")}</label>
<select id="theme-select" class="theme-select form-select"></select>
</div>
<div class="col-6 side-checkbox">
@@ -69,8 +69,11 @@ export default class ThemeOptions extends OptionsWidget {
async optionsLoaded(options) {
const themes = [
{ val: 'next', title: t("theme.triliumnext") },
{ val: 'next-light', title: t("theme.triliumnext-light") },
{ val: 'next-dark', title: t("theme.triliumnext-dark") },
{ val: 'auto', title: t('theme.auto_theme') },
{ val: 'light', title: t('theme.light_theme') },
{ val: 'dark', title: t('theme.dark_theme') }
{ val: 'dark', title: t('theme.dark_theme') }
].concat(await server.get('options/user-themes'));
this.$themeSelect.empty();

View File

@@ -8,8 +8,8 @@ const TPL = `
<p>${t('code_auto_read_only_size.description')}</p>
<div class="form-group">
<label>${t('code_auto_read_only_size.label')}</label>
<input class="auto-readonly-size-code form-control options-number-input" type="number" min="0">
<label for="auto-readonly-size-code">${t('code_auto_read_only_size.label')}</label>
<input id="auto-readonly-size-code" class="auto-readonly-size-code form-control options-number-input" type="number" min="0">
</div>
</div>`;

View File

@@ -10,8 +10,8 @@ const TPL = `
<form class="sync-setup-form">
<div class="form-group">
<label>${t("search_engine.predefined_templates_label")}</label>
<select class="predefined-search-engine-select form-control">
<label for="predefined-search-engine-select">${t("search_engine.predefined_templates_label")}</label>
<select id="predefined-search-engine-select" class="predefined-search-engine-select form-control">
<option value="Bing">${t("search_engine.bing")}</option>
<option value="Baidu">${t("search_engine.baidu")}</option>
<option value="DuckDuckGo">${t("search_engine.duckduckgo")}</option>

View File

@@ -14,18 +14,18 @@ const TPL = `
<form class="change-password-form">
<div class="old-password-form-group form-group">
<label>${t("password.old_password")}</label>
<input class="old-password form-control" type="password">
<label for="old-password">${t("password.old_password")}</label>
<input id="old-password" class="old-password form-control" type="password">
</div>
<div class="form-group">
<label>${t("password.new_password")}</label>
<input class="new-password1 form-control" type="password">
<label for="new-password1">${t("password.new_password")}</label>
<input id="new-password1" class="new-password1 form-control" type="password">
</div>
<div class="form-group">
<label>${t("password.new_password_confirmation")}</label>
<input class="new-password2 form-control" type="password">
<label for="new-password2">${t("password.new_password_confirmation")}</label>
<input id="new-password2" class="new-password2 form-control" type="password">
</div>
<button class="save-password-button btn btn-primary">${t("password.change_password")}</button>
@@ -38,8 +38,8 @@ const TPL = `
<p>${t("password.protected_session_timeout_description")} <a href="https://triliumnext.github.io/Docs/Wiki/protected-notes.html" class="external">${t("password.wiki")}</a> ${t("password.for_more_info")}</p>
<div class="form-group">
<label>${t("password.protected_session_timeout_label")}</label>
<input class="protected-session-timeout-in-seconds form-control options-number-input" type="number" min="60">
<label for="protected-session-timeout-in-seconds">${t("password.protected_session_timeout_label")}</label>
<input id="protected-session-timeout-in-seconds" class="protected-session-timeout-in-seconds form-control options-number-input" type="number" min="60">
</div>
</div>`;

View File

@@ -24,8 +24,8 @@ const TPL_ELECTRON = `
<br/>
<div class="form-group">
<label>${t('spellcheck.language_code_label')}</label>
<input type="text" class="spell-check-language-code form-control" placeholder="${t('spellcheck.language_code_placeholder')}">
<label for="spell-check-language-code">${t('spellcheck.language_code_label')}</label>
<input id="spell-check-language-code" type="text" class="spell-check-language-code form-control" placeholder="${t('spellcheck.language_code_placeholder')}">
</div>
<p>${t('spellcheck.multiple_languages_info')}</p>

View File

@@ -9,18 +9,18 @@ const TPL = `
<form class="sync-setup-form">
<div class="form-group">
<label>${t('sync_2.server_address')}</label>
<input class="sync-server-host form-control" placeholder="https://<host>:<port>">
<label for="sync-server-host" >${t('sync_2.server_address')}</label>
<input id="sync-server-host" class="sync-server-host form-control" placeholder="https://<host>:<port>">
</div>
<div class="form-group">
<label>${t('sync_2.timeout')}</label>
<input class="sync-server-timeout form-control" min="1" max="10000000" type="number" style="text-align: left;">
<label for="sync-server-timeout" >${t('sync_2.timeout')}</label>
<input id="sync-server-timeout" class="sync-server-timeout form-control" min="1" max="10000000" type="number" style="text-align: left;">
</div>
<div class="form-group">
<label>${t('sync_2.proxy_label')}</label>
<input class="sync-proxy form-control" placeholder="https://<host>:<port>">
<label for="sync-proxy form-control" >${t('sync_2.proxy_label')}</label>
<input id="sync-proxy form-control" class="sync-proxy form-control" placeholder="https://<host>:<port>">
<p><strong>${t('sync_2.note')}:</strong> ${t('sync_2.note_description')}</p>
<p>${t('sync_2.special_value_description')}</p>

View File

@@ -8,8 +8,8 @@ const TPL = `
<p>${t("text_auto_read_only_size.description")}</p>
<div class="form-group">
<label>${t("text_auto_read_only_size.label")}</label>
<input class="auto-readonly-size-text form-control options-number-input" type="number" min="0">
<label for="auto-readonly-size-text">${t("text_auto_read_only_size.label")}</label>
<input id="auto-readonly-size-text" class="auto-readonly-size-text form-control options-number-input" type="number" min="0">
</div>
</div>`;