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
+26 -2
View File
@@ -303,6 +303,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))));
}
}
// ____ __ _
// / _/___ / / (_)___ ___
// / // __ \/ / / / __ \/ _ \
@@ -321,8 +341,12 @@ module.exports = {
return [
m(_Header),
m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){
// console.log("MAP _dbs", p);
return m(_Part,p);
console.log("MAP _dbs", p);
if(p.id == 'intro'){
return m(_Intro,p);
}else{
return m(_Part,p);
}
})
),
m(_Footer)