updated settings
This commit is contained in:
		
							parent
							
								
									a980db5b11
								
							
						
					
					
						commit
						e53cef75b6
					
				
					 1 changed files with 67 additions and 52 deletions
				
			
		|  | @ -8,10 +8,10 @@ | |||
| async function build() { | ||||
| 	let secretariat = ( | ||||
| 		await import(chrome.runtime.getURL("scripts/secretariat.js")) | ||||
|   ).secretariat; | ||||
| 	); | ||||
| 	let windowman = ( | ||||
| 		await import(chrome.runtime.getURL("gui/scripts/windowman.js")) | ||||
|   ).windowman; | ||||
| 	).default; | ||||
| 
 | ||||
| 	let window = new windowman(); | ||||
| } | ||||
|  | @ -48,15 +48,30 @@ function main() { | |||
| 		*/ | ||||
| function events() { | ||||
| 	if (document.querySelector(`[data-action="filters,update"]`)) { | ||||
|     document | ||||
|       .querySelector(`[data-action="filters,update"]`) | ||||
|       .addEventListener(`click`, async () => { | ||||
|         let filters = ( | ||||
| 		document.querySelector(`[data-action="filters,update"]`).addEventListener(`click`, async () => { | ||||
| 			let filters = new (( | ||||
| 				await import(chrome.runtime.getURL(`scripts/filters.js`)) | ||||
|         ).default; | ||||
|         filters.update(); | ||||
| 			).default); | ||||
| 			await filters.update(); | ||||
| 		}); | ||||
| 	} | ||||
| 	 | ||||
| 	if (document.querySelector(`[data-action="filters,add,one"]`)) { | ||||
| 		document.querySelector(`[data-action="filters,add,one"]`).addEventListener(`click`, async () => { | ||||
| 			(async () => { | ||||
| 				// Import the filters module.
 | ||||
| 				let texts = (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.
 | ||||
| 				let filter_source = prompt(texts.localized(`settings_filters_add_prompt`)); | ||||
| 				if (filter_source.trim) { | ||||
| 					filters.update(filter_source.trim); | ||||
| 				}; | ||||
| 			})(); | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	if (document.querySelector(`[data-action="storage,clear"]`)) { | ||||
| 		document | ||||
| 			.querySelector(`[data-action="storage,clear"]`) | ||||
|  | @ -73,10 +88,10 @@ function events() { | |||
| function load() { | ||||
| 	document.addEventListener("DOMContentLoaded", function () { | ||||
| 		M.AutoInit(); | ||||
| 		events(); | ||||
| 	}); | ||||
| 
 | ||||
| 	build(); | ||||
|   events(); | ||||
| } | ||||
| 
 | ||||
| load(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue