mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	Merge branch 'develop' into revisions_number_limit
This commit is contained in:
		
						commit
						353c410f0e
					
				
							
								
								
									
										12
									
								
								.github/workflows/main-docker.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/workflows/main-docker.yml
									
									
									
									
										vendored
									
									
								
							| @ -66,8 +66,10 @@ jobs: | |||||||
|           cache-from: type=gha |           cache-from: type=gha | ||||||
|           cache-to: type=gha,mode=max |           cache-to: type=gha,mode=max | ||||||
|        |        | ||||||
|       - name: Run the container in the background |       - name: Validate container run output | ||||||
|         run: docker run -d --rm --name trilium_local ${{ env.TEST_TAG }} |         run: | | ||||||
|  |           CONTAINER_ID=$(docker run -d --log-driver=journald --rm --name trilium_local ${{ env.TEST_TAG }}) | ||||||
|  |           echo "Container ID: $CONTAINER_ID" | ||||||
|        |        | ||||||
|       - name: Wait for the healthchecks to pass |       - name: Wait for the healthchecks to pass | ||||||
|         uses: stringbean/docker-healthcheck-action@v1 |         uses: stringbean/docker-healthcheck-action@v1 | ||||||
| @ -77,6 +79,12 @@ jobs: | |||||||
|           require-status: running |           require-status: running | ||||||
|           require-healthy: true |           require-healthy: true | ||||||
| 
 | 
 | ||||||
|  |       # Print the entire log of the container thus far, regardless if the healthcheck failed or succeeded | ||||||
|  |       - name: Print entire log | ||||||
|  |         if: always() | ||||||
|  |         run: | | ||||||
|  |           journalctl -u docker CONTAINER_NAME=trilium_local --no-pager | ||||||
|  | 
 | ||||||
