mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	improvements to the search spec
This commit is contained in:
		
							parent
							
								
									b936a63db3
								
							
						
					
					
						commit
						ee78413ecb
					
				| @ -14,7 +14,9 @@ export default class AbstractSearchAction extends Component { | |||||||
|         try { |         try { | ||||||
|             const $rendered = this.doRender(); |             const $rendered = this.doRender(); | ||||||
| 
 | 
 | ||||||
|             $rendered.find('.action-conf-del').on('click', () => this.deleteAction()) |             $rendered.find('.action-conf-del') | ||||||
|  |                 .on('click', () => this.deleteAction()) | ||||||
|  |                 .attr('title', 'Remove this search action'); | ||||||
| 
 | 
 | ||||||
|             return $rendered; |             return $rendered; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -12,7 +12,20 @@ const TPL = ` | |||||||
|            placeholder="note.title = note.title + '- suffix';"/> |            placeholder="note.title = note.title + '- suffix';"/> | ||||||
|     </td> |     </td> | ||||||
|     <td class="button-column"> |     <td class="button-column"> | ||||||
|         <span class="bx bx-x icon-action action-conf-del"></span> |         <div style="display: flex"> | ||||||
|  |             <div class="dropdown help-dropdown"> | ||||||
|  |               <span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> | ||||||
|  |               <div class="dropdown-menu dropdown-menu-right p-4"> | ||||||
|  |                 You can execute simple scripts on the matched notes. | ||||||
|  |                  | ||||||
|  |                 For example to append a string to a note's title, use this small script: | ||||||
|  |                  | ||||||
|  |                 <pre>note.title = note.title + ' - suffix';</pre> | ||||||
|  |               </div> | ||||||
|  |             </div> | ||||||
|  |          | ||||||
|  |             <span class="bx bx-x icon-action action-conf-del"></span> | ||||||
|  |         </div> | ||||||
|     </td> |     </td> | ||||||
| </tr>`; | </tr>`; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,23 +5,21 @@ const TPL = ` | |||||||
| <tr> | <tr> | ||||||
|     <td colspan="2"> |     <td colspan="2"> | ||||||
|         <div style="display: flex; align-items: center"> |         <div style="display: flex; align-items: center"> | ||||||
|             <div style="display: flex; align-items: center"> |             <div style="margin-right: 10px;">Rename label from:</div>  | ||||||
|                 <div style="margin-right: 15px;">Rename label from:</div>  |  | ||||||
|              |              | ||||||
|                 <input type="text"  |             <input type="text"  | ||||||
|                     class="form-control old-label-name"  |                 class="form-control old-label-name"  | ||||||
|                     placeholder="old name"  |                 placeholder="old name"  | ||||||
|                     pattern="[\\p{L}\\p{N}_:]+" |                 pattern="[\\p{L}\\p{N}_:]+" | ||||||
|                     title="Alphanumeric characters, underscore and colon are allowed characters."/> |                 title="Alphanumeric characters, underscore and colon are allowed characters."/> | ||||||
|              |              | ||||||
|                 <div style="margin-right: 15px; margin-left: 15px;">To:</div>  |             <div style="margin-right: 10px; margin-left: 10px;">To:</div>  | ||||||
|              |              | ||||||
|                 <input type="text"  |             <input type="text"  | ||||||
|                     class="form-control new-label-name"  |                 class="form-control new-label-name"  | ||||||
|                     placeholder="new name" |                 placeholder="new name" | ||||||
|                     pattern="[\\p{L}\\p{N}_:]+" |                 pattern="[\\p{L}\\p{N}_:]+" | ||||||
|                     title="Alphanumeric characters, underscore and colon are allowed characters."/> |                 title="Alphanumeric characters, underscore and colon are allowed characters."/> | ||||||
|             </div> |  | ||||||
|         </div> |         </div> | ||||||
|     </td> |     </td> | ||||||
|     <td class="button-column"> |     <td class="button-column"> | ||||||
|  | |||||||
| @ -5,23 +5,21 @@ const TPL = ` | |||||||
| <tr> | <tr> | ||||||
|     <td colspan="2"> |     <td colspan="2"> | ||||||
|         <div style="display: flex; align-items: center"> |         <div style="display: flex; align-items: center"> | ||||||
|             <div style="display: flex; align-items: center"> |             <div style="margin-right: 10px;">Rename relation from:</div>  | ||||||
|                 <div style="margin-right: 15px;">Rename relation from:</div>  |  | ||||||
|              |              | ||||||
|                 <input type="text"  |             <input type="text"  | ||||||
|                     class="form-control old-relation-name"  |                 class="form-control old-relation-name"  | ||||||
|                     placeholder="old name"  |                 placeholder="old name"  | ||||||
|                     pattern="[\\p{L}\\p{N}_:]+" |                 pattern="[\\p{L}\\p{N}_:]+" | ||||||
|                     title="Alphanumeric characters, underscore and colon are allowed characters."/> |                 title="Alphanumeric characters, underscore and colon are allowed characters."/> | ||||||
|              |              | ||||||
|                 <div style="margin-right: 15px; margin-left: 15px;">To:</div>  |             <div style="margin-right: 10px; margin-left: 10px;">To:</div>  | ||||||
|              |              | ||||||
|                 <input type="text"  |             <input type="text"  | ||||||
|                     class="form-control new-relation-name"  |                 class="form-control new-relation-name"  | ||||||
|                     placeholder="new name" |                 placeholder="new name" | ||||||
|                     pattern="[\\p{L}\\p{N}_:]+" |                 pattern="[\\p{L}\\p{N}_:]+" | ||||||
|                     title="Alphanumeric characters, underscore and colon are allowed characters."/> |                 title="Alphanumeric characters, underscore and colon are allowed characters."/> | ||||||
|             </div> |  | ||||||
|         </div> |         </div> | ||||||
|     </td> |     </td> | ||||||
|     <td class="button-column"> |     <td class="button-column"> | ||||||
|  | |||||||
| @ -5,19 +5,17 @@ const TPL = ` | |||||||
| <tr> | <tr> | ||||||
|     <td colspan="2"> |     <td colspan="2"> | ||||||
|         <div style="display: flex; align-items: center"> |         <div style="display: flex; align-items: center"> | ||||||
|             <div style="display: flex; align-items: center"> |             <div style="margin-right: 10px;" class="text-nowrap">Set label</div>  | ||||||
|                 <div style="margin-right: 15px;" class="text-nowrap">Set label</div>  |  | ||||||
|              |              | ||||||
|                 <input type="text"  |             <input type="text"  | ||||||
|                     class="form-control label-name"  |                 class="form-control label-name"  | ||||||
|                     placeholder="label name" |                 placeholder="label name" | ||||||
|                     pattern="[\\p{L}\\p{N}_:]+" |                 pattern="[\\p{L}\\p{N}_:]+" | ||||||
|                     title="Alphanumeric characters, underscore and colon are allowed characters."/> |                 title="Alphanumeric characters, underscore and colon are allowed characters."/> | ||||||
|              |              | ||||||
|                 <div style="margin-right: 15px; margin-left: 15px;" class="text-nowrap">to value</div> |             <div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">to value</div> | ||||||
|              |              | ||||||
|                 <input type="text" class="form-control label-value" placeholder="new value"/> |             <input type="text" class="form-control label-value" placeholder="new value"/> | ||||||
|             </div> |  | ||||||
|         </div> |         </div> | ||||||
|     </td> |     </td> | ||||||
|     <td class="button-column"> |     <td class="button-column"> | ||||||
|  | |||||||
| @ -6,18 +6,20 @@ const TPL = ` | |||||||
| <tr> | <tr> | ||||||
|     <td colspan="2"> |     <td colspan="2"> | ||||||
|         <div style="display: flex; align-items: center"> |         <div style="display: flex; align-items: center"> | ||||||
|             <div style="margin-right: 15px;" class="text-nowrap">Set relation</div>  |             <div style="margin-right: 10px;" class="text-nowrap">Set relation</div>  | ||||||
|              |              | ||||||
|             <input type="text"  |             <input type="text"  | ||||||
|                 class="form-control relation-name"  |                 class="form-control relation-name"  | ||||||
|                 placeholder="relation name" |                 placeholder="relation name" | ||||||
|                 pattern="[\\p{L}\\p{N}_:]+" |                 pattern="[\\p{L}\\p{N}_:]+" | ||||||
|  |                 style="flex-shrink: 3" | ||||||
|                 title="Alphanumeric characters, underscore and colon are allowed characters."/> |                 title="Alphanumeric characters, underscore and colon are allowed characters."/> | ||||||
|         </div> |  | ||||||
|         <div style="display: flex; align-items: center; margin-top: 10px;"> |  | ||||||
|             <div style="margin-right: 15px;" class="text-nowrap">target to note</div> |  | ||||||
|                  |                  | ||||||
|             <input type="text" class="form-control target-note"/> |             <div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">to</div> | ||||||
|  |              | ||||||
|  |             <div class="input-group" style="flex-shrink: 2"> | ||||||
|  |                 <input type="text" class="form-control target-note" placeholder="target note"/> | ||||||
|  |             </div> | ||||||
|         </div> |         </div> | ||||||
|     </td> |     </td> | ||||||
|     <td class="button-column"> |     <td class="button-column"> | ||||||
|  | |||||||
| @ -30,6 +30,10 @@ const TPL = ` | |||||||
|         border-spacing: 10px; |         border-spacing: 10px; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  |     .search-setting-table div { | ||||||
|  |         white-space: nowrap; | ||||||
|  |     } | ||||||
|  |      | ||||||
|     .search-setting-table .button-column { |     .search-setting-table .button-column { | ||||||
|         /* minimal width so that table remains static sized and most space remains for middle column with settings */ |         /* minimal width so that table remains static sized and most space remains for middle column with settings */ | ||||||
|         width: 50px; |         width: 50px; | ||||||
|  | |||||||
| @ -24,7 +24,9 @@ export default class AbstractSearchOption extends Component { | |||||||
|         try { |         try { | ||||||
|             const $rendered = this.doRender(); |             const $rendered = this.doRender(); | ||||||
| 
 | 
 | ||||||
|             $rendered.find('.search-option-del').on('click', () => this.deleteOption()) |             $rendered.find('.search-option-del') | ||||||
|  |                 .on('click', () => this.deleteOption()) | ||||||
|  |                 .attr('title', 'Remove this search option'); | ||||||
| 
 | 
 | ||||||
|             return $rendered; |             return $rendered; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -12,7 +12,7 @@ const TPL = ` | |||||||
|     <td class="button-column"> |     <td class="button-column"> | ||||||
|         <div class="dropdown help-dropdown"> |         <div class="dropdown help-dropdown"> | ||||||
|           <span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> |           <span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> | ||||||
|           <div class="dropdown-menu dropdown-menu-right p-4" style="width: 500px;"> |           <div class="dropdown-menu dropdown-menu-right p-4"> | ||||||
|             <strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="Search">complete help on search syntax</button> |             <strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="Search">complete help on search syntax</button> | ||||||
|             <p> |             <p> | ||||||
|             <ul> |             <ul> | ||||||
|  | |||||||
| @ -935,4 +935,11 @@ ul.fancytree-container li { | |||||||
|     border-width: 2px; |     border-width: 2px; | ||||||
|     box-shadow: 10px 10px 93px -25px black; |     box-shadow: 10px 10px 93px -25px black; | ||||||
|     padding: 10px 15px 10px 15px !important; |     padding: 10px 15px 10px 15px !important; | ||||||
|  |     width: 500px; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .help-dropdown .dropdown-menu pre { | ||||||
|  |     background-color: var(--accented-background-color); | ||||||
|  |     padding: 10px; | ||||||
|  |     margin: 10px; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam