mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	Compare commits
	
		
			32 Commits
		
	
	
		
			v0.41.2-be
			...
			v0.41.6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 5769587305 | ||
|  | ffbfccb701 | ||
|  | 907cdd8fcb | ||
|  | 7ea53d468e | ||
|  | 586d6b4557 | ||
|  | 8f68ff1932 | ||
|  | a1ea2c9115 | ||
|  | e8ce81a133 | ||
|  | aff12950f0 | ||
|  | 75c58cbf79 | ||
|  | 87a1e98fa2 | ||
|  | d1eacbb574 | ||
|  | 71d248cd87 | ||
|  | ac608b9334 | ||
|  | 32020d78b5 | ||
|  | ff853c7d0a | ||
|  | 8526cb2315 | ||
|  | dc89f72e75 | ||
|  | 657ff16267 | ||
|  | ed759f5585 | ||
|  | a86177bb59 | ||
|  | 9f1b3cc892 | ||
|  | 8473f72ec8 | ||
|  | 666d202a3a | ||
|  | 988fae50cb | ||
|  | 98bbd17920 | ||
|  | dadcc93ae3 | ||
|  | 48e19d0149 | ||
|  | f97c9e3619 | ||
|  | 61167f6646 | ||
|  | 29cec8112e | ||
|  | 48aadc8309 | 
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| .DS_Store | .DS_Store | ||||||
| node_modules/ | node_modules/ | ||||||
| dist/ | dist/ | ||||||
| src/public/dist/ | src/public/app-dist/ | ||||||
| npm-debug.log | npm-debug.log | ||||||
| yarn-error.log | yarn-error.log | ||||||
| *.db | *.db | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.idea/dataSources.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/dataSources.xml
									
									
									
										generated
									
									
									
								
							| @@ -5,7 +5,7 @@ | |||||||
