Skip to content

Commit 467b587

Browse files
save file
1 parent 8d34dec commit 467b587

File tree

1 file changed

+19
-93
lines changed

1 file changed

+19
-93
lines changed

utils/editors/markdown-editor/markdown-editor.html

Lines changed: 19 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,20 @@
4040
<script src='https://cdn.jsdelivr.net/npm/ace-builds@1.37.0/src-min-noconflict/ace.js'></script>
4141

4242

43-
<script src='https://libs.ext-code.com/js/dom/component/component.js'></script>
43+
<script src='https://libs.ext-code.com/js/dom/component/v3.0/component.js?hdr'></script>
4444

45-
<script init>
46-
console.clear();
47-
console.log('markdown-editor-v2.0.html');
48-
console.log();
49-
console.json=v=>console.log(JSON.stringify(v,null,4));
50-
var version='v2.0';
45+
<script>
46+
console.log('markdown-editor-v3.0.html');
47+
var version='v3.0';
5148
var df=true,did='html';
5249

5350

5451
var ace;
5552

56-
var ext;
57-
var $;
58-
var datatype;
59-
var menumod;
60-
var keydown;
61-
var debug;
62-
63-
var menu;
64-
6553
var hdr;
66-
var mainmenu;
6754
var filemod;
6855
var publish;
6956
var editor;
70-
var output;
71-
var log;
7257

7358

7459

@@ -77,47 +62,24 @@
7762

7863
async function init(){
7964
debug('init',version);
80-
//keydown = keydown();
81-
menu = menumod();
82-
83-
mod.base.add({ext,$,datatype,keydown,menu,menumod,ace});
84-
85-
65+
8666
hdr = mod['editors-hdr'];
87-
mainmenu = mod['main-menu']
8867
filemod = mod['file-mod'];
8968
publish = mod['publish-ui'];
9069
editor = mod['web-editor'];
91-
output = mod['output-md'];
92-
log = mod['log-mod'];
93-
94-
menu.initmod({keydown});
95-
96-
hdr.initmod({ext,$,menumod,menu});
97-
mainmenu.initmod({ext,$,menumod,menu,editor});
98-
filemod.initmod({ext,$,menumod,menu,complete,focus,source,log});
99-
publish.initmod({ext,$,ui,menumod,menu,source,complete,log});
100-
editor.initmod({ext,$,menumod,menu,on});
101-
output.initmod({ext,$,editor});
102-
log.initmod({ext,$});
103-
104-
await Promise.all([
105-
hdr.init(),
106-
mainmenu.init(),
107-
filemod.init(),
108-
publish.init(),
109-
editor.init(),
110-
output.init(),
111-
log.init(),
112-
]);
11370

71+
mod.base.add({complete,source,focus,filemod});
72+
73+
publish.initmod({ui});
74+
editor.initmod({on,mode:'markdown'});
75+
76+
await mod.auto();
11477

11578
//:
11679

117-
118-
icon.def = $('[rel*=icon]').href;
119-
80+
hdr['page-source'].url('v3.0/markdown-editor-v3.0.html');
12081

82+
icon.def = $('[rel*=icon]').href;
12183

12284
window.onfocus = ()=>editor && editor.focus();
12385
keydown.add(kd);
@@ -130,27 +92,7 @@
13092
}//init
13193

13294

133-
(async()=>{
134-
135-
mod.stack.add;
136-
137-
({ext} = await import('https://libs.ext-code.com/js/io/ext-loader/ext-loader.m.js'));
138-
139-
var promise = ext.load.libs(
140-
'js/dom/$.js',
141-
'js/core/datatype.js',
142-
'js/dom/menumod/menumod.js',
143-
'js/dom/keydown/keydown.js',
144-
'js/debug/debug.js',
145-
);
146-
[$,datatype,menumod,keydown,debug] = await promise;
147-
148-
mod.stack.complete;
149-
150-
})();
151-
152-
153-
</script init>
95+
</script>
15496

15597

15698
<link rel=stylesheet href='/utils/css/utils.css'>
@@ -208,9 +150,10 @@
208150

209151
<body>
210152

211-
<editors-hdr component=grp>
212-
<img class=title src='images/markdown-editor.png' style='top:-5px;height:55px'>
213-
<time slot=date datetime=2025-10-31>31 Oct 2025</time>
153+
<editors-hdr v2.0 component=grp>
154+
<img slot=title src='images/markdown-editor.png' style='top:-5px;height:55px'>
155+
<h4 slot=version>v3.0</h4>
156+
<time slot=date datetime=2026-01-24>24 Jan 2026</time>
214157
</editors-hdr>
215158

216159

@@ -232,7 +175,7 @@
232175

233176
<publish-ui component></publish-ui>
234177

235-
<button id=run>run</button>
178+
<button id=run title='ctrl+enter'>run</button>
236179

237180
<span class=spc></span>
238181

@@ -295,13 +238,6 @@
295238
menu.add.style();
296239

297240

298-
hdr.initdom(root);
299-
300-
301-
mainmenu.initdom(root);
302-
//debugger;
303-
filemod.initdom(root);
304-
305241

306242
$(root,'#save').onclick = btn.save;
307243

@@ -311,8 +247,6 @@
311247
autosave = $(root,'#autosave');
312248

313249

314-
publish.initdom(root);
315-
316250
$('#run').onclick = run;
317251

318252
$('#horiz').onclick = horiz;
@@ -322,16 +256,8 @@
322256
var view = $('#view');
323257
ui.root = view;
324258

325-
editor.initdom(root,{mode:'markdown'});
326-
327259
slider.node = $.slider('web-editor','#page-slider','output-md',slider,ui);
328260

329-
output.initdom(root);
330-
331-
332-
await Promise.all([
333-
log.initdom(),
334-
]);
335261

336262

337263
//ui.setup(view);

0 commit comments

Comments
 (0)