|
6 | 6 |
|
7 | 7 | <style> |
8 | 8 |
|
9 | | - section |
| 9 | + section |
10 | 10 | {margin:0;box-sizing:border-box;display:flex;align-items:center; |
11 | 11 | gap:10px; |
12 | 12 | } |
13 | | - |
| 13 | + |
14 | 14 | .icon |
15 | 15 | {cursor:pointer;border-radius:3px;border:1px solid gray;box-sizing:border-box; |
16 | 16 | width:38px;height:38px; |
17 | 17 | } |
18 | | - |
| 18 | + |
19 | 19 | .item |
20 | 20 | {display:inline-flex;align-items:center;text-align:center;background:buttonface; |
21 | 21 | border-radius:3px;border:1px solid lightgray;padding:5px 7px; |
22 | 22 | } |
23 | | - |
| 23 | + |
24 | 24 | .item-label |
25 | 25 | {} |
26 | | - |
| 26 | + |
27 | 27 | ::slotted(.title) |
28 | 28 | {text-align:center;position:absolute;left:0;right:0;top:0px;z-index:-1;margin:0 auto; |
29 | 29 | } |
30 | | - |
31 | | - |
| 30 | + |
| 31 | + ::slotted([slot=version]) |
| 32 | + {color:green;font-weight:bold} |
| 33 | + |
32 | 34 | .date |
33 | 35 | {position:absolute;top:5px;right:5px;} |
34 | | - |
| 36 | + |
35 | 37 | a |
36 | 38 | {color:blue;} |
37 | 39 | a:visited |
38 | 40 | {color:blue;} |
39 | | - |
| 41 | + |
40 | 42 | ::slotted(.visually-hidden) |
41 | 43 | {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0} |
42 | 44 |
|
|
46 | 48 | </style> |
47 | 49 |
|
48 | 50 | <section> |
49 | | - |
| 51 | + |
| 52 | + <slot name=seo-hdr class=visually-hidden></slot> |
| 53 | + |
50 | 54 | <div class=item> |
51 | 55 |
|
52 | 56 | <a id=home class=item-label href='/'> |
53 | 57 | home |
54 | 58 | </a> |
55 | 59 |
|
56 | 60 | <top-menu component=grp></top-menu> |
57 | | - |
| 61 | + |
58 | 62 | </div> |
59 | 63 |
|
60 | 64 | <input value=isolate type=button> |
61 | | - |
| 65 | + |
62 | 66 | <slot></slot> |
63 | 67 |
|
64 | | - <slot name=seo-hdr class=visually-hidden></slot> |
65 | | - |
| 68 | + <slot name=version></slot> |
| 69 | + |
66 | 70 | <div class=date> |
67 | 71 | <slot name=date></slot> |
68 | 72 | </div> |
69 | | - |
| 73 | + |
70 | 74 | </section> |
71 | 75 |
|
72 | 76 | </template> |
73 | | - |
| 77 | + |
74 | 78 |
|
75 | 79 | <script> |
76 | 80 |
|
77 | 81 | (function editors_hdr({mod,dom,host}){ |
78 | | - |
| 82 | + |
79 | 83 | var obj = { |
80 | 84 | version : 'v2.0' |
81 | 85 | }; |
|
85 | 89 |
|
86 | 90 | var ext,$,menu |
87 | 91 | ; |
88 | | - |
| 92 | + |
89 | 93 | obj.initmod = function(params){ |
90 | | - |
| 94 | + |
91 | 95 | ext = params.ext; |
92 | 96 | $ = params.$; |
93 | 97 | menu = params.menu; |
94 | 98 |
|
95 | 99 | }//initmod |
96 | 100 |
|
97 | | - |
| 101 | + |
98 | 102 | //: |
99 | 103 |
|
100 | | - |
| 104 | + |
101 | 105 | var top; |
102 | 106 |
|
103 | | - |
| 107 | + |
104 | 108 | obj.init = async function(){ |
105 | 109 | debug('init',obj.version); |
106 | 110 | top = mod['top-menu']; |
107 | 111 |
|
108 | 112 | top.initmod({ext,$,menu}); |
109 | 113 |
|
110 | 114 | await top.init(); |
111 | | - |
| 115 | + |
112 | 116 |
|
113 | 117 | }//init |
114 | | - |
115 | | - |
| 118 | + |
| 119 | + |
116 | 120 | //: |
117 | 121 |
|
118 | 122 |
|
119 | 123 | obj.initdom = function(rootnode){ |
120 | | - |
| 124 | + |
121 | 125 | var shadow = host.shadowRoot; |
122 | 126 |
|
123 | 127 | top.initdom(shadow); |
|
127 | 131 |
|
128 | 132 | }//initdom |
129 | 133 |
|
130 | | - |
| 134 | + |
131 | 135 | //: |
132 | 136 |
|
133 | 137 |
|
134 | 138 | btn.isolate = function(){ |
135 | | - |
| 139 | + |
136 | 140 | var url = window.location.toString(); |
137 | 141 |
|
138 | 142 | if(url.indexOf('?')!=-1){ |
|
143 | 147 | window.location = url; |
144 | 148 |
|
145 | 149 | }//isolate |
146 | | - |
147 | | - |
| 150 | + |
| 151 | + |
148 | 152 | //: |
149 | | - |
| 153 | + |
150 | 154 |
|
151 | 155 | function debug(){ |
152 | | - |
| 156 | + |
153 | 157 | if(!df && !obj.df)return; |
154 | 158 | var str = [...arguments].join(' '); |
155 | 159 | console.log(`[ ${did} ]`,str); |
156 | 160 |
|
157 | 161 | }//debug |
158 | | - |
159 | | - |
| 162 | + |
| 163 | + |
160 | 164 | return obj; |
161 | 165 |
|
162 | 166 | })//editors-hdr |
163 | 167 |
|
164 | | - |
| 168 | + |
165 | 169 | </script> |
166 | 170 |
|
167 | 171 | </editors-hdr> |
|
0 commit comments