|       <driver-ref>sqlite.xerial</driver-ref> |       <driver-ref>sqlite.xerial</driver-ref> | ||||||
|       <synchronize>true</synchronize> |       <synchronize>true</synchronize> | ||||||
|       <jdbc-driver>org.sqlite.JDBC</jdbc-driver> |       <jdbc-driver>org.sqlite.JDBC</jdbc-driver> | ||||||
|       <jdbc-url>jdbc:sqlite:$PROJECT_DIR$/../trilium-data/document.db</jdbc-url> |       <jdbc-url>jdbc:sqlite:$USER_HOME$/trilium-data/document.db</jdbc-url> | ||||||
|     </data-source> |     </data-source> | ||||||
|   </component> |   </component> | ||||||
| </project> | </project> | ||||||
| @@ -1,8 +1,8 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| <dataSource name="document.db"> | <dataSource name="document.db"> | ||||||
|   <database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.17"> |   <database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.18"> | ||||||
|     <root id="1"> |     <root id="1"> | ||||||
|       <ServerVersion>3.25.1</ServerVersion> |       <ServerVersion>3.16.1</ServerVersion> | ||||||
|     </root> |     </root> | ||||||
|     <schema id="2" parent="1" name="main"> |     <schema id="2" parent="1" name="main"> | ||||||
|       <Current>1</Current> |       <Current>1</Current> | ||||||
| @@ -57,6 +57,7 @@ | |||||||
|     <index id="24" parent="6" name="sqlite_autoindex_api_tokens_1"> |     <index id="24" parent="6" name="sqlite_autoindex_api_tokens_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>apiTokenId</ColNames> |       <ColNames>apiTokenId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <key id="25" parent="6"> |     <key id="25" parent="6"> | ||||||
| @@ -130,17 +131,21 @@ | |||||||
|     <index id="38" parent="7" name="sqlite_autoindex_attributes_1"> |     <index id="38" parent="7" name="sqlite_autoindex_attributes_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>attributeId</ColNames> |       <ColNames>attributeId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <index id="39" parent="7" name="IDX_attributes_noteId_index"> |     <index id="39" parent="7" name="IDX_attributes_noteId_index"> | ||||||
|       <ColNames>noteId</ColNames> |       <ColNames>noteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="40" parent="7" name="IDX_attributes_name_value"> |     <index id="40" parent="7" name="IDX_attributes_name_value"> | ||||||
|       <ColNames>name |       <ColNames>name | ||||||
| value</ColNames> | value</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="41" parent="7" name="IDX_attributes_value_index"> |     <index id="41" parent="7" name="IDX_attributes_value_index"> | ||||||
|       <ColNames>value</ColNames> |       <ColNames>value</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <key id="42" parent="7"> |     <key id="42" parent="7"> | ||||||
|       <ColNames>attributeId</ColNames> |       <ColNames>attributeId</ColNames> | ||||||
| @@ -207,14 +212,17 @@ value</ColNames> | |||||||
|     <index id="54" parent="8" name="sqlite_autoindex_branches_1"> |     <index id="54" parent="8" name="sqlite_autoindex_branches_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>branchId</ColNames> |       <ColNames>branchId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <index id="55" parent="8" name="IDX_branches_noteId_parentNoteId"> |     <index id="55" parent="8" name="IDX_branches_noteId_parentNoteId"> | ||||||
|       <ColNames>noteId |       <ColNames>noteId | ||||||
| parentNoteId</ColNames> | parentNoteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="56" parent="8" name="IDX_branches_parentNoteId"> |     <index id="56" parent="8" name="IDX_branches_parentNoteId"> | ||||||
|       <ColNames>parentNoteId</ColNames> |       <ColNames>parentNoteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <key id="57" parent="8"> |     <key id="57" parent="8"> | ||||||
|       <ColNames>branchId</ColNames> |       <ColNames>branchId</ColNames> | ||||||
| @@ -245,6 +253,7 @@ parentNoteId</ColNames> | |||||||
|     <index id="62" parent="9" name="sqlite_autoindex_note_contents_1"> |     <index id="62" parent="9" name="sqlite_autoindex_note_contents_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>noteId</ColNames> |       <ColNames>noteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <key id="63" parent="9"> |     <key id="63" parent="9"> | ||||||
| @@ -275,6 +284,7 @@ parentNoteId</ColNames> | |||||||
|     <index id="68" parent="10" name="sqlite_autoindex_note_revision_contents_1"> |     <index id="68" parent="10" name="sqlite_autoindex_note_revision_contents_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>noteRevisionId</ColNames> |       <ColNames>noteRevisionId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <key id="69" parent="10"> |     <key id="69" parent="10"> | ||||||
| @@ -359,22 +369,28 @@ parentNoteId</ColNames> | |||||||
|     <index id="84" parent="11" name="sqlite_autoindex_note_revisions_1"> |     <index id="84" parent="11" name="sqlite_autoindex_note_revisions_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>noteRevisionId</ColNames> |       <ColNames>noteRevisionId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <index id="85" parent="11" name="IDX_note_revisions_noteId"> |     <index id="85" parent="11" name="IDX_note_revisions_noteId"> | ||||||
|       <ColNames>noteId</ColNames> |       <ColNames>noteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="86" parent="11" name="IDX_note_revisions_utcDateLastEdited"> |     <index id="86" parent="11" name="IDX_note_revisions_utcDateLastEdited"> | ||||||
|       <ColNames>utcDateLastEdited</ColNames> |       <ColNames>utcDateLastEdited</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="87" parent="11" name="IDX_note_revisions_utcDateCreated"> |     <index id="87" parent="11" name="IDX_note_revisions_utcDateCreated"> | ||||||
|       <ColNames>utcDateCreated</ColNames> |       <ColNames>utcDateCreated</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="88" parent="11" name="IDX_note_revisions_dateLastEdited"> |     <index id="88" parent="11" name="IDX_note_revisions_dateLastEdited"> | ||||||
|       <ColNames>dateLastEdited</ColNames> |       <ColNames>dateLastEdited</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="89" parent="11" name="IDX_note_revisions_dateCreated"> |     <index id="89" parent="11" name="IDX_note_revisions_dateCreated"> | ||||||
|       <ColNames>dateCreated</ColNames> |       <ColNames>dateCreated</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <key id="90" parent="11"> |     <key id="90" parent="11"> | ||||||
|       <ColNames>noteRevisionId</ColNames> |       <ColNames>noteRevisionId</ColNames> | ||||||
| @@ -461,28 +477,36 @@ parentNoteId</ColNames> | |||||||
|     <index id="105" parent="12" name="sqlite_autoindex_notes_1"> |     <index id="105" parent="12" name="sqlite_autoindex_notes_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>noteId</ColNames> |       <ColNames>noteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <index id="106" parent="12" name="IDX_notes_title"> |     <index id="106" parent="12" name="IDX_notes_title"> | ||||||
|       <ColNames>title</ColNames> |       <ColNames>title</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="107" parent="12" name="IDX_notes_type"> |     <index id="107" parent="12" name="IDX_notes_type"> | ||||||
|       <ColNames>type</ColNames> |       <ColNames>type</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="108" parent="12" name="IDX_notes_isDeleted"> |     <index id="108" parent="12" name="IDX_notes_isDeleted"> | ||||||
|       <ColNames>isDeleted</ColNames> |       <ColNames>isDeleted</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="109" parent="12" name="IDX_notes_dateCreated"> |     <index id="109" parent="12" name="IDX_notes_dateCreated"> | ||||||
|       <ColNames>dateCreated</ColNames> |       <ColNames>dateCreated</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="110" parent="12" name="IDX_notes_dateModified"> |     <index id="110" parent="12" name="IDX_notes_dateModified"> | ||||||
|       <ColNames>dateModified</ColNames> |       <ColNames>dateModified</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="111" parent="12" name="IDX_notes_utcDateCreated"> |     <index id="111" parent="12" name="IDX_notes_utcDateCreated"> | ||||||
|       <ColNames>utcDateCreated</ColNames> |       <ColNames>utcDateCreated</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <index id="112" parent="12" name="IDX_notes_utcDateModified"> |     <index id="112" parent="12" name="IDX_notes_utcDateModified"> | ||||||
|       <ColNames>utcDateModified</ColNames> |       <ColNames>utcDateModified</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <key id="113" parent="12"> |     <key id="113" parent="12"> | ||||||
|       <ColNames>noteId</ColNames> |       <ColNames>noteId</ColNames> | ||||||
| @@ -523,6 +547,7 @@ parentNoteId</ColNames> | |||||||
|     <index id="120" parent="13" name="sqlite_autoindex_options_1"> |     <index id="120" parent="13" name="sqlite_autoindex_options_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>name</ColNames> |       <ColNames>name</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <key id="121" parent="13"> |     <key id="121" parent="13"> | ||||||
| @@ -558,6 +583,7 @@ parentNoteId</ColNames> | |||||||
|     <index id="127" parent="14" name="sqlite_autoindex_recent_notes_1"> |     <index id="127" parent="14" name="sqlite_autoindex_recent_notes_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>noteId</ColNames> |       <ColNames>noteId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <key id="128" parent="14"> |     <key id="128" parent="14"> | ||||||
| @@ -578,10 +604,12 @@ parentNoteId</ColNames> | |||||||
|     <index id="131" parent="15" name="sqlite_autoindex_source_ids_1"> |     <index id="131" parent="15" name="sqlite_autoindex_source_ids_1"> | ||||||
|       <NameSurrogate>1</NameSurrogate> |       <NameSurrogate>1</NameSurrogate> | ||||||
|       <ColNames>sourceId</ColNames> |       <ColNames>sourceId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <index id="132" parent="15" name="IDX_source_ids_utcDateCreated"> |     <index id="132" parent="15" name="IDX_source_ids_utcDateCreated"> | ||||||
|       <ColNames>utcDateCreated</ColNames> |       <ColNames>utcDateCreated</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <key id="133" parent="15"> |     <key id="133" parent="15"> | ||||||
|       <ColNames>sourceId</ColNames> |       <ColNames>sourceId</ColNames> | ||||||
| @@ -602,7 +630,7 @@ parentNoteId</ColNames> | |||||||
|     </column> |     </column> | ||||||
|     <column id="137" parent="16" name="rootpage"> |     <column id="137" parent="16" name="rootpage"> | ||||||
|       <Position>4</Position> |       <Position>4</Position> | ||||||
|       <DataType>int|0s</DataType> |       <DataType>integer|0s</DataType> | ||||||
|     </column> |     </column> | ||||||
|     <column id="138" parent="16" name="sql"> |     <column id="138" parent="16" name="sql"> | ||||||
|       <Position>5</Position> |       <Position>5</Position> | ||||||
| @@ -649,10 +677,12 @@ parentNoteId</ColNames> | |||||||
|     <index id="147" parent="18" name="IDX_sync_entityName_entityId"> |     <index id="147" parent="18" name="IDX_sync_entityName_entityId"> | ||||||
|       <ColNames>entityName |       <ColNames>entityName | ||||||
| entityId</ColNames> | entityId</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|       <Unique>1</Unique> |       <Unique>1</Unique> | ||||||
|     </index> |     </index> | ||||||
|     <index id="148" parent="18" name="IDX_sync_utcSyncDate"> |     <index id="148" parent="18" name="IDX_sync_utcSyncDate"> | ||||||
|       <ColNames>utcSyncDate</ColNames> |       <ColNames>utcSyncDate</ColNames> | ||||||
|  |       <ColumnCollations></ColumnCollations> | ||||||
|     </index> |     </index> | ||||||
|     <key id="149" parent="18"> |     <key id="149" parent="18"> | ||||||
|       <ColNames>id</ColNames> |       <ColNames>id</ColNames> | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								.idea/vcs.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								.idea/vcs.xml
									
									
									
										generated
									
									
									
								
							| @@ -2,5 +2,6 @@ | |||||||
