Skip to content

Commit 5b172d0

Browse files
save file
1 parent 20ce611 commit 5b172d0

1 file changed

Lines changed: 129 additions & 94 deletions

File tree

utils/misc/html/misc-hdr/misc-hdr.html

Lines changed: 129 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,197 @@
11

22

3-
<misc-hdr style='position:relative'>
3+
<misc-hdr v2.0>
44

55
<template shadowrootmode=open>
66

77
<style>
88

9+
:host
10+
{position:relative}
11+
912
section
1013
{margin:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;
1114
padding-bottom:20px;border-bottom:1px solid lightgray;
1215
}
13-
14-
.icon {
15-
cursor : pointer;
16-
border-radius : 3px;
17-
border : 1px solid gray;
18-
box-sizing : border-box;
19-
width : 38px;
20-
height : 38px;
21-
}
22-
23-
.item {
24-
display : inline-flex;
25-
align-items : center;
26-
text-align : center;
27-
background : buttonface;
28-
border-radius : 3px;
29-
border : 1px solid lightgray;
30-
padding : 5px 7px;
31-
}
32-
33-
.item-label {
34-
}
35-
36-
::slotted(.title) {
37-
text-align : center;
38-
position : absolute;
39-
left : 0;
40-
right : 0;
41-
top : 0px;
42-
z-index : -1;
43-
margin : 0 auto;
44-
}
45-
46-
47-
.date {
48-
position : absolute;
49-
top : 5px;
50-
right : 5px;
51-
}
52-
53-
a {
54-
color : blue;
55-
}
56-
a:visited {
57-
color : blue;
58-
}
59-
60-
16+
17+
.icon
18+
{cursor:pointer;border-radius:3px;border:1px solid gray;box-sizing:border-box;
19+
width:38px;height:38px}
20+
21+
.item
22+
{display:inline-flex;align-items:center;text-align:center;background:buttonface;
23+
border-radius:3px;border:1px solid lightgray;padding:5px 7px}
24+
25+
.item-label
26+
{}
27+
28+
::slotted([slot=title])
29+
{text-align:center;position:absolute;left:0;right:0;top:0px;z-index:-1;margin:0 auto}
30+
31+
page-source
32+
{margin-right:20px}
33+
34+
::slotted([slot=version]), [name=version]
35+
{font-weight:bold;color:blue;margin-right:10px}
36+
37+
.date
38+
{}
39+
40+
.spc
41+
{flex:1}
42+
43+
a
44+
{color:blue}
45+
a:visited
46+
{color:blue}
47+
48+
6149
</style>
6250

6351
<section>
64-
52+
53+
<slot name=title></slot>
54+
55+
6556
<!--
6657
<img id=help class=icon style='padding:2px' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAABANJREFUSEvNl2tsVEUUx39n224pEVNsTcGqAYM1gYYP0mCUaILGLqVptzVGKZCArxIU2VYTYpQapU2Mj9jWR9H6wUesUdcGWoRSJIQYjUhETUkkRUVIoGztLqB9bOm2OzL7urtst3eXhsT77c495/+bOXPmzLlCEk9JydOZKsNi8ws2QYqAW4DskOsF4IRC/WRRdIvP393V9fZFM1mZyqC0dONsX8aMZ0SpjUCOmVjou0eJbM/wjb65e/f284l8YsCqbNN8JK0Ii5JeJXN2IXVjkJskMMbMCu4yVP1tolyBD4ohrNftF+dLY/o1AlbljsUIh4CsKwEl5aPoks7mlbFg++bnQF5JSmA6RlbLTHE2eo0V22teANUwHc2kfK2+WeJsGYqABysc9dcotiblPB2jaLDO3rXp1uOrrjCRUpmH02ed+9Ce112BFRdX1NavVmrrOlRQ4/nH4YN2GDgP826AiuXQ1AY1a2B+vsE5dBRO9UF+Hjj3GeMr7wbbncH3f4fB+Q30HA+8Voml4fOdjXWii4PfmnamCnIi4A+3wcvvwck+WFwAj1WC41Vo2gKdB+HYX0HRwWG4747gZJo+NcCPVEBWJuw4AIULYF0ZrK+D8QkeQDyjYxP5sqLcUa5EOqqApMAfdcCvvQbEvnxy8MQEfLILROCrN+CJbXDuHyoRRpWyS7Hd8a4gT8aB/zwNwyOQfS1kzzJWrEPr8sDX3wZXnAicZoEvu6HwVtjwIDz6Ikz4A+ARVIvY7DU/AkvjwB93wlk3LLgJiu8ywEd+g1Nn4fBRGB1LDL7n9mCOXBiE9v3QezIQJQ32wmENHgByr1qoL0v5ENitwT4gPWnwd7/AidNBuf5LIS9aBEsWws4DwTGXG2zLILzHk4PHJwfrLNbh0WGamwv3LoW2PbC2FG7MM6R6foczf0PJMmPs52Mw7AW/H37oiTvioRUHwPGhTqUipGgbHer45EpRLBXzSHKFj9MqYH24cqWilKJtRSCrVUukgBQCr6GwpCiUirkumpsRRBeQcMnUrc1CYFF0dxClOhtFpQmlD9hr9BYx1l7goK6y4LHokqm/6ktClDK9Eh0oShLA9ZmsRfjDZHJKpGGfviS0nb4Wx9MzdSSm7K8ygWYU8yYRb0HoNI+7O338YoFuAiONgM1euxpUm5nvzcBbKGZEGX4P1CcIcayerOnuaPxMj8V0mSvKa95XQrUZ/P5Le/Vs6AT0A08hDJk4iaJ1b2fThrBZDHhJdXVGTn/WF4KY5VFgrwtQtCOECmhCtELt8OR5Hz7S2qpTIfDENfQafr1r5jvJrNwsMgGAonVgzsimaOik4LBYaM+bzRJuCrgbxBHe08vt/h+/MIlmfzV+2v4DHQu0lKRbJa4AAAAASUVORK5CYII='>
6758
-->
68-
59+
60+
6961
<div class=item>
70-
62+
7163
<!--
7264
<top-menu component=grp v2.0></top-menu>
7365
-->
7466

