mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-29 03:23:25 +08:00 
			
		
		
		
	moving canvas_note_share to src/share and add routes
This commit is contained in:
		
							parent
							
								
									83f1a68bfd
								
							
						
					
					
						commit
						f85ed672cc
					
				| @ -1,4 +1,10 @@ | |||||||
| // const {elements, appState, files} = window.triliumExcalidraw;
 | /** | ||||||
|  |  * this is used as a "standalone js" file and required by a shared note directly via script-tags | ||||||
|  |  *  | ||||||
|  |  * data input comes via window variable as follow | ||||||
|  |  * const {elements, appState, files} = window.triliumExcalidraw; | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
| document.getElementById("excalidraw-app").style.height = appState.height+"px"; | document.getElementById("excalidraw-app").style.height = appState.height+"px"; | ||||||
| 
 | 
 | ||||||
| const App = () => { | const App = () => { | ||||||
| @ -114,7 +114,7 @@ document.addEventListener("DOMContentLoaded", function() { | |||||||
|             <div id="excalidraw-app"></div> |             <div id="excalidraw-app"></div> | ||||||
|             <hr> |             <hr> | ||||||
|             <a href="api/images/${note.noteId}/${note.title}?utc=${note.utcDateModified}">Get Image Link</a> |             <a href="api/images/${note.noteId}/${note.title}?utc=${note.utcDateModified}">Get Image Link</a> | ||||||
|             <script src="../../libraries/excalidraw/canvas_note_share.js"></script> |             <script src="./canvas_note_share.js"></script> | ||||||
|         </div>`; |         </div>`; | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|  | |||||||
| @ -1,3 +1,6 @@ | |||||||
|  | const express = require('express'); | ||||||
|  | const path = require('path'); | ||||||
|  | 
 | ||||||
| const shaca = require("./shaca/shaca"); | const shaca = require("./shaca/shaca"); | ||||||
| const shacaLoader = require("./shaca/shaca_loader"); | const shacaLoader = require("./shaca/shaca_loader"); | ||||||
| const shareRoot = require("./share_root"); | const shareRoot = require("./share_root"); | ||||||
| @ -55,6 +58,8 @@ function register(router) { | |||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     router.use('/share/canvas_note_share.js', express.static(path.join(__dirname, 'canvas_note_share.js'))); | ||||||
|  | 
 | ||||||
|     router.get(['/share', '/share/'], (req, res, next) => { |     router.get(['/share', '/share/'], (req, res, next) => { | ||||||
|         shacaLoader.ensureLoad(); |         shacaLoader.ensureLoad(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom
						Tom