Skip to content

Commit 3cab89e

Browse files
save file
1 parent 2f0dfba commit 3cab89e

1 file changed

Lines changed: 56 additions & 8 deletions

File tree

utils/misc/html/hdr-index/v2.0/hdr-index-v2.0.html

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,28 @@
7373
<slot name=title></slot>
7474

7575

76-
<div class=date>
77-
<slot name=date></slot>
78-
</div>
76+
<page-source v2.0 component></page-source>
77+
78+
79+
<slot name=filename></slot>
80+
81+
<slot name=version></slot>
7982

8083

84+
<slot name=date class=date></slot>
85+
8186
</section>
8287

8388
</template>
8489

8590
<script>
8691

87-
(function hdr_index({mod,dom,host}){
88-
89-
var obj = {};
92+
(function({mod,host}){
93+
//misc/hdr-index.html
94+
95+
var obj = {
96+
version : 'v2.0',
97+
};
9098

9199
var df=false
92100
;
@@ -95,6 +103,16 @@
95103
}//initmod
96104

97105

106+
//:
107+
108+
109+
var shadow;
110+
111+
112+
var set = {};
113+
obj.set = set;
114+
115+
98116
//:
99117

100118

@@ -107,15 +125,45 @@
107125

108126
obj.initdom = function(){
109127

110-
var shadow = host.shadowRoot;
128+
shadow = host.shadowRoot;
129+
130+
set.filename();
131+
if(typeof version!=='undefined'){
132+
set.version(version);
133+
}
111134

112135
}//initdom
113136

114137

138+
//:
139+
140+
141+
obj.set.version = function(v){
142+
143+
$(shadow,'[name=version]').textContent = v;
144+
145+
}//version
146+
147+
148+
obj.set.filename = function(fn){
149+
150+
if(!fn){
151+
var str = window.location.toString();
152+
var i = str.lastIndexOf('/');
153+
fn = str.slice(i+1);
154+
}
155+
$(shadow,'[name=filename]').textContent = fn;
156+
157+
}//filename
158+
159+
160+
161+
115162

116163
return obj;
117164

118-
})//hdr_index
165+
//misc/hdr_index
166+
})
119167

120168
</script>
121169

0 commit comments

Comments
 (0)