7567
<a id=home class=item-label href='/'>
7668
home
7769
</a>
78-
70+
7971
</div>
80-
72+
8173
<div class=item>
82-
83-
<a id=home class=item-label href='/utils/misc/index.html'>
74+
75+
<a id=home class=item-label href='/utils/misc/index.html' target=_blank>
8476
misc
8577
</a>
86-
78+
8779
</div>
88-
89-
90-
<slot></slot>
91-
92-
80+
81+
82+
<div class=spc></div>
83+
84+
85+
<page-source v2.0 component></page-source>
86+
87+
88+
<slot name=filename></slot>
89+
90+
<slot name=version></slot>
91+
92+
9393
<div class=date>
9494
<slot name=date></slot>
9595
</div>
96-
97-
96+
97+
9898
</section>
9999

100100
</template>
101101

102102
<script>
103103

104-
(function misc_hdr({mod,dom,host}){
105-
104+
(function misc_hdr({mod,host}){
105+
106106
var obj = {
107107
version : 'v2.0',
108108
};
109109

110-
var df=true
110+
var df=true,did='misc-hdr'
111111
;
112-
112+
113+
113114
var ext,$,menu
114115
;
115-
116+
116117
obj.initmod=function(params){
117-
118-
ext = params.ext;
119-
$ = params.$;
120-
menu = params.menu;
118+
119+
ext = mod.rd(params,'ext',ext);
120+
$ = mod.rd(params,'$',$);
121+
menu = mod.rd(params,'menu',menu);
121122

122123
}//initmod
123-
124124

125-
//:
126-
125+
126+
//:
127+
128+
127129
var top;
128130

131+
var shadow;
132+
133+
134+
var set = {};
135+
obj.set = set;
136+
137+
138+
//:
139+
129140
obj.init = async function(){
130141

131-
//top = mod['top-menu'];
132-
133-
//top.initmod({$,menu});
134-
135-
//await top.init();
136-
142+
await mod.auto();
137143

138144
}//init
139-
140-
145+
146+
141147
//:
142148

143149

144150
obj.initdom = function(){
145-
146-
//var root = $.$(rootnode,'misc-hdr');
147-
var shadow = host.shadowRoot;
148-
149-
//top.initdom(shadow);
151+
152+
shadow = host.shadowRoot;
150153

154+
set.filename();
155+
if(typeof version!=='undefined'){
156+
set.version(version);
157+
}
151158

152159
}//initdom
153-
154-
155-
160+
161+
162+
//:
163+
164+
165+
obj.set.version = function(v){
166+
167+
$(shadow,'[name=version]').textContent = v;
168+
169+
}//version
170+
171+
172+
obj.set.filename = function(fn){
173+
174+
if(!fn){
175+
var str = window.location.toString();
176+
var i = str.lastIndexOf('/');
177+
fn = str.slice(i+1);
178+
}
179+
$(shadow,'[name=filename]').textContent = fn;
180+
181+
}//filename
182+
183+
184+
185+
186+
187+
188+
189+
156190
return obj;
157191

158-
})//misc-hdr
159-
192+
//misc-hdr
193+
})
194+
160195
</script>
161196

162197
</misc-hdr>

0 commit comments

Comments
 (0)