| <project version="4"> | <project version="4"> | ||||||
|   <component name="VcsDirectoryMappings"> |   <component name="VcsDirectoryMappings"> | ||||||
|     <mapping directory="" vcs="Git" /> |     <mapping directory="" vcs="Git" /> | ||||||
|  |     <mapping directory="$PROJECT_DIR$/../.." vcs="Git" /> | ||||||
|   </component> |   </component> | ||||||
| </project> | </project> | ||||||
| @@ -8,7 +8,7 @@ Trilium Notes is a hierarchical note taking application with focus on building l | |||||||
| ## Features | ## Features | ||||||
|  |  | ||||||
| * Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes)) | * Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes)) | ||||||
| * Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-editor#autoformat) | * Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-notes#autoformat) | ||||||
| * Support for editing [notes with source code](https://github.com/zadam/trilium/wiki/Code-notes), including syntax highlighting | * Support for editing [notes with source code](https://github.com/zadam/trilium/wiki/Code-notes), including syntax highlighting | ||||||
| * Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation), full text search and [note hoisting](https://github.com/zadam/trilium/wiki/Note-hoisting) | * Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation), full text search and [note hoisting](https://github.com/zadam/trilium/wiki/Note-hoisting) | ||||||
| * Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions) | * Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions) | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ echo "Copying required linux-x64 binaries" | |||||||
| rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/* | rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/* | ||||||
| rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/* | rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/* | ||||||
|  |  | ||||||
| rm -r $SRC_DIR/src/public/dist/*.mobile.* | rm -r $SRC_DIR/src/public/app-dist/*.mobile.* | ||||||
|  |  | ||||||
| cp -r bin/deps/linux-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/ | cp -r bin/deps/linux-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/ | ||||||
| cp bin/deps/linux-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/ | cp bin/deps/linux-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/ | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ cp bin/deps/mac-x64/image/cjpeg $SRC_DIR/node_modules/mozjpeg/vendor/ | |||||||
| cp bin/deps/mac-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/ | cp bin/deps/mac-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/ | ||||||
| cp bin/deps/mac-x64/image/gifsicle $SRC_DIR/node_modules/giflossy/vendor/ | cp bin/deps/mac-x64/image/gifsicle $SRC_DIR/node_modules/giflossy/vendor/ | ||||||
|  |  | ||||||
| rm -r $SRC_DIR/src/public/dist/*.mobile.* | rm -r $SRC_DIR/src/public/app-dist/*.mobile.* | ||||||
|  |  | ||||||
| ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns | ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/ | |||||||
| cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/ | cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/ | ||||||
| cp bin/deps/win-x64/image/gifsicle.exe $SRC_DIR/node_modules/giflossy/vendor/ | cp bin/deps/win-x64/image/gifsicle.exe $SRC_DIR/node_modules/giflossy/vendor/ | ||||||
|  |  | ||||||
| rm -r $SRC_DIR/src/public/dist/*.mobile.* | rm -r $SRC_DIR/src/public/app-dist/*.mobile.* | ||||||
|  |  | ||||||
| ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32  --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico | ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32  --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico | ||||||
|  |  | ||||||
|   | |||||||
| @@ -5,6 +5,8 @@ if [[ $# -eq 0 ]] ; then | |||||||
|     exit 1 |     exit 1 | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | npm run webpack | ||||||
|  |  | ||||||
| DIR=$1 | DIR=$1 | ||||||
|  |  | ||||||
| rm -rf $DIR | rm -rf $DIR | ||||||
| @@ -25,11 +27,11 @@ cp -r electron.js $DIR/ | |||||||
| cp webpack-* $DIR/ | cp webpack-* $DIR/ | ||||||
|  |  | ||||||
| # run in subshell (so we return to original dir) | # run in subshell (so we return to original dir) | ||||||
| (cd $DIR && npm install --only=prod && npm run webpack) | (cd $DIR && npm install --only=prod) | ||||||
|  |  | ||||||
| find $DIR/libraries -name "*.map" -type f -delete | find $DIR/libraries -name "*.map" -type f -delete | ||||||
|  |  | ||||||
| rm -r $DIR/src/public/javascripts | rm -r $DIR/src/public/app | ||||||
|  |  | ||||||
| sed -i -e 's/javascripts\/desktop.js/dist\/desktop.js/g' $DIR/src/views/desktop.ejs | sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs | ||||||
| sed -i -e 's/javascripts\/mobile.js/dist\/mobile.js/g' $DIR/src/views/mobile.ejs | sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs | ||||||
| @@ -879,7 +879,7 @@ | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -5483,7 +5483,7 @@ Typical use case is when new note has been created, we should wait until it is s | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -507,7 +507,7 @@ | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -6813,7 +6813,7 @@ Cache is note instance scoped. | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -79,7 +79,7 @@ export default Attribute;</code></pre> | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -81,7 +81,7 @@ export default Branch;</code></pre> | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -61,7 +61,7 @@ export default NoteComplement;</code></pre> | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -493,7 +493,7 @@ export default NoteShort;</code></pre> | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -94,6 +94,275 @@ | |||||||
|      |      | ||||||
|  |  | ||||||
|      |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |         <h3 class="subsection-title">Methods</h3> | ||||||
|  |  | ||||||
|  |          | ||||||
|  |              | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <h4 class="name" id="decorateWidget"><span class="type-signature"></span>decorateWidget<span class="signature">()</span><span class="type-signature"></span></h4> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <div class="description"> | ||||||
|  |     for overriding | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <dl class="details"> | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <dt class="tag-source">Source:</dt> | ||||||
|  |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|  |         <a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line93">line 93</a> | ||||||
|  |     </li></ul></dd> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |          | ||||||
|  |              | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <h4 class="name" id="doRenderBody"><span class="type-signature">(async) </span>doRenderBody<span class="signature">()</span><span class="type-signature"></span></h4> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <div class="description"> | ||||||
|  |     for overriding | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <dl class="details"> | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <dt class="tag-source">Source:</dt> | ||||||
|  |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|  |         <a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line96">line 96</a> | ||||||
|  |     </li></ul></dd> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |          | ||||||
|  |              | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <h4 class="name" id="widgetCollapsedStateChangedEvent"><span class="type-signature"></span>widgetCollapsedStateChangedEvent<span class="signature">()</span><span class="type-signature"></span></h4> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <div class="description"> | ||||||
|  |     This event is used to synchronize collapsed state of all the tab-cached widgets since they are all rendered | ||||||
|  | separately but should behave uniformly for the user. | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <dl class="details"> | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <dt class="tag-source">Source:</dt> | ||||||
|  |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|  |         <a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line86">line 86</a> | ||||||
|  |     </li></ul></dd> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|          |          | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -333,7 +602,7 @@ | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -50,7 +50,7 @@ | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
| @@ -443,7 +443,7 @@ export default FrontendScriptApi;</code></pre> | |||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <nav> | <nav> | ||||||
|     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3> |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
| </nav> | </nav> | ||||||
|  |  | ||||||
| <br class="clear"> | <br class="clear"> | ||||||
|   | |||||||
							
								
								
									
										151
									
								
								docs/frontend_api/widgets_collapsible_widget.js.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								docs/frontend_api/widgets_collapsible_widget.js.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,151 @@ | |||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="en"> | ||||||
|  | <head> | ||||||
|  |     <meta charset="utf-8"> | ||||||
|  |     <title>JSDoc: Source: widgets/collapsible_widget.js</title> | ||||||
|  |  | ||||||
|  |     <script src="scripts/prettify/prettify.js"> </script> | ||||||
|  |     <script src="scripts/prettify/lang-css.js"> </script> | ||||||
|  |     <!--[if lt IE 9]> | ||||||
|  |       <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||||||
|  |     <![endif]--> | ||||||
|  |     <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> | ||||||
|  |     <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> | ||||||
|  | </head> | ||||||
|  |  | ||||||
|  | <body> | ||||||
|  |  | ||||||
|  | <div id="main"> | ||||||
|  |  | ||||||
|  |     <h1 class="page-title">Source: widgets/collapsible_widget.js</h1> | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <section> | ||||||
|  |         <article> | ||||||
|  |             <pre class="prettyprint source linenums"><code>import TabAwareWidget from "./tab_aware_widget.js"; | ||||||
|  | import options from "../services/options.js"; | ||||||
|  |  | ||||||
|  | const WIDGET_TPL = ` | ||||||
|  | <div class="card widget"> | ||||||
|  |     <div class="card-header"> | ||||||
|  |         <div>            | ||||||
|  |             <button class="btn btn-sm widget-title" data-toggle="collapse" data-target="#[to be set]"> | ||||||
|  |                 Collapsible Group Item | ||||||
|  |             </button> | ||||||
|  |              | ||||||
|  |             <a class="widget-help external no-arrow bx bx-info-circle"></a> | ||||||
|  |         </div> | ||||||
|  |          | ||||||
|  |         <div class="widget-header-actions"></div> | ||||||
|  |     </div> | ||||||
|  |  | ||||||
|  |     <div id="[to be set]" class="collapse body-wrapper" style="transition: none; "> | ||||||
|  |         <div class="card-body"></div> | ||||||
|  |     </div> | ||||||
|  | </div>`; | ||||||
|  |  | ||||||
|  | export default class CollapsibleWidget extends TabAwareWidget { | ||||||
|  |     get widgetTitle() { return "Untitled widget"; } | ||||||
|  |  | ||||||
|  |     get headerActions() { return []; } | ||||||
|  |  | ||||||
|  |     get help() { return {}; } | ||||||
|  |  | ||||||
|  |     doRender() { | ||||||
|  |         this.$widget = $(WIDGET_TPL); | ||||||
|  |         this.$widget.find('[data-target]').attr('data-target', "#" + this.componentId); | ||||||
|  |  | ||||||
|  |         this.$bodyWrapper = this.$widget.find('.body-wrapper'); | ||||||
|  |         this.$bodyWrapper.attr('id', this.componentId); // for toggle to work we need id | ||||||
|  |  | ||||||
|  |         this.widgetName = this.constructor.name; | ||||||
|  |  | ||||||
|  |         if (!options.is(this.widgetName + 'Collapsed')) { | ||||||
|  |             this.$bodyWrapper.collapse("show"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         // using immediate variants of the event so that the previous collapse is not caught | ||||||
|  |         this.$bodyWrapper.on('hide.bs.collapse', () => this.saveCollapsed(true)); | ||||||
|  |         this.$bodyWrapper.on('show.bs.collapse', () => this.saveCollapsed(false)); | ||||||
|  |  | ||||||
|  |         this.$body = this.$bodyWrapper.find('.card-body'); | ||||||
|  |  | ||||||
|  |         this.$title = this.$widget.find('.widget-title'); | ||||||
|  |         this.$title.text(this.widgetTitle); | ||||||
|  |  | ||||||
|  |         this.$help = this.$widget.find('.widget-help'); | ||||||
|  |  | ||||||
|  |         if (this.help.title) { | ||||||
|  |             this.$help.attr("title", this.help.title); | ||||||
|  |             this.$help.attr("href", this.help.url || "javascript:"); | ||||||
|  |  | ||||||
|  |             if (!this.help.url) { | ||||||
|  |                 this.$help.addClass('no-link'); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |             this.$help.hide(); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         this.$headerActions = this.$widget.find('.widget-header-actions'); | ||||||
|  |         this.$headerActions.append(...this.headerActions); | ||||||
|  |  | ||||||
|  |         this.initialized = this.doRenderBody(); | ||||||
|  |  | ||||||
|  |         this.decorateWidget(); | ||||||
|  |  | ||||||
|  |         return this.$widget; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     saveCollapsed(collapse) { | ||||||
|  |         options.save(this.widgetName + 'Collapsed', collapse.toString()); | ||||||
|  |  | ||||||
|  |         this.triggerEvent(`widgetCollapsedStateChanged`, {widgetName: this.widgetName, collapse}); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * This event is used to synchronize collapsed state of all the tab-cached widgets since they are all rendered | ||||||
|  |      * separately but should behave uniformly for the user. | ||||||
|  |      */ | ||||||
|  |     widgetCollapsedStateChangedEvent({widgetName, collapse}) { | ||||||
|  |         if (widgetName === this.widgetName) { | ||||||
|  |             this.$bodyWrapper.toggleClass('show', !collapse); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** for overriding */ | ||||||
|  |     decorateWidget() {} | ||||||
|  |  | ||||||
|  |     /** for overriding */ | ||||||
|  |     async doRenderBody() {} | ||||||
|  |  | ||||||
|  |     isExpanded() { | ||||||
|  |         return this.$bodyWrapper.hasClass("show"); | ||||||
|  |     } | ||||||
|  | }</code></pre> | ||||||
|  |         </article> | ||||||
|  |     </section> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  | <nav> | ||||||
|  |     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul> | ||||||
|  | </nav> | ||||||
|  |  | ||||||
|  | <br class="clear"> | ||||||
|  |  | ||||||
|  | <footer> | ||||||
|  |     Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> | ||||||
|  | </footer> | ||||||
|  |  | ||||||
|  | <script> prettyPrint(); </script> | ||||||
|  | <script src="scripts/linenumber.js"> </script> | ||||||
|  | </body> | ||||||
|  | </html> | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| For bug reports, please mention **version of the application** and include **log files** from following location: | For bug reports, **PLEASE mention version of Trilium you're using** and also include **log files** from following location: | ||||||
|  |  | ||||||
| * `/home/[user]/.local/share/trilium-data/log` for Linux | * `/home/[user]/.local/share/trilium-data/log` for Linux | ||||||
| * `C:\Users\[user]\AppData\Roaming\trilium-data\log` for Windows Vista and up | * `C:\Users\[user]\AppData\Roaming\trilium-data\log` for Windows Vista and up | ||||||
|   | |||||||
							
								
								
									
										727
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										727
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										34
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								package.json
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | |||||||
|   "name": "trilium", |   "name": "trilium", | ||||||
|   "productName": "Trilium Notes", |   "productName": "Trilium Notes", | ||||||
|   "description": "Trilium Notes", |   "description": "Trilium Notes", | ||||||
|   "version": "0.41.2-beta", |   "version": "0.41.5", | ||||||
|   "license": "AGPL-3.0-only", |   "license": "AGPL-3.0-only", | ||||||
|   "main": "electron.js", |   "main": "electron.js", | ||||||
|   "bin": { |   "bin": { | ||||||
| @@ -16,28 +16,28 @@ | |||||||
|     "start-server": "TRILIUM_ENV=dev node ./src/www", |     "start-server": "TRILIUM_ENV=dev node ./src/www", | ||||||
|     "start-electron": "TRILIUM_ENV=dev electron .", |     "start-electron": "TRILIUM_ENV=dev electron .", | ||||||
|     "build-backend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/entities/*.js src/services/backend_script_api.js", |     "build-backend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/entities/*.js src/services/backend_script_api.js", | ||||||
|     "build-frontend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/javascripts/entities/*.js src/public/javascripts/services/frontend_script_api.js", |     "build-frontend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/collapsible_widget.js", | ||||||
|     "build-docs": "npm run build-backend-docs && npm run build-frontend-docs", |     "build-docs": "npm run build-backend-docs && npm run build-frontend-docs", | ||||||
|     "webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js" |     "webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js && npx webpack -c webpack-setup.config.js" | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "async-mutex": "0.2.1", |     "async-mutex": "0.2.2", | ||||||
|     "axios": "0.19.2", |     "axios": "0.19.2", | ||||||
|     "body-parser": "1.19.0", |     "body-parser": "1.19.0", | ||||||
|     "cls-hooked": "4.2.2", |     "cls-hooked": "4.2.2", | ||||||
|     "commonmark": "0.29.1", |     "commonmark": "0.29.1", | ||||||
|     "cookie-parser": "1.4.5", |     "cookie-parser": "1.4.5", | ||||||
|     "csurf": "1.11.0", |     "csurf": "1.11.0", | ||||||
|     "dayjs": "1.8.24", |     "dayjs": "1.8.25", | ||||||
|     "debug": "4.1.1", |     "debug": "4.1.1", | ||||||
|     "ejs": "3.0.2", |     "ejs": "3.1.2", | ||||||
|     "electron-debug": "3.0.1", |     "electron-debug": "3.0.1", | ||||||
|     "electron-dl": "3.0.0", |     "electron-dl": "3.0.0", | ||||||
|     "electron-find": "1.0.6", |     "electron-find": "1.0.6", | ||||||
|     "electron-window-state": "5.0.3", |     "electron-window-state": "5.0.3", | ||||||
|     "express": "4.17.1", |     "express": "4.17.1", | ||||||
|     "express-session": "1.17.0", |     "express-session": "1.17.1", | ||||||
|     "file-type": "14.1.4", |     "file-type": "14.2.0", | ||||||
|     "fs-extra": "9.0.0", |     "fs-extra": "9.0.0", | ||||||
|     "helmet": "3.22.0", |     "helmet": "3.22.0", | ||||||
|     "html": "1.0.0", |     "html": "1.0.0", | ||||||
| @@ -51,10 +51,10 @@ | |||||||
|     "imagemin-pngquant": "8.0.0", |     "imagemin-pngquant": "8.0.0", | ||||||
|     "ini": "1.3.5", |     "ini": "1.3.5", | ||||||
|     "is-svg": "4.2.1", |     "is-svg": "4.2.1", | ||||||
|     "jimp": "0.10.1", |     "jimp": "0.10.3", | ||||||
|     "mime-types": "2.1.26", |     "mime-types": "2.1.27", | ||||||
|     "multer": "1.4.2", |     "multer": "1.4.2", | ||||||
|     "node-abi": "2.15.0", |     "node-abi": "2.16.0", | ||||||
|     "open": "7.0.3", |     "open": "7.0.3", | ||||||
|     "portscanner": "2.2.0", |     "portscanner": "2.2.0", | ||||||
|     "rand-token": "1.0.1", |     "rand-token": "1.0.1", | ||||||
| @@ -62,29 +62,29 @@ | |||||||
|     "rimraf": "3.0.2", |     "rimraf": "3.0.2", | ||||||
|     "sanitize-filename": "1.6.3", |     "sanitize-filename": "1.6.3", | ||||||
|     "sax": "1.2.4", |     "sax": "1.2.4", | ||||||
|     "semver": "7.2.2", |     "semver": "7.3.2", | ||||||
|     "serve-favicon": "2.5.0", |     "serve-favicon": "2.5.0", | ||||||
|     "session-file-store": "1.4.0", |     "session-file-store": "1.4.0", | ||||||
|     "simple-node-logger": "18.12.24", |     "simple-node-logger": "18.12.24", | ||||||
|     "sqlite": "4.0.6", |     "sqlite": "4.0.7", | ||||||
|     "sqlite3": "4.1.1", |     "sqlite3": "4.1.1", | ||||||
|     "string-similarity": "4.0.1", |     "string-similarity": "4.0.1", | ||||||
|     "tar-stream": "2.1.2", |     "tar-stream": "2.1.2", | ||||||
|     "turndown": "6.0.0", |     "turndown": "6.0.0", | ||||||
|     "turndown-plugin-gfm": "1.0.2", |     "turndown-plugin-gfm": "1.0.2", | ||||||
|     "unescape": "1.0.1", |     "unescape": "1.0.1", | ||||||
|     "ws": "7.2.3", |     "ws": "7.2.5", | ||||||
|     "yauzl": "^2.10.0", |     "yauzl": "^2.10.0", | ||||||
|     "yazl": "^2.5.1" |     "yazl": "^2.5.1" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "electron": "9.0.0-beta.15", |     "electron": "9.0.0-beta.20", | ||||||
|     "electron-builder": "22.4.1", |     "electron-builder": "22.5.1", | ||||||
|     "electron-packager": "14.2.1", |     "electron-packager": "14.2.1", | ||||||
|     "electron-rebuild": "1.10.1", |     "electron-rebuild": "1.10.1", | ||||||
|     "jsdoc": "3.6.4", |     "jsdoc": "3.6.4", | ||||||
|     "lorem-ipsum": "2.0.3", |     "lorem-ipsum": "2.0.3", | ||||||
|     "webpack": "5.0.0-beta.14", |     "webpack": "5.0.0-beta.15", | ||||||
|     "webpack-cli": "4.0.0-beta.8" |     "webpack-cli": "4.0.0-beta.8" | ||||||
|   }, |   }, | ||||||
|   "optionalDependencies": { |   "optionalDependencies": { | ||||||
|   | |||||||
| @@ -45,7 +45,6 @@ app.use(cookieParser()); | |||||||
| app.use(express.static(path.join(__dirname, 'public'))); | app.use(express.static(path.join(__dirname, 'public'))); | ||||||
| app.use('/libraries', express.static(path.join(__dirname, '..', 'libraries'))); | app.use('/libraries', express.static(path.join(__dirname, '..', 'libraries'))); | ||||||
| app.use('/images', express.static(path.join(__dirname, '..', 'images'))); | app.use('/images', express.static(path.join(__dirname, '..', 'images'))); | ||||||
| app.use('/dist', express.static(path.join(__dirname, '..', 'dist'))); |  | ||||||
| const sessionParser = session({ | const sessionParser = session({ | ||||||
|     secret: sessionSecret, |     secret: sessionSecret, | ||||||
|     resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request. |     resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request. | ||||||
|   | |||||||
| @@ -5,8 +5,9 @@ import bundleService from "./services/bundle.js"; | |||||||
| import noteAutocompleteService from './services/note_autocomplete.js'; | import noteAutocompleteService from './services/note_autocomplete.js'; | ||||||
| import macInit from './services/mac_init.js'; | import macInit from './services/mac_init.js'; | ||||||
| import contextMenu from "./services/context_menu.js"; | import contextMenu from "./services/context_menu.js"; | ||||||
| import DesktopLayout from "./widgets/desktop_layout.js"; | import DesktopMainWindowLayout from "./layouts/desktop_main_window_layout.js"; | ||||||
| import glob from "./services/glob.js"; | import glob from "./services/glob.js"; | ||||||
|  | import DesktopExtraWindowLayout from "./layouts/desktop_extra_window_layout.js"; | ||||||
| 
 | 
 | ||||||
| glob.setupGlobs(); | glob.setupGlobs(); | ||||||
| 
 | 
 | ||||||
| @@ -23,9 +24,11 @@ $('[data-toggle="tooltip"]').tooltip({ | |||||||
| macInit.init(); | macInit.init(); | ||||||
| 
 | 
 | ||||||
| bundleService.getWidgetBundlesByParent().then(widgetBundles => { | bundleService.getWidgetBundlesByParent().then(widgetBundles => { | ||||||
|     const desktopLayout = new DesktopLayout(widgetBundles); |     const layout = window.glob.isMainWindow | ||||||
|  |         ? new DesktopMainWindowLayout(widgetBundles) | ||||||
|  |         : new DesktopExtraWindowLayout(widgetBundles); | ||||||
| 
 | 
 | ||||||
|     appContext.setLayout(desktopLayout); |     appContext.setLayout(layout); | ||||||
|     appContext.start(); |     appContext.start(); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| import optionsService from "../../services/options.js"; | import utils from "../../services/utils.js"; | ||||||
| import server from "../../services/server.js"; | import server from "../../services/server.js"; | ||||||
| import toastService from "../../services/toast.js"; | import toastService from "../../services/toast.js"; | ||||||
| 
 | 
 | ||||||
| @@ -20,7 +20,9 @@ const TPL = ` | |||||||
|         <input type="text" class="form-control" id="spell-check-language-code" placeholder="for example "en-US", "de-AT""> |         <input type="text" class="form-control" id="spell-check-language-code" placeholder="for example "en-US", "de-AT""> | ||||||
|     </div> |     </div> | ||||||
| 
 | 
 | ||||||
|     <p>Multiple languages can be separated by comman. Changes to the spell check options will take effect after application restart.</p> |     <p>Multiple languages can be separated by comma, e.g. <code>en-US, de-DE, cs</code>. Changes to the spell check options will take effect after application restart.</p> | ||||||
|  |      | ||||||
|  |     <p><strong>Available language codes: </strong> <span id="available-language-codes"></span></p> | ||||||
| </div> | </div> | ||||||
| 
 | 
 | ||||||
| <div> | <div> | ||||||
| @@ -95,6 +97,14 @@ export default class ProtectedSessionOptions { | |||||||
|             return false; |             return false; | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|  |         this.$availableLanguageCodes = $("#available-language-codes"); | ||||||
|  | 
 | ||||||
|  |         if (utils.isElectron()) { | ||||||
|  |             const {webContents} = utils.dynamicRequire('electron').remote.getCurrentWindow(); | ||||||
|  | 
 | ||||||
|  |             this.$availableLanguageCodes.text(webContents.session.availableSpellCheckerLanguages.join(', ')); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         this.$eraseNotesAfterTimeInSeconds = $("#erase-notes-after-time-in-seconds"); |         this.$eraseNotesAfterTimeInSeconds = $("#erase-notes-after-time-in-seconds"); | ||||||
| 
 | 
 | ||||||
|         this.$eraseNotesAfterTimeInSeconds.on('change', () => { |         this.$eraseNotesAfterTimeInSeconds.on('change', () => { | ||||||
| @@ -32,10 +32,10 @@ export async function showDialog(ancestorNoteId) { | |||||||
|     for (const [dateDay, dayChanges] of groupedByDate) { |     for (const [dateDay, dayChanges] of groupedByDate) { | ||||||
|         const $changesList = $('<ul>'); |         const $changesList = $('<ul>'); | ||||||
| 
 | 
 | ||||||
|         const dayEl = $('<div>').append($('<b>').html(utils.formatDate(dateDay))).append($changesList); |         const dayEl = $('<div>').append($('<b>').text(dateDay)).append($changesList); | ||||||
| 
 | 
 | ||||||
|         for (const change of dayChanges) { |         for (const change of dayChanges) { | ||||||
|             const formattedTime = utils.formatTime(utils.parseDate(change.date)); |             const formattedTime = change.date.substr(11, 5); | ||||||
| 
 | 
 | ||||||
|             let $noteLink; |             let $noteLink; | ||||||
| 
 | 
 | ||||||
| @@ -82,7 +82,12 @@ export async function showDialog(ancestorNoteId) { | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             $changesList.append($('<li>') |             $changesList.append($('<li>') | ||||||
|                 .append(formattedTime + ' - ') |                 .append( | ||||||
|  |                     $("<span>") | ||||||
|  |                         .text(formattedTime) | ||||||
|  |                         .attr("title", change.date) | ||||||
|  |                 ) | ||||||
|  |                 .append(' - ') | ||||||
|                 .append($noteLink)); |                 .append($noteLink)); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @@ -92,23 +97,9 @@ export async function showDialog(ancestorNoteId) { | |||||||
| 
 | 
 | ||||||
| function groupByDate(result) { | function groupByDate(result) { | ||||||
|     const groupedByDate = new Map(); |     const groupedByDate = new Map(); | ||||||
|     const dayCache = {}; |  | ||||||
| 
 | 
 | ||||||
|     for (const row of result) { |     for (const row of result) { | ||||||
|         let dateDay = utils.parseDate(row.date); |         const dateDay = row.date.substr(0, 10); | ||||||
|         dateDay.setHours(0); |  | ||||||
|         dateDay.setMinutes(0); |  | ||||||
|         dateDay.setSeconds(0); |  | ||||||
|         dateDay.setMilliseconds(0); |  | ||||||
| 
 |  | ||||||
|         // this stupidity is to make sure that we always use the same day object because Map uses only
 |  | ||||||
|         // reference equality
 |  | ||||||
|         if (dayCache[dateDay]) { |  | ||||||
|             dateDay = dayCache[dateDay]; |  | ||||||
|         } |  | ||||||
|         else { |  | ||||||
|             dayCache[dateDay] = dateDay; |  | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         if (!groupedByDate.has(dateDay)) { |         if (!groupedByDate.has(dateDay)) { | ||||||
|             groupedByDate.set(dateDay, []); |             groupedByDate.set(dateDay, []); | ||||||
							
								
								
									
										48
									
								
								src/public/app/layouts/desktop_extra_window_layout.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/public/app/layouts/desktop_extra_window_layout.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,48 @@ | |||||||
|  | import FlexContainer from "../widgets/flex_container.js"; | ||||||
|  | import GlobalMenuWidget from "../widgets/global_menu.js"; | ||||||
|  | import TabRowWidget from "../widgets/tab_row.js"; | ||||||
|  | import TitleBarButtonsWidget from "../widgets/title_bar_buttons.js"; | ||||||
|  | import NoteTreeWidget from "../widgets/note_tree.js"; | ||||||
|  | import TabCachingWidget from "../widgets/tab_caching_widget.js"; | ||||||
|  | import NoteTitleWidget from "../widgets/note_title.js"; | ||||||
|  | import RunScriptButtonsWidget from "../widgets/run_script_buttons.js"; | ||||||
|  | import ProtectedNoteSwitchWidget from "../widgets/protected_note_switch.js"; | ||||||
|  | import NoteTypeWidget from "../widgets/note_type.js"; | ||||||
|  | import NoteActionsWidget from "../widgets/note_actions.js"; | ||||||
|  | import PromotedAttributesWidget from "../widgets/promoted_attributes.js"; | ||||||
|  | import NoteDetailWidget from "../widgets/note_detail.js"; | ||||||
|  |  | ||||||
|  | export default class DesktopExtraWindowLayout { | ||||||
|  |     constructor(customWidgets) { | ||||||
|  |         this.customWidgets = customWidgets; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     getRootWidget(appContext) { | ||||||
|  |         appContext.mainTreeWidget = new NoteTreeWidget(); | ||||||
|  |  | ||||||
|  |         return new FlexContainer('column') | ||||||
|  |             .setParent(appContext) | ||||||
|  |             .id('root-widget') | ||||||
|  |             .css('height', '100vh') | ||||||
|  |             .child(new FlexContainer('row') | ||||||
|  |                 .child(new GlobalMenuWidget()) | ||||||
|  |                 .child(new TabRowWidget()) | ||||||
|  |                 .child(new TitleBarButtonsWidget())) | ||||||
|  |             .child(new FlexContainer('row') | ||||||
|  |                 .collapsible() | ||||||
|  |                 .child(new FlexContainer('column').id('center-pane').css('flex-grow', '1') | ||||||
|  |                     .child(new FlexContainer('row').class('title-row') | ||||||
|  |                         .cssBlock('.title-row > * { margin: 5px; }') | ||||||
|  |                         .child(new NoteTitleWidget()) | ||||||
|  |                         .child(new RunScriptButtonsWidget().hideInZenMode()) | ||||||
|  |                         .child(new ProtectedNoteSwitchWidget().hideInZenMode()) | ||||||
|  |                         .child(new NoteTypeWidget().hideInZenMode()) | ||||||
|  |                         .child(new NoteActionsWidget().hideInZenMode()) | ||||||
|  |                     ) | ||||||
|  |                     .child(new TabCachingWidget(() => new PromotedAttributesWidget())) | ||||||
|  |                     .child(new TabCachingWidget(() => new NoteDetailWidget())) | ||||||
|  |                     .child(...this.customWidgets.get('center-pane')) | ||||||
|  |                 ) | ||||||
|  |             ); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -1,30 +1,30 @@ | |||||||
| import FlexContainer from "./flex_container.js"; | import FlexContainer from "../widgets/flex_container.js"; | ||||||
| import GlobalMenuWidget from "./global_menu.js"; | import GlobalMenuWidget from "../widgets/global_menu.js"; | ||||||
| import TabRowWidget from "./tab_row.js"; | import TabRowWidget from "../widgets/tab_row.js"; | ||||||
| import TitleBarButtonsWidget from "./title_bar_buttons.js"; | import TitleBarButtonsWidget from "../widgets/title_bar_buttons.js"; | ||||||
| import StandardTopWidget from "./standard_top_widget.js"; | import StandardTopWidget from "../widgets/standard_top_widget.js"; | ||||||
| import SidePaneContainer from "./side_pane_container.js"; | import SidePaneContainer from "../widgets/side_pane_container.js"; | ||||||
| import GlobalButtonsWidget from "./global_buttons.js"; | import GlobalButtonsWidget from "../widgets/global_buttons.js"; | ||||||
| import SearchBoxWidget from "./search_box.js"; | import SearchBoxWidget from "../widgets/search_box.js"; | ||||||
| import SearchResultsWidget from "./search_results.js"; | import SearchResultsWidget from "../widgets/search_results.js"; | ||||||
| import NoteTreeWidget from "./note_tree.js"; | import NoteTreeWidget from "../widgets/note_tree.js"; | ||||||
| import TabCachingWidget from "./tab_caching_widget.js"; | import TabCachingWidget from "../widgets/tab_caching_widget.js"; | ||||||
| import NotePathsWidget from "./note_paths.js"; | import NotePathsWidget from "../widgets/note_paths.js"; | ||||||
| import NoteTitleWidget from "./note_title.js"; | import NoteTitleWidget from "../widgets/note_title.js"; | ||||||
| import RunScriptButtonsWidget from "./run_script_buttons.js"; | import RunScriptButtonsWidget from "../widgets/run_script_buttons.js"; | ||||||
| import ProtectedNoteSwitchWidget from "./protected_note_switch.js"; | import ProtectedNoteSwitchWidget from "../widgets/protected_note_switch.js"; | ||||||
| import NoteTypeWidget from "./note_type.js"; | import NoteTypeWidget from "../widgets/note_type.js"; | ||||||
| import NoteActionsWidget from "./note_actions.js"; | import NoteActionsWidget from "../widgets/note_actions.js"; | ||||||
| import PromotedAttributesWidget from "./promoted_attributes.js"; | import PromotedAttributesWidget from "../widgets/promoted_attributes.js"; | ||||||
| import NoteDetailWidget from "./note_detail.js"; | import NoteDetailWidget from "../widgets/note_detail.js"; | ||||||
| import NoteInfoWidget from "./note_info.js"; | import NoteInfoWidget from "../widgets/collapsible_widgets/note_info.js"; | ||||||
| import CalendarWidget from "./calendar.js"; | import CalendarWidget from "../widgets/collapsible_widgets/calendar.js"; | ||||||
| import AttributesWidget from "./attributes.js"; | import AttributesWidget from "../widgets/collapsible_widgets/attributes.js"; | ||||||
| import LinkMapWidget from "./link_map.js"; | import LinkMapWidget from "../widgets/collapsible_widgets/link_map.js"; | ||||||
| import NoteRevisionsWidget from "./note_revisions.js"; | import NoteRevisionsWidget from "../widgets/collapsible_widgets/note_revisions.js"; | ||||||
| import SimilarNotesWidget from "./similar_notes.js"; | import SimilarNotesWidget from "../widgets/collapsible_widgets/similar_notes.js"; | ||||||
| import WhatLinksHereWidget from "./what_links_here.js"; | import WhatLinksHereWidget from "../widgets/collapsible_widgets/what_links_here.js"; | ||||||
| import SidePaneToggles from "./side_pane_toggles.js"; | import SidePaneToggles from "../widgets/side_pane_toggles.js"; | ||||||
| import appContext from "../services/app_context.js"; | import appContext from "../services/app_context.js"; | ||||||
| 
 | 
 | ||||||
| const RIGHT_PANE_CSS = ` | const RIGHT_PANE_CSS = ` | ||||||
| @@ -98,7 +98,7 @@ const RIGHT_PANE_CSS = ` | |||||||
| } | } | ||||||
| </style>`; | </style>`; | ||||||
| 
 | 
 | ||||||
| export default class DesktopLayout { | export default class DesktopMainWindowLayout { | ||||||
|     constructor(customWidgets) { |     constructor(customWidgets) { | ||||||
|         this.customWidgets = customWidgets; |         this.customWidgets = customWidgets; | ||||||
|     } |     } | ||||||
| @@ -1,11 +1,11 @@ | |||||||
| import FlexContainer from "./flex_container.js"; | import FlexContainer from "../widgets/flex_container.js"; | ||||||
| import NoteTitleWidget from "./note_title.js"; | import NoteTitleWidget from "../widgets/note_title.js"; | ||||||
| import NoteDetailWidget from "./note_detail.js"; | import NoteDetailWidget from "../widgets/note_detail.js"; | ||||||
| import NoteTreeWidget from "./note_tree.js"; | import NoteTreeWidget from "../widgets/note_tree.js"; | ||||||
| import MobileGlobalButtonsWidget from "./mobile_global_buttons.js"; | import MobileGlobalButtonsWidget from "../widgets/mobile_widgets/mobile_global_buttons.js"; | ||||||
| import CloseDetailButtonWidget from "./close_detail_button.js"; | import CloseDetailButtonWidget from "../widgets/mobile_widgets/close_detail_button.js"; | ||||||
| import MobileDetailMenuWidget from "./mobile_detail_menu.js"; | import MobileDetailMenuWidget from "../widgets/mobile_widgets/mobile_detail_menu.js"; | ||||||
| import ScreenContainer from "./screen_container.js"; | import ScreenContainer from "../widgets/mobile_widgets/screen_container.js"; | ||||||
| 
 | 
 | ||||||
| const MOBILE_CSS = ` | const MOBILE_CSS = ` | ||||||
| <style> | <style> | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| import appContext from "./services/app_context.js"; | import appContext from "./services/app_context.js"; | ||||||
| import MobileLayout from "./widgets/mobile_layout.js"; | import MobileLayout from "./layouts/mobile_layout.js"; | ||||||
| import glob from "./services/glob.js"; | import glob from "./services/glob.js"; | ||||||
| 
 | 
 | ||||||
| glob.setupGlobs(); | glob.setupGlobs(); | ||||||
| @@ -9,10 +9,16 @@ import TabManager from "./tab_manager.js"; | |||||||
| import treeService from "./tree.js"; | import treeService from "./tree.js"; | ||||||
| import Component from "../widgets/component.js"; | import Component from "../widgets/component.js"; | ||||||
| import keyboardActionsService from "./keyboard_actions.js"; | import keyboardActionsService from "./keyboard_actions.js"; | ||||||
| import MobileScreenSwitcherExecutor from "../widgets/mobile_screen_switcher.js"; | import MobileScreenSwitcherExecutor from "../widgets/mobile_widgets/mobile_screen_switcher.js"; | ||||||
| import MainTreeExecutors from "./main_tree_executors.js"; | import MainTreeExecutors from "./main_tree_executors.js"; | ||||||
| 
 | 
 | ||||||
| class AppContext extends Component { | class AppContext extends Component { | ||||||
|  |     constructor(isMainWindow) { | ||||||
|  |         super(); | ||||||
|  | 
 | ||||||
|  |         this.isMainWindow = isMainWindow; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     setLayout(layout) { |     setLayout(layout) { | ||||||
|         this.layout = layout; |         this.layout = layout; | ||||||
|     } |     } | ||||||
| @@ -95,14 +101,21 @@ class AppContext extends Component { | |||||||
|         return $(el).closest(".component").prop('component'); |         return $(el).closest(".component").prop('component'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async protectedSessionStartedEvent() { |     async openInNewWindow(notePath) { | ||||||
|         await treeCache.loadInitialTree(); |         if (utils.isElectron()) { | ||||||
|  |             const {ipcRenderer} = utils.dynamicRequire('electron'); | ||||||
| 
 | 
 | ||||||
|         this.triggerEvent('treeCacheReloaded'); |             ipcRenderer.send('create-extra-window', {notePath}); | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |             const url = window.location.protocol + '//' + window.location.host + window.location.pathname + '?extra=1#' + notePath; | ||||||
|  | 
 | ||||||
|  |             window.open(url, '', 'width=1000,height=800'); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const appContext = new AppContext(); | const appContext = new AppContext(window.glob.isMainWindow); | ||||||
| 
 | 
 | ||||||
| // we should save all outstanding changes before the page/app is closed
 | // we should save all outstanding changes before the page/app is closed
 | ||||||
| $(window).on('beforeunload', () => { | $(window).on('beforeunload', () => { | ||||||
| @@ -113,12 +113,16 @@ function newTabContextMenu(e) { | |||||||
|         x: e.pageX, |         x: e.pageX, | ||||||
|         y: e.pageY, |         y: e.pageY, | ||||||
|         items: [ |         items: [ | ||||||
|             {title: "Open note in new tab", command: "openNoteInNewTab", uiIcon: "arrow-up-right"} |             {title: "Open note in new tab", command: "openNoteInNewTab", uiIcon: "arrow-up-right"}, | ||||||
|  |             {title: "Open note in new window", command: "openNoteInNewWindow", uiIcon: "arrow-up-right"} | ||||||
|         ], |         ], | ||||||
|         selectMenuItemHandler: ({command}) => { |         selectMenuItemHandler: ({command}) => { | ||||||
|             if (command === 'openNoteInNewTab') { |             if (command === 'openNoteInNewTab') { | ||||||
|                 appContext.tabManager.openTabWithNote(notePath); |                 appContext.tabManager.openTabWithNote(notePath); | ||||||
|             } |             } | ||||||
|  |             else if (command === 'openNoteInNewWindow') { | ||||||
|  |                 appContext.openInNewWindow(notePath); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| @@ -162,6 +166,7 @@ $(document).on('contextmenu', 'a.ck-link-actions__preview', newTabContextMenu); | |||||||
| $(document).on('contextmenu', '.note-detail-text a', newTabContextMenu); | $(document).on('contextmenu', '.note-detail-text a', newTabContextMenu); | ||||||
| $(document).on('contextmenu', "a[data-action='note']", newTabContextMenu); | $(document).on('contextmenu', "a[data-action='note']", newTabContextMenu); | ||||||
| $(document).on('contextmenu', ".note-detail-render a", newTabContextMenu); | $(document).on('contextmenu', ".note-detail-render a", newTabContextMenu); | ||||||
|  | $(document).on('contextmenu', ".note-paths-widget a", newTabContextMenu); | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|     getNotePathFromUrl, |     getNotePathFromUrl, | ||||||
| @@ -42,6 +42,8 @@ export default class MainTreeExecutors extends Component { | |||||||
|         await ws.waitForMaxKnownSyncId(); |         await ws.waitForMaxKnownSyncId(); | ||||||
| 
 | 
 | ||||||
|         appContext.tabManager.getActiveTabContext().setNote(note.noteId); |         appContext.tabManager.getActiveTabContext().setNote(note.noteId); | ||||||
|  | 
 | ||||||
|  |         appContext.triggerCommand('focusAndSelectTitle'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async createNoteAfterCommand() { |     async createNoteAfterCommand() { | ||||||
| @@ -63,5 +65,7 @@ export default class MainTreeExecutors extends Component { | |||||||
|         await ws.waitForMaxKnownSyncId(); |         await ws.waitForMaxKnownSyncId(); | ||||||
| 
 | 
 | ||||||
|         appContext.tabManager.getActiveTabContext().setNote(note.noteId); |         appContext.tabManager.getActiveTabContext().setNote(note.noteId); | ||||||
|  | 
 | ||||||
|  |         appContext.triggerCommand('focusAndSelectTitle'); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -1,13 +1,10 @@ | |||||||
| import treeService from './tree.js'; |  | ||||||
| import utils from './utils.js'; | import utils from './utils.js'; | ||||||
| import server from './server.js'; | import server from './server.js'; | ||||||
| import protectedSessionHolder from './protected_session_holder.js'; | import protectedSessionHolder from './protected_session_holder.js'; | ||||||
| import toastService from "./toast.js"; | import toastService from "./toast.js"; | ||||||
| import ws from "./ws.js"; | import ws from "./ws.js"; | ||||||
| import appContext from "./app_context.js"; | import appContext from "./app_context.js"; | ||||||
| 
 | import treeCache from "./tree_cache.js"; | ||||||
| const $enterProtectedSessionButton = $("#enter-protected-session-button"); |  | ||||||
| const $leaveProtectedSessionButton = $("#leave-protected-session-button"); |  | ||||||
| 
 | 
 | ||||||
| let protectedSessionDeferred = null; | let protectedSessionDeferred = null; | ||||||
| 
 | 
 | ||||||
| @@ -45,6 +42,10 @@ async function setupProtectedSession(password) { | |||||||
|     protectedSessionHolder.setProtectedSessionId(response.protectedSessionId); |     protectedSessionHolder.setProtectedSessionId(response.protectedSessionId); | ||||||
|     protectedSessionHolder.touchProtectedSession(); |     protectedSessionHolder.touchProtectedSession(); | ||||||
| 
 | 
 | ||||||
|  |     await treeCache.loadInitialTree(); | ||||||
|  | 
 | ||||||
|  |     await appContext.triggerEvent('treeCacheReloaded'); | ||||||
|  | 
 | ||||||
|     appContext.triggerEvent('protectedSessionStarted'); |     appContext.triggerEvent('protectedSessionStarted'); | ||||||
| 
 | 
 | ||||||
|     if (protectedSessionDeferred !== null) { |     if (protectedSessionDeferred !== null) { | ||||||
| @@ -54,9 +55,6 @@ async function setupProtectedSession(password) { | |||||||
|         protectedSessionDeferred = null; |         protectedSessionDeferred = null; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     $enterProtectedSessionButton.hide(); |  | ||||||
|     $leaveProtectedSessionButton.show(); |  | ||||||
| 
 |  | ||||||
|     toastService.showMessage("Protected session has been started."); |     toastService.showMessage("Protected session has been started."); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @@ -39,9 +39,16 @@ function touchProtectedSession() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function touchProtectedSessionIfNecessary(note) { | ||||||
|  |     if (note && note.isProtected && isProtectedSessionAvailable()) { | ||||||
|  |         touchProtectedSession(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| export default { | export default { | ||||||
|     setProtectedSessionId, |     setProtectedSessionId, | ||||||
|     resetProtectedSession, |     resetProtectedSession, | ||||||
|     isProtectedSessionAvailable, |     isProtectedSessionAvailable, | ||||||
|     touchProtectedSession |     touchProtectedSession, | ||||||
|  |     touchProtectedSessionIfNecessary | ||||||
| }; | }; | ||||||
| @@ -8,6 +8,7 @@ function getHeaders(headers) { | |||||||
|     // also avoiding using underscores instead of dashes since nginx filters them out by default
 |     // also avoiding using underscores instead of dashes since nginx filters them out by default
 | ||||||
|     const allHeaders = { |     const allHeaders = { | ||||||
|         'trilium-source-id': glob.sourceId, |         'trilium-source-id': glob.sourceId, | ||||||
|  |         'trilium-local-now-datetime': utils.localNowDateTime(), | ||||||
|         'x-csrf-token': glob.csrfToken |         'x-csrf-token': glob.csrfToken | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user