added intro

This commit is contained in:
Bachir Soussi Chiadmi
2017-10-18 12:30:38 +02:00
parent 50a22a57dc
commit f45f05be04
12 changed files with 1243 additions and 1083 deletions
+25 -1
View File
@@ -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)