5757 < script src ='
https://cdn.jsdelivr.net/npm/[email protected] /parser-html.js '
> </ script > 5858
5959
60- < script src ='https://libs.ext-code.com/js/dom/component/component.js '> </ script >
60+ < script src ='https://libs.ext-code.com/js/dom/component/component.js?init '> </ script >
6161
6262
6363
9696
9797
9898 < script init >
99- console . clear ( ) ;
10099 console . log ( 'html-editor-v2.0.html' ) ;
101- console . log ( ) ;
102- console . json = v => console . log ( JSON . stringify ( v , null , 4 ) ) ;
103- var df = true , did = 'html-editor' , version = 'v1.0'
104- ;
100+ var version = 'v3.0' ;
105101
106- var ace ;
102+ var df = true , did = 'html-editor' ;
107103
108- var ext , $ , datatype , menumod , keydown , debug , ls
109- ;
110104
111-
112- var menu ;
113-
114- var hdr ;
115- var mainmenu ;
116105 var filemod ;
117106 var autosave ;
118107 var publish ;
121110 var log ;
122111
123112
124- var icon = { } ;
125113
126114
127115 //:
128116
129117
130118 async function init ( ) {
131119 debug ( 'init' , version ) ;
132-
133- //keydown = keydown();
134- menu = menumod ( ) ;
135-
136- mod . base . add ( { ext, $, datatype, keydown, menu, menumod, ace, ls} ) ;
137-
138-
139- hdr = mod [ 'editors-hdr' ] ;
140- mainmenu = mod [ 'main-menu' ] ;
120+ log = mod [ 'log-mod' ] ;
141121 filemod = mod [ 'file-mod' ] ;
142122 autosave = mod [ 'auto-save' ] ;
143123 publish = mod [ 'publish-ui' ] ;
144124 editor = mod [ 'web-editor' ] ;
145125 output = mod [ 'output-html' ] ;
146- log = mod [ 'log-mod' ] ;
147126
127+ editor . initmod ( { mode :'html' , on} ) ;
128+ autosave . initmod ( { save :btn . save } ) ;
148129
149- menu . initmod ( { keydown} ) ;
150- mainmenu . initmod ( { ext, $, menu, editor, filemod} ) ;
151- hdr . initmod ( { ext, $, menu} ) ;
152- filemod . initmod ( { ext, $, menumod, menu, complete, source, focus, log} ) ;
153- autosave . initmod ( { $, menu, keydown, log, save :btn . save } ) ;
154- publish . initmod ( { ext, $, menu, run, source, complete, log} ) ;
155- editor . initmod ( { ext, $, menu, on, ace} ) ;
156- output . initmod ( { ext, $} ) ;
157- log . initmod ( { ext, $} ) ;
158-
159-
160- await Promise . all ( [
161- mainmenu . init ( ) ,
162- hdr . init ( ) ,
163- filemod . init ( ) ,
164- autosave . init ( ) ,
165- publish . init ( ) ,
166- editor . init ( ) ,
167- output . init ( ) ,
168- log . init ( ) ,
169- ] ) ;
130+ mod . base . add ( { log, complete, source, focus, editor, filemod} ) ;
131+ await mod . auto ( ) ;
170132
171- //:
172-
173133 window . onfocus = focus ;
174134 keydown . add ( kd ) ;
175135 menu . on . close = focus ;
176-
177-
178- icon . def = $ ( 'link[rel~=icon]' ) . href ;
179-
136+ icon . def = $ ( 'link[rel~=icon]' ) . href ;
180137
181138 await initdom ( document . body ) ;
182139
183-
184140 publish . query ( ) ;
185141
186-
187-
188142 } //init
189143
190144
191- ( async ( ) => {
192-
193- mod . stack . add ;
194-
195- ( { ext} = await import ( 'https://libs.ext-code.com/js/io/ext-loader/ext-loader.m.js' ) ) ;
196-
197- var lsmod ;
198-
199- var promise = ext . load . libs (
200- 'js/dom/$.js' ,
201- 'js/core/datatype.js' ,
202- 'js/dom/menumod/menumod.js.api' ,
203- 'js/dom/keydown/keydown.js' ,
204- 'js/debug/debug.js' ,
205- 'js/core/ls-mod/ls-mod.js' ,
206- ) ;
207- [ $ , datatype , menumod , keydown , debug , lsmod ] = await promise ;
208-
209- ls = lsmod ( ) ;
210-
211- mod . stack . complete ;
212-
213- } ) ( ) ;
214-
215-
216145 </ script init>
217146
218147
@@ -336,6 +265,10 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
336265 < script >
337266
338267
268+
269+ var icon = { } ;
270+
271+
339272 var root ;
340273
341274
@@ -362,10 +295,6 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
362295 menu . add . style ( ) ;
363296
364297
365-
366-
367-
368-
369298 $ ( root , '#save' ) . onclick = btn . save ;
370299
371300
@@ -385,29 +314,9 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
385314
386315
387316
388- //ui.setup(view);
389-
390-
391- await Promise . all ( [
392- keydown . initdom ( ) ,
393- hdr . initdom ( root ) ,
394- mainmenu . initdom ( root ) ,
395- filemod . initdom ( ) ,
396- autosave . initdom ( ) ,
397- publish . initdom ( ) ,
398- output . initdom ( root ) ,
399- log . initdom ( ) ,
400- editor . initdom ( view , { mode :'html' } ) ,
401- ] ) ;
402-
403-
404-
405-
406317 editor . focus ( ) ;
407318
408319
409-
410-
411320 } //initdom
412321
413322
0 commit comments