added intro
This commit is contained in:
+25
-1
@@ -322,6 +322,26 @@ var _Part = {
|
||||
}
|
||||
}
|
||||
|
||||
// ____ __
|
||||
// / _/___ / /__________
|
||||
// / // __ \/ __/ ___/ __ \
|
||||
// _/ // / / / /_/ / / /_/ /
|
||||
// /___/_/ /_/\__/_/ \____/
|
||||
var _Intro = {
|
||||
oninit : function(vn){
|
||||
console.log('_Intro : oninit : vn', vn);
|
||||
this.id = vn.attrs.id;
|
||||
this.text = vn.attrs.text || '';
|
||||
},
|
||||
onbeforeupdate : function(vn, old){
|
||||
this.id = vn.attrs.id;
|
||||
this.text = vn.attrs.text || '';
|
||||
},
|
||||
view : function(vn){
|
||||
return m("section", {'class':'intro'}, m("p",m.trust(markdown.renderInline(this.text))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ______
|
||||
// /_ __/_______ ___
|
||||
@@ -341,7 +361,11 @@ module.exports = {
|
||||
return [
|
||||
m(_Header),
|
||||
m('main', {id:"content", 'class':'tree'}, _dbs.data[vn.attrs.lang].map(function(p){
|
||||
return m(_Part,p);
|
||||
if(p.id == 'intro'){
|
||||
return m(_Intro,p);
|
||||
}else{
|
||||
return m(_Part,p);
|
||||
}
|
||||
})
|
||||
),
|
||||
m(_Footer)
|
||||
|
||||
Reference in New Issue
Block a user