Skip to content

Commit 4872fd8

Browse files
save file
1 parent e5b8359 commit 4872fd8

File tree

1 file changed

+154
-7
lines changed

1 file changed

+154
-7
lines changed

html-components/list/web-console/web-console.html

Lines changed: 154 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,110 @@
2626
<script src='https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js'></script>
2727
<link rel=stylesheet href='/css/github-markdown-light.css'>
2828

29+
<link rel=stylesheet href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css'>
30+
<link rel=stylesheet href='https://cdn.jsdelivr.net/npm/wunderbaum@0/dist/wunderbaum.min.css'>
31+
<script src='https://cdn.jsdelivr.net/npm/wunderbaum@0/dist/wunderbaum.umd.min.js'></script>
32+
2933

3034
<script src='https://libs.ext-code.com/js/dom/component/component.js?init'></script>
3135

3236
<script>
3337

34-
35-
async function init(){
38+
var df=true,did='html'
39+
;
3640

41+
var ace;
42+
var md;
43+
var snippet;
44+
var editor;
3745

46+
47+
async function init(){
48+
console.log('init');
49+
50+
md = markdownit();
51+
52+
await load();
53+
54+
55+
snippet = mod['snippet-html-console'];
56+
editor = mod['web-editor'];
57+
3858
await mod.auto();
3959

4060

61+
initdom();
62+
4163

4264
}//init
4365

4466

67+
async function load(){
68+
69+
txt = await fetch('readme.md').then(res=>res.text());
70+
71+
}//load
72+
73+
4574
</script>
4675

4776
<style>
4877

78+
79+
html
80+
{height:100%;font-family:arial}
81+
82+
83+
body
84+
{height:calc(100% - 40px);display:flex;flex-direction:column;gap:20px;align-items:center;margin:20px;padding-bottom:200px}
85+
86+
87+
body>*
88+
{max-width:1400px;width:100%;padding:0 20px;}
89+
90+
[component],config
91+
{display:none}
92+
93+
input
94+
{font-size:16px;padding:5px 10px}
95+
input[type=button]
96+
{cursor:pointer}
97+
input[type=checkbox]
98+
{width:15px;height:15px;margin:0}
99+
100+
101+
#demo-tree
102+
{margin:50px 0;height:auto !important;border:none !important;overflow:visible;box-sizing:border-box;outline:none}
103+
104+
49105
</style>
50106

51107
</head>
52108

53109
<body>
54110

55-
<div id=output class=markdown-body>
111+
112+
<html-components-hdr component=grp1>
113+
<h2 class=title style='top:10px'>web-console</h2>
114+
<time slot=date datetime=2026-01-04>04 Jan 2026</time>
115+
</html-components-hdr>
116+
117+
118+
<div id=readme class=markdown-body></div>
119+
120+
<section>
121+
122+
<h3>
123+
files
124+
</h3>
125+
126+
<div id=demo-tree class='wb-skeleton wb-initializing wb-fade-expander'></div>
127+
128+
</section>
129+
130+
<div id=view style='display:none'>
131+
<snippet-html-console component></snippet-html-console>
132+
<web-editor component></web-editor>
56133
</div>
57134

58135

@@ -61,22 +138,92 @@
61138
<script>
62139

63140

141+
var txt;
142+
143+
144+
//:
145+
146+
64147
function initdom(){
148+
debug('initdom');
149+
150+
var html = md.render(txt);
151+
$('#readme').innerHTML = html;
152+
153+
154+
var node = $('#demo-tree');
155+
var tree = new mar10.Wunderbaum({
156+
element:node,
157+
source: files,
158+
init:e=>{e.tree.setFocus()},
159+
activate:show
160+
});
161+
162+
65163
}//initdom
66164

67165

166+
//:
167+
168+
169+
function show(e){
170+
171+
var depth = e=>{
172+
173+
var c = 0;
174+
var node = e.node;
175+
176+
while(node.parent){
177+
178+
c++;
179+
node = node.parent;
180+
181+
}//while
182+
return c;
183+
184+
}//depth
185+
186+
var d = depth(e);
187+
console.log(d,e.node.title);
188+
console.log(`Thank you for activating ${e.node}.`);
189+
190+
191+
}//show
192+
193+
68194
</script>
69195

70196

71197
<script>
72198

73-
var data = {
74-
};
199+
200+
201+
202+
var files = [
203+
204+
{
205+
title: 'source',
206+
expanded: true,
207+
children: [
208+
{title:'latest'},
209+
{title:'v2.0'}
210+
],
211+
},
212+
213+
{
214+
title: 'examples',
215+
expanded:true,
216+
children:[
217+
{title:'simple example'}
218+
]
219+
},
220+
221+
];
222+
75223

76-
data.readme = `
77-
`;
78224

79225
</script>
226+
80227
</html>
81228

82229

0 commit comments

Comments
 (0)