@@ -16,14 +16,20 @@ import { matchesObject, sortByProperty, stringRange } from './utils/utils.js';
1616import { Clipboard } from './utils/clipboard.js' ;
1717import { FlowLauncher } from './utils/flowLauncher.js' ;
1818import { ensureError } from './utils/error.js' ;
19+ import { NotificationManagerController } from './controllers/NotificationManagerController.js' ;
1920
2021export class ScriptManager {
2122 scripts : Script [ ] ;
2223 scriptsError : ScriptError [ ] ;
2324
25+ //WARN: possibly change in futur
26+ notifier : NotificationManagerController ;
27+
2428 constructor ( ) {
2529 this . scripts = [ ] ;
2630 this . scriptsError = [ ] ;
31+
32+ this . notifier = new NotificationManagerController ( ) ;
2733 }
2834
2935 init ( ) {
@@ -122,10 +128,16 @@ export class ScriptManager {
122128 const result = this . runScript ( script , clip ) ;
123129
124130 this . replaceText ( result , clip ) ;
131+
132+ //TODO: Possibly change location in futur
133+ this . notifier . displayAll ( ) ;
125134 }
126135
127136 runScript ( script : Script , text : string ) : string {
128- let scriptExecution = new ScriptExecution ( { text : text } ) ;
137+ let scriptExecution = new ScriptExecution ( {
138+ text : text ,
139+ notifier : this . notifier
140+ } ) ;
129141
130142 script . run ( scriptExecution ) ;
131143
@@ -139,8 +151,7 @@ export class ScriptManager {
139151
140152 //TODO: Possibly change location in futur
141153 // Notify User from change
142- const { title, subtitle } = NOTIFY . clipboard ;
143- FlowLauncher . showMessage ( title , subtitle ) ;
154+ this . notifier . add ( 'MESSAGE' , NOTIFY . clipboard ) ;
144155 }
145156 }
146157}
0 commit comments