|   build: |   build: | ||||||
|     name: Build Docker images |     name: Build Docker images | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  | |||||||
| @ -13,11 +13,13 @@ import cls from "../services/cls.js"; | |||||||
| import entityConstructor from "../becca/entity_constructor.js"; | import entityConstructor from "../becca/entity_constructor.js"; | ||||||
| import { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from './entities/rows.js'; | import { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from './entities/rows.js'; | ||||||
| import AbstractBeccaEntity from "./entities/abstract_becca_entity.js"; | import AbstractBeccaEntity from "./entities/abstract_becca_entity.js"; | ||||||
| import options_init from "../services/options_init.js"; |  | ||||||
| import ws from "../services/ws.js"; | import ws from "../services/ws.js"; | ||||||
| 
 | 
 | ||||||
| const beccaLoaded = new Promise<void>(async (res, rej) => { | const beccaLoaded = new Promise<void>(async (res, rej) => { | ||||||
|     const sqlInit = (await import("../services/sql_init.js")).default; |     const sqlInit = (await import("../services/sql_init.js")).default; | ||||||
|  |     // We have to import async since options init requires keyboard actions which require translations.
 | ||||||
|  |     const options_init = (await import("../services/options_init.js")).default; | ||||||
|  | 
 | ||||||
|     sqlInit.dbReady.then(() => { |     sqlInit.dbReady.then(() => { | ||||||
|         cls.init(() => { |         cls.init(() => { | ||||||
|             load(); |             load(); | ||||||
|  | |||||||
| @ -175,7 +175,7 @@ const editorConfig = { | |||||||
|     toolbar: { |     toolbar: { | ||||||
|         items: [] |         items: [] | ||||||
|     }, |     }, | ||||||
|     placeholder: "Type the labels and relations here", |     placeholder: t("attribute_editor.placeholder"), | ||||||
|     mention: mentionSetup |     mention: mentionSetup | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -280,7 +280,9 @@ export default class GlobalMenuWidget extends BasicWidget { | |||||||
|             this.dropdown.toggle(); |             this.dropdown.toggle(); | ||||||
|         }); |         }); | ||||||
|         this.$widget.on('click', '.dropdown-submenu', e => { |         this.$widget.on('click', '.dropdown-submenu', e => { | ||||||
|  |             if ($(e.target).children(".dropdown-menu").length === 1 || $(e.target).hasClass('dropdown-toggle')) { | ||||||
|                 e.stopPropagation(); |                 e.stopPropagation(); | ||||||
|  |             } | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|         this.$widget.find(".global-menu-button-update-available").append( |         this.$widget.find(".global-menu-button-update-available").append( | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import NoteContextAwareWidget from "../note_context_aware_widget.js"; | import NoteContextAwareWidget from "../note_context_aware_widget.js"; | ||||||
|  | import { t } from "../../services/i18n.js"; | ||||||
| 
 | 
 | ||||||
| const TPL = ` | const TPL = ` | ||||||
| <div class="floating-buttons no-print"> | <div class="floating-buttons no-print"> | ||||||
| @ -7,7 +8,7 @@ const TPL = ` | |||||||
|             position: relative; |             position: relative; | ||||||
|         } |         } | ||||||
|          |          | ||||||
|         .floating-buttons-children { |         .floating-buttons-children,.show-floating-buttons { | ||||||
|             position: absolute;  |             position: absolute;  | ||||||
|             top: 10px;  |             top: 10px;  | ||||||
|             right: 10px; |             right: 10px; | ||||||
| @ -42,12 +43,44 @@ const TPL = ` | |||||||
|             border-color: var(--button-border-color); |             border-color: var(--button-border-color); | ||||||
|         } |         } | ||||||
|          |          | ||||||
|         .floating-buttons.temporarily-hidden { |         .floating-buttons .floating-buttons-children.temporarily-hidden { | ||||||
|             display: none; |             display: none; | ||||||
|         } |         } | ||||||
|     </style> |     </style> | ||||||
|      |      | ||||||
|     <div class="floating-buttons-children"></div> |     <div class="floating-buttons-children"></div> | ||||||
|  | 
 | ||||||
|  |     <!-- Show button that displays floating button after click on close button --> | ||||||
|  |     <div class="show-floating-buttons"> | ||||||
|  |         <style> | ||||||
|  |             .floating-buttons-children.temporarily-hidden+.show-floating-buttons { | ||||||
|  |                 display: block; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .floating-buttons-children:not(.temporarily-hidden)+.show-floating-buttons { | ||||||
|  |                 display: none; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .show-floating-buttons { | ||||||
|  |                 /* display: none;*/ | ||||||
|  |                 margin-left: 5px !important; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .show-floating-buttons-button { | ||||||
|  |                 border: 1px solid transparent; | ||||||
|  |                 color: var(--button-text-color); | ||||||
|  |                 padding: 6px; | ||||||
|  |                 border-radius: 100px; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .show-floating-buttons-button:hover { | ||||||
|  |                 border: 1px solid var(--button-border-color); | ||||||
|  |             } | ||||||
|  |         </style> | ||||||
|  | 
 | ||||||
|  |         <button type="button" class="show-floating-buttons-button btn bx bx-chevrons-left" | ||||||
|  |             title="${t('show_floating_buttons_button.button_title')}"></button> | ||||||
|  |     </div> | ||||||
| </div>`; | </div>`; | ||||||
| 
 | 
 | ||||||
| export default class FloatingButtons extends NoteContextAwareWidget { | export default class FloatingButtons extends NoteContextAwareWidget { | ||||||
| @ -62,10 +95,11 @@ export default class FloatingButtons extends NoteContextAwareWidget { | |||||||
| 
 | 
 | ||||||
|     async refreshWithNote(note) { |     async refreshWithNote(note) { | ||||||
|         this.toggle(true); |         this.toggle(true); | ||||||
|  |         this.$widget.find(".show-floating-buttons-button").on('click', () => this.toggle(true)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     toggle(show) { |     toggle(show) { | ||||||
|         this.$widget.toggleClass("temporarily-hidden", !show); |         this.$widget.find(".floating-buttons-children").toggleClass("temporarily-hidden", !show); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     hideFloatingButtonsCommand() { |     hideFloatingButtonsCommand() { | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ const TPL = ` | |||||||
|     </style> |     </style> | ||||||
| 
 | 
 | ||||||
|     <button type="button" |     <button type="button" | ||||||
|             class="close-floating-buttons-button btn bx bx-x" |             class="close-floating-buttons-button btn bx bx-chevrons-right" | ||||||
|             title="${t('hide_floating_buttons_button.button_title')}"></button> |             title="${t('hide_floating_buttons_button.button_title')}"></button> | ||||||
| </div> | </div> | ||||||
| `;
 | `;
 | ||||||
|  | |||||||
| @ -18,11 +18,14 @@ const TPL = ` | |||||||
|         } |         } | ||||||
|          |          | ||||||
|         .basic-properties-widget > * {             |         .basic-properties-widget > * {             | ||||||
|             margin-right: 30px; |  | ||||||
|             margin-top: 9px; |             margin-top: 9px; | ||||||
|             margin-bottom: 2px; |             margin-bottom: 2px; | ||||||
|         } |         } | ||||||
|          |          | ||||||
|  |         .basic-properties-widget > * > :last-child { | ||||||
|  |             margin-right: 30px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         .note-type-container, .editability-select-container { |         .note-type-container, .editability-select-container { | ||||||
|             display: flex; |             display: flex; | ||||||
|             align-items: center; |             align-items: center; | ||||||
|  | |||||||
| @ -411,7 +411,8 @@ | |||||||
|     "add_new_label": "Add new label <kbd data-command=\"addNewLabel\"></kbd>", |     "add_new_label": "Add new label <kbd data-command=\"addNewLabel\"></kbd>", | ||||||
|     "add_new_relation": "Add new relation <kbd data-command=\"addNewRelation\"></kbd>", |     "add_new_relation": "Add new relation <kbd data-command=\"addNewRelation\"></kbd>", | ||||||
|     "add_new_label_definition": "Add new label definition", |     "add_new_label_definition": "Add new label definition", | ||||||
|     "add_new_relation_definition": "Add new relation definition" |     "add_new_relation_definition": "Add new relation definition", | ||||||
|  |     "placeholder": "Type the labels and relations here" | ||||||
|   }, |   }, | ||||||
|   "abstract_bulk_action": { |   "abstract_bulk_action": { | ||||||
|     "remove_this_search_action": "Remove this search action" |     "remove_this_search_action": "Remove this search action" | ||||||
| @ -662,6 +663,9 @@ | |||||||
|   "hide_floating_buttons_button": { |   "hide_floating_buttons_button": { | ||||||
|     "button_title": "Hide buttons" |     "button_title": "Hide buttons" | ||||||
|   }, |   }, | ||||||
|  |   "show_floating_buttons_button": { | ||||||
|  |     "button_title": "Show buttons" | ||||||
|  |   }, | ||||||
|   "svg_export_button": { |   "svg_export_button": { | ||||||
|     "button_title": "Export diagram as SVG" |     "button_title": "Export diagram as SVG" | ||||||
|   }, |   }, | ||||||
|  | |||||||
| @ -237,7 +237,8 @@ | |||||||
|     "help_text_body1": "Pentru a adăuga o etichetă doar scrieți, spre exemplu, <code>#piatră</code> sau <code>#an = 2020</code> dacă se dorește adăugarea unei valori", |     "help_text_body1": "Pentru a adăuga o etichetă doar scrieți, spre exemplu, <code>#piatră</code> sau <code>#an = 2020</code> dacă se dorește adăugarea unei valori", | ||||||
|     "help_text_body2": "Pentru relații, scrieți <code>author = @</code> ce va afișa o autocompletare pentru identificarea notiței dorite.", |     "help_text_body2": "Pentru relații, scrieți <code>author = @</code> ce va afișa o autocompletare pentru identificarea notiței dorite.", | ||||||
|     "help_text_body3": "În mod alternativ, se pot adăuga etichete și relații utilizând butonul <code>+</code> din partea dreaptă.", |     "help_text_body3": "În mod alternativ, se pot adăuga etichete și relații utilizând butonul <code>+</code> din partea dreaptă.", | ||||||
|     "save_attributes": "Salvează atributele <enter>" |     "save_attributes": "Salvează atributele <enter>", | ||||||
|  |     "placeholder": "Aici puteți introduce etichete și relații" | ||||||
|   }, |   }, | ||||||
|   "backend_log": { |   "backend_log": { | ||||||
|     "refresh": "Reîmprospătare" |     "refresh": "Reîmprospătare" | ||||||
|  | |||||||
| @ -18,6 +18,10 @@ const isElectron = utils.isElectron(); | |||||||
|  * e.g. CTRL-C in note tree does something a bit different from CTRL-C in the text editor. |  * e.g. CTRL-C in note tree does something a bit different from CTRL-C in the text editor. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | if (!t("keyboard_actions.note-navigation")) { | ||||||
|  |     throw new Error("Keyboard actions loaded before translations."); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| const DEFAULT_KEYBOARD_ACTIONS: KeyboardShortcut[] = [ | const DEFAULT_KEYBOARD_ACTIONS: KeyboardShortcut[] = [ | ||||||
|     { |     { | ||||||
|         separator: t("keyboard_actions.note-navigation") |         separator: t("keyboard_actions.note-navigation") | ||||||
|  | |||||||
| @ -11,7 +11,6 @@ import migrationService from "./migration.js"; | |||||||
| import cls from "./cls.js"; | import cls from "./cls.js"; | ||||||
| import config from "./config.js"; | import config from "./config.js"; | ||||||
| import { OptionRow } from '../becca/entities/rows.js'; | import { OptionRow } from '../becca/entities/rows.js'; | ||||||
| import optionsInitService from "./options_init.js"; |  | ||||||
| import BNote from "../becca/entities/bnote.js"; | import BNote from "../becca/entities/bnote.js"; | ||||||
| import BBranch from "../becca/entities/bbranch.js"; | import BBranch from "../becca/entities/bbranch.js"; | ||||||
| import zipImportService from "./import/zip.js"; | import zipImportService from "./import/zip.js"; | ||||||
| @ -62,6 +61,9 @@ async function createInitialDatabase() { | |||||||
| 
 | 
 | ||||||
|     let rootNote!: BNote; |     let rootNote!: BNote; | ||||||
| 
 | 
 | ||||||
|  |     // We have to import async since options init requires keyboard actions which require translations.
 | ||||||
|  |     const optionsInitService = (await import("./options_init.js")).default; | ||||||
|  | 
 | ||||||
|     sql.transactional(() => { |     sql.transactional(() => { | ||||||
|         log.info("Creating database schema ..."); |         log.info("Creating database schema ..."); | ||||||
| 
 | 
 | ||||||
| @ -129,6 +131,9 @@ async function createDatabaseForSync(options: OptionRow[], syncServerHost = '', | |||||||
|     const defaultTheme = await getDefaultTheme(); |     const defaultTheme = await getDefaultTheme(); | ||||||
|     const schema = fs.readFileSync(`${resourceDir.DB_INIT_DIR}/schema.sql`, "utf8"); |     const schema = fs.readFileSync(`${resourceDir.DB_INIT_DIR}/schema.sql`, "utf8"); | ||||||
| 
 | 
 | ||||||
|  |     // We have to import async since options init requires keyboard actions which require translations.
 | ||||||
|  |     const optionsInitService = (await import("./options_init.js")).default; | ||||||
|  |      | ||||||
|     sql.transactional(() => { |     sql.transactional(() => { | ||||||
|         sql.executeScript(schema); |         sql.executeScript(schema); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 SiriusXT
						SiriusXT