mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	fixed image upload and eslint
This commit is contained in:
		
							parent
							
								
									341f47f0f2
								
							
						
					
					
						commit
						a69d8737ce
					
				
							
								
								
									
										12
									
								
								src/public/javascripts/services/bootstrap.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								src/public/javascripts/services/bootstrap.js
									
									
									
									
										vendored
									
									
								
							| @ -14,7 +14,7 @@ import dragAndDropSetup from './drag_and_drop.js'; | |||||||
| import exportService from './export.js'; | import exportService from './export.js'; | ||||||
| import link from './link.js'; | import link from './link.js'; | ||||||
| import messaging from './messaging.js'; | import messaging from './messaging.js'; | ||||||
| import noteDetail from './note_detail.js'; | import noteDetailService from './note_detail.js'; | ||||||
| import noteType from './note_type.js'; | import noteType from './note_type.js'; | ||||||
| import protected_session from './protected_session.js'; | import protected_session from './protected_session.js'; | ||||||
| import searchTreeService from './search_tree.js'; | import searchTreeService from './search_tree.js'; | ||||||
| @ -25,9 +25,19 @@ import treeService from './tree.js'; | |||||||
| import treeChanges from './tree_changes.js'; | import treeChanges from './tree_changes.js'; | ||||||
| import treeUtils from './tree_utils.js'; | import treeUtils from './tree_utils.js'; | ||||||
| import utils from './utils.js'; | import utils from './utils.js'; | ||||||
|  | import server from './server.js'; | ||||||
| 
 | 
 | ||||||
| import './init.js'; | import './init.js'; | ||||||
| 
 | 
 | ||||||
|  | // required for CKEditor image upload plugin
 | ||||||
|  | window.glob.getCurrentNode = treeService.getCurrentNode; | ||||||
|  | window.glob.getHeaders = server.getHeaders; | ||||||
|  | 
 | ||||||
|  | // required for ESLint plugin
 | ||||||
|  | window.glob.getCurrentNote = noteDetailService.getCurrentNote; | ||||||
|  | window.glob.requireLibrary = utils.requireLibrary; | ||||||
|  | window.glob.ESLINT = utils.ESLINT; | ||||||
|  | 
 | ||||||
| utils.bindShortcut('ctrl+l', addLinkDialog.showDialog); | utils.bindShortcut('ctrl+l', addLinkDialog.showDialog); | ||||||
| 
 | 
 | ||||||
| $("#jump-to-note-button").click(jumpToNoteDialog.showDialog); | $("#jump-to-note-button").click(jumpToNoteDialog.showDialog); | ||||||
|  | |||||||
| @ -520,29 +520,29 @@ function initFancyTree(branch) { | |||||||
|         }, |         }, | ||||||
|         "backspace": node => { |         "backspace": node => { | ||||||
|             if (!utils.isTopLevelNode(node)) { |             if (!utils.isTopLevelNode(node)) { | ||||||
|                 node.getParent().setActive().then(() => clearSelectedNodes()); |                 node.getParent().setActive().then(clearSelectedNodes); | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         // code below shouldn't be necessary normally, however there's some problem with interaction with context menu plugin
 |         // code below shouldn't be necessary normally, however there's some problem with interaction with context menu plugin
 | ||||||
|         // after opening context menu, standard shortcuts don't work, but they are detected here
 |         // after opening context menu, standard shortcuts don't work, but they are detected here
 | ||||||
|         // so we essentially takeover the standard handling with our implementation.
 |         // so we essentially takeover the standard handling with our implementation.
 | ||||||
|         "left": node => { |         "left": node => { | ||||||
|             node.navigate($.ui.keyCode.LEFT, true).then(() => clearSelectedNodes()); |             node.navigate($.ui.keyCode.LEFT, true).then(clearSelectedNodes); | ||||||
| 
 | 
 | ||||||
|             return false; |             return false; | ||||||
|         }, |         }, | ||||||
|         "right": node => { |         "right": node => { | ||||||
|             node.navigate($.ui.keyCode.RIGHT, true).then(() => clearSelectedNodes()); |             node.navigate($.ui.keyCode.RIGHT, true).then(clearSelectedNodes); | ||||||
| 
 | 
 | ||||||
|             return false; |             return false; | ||||||
|         }, |         }, | ||||||
|         "up": node => { |         "up": node => { | ||||||
|             node.navigate($.ui.keyCode.UP, true).then(() => clearSelectedNodes()); |             node.navigate($.ui.keyCode.UP, true).then(clearSelectedNodes); | ||||||
| 
 | 
 | ||||||
|             return false; |             return false; | ||||||
|         }, |         }, | ||||||
|         "down": node => { |         "down": node => { | ||||||
|             node.navigate($.ui.keyCode.DOWN, true).then(() => clearSelectedNodes()); |             node.navigate($.ui.keyCode.DOWN, true).then(clearSelectedNodes); | ||||||
| 
 | 
 | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								src/public/libraries/ckeditor/ckeditor.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/public/libraries/ckeditor/ckeditor.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -28,13 +28,12 @@ | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async function validatorJavaScript(text, options) { |     async function validatorJavaScript(text, options) { | ||||||
|         // FIXME!!!
 |         if (glob.getCurrentNote().detail.mime === 'application/json') { | ||||||
|         // if (noteEditor.getCurrentNote().detail.mime === 'application/json') {
 |             // eslint doesn't seem to validate pure JSON well
 | ||||||
|         //     // eslint doesn't seem to validate pure JSON well
 |             return []; | ||||||
|         //     return [];
 |         } | ||||||
|         // }
 |  | ||||||
| 
 | 
 | ||||||
|         await requireLibrary(ESLINT); |         await glob.requireLibrary(glob.ESLINT); | ||||||
| 
 | 
 | ||||||
|         if (text.length > 20000) { |         if (text.length > 20000) { | ||||||
|             console.log("Skipping linting because of large size: ", text.length); |             console.log("Skipping linting because of large size: ", text.length); | ||||||
|  | |||||||
| @ -484,8 +484,8 @@ | |||||||
|     <div id="tooltip" style="display: none;"></div> |     <div id="tooltip" style="display: none;"></div> | ||||||
| 
 | 
 | ||||||
|     <script type="text/javascript"> |     <script type="text/javascript"> | ||||||
|       const baseApiUrl = 'api/'; |       window.baseApiUrl = 'api/'; | ||||||
|       const glob = { |       window.glob = { | ||||||
|           activeDialog: null, |           activeDialog: null, | ||||||
|           sourceId: '<%= sourceId %>', |           sourceId: '<%= sourceId %>', | ||||||
|           maxSyncIdAtLoad: <%= maxSyncIdAtLoad %> |           maxSyncIdAtLoad: <%= maxSyncIdAtLoad %> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner