update reference to be as default functions
This commit is contained in:
		
							parent
							
								
									1e9c50dc9e
								
							
						
					
					
						commit
						8164ccf8e4
					
				
					 1 changed files with 55 additions and 45 deletions
				
			
		|  | @ -6,8 +6,8 @@ | ||||||
| //import { windowman } from "../windowman.js";
 | //import { windowman } from "../windowman.js";
 | ||||||
| 
 | 
 | ||||||
| async function build() { | async function build() { | ||||||
| 	let secretariat = ( |   let secretariat = await import( | ||||||
| 		await import(chrome.runtime.getURL("scripts/secretariat.js")) |     chrome.runtime.getURL("scripts/secretariat.js") | ||||||
|   ); |   ); | ||||||
|   let windowman = ( |   let windowman = ( | ||||||
|     await import(chrome.runtime.getURL("gui/scripts/windowman.js")) |     await import(chrome.runtime.getURL("gui/scripts/windowman.js")) | ||||||
|  | @ -48,26 +48,36 @@ function main() { | ||||||
| 		*/ | 		*/ | ||||||
| function events() { | function events() { | ||||||
|   if (document.querySelector(`[data-action="filters,update"]`)) { |   if (document.querySelector(`[data-action="filters,update"]`)) { | ||||||
| 		document.querySelector(`[data-action="filters,update"]`).addEventListener(`click`, async () => { |     document | ||||||
| 			let filters = new (( |       .querySelector(`[data-action="filters,update"]`) | ||||||
|  |       .addEventListener(`click`, async () => { | ||||||
|  |         let filters = new ( | ||||||
|           await import(chrome.runtime.getURL(`scripts/filters.js`)) |           await import(chrome.runtime.getURL(`scripts/filters.js`)) | ||||||
| 			).default); |         ).default(); | ||||||
|         await filters.update(); |         await filters.update(); | ||||||
|       }); |       }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (document.querySelector(`[data-action="filters,add,one"]`)) { |   if (document.querySelector(`[data-action="filters,add,one"]`)) { | ||||||
| 		document.querySelector(`[data-action="filters,add,one"]`).addEventListener(`click`, async () => { |     document | ||||||
|  |       .querySelector(`[data-action="filters,add,one"]`) | ||||||
|  |       .addEventListener(`click`, async () => { | ||||||
|         (async () => { |         (async () => { | ||||||
|           // Import the filters module.
 |           // Import the filters module.
 | ||||||
| 				let texts = (await import(chrome.runtime.getURL(`gui/scripts/read.js`))).default; |           let texts = ( | ||||||
| 				let filters = new ((await import(chrome.runtime.getURL(`scripts/filters.js`))).default); |             await import(chrome.runtime.getURL(`gui/scripts/read.js`)) | ||||||
|  |           ).default; | ||||||
|  |           let filters = new ( | ||||||
|  |             await import(chrome.runtime.getURL(`scripts/filters.js`)) | ||||||
|  |           ).default(); | ||||||
| 
 | 
 | ||||||
|           // Open text input window for adding a filter.
 |           // Open text input window for adding a filter.
 | ||||||
| 				let filter_source = prompt(texts.localized(`settings_filters_add_prompt`)); |           let filter_source = prompt( | ||||||
| 				if (filter_source.trim) { |             texts.localized(`settings_filters_add_prompt`), | ||||||
| 					filters.update(filter_source.trim); |           ); | ||||||
| 				}; |           if (filter_source ? filter_source.trim() : false) { | ||||||
|  |             filters.update(filter_source.trim()); | ||||||
|  |           } | ||||||
|         })(); |         })(); | ||||||
|       }); |       }); | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue