fix tranlsation in mode connection
This commit is contained in:
Vendored
+35
-88
@@ -1648,7 +1648,6 @@ module.exports = g;
|
|||||||
// /___/
|
// /___/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lang:'fr',
|
|
||||||
langs:[
|
langs:[
|
||||||
{
|
{
|
||||||
'lc':'lat',
|
'lc':'lat',
|
||||||
@@ -11360,7 +11359,7 @@ var _Link = {
|
|||||||
vn.state.opened = false;
|
vn.state.opened = false;
|
||||||
// return false;
|
// return false;
|
||||||
}
|
}
|
||||||
}, m('span', m.trust("🗙"))),
|
}),//, m('span', m.trust("🗙"))),
|
||||||
typeof _dbs.data_byid[_dbs.lang][this.tid].childs != "undefined"
|
typeof _dbs.data_byid[_dbs.lang][this.tid].childs != "undefined"
|
||||||
? m(_Enonce, this.tob)
|
? m(_Enonce, this.tob)
|
||||||
: m(_Item, this.tob)
|
: m(_Item, this.tob)
|
||||||
@@ -11725,7 +11724,7 @@ var _Dot = {
|
|||||||
nested:false,
|
nested:false,
|
||||||
links:null,
|
links:null,
|
||||||
parents:[],
|
parents:[],
|
||||||
lang:_dbs.lang,
|
lang:null,
|
||||||
setupTitle(vn){
|
setupTitle(vn){
|
||||||
this.title = vn.attrs.title;
|
this.title = vn.attrs.title;
|
||||||
if(!this.title) this.title = this.type;
|
if(!this.title) this.title = this.type;
|
||||||
@@ -11761,6 +11760,7 @@ var _Dot = {
|
|||||||
oninit(vn){
|
oninit(vn){
|
||||||
this.id = vn.attrs.id;
|
this.id = vn.attrs.id;
|
||||||
this.type = vn.attrs.type;
|
this.type = vn.attrs.type;
|
||||||
|
this.level = vn.attrs.level;
|
||||||
this.dottype = vn.attrs.dottype;
|
this.dottype = vn.attrs.dottype;
|
||||||
this.breadcrumb = vn.attrs.breadcrumb;
|
this.breadcrumb = vn.attrs.breadcrumb;
|
||||||
// console.log(`${this.id} -> ${this.dottype}`);
|
// console.log(`${this.id} -> ${this.dottype}`);
|
||||||
@@ -11777,9 +11777,10 @@ var _Dot = {
|
|||||||
// console.log('_Dot init '+this.id+' parents :',this.parents);
|
// console.log('_Dot init '+this.id+' parents :',this.parents);
|
||||||
}
|
}
|
||||||
this.nested = this.parents.length ? true : false;
|
this.nested = this.parents.length ? true : false;
|
||||||
|
|
||||||
// if(this.nested) console.log(`oninit ${this.id}`);
|
// if(this.nested) console.log(`oninit ${this.id}`);
|
||||||
|
|
||||||
|
this.lang = vn.attrs.lang;
|
||||||
|
|
||||||
this.setupTitle(vn);
|
this.setupTitle(vn);
|
||||||
this.setuptext(vn);
|
this.setuptext(vn);
|
||||||
},
|
},
|
||||||
@@ -11791,14 +11792,13 @@ var _Dot = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onbeforeupdate(vn){
|
onbeforeupdate(vn){
|
||||||
// if(this.opened) console.log(`onbeforeupdate ${this.id} : vn`,vn);
|
if(this.lang != vn.attrs.lang){
|
||||||
if(this.lang != _dbs.lang){
|
this.lang = vn.attrs.lang;
|
||||||
this.lang = _dbs.lang;
|
|
||||||
this.breadcrumb = vn.attrs.breadcrumb;
|
this.breadcrumb = vn.attrs.breadcrumb;
|
||||||
|
this.type = vn.attrs.type;
|
||||||
this.setuptext(vn);
|
this.setuptext(vn);
|
||||||
this.setupTitle(vn);
|
this.setupTitle(vn);
|
||||||
}
|
}
|
||||||
// this.opened = 0;
|
|
||||||
},
|
},
|
||||||
onupdate(vn){
|
onupdate(vn){
|
||||||
// if(this.nested) console.log(`onupdate ${this.id}`);
|
// if(this.nested) console.log(`onupdate ${this.id}`);
|
||||||
@@ -11817,12 +11817,13 @@ var _Dot = {
|
|||||||
setupLinks(vn, c, links){
|
setupLinks(vn, c, links){
|
||||||
return m('nav', {'class':`links ${c}`}, links.map(id => {
|
return m('nav', {'class':`links ${c}`}, links.map(id => {
|
||||||
// console.log(id);
|
// console.log(id);
|
||||||
if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
|
if(typeof _dbs.data_byid[this.lang][id] !== 'undefined'){
|
||||||
var obj = _dbs.data_byid[_dbs.lang][id];
|
var obj = _dbs.data_byid[this.lang][id];
|
||||||
// console.log('link to : obj', obj);
|
// console.log('link to : obj', obj);
|
||||||
return m(_Dot, {
|
return m(_Dot, {
|
||||||
"id":id,
|
"id":id,
|
||||||
'title':obj.title,
|
'title':obj.title,
|
||||||
|
// TODO: translate breadcrumb
|
||||||
'breadcrumb':obj.breadcrumb,
|
'breadcrumb':obj.breadcrumb,
|
||||||
'text':obj.text,
|
'text':obj.text,
|
||||||
'dottype':obj.dottype,
|
'dottype':obj.dottype,
|
||||||
@@ -11832,14 +11833,13 @@ var _Dot = {
|
|||||||
// activate link only if not in parents (already went through it)
|
// activate link only if not in parents (already went through it)
|
||||||
'active':vn.state.parents.indexOf(id) == -1 ? true:false,
|
'active':vn.state.parents.indexOf(id) == -1 ? true:false,
|
||||||
// 'nested':true,
|
// 'nested':true,
|
||||||
|
'lang':this.lang,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
viewOpenedContent(vn){
|
viewOpenedContent(vn){
|
||||||
// if(this.nested) console.log(`viewOpenedContent ${this.id} : vn`, vn);
|
|
||||||
// if(this.nested) console.log(`viewOpenedContent ${this.id} : this`, this);
|
|
||||||
return m('div', {
|
return m('div', {
|
||||||
'uid':this.id,
|
'uid':this.id,
|
||||||
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`},
|
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`},
|
||||||
@@ -11854,7 +11854,7 @@ var _Dot = {
|
|||||||
onclick(e){
|
onclick(e){
|
||||||
vn.state.opened = 0;
|
vn.state.opened = 0;
|
||||||
}
|
}
|
||||||
}, m('span', m.trust("🗙"))
|
}//, m('span') // , m.trust("🗙")
|
||||||
),
|
),
|
||||||
// Title
|
// Title
|
||||||
m('span', {'class':'title'}, m.trust(this.nested ? this.breadcrumb : this.title)),
|
m('span', {'class':'title'}, m.trust(this.nested ? this.breadcrumb : this.title)),
|
||||||
@@ -11891,8 +11891,6 @@ var _Dot = {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
viewPreviewContent(vn){
|
viewPreviewContent(vn){
|
||||||
// if(this.nested) console.log(`viewPreviewContent ${this.id} : vn`, vn);
|
|
||||||
// if(this.nested) console.log(`viewPreviewContent ${this.id} : this`, this);
|
|
||||||
return m('div', {
|
return m('div', {
|
||||||
'uid':this.id,
|
'uid':this.id,
|
||||||
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`
|
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`
|
||||||
@@ -11911,10 +11909,6 @@ var _Dot = {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
view(vn){
|
view(vn){
|
||||||
// if (this.nested) console.log(`view ${this.id}`);
|
|
||||||
// if (this.opened) console.log(`view ${this.id} : vn`,vn);
|
|
||||||
// if (this.nested) console.log(`view ${this.id} : this`,this);
|
|
||||||
|
|
||||||
return this.active && vn.state.opened
|
return this.active && vn.state.opened
|
||||||
? this.viewOpenedContent(vn) // full view of dot with linked dots
|
? this.viewOpenedContent(vn) // full view of dot with linked dots
|
||||||
: this.viewPreviewContent(vn); // preview dot
|
: this.viewPreviewContent(vn); // preview dot
|
||||||
@@ -11940,38 +11934,18 @@ full list of black dotlikes from unicode
|
|||||||
// / /__/ _ \/ / / _ /
|
// / /__/ _ \/ / / _ /
|
||||||
// \___/_//_/_/_/\_,_/
|
// \___/_//_/_/_/\_,_/
|
||||||
var _Child = {
|
var _Child = {
|
||||||
// id:null,
|
// oninit(vn){},
|
||||||
// part:null,
|
// onbeforeupdate(vn, old){},
|
||||||
// type:null,
|
|
||||||
// dottype:null,
|
|
||||||
// // nested:false,
|
|
||||||
// text:'',
|
|
||||||
childs:[],
|
|
||||||
oninit(vn){
|
|
||||||
// // console.log('vn.attrs', vn.attrs);
|
|
||||||
// this.id = vn.attrs.id;
|
|
||||||
// this.type = vn.attrs.type;
|
|
||||||
// // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// this.dottype = vn.attrs.dottype;
|
|
||||||
},
|
|
||||||
onbeforeupdate(vn, old){
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// this.type = vn.attrs.type;
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
},
|
|
||||||
view(vn){
|
view(vn){
|
||||||
// return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type, 'dottype':this.dottype});
|
|
||||||
|
|
||||||
// if (typeof vn.attrs.childs === 'undefined'){
|
|
||||||
// debugger;
|
|
||||||
// }
|
|
||||||
return [
|
return [
|
||||||
m(_Dot, vn.attrs),
|
m(_Dot, vn.attrs),
|
||||||
// add children
|
// add children
|
||||||
typeof vn.attrs.childs !== 'undefined'
|
typeof vn.attrs.childs !== 'undefined'
|
||||||
? vn.attrs.childs.map(c => { return m(_Child, c); })
|
? vn.attrs.childs.map(c => {
|
||||||
|
c.lang = vn.attrs.lang;
|
||||||
|
c.level = vn.attrs.level + 1;
|
||||||
|
return m(_Child, c);
|
||||||
|
})
|
||||||
: null
|
: null
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -11983,45 +11957,19 @@ var _Child = {
|
|||||||
// / /___/ / / / /_/ / / / / /__/ __/
|
// / /___/ / / / /_/ / / / / /__/ __/
|
||||||
// /_____/_/ /_/\____/_/ /_/\___/\___/
|
// /_____/_/ /_/\____/_/ /_/\___/\___/
|
||||||
var _Enonce = {
|
var _Enonce = {
|
||||||
partid:null,
|
// oninit(vn){},
|
||||||
id:null,
|
// onbeforeupdate(vn, old) {},
|
||||||
title:null,
|
|
||||||
text:null,
|
|
||||||
dottype:null,
|
|
||||||
// nested:false,
|
|
||||||
childs:[],
|
|
||||||
oninit(vn){
|
|
||||||
// // // console.log('Enonce on init', vn);
|
|
||||||
// this.partid = vn.attrs.partid;
|
|
||||||
// this.id = vn.attrs.id;
|
|
||||||
// this.title = vn.attrs.title || "";
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
// this.childs = vn.attrs.childs || [];
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// this.dottype = vn.attrs.dottype;
|
|
||||||
},
|
|
||||||
onbeforeupdate(vn, old) {
|
|
||||||
// // console.log(vn.attrs.childs);
|
|
||||||
// this.title = vn.attrs.title || "";
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
// this.childs = vn.attrs.childs || [];
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
|
|
||||||
// this.dottype = vn.attrs.dottype;
|
|
||||||
},
|
|
||||||
view(vn){
|
view(vn){
|
||||||
// if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
|
vn.attrs.level = 0;
|
||||||
return [
|
return [
|
||||||
// create dot
|
// create dot
|
||||||
// m(_Dot, {
|
|
||||||
// 'id':this.id
|
|
||||||
// 'text':this.text
|
|
||||||
// 'type':this.title
|
|
||||||
// 'dottype':this.dottype
|
|
||||||
// }),
|
|
||||||
m(_Dot, vn.attrs),
|
m(_Dot, vn.attrs),
|
||||||
// addd children
|
// addd children
|
||||||
vn.attrs.childs.map(c => { return m(_Child, c); })
|
vn.attrs.childs.map(c => {
|
||||||
|
c.lang = vn.attrs.lang;
|
||||||
|
c.level = 1;
|
||||||
|
return m(_Child, c);
|
||||||
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12036,15 +11984,11 @@ var _Part = {
|
|||||||
oninit(vn){
|
oninit(vn){
|
||||||
this.id = vn.attrs.id;
|
this.id = vn.attrs.id;
|
||||||
this.title = vn.attrs.title || "";
|
this.title = vn.attrs.title || "";
|
||||||
this.enonces = vn.attrs.enonces;
|
|
||||||
},
|
},
|
||||||
onbeforeupdate(vn, old){
|
onbeforeupdate(vn, old){
|
||||||
// console.log('_Part, onbeforeupdate old',old);
|
|
||||||
this.title = vn.attrs.title || "";
|
this.title = vn.attrs.title || "";
|
||||||
this.enonces = vn.attrs.enonces;
|
|
||||||
},
|
},
|
||||||
view(vn){
|
view(vn){
|
||||||
// console.log(vn.attrs.enonces);
|
|
||||||
return m("section", {
|
return m("section", {
|
||||||
'id' :this.id,
|
'id' :this.id,
|
||||||
'class' :'part'
|
'class' :'part'
|
||||||
@@ -12053,9 +11997,9 @@ var _Part = {
|
|||||||
// create title node
|
// create title node
|
||||||
m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
|
m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
|
||||||
// create text node
|
// create text node
|
||||||
this.enonces.map(e => {
|
vn.attrs.enonces.map(e => {
|
||||||
// console.log(e.text);
|
// console.log(e.text);
|
||||||
// return m(_Enonce, Object.assign({"partid":this.id},e))
|
e.lang = vn.attrs.lang;
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "title":
|
case "title":
|
||||||
// handle titles
|
// handle titles
|
||||||
@@ -12095,7 +12039,6 @@ var _Intro = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ______ __ _
|
// ______ __ _
|
||||||
// / ____/___ ____ ____ ___ _____/ /_(_)___ ____ _____
|
// / ____/___ ____ ____ ___ _____/ /_(_)___ ____ _____
|
||||||
// / / / __ \/ __ \/ __ \/ _ \/ ___/ __/ / __ \/ __ \/ ___/
|
// / / / __ \/ __ \/ __ \/ _ \/ ___/ __/ / __ \/ __ \/ ___/
|
||||||
@@ -12106,9 +12049,13 @@ module.exports = {
|
|||||||
document.body.classList.add('mode-connections');
|
document.body.classList.add('mode-connections');
|
||||||
_Ui.init();
|
_Ui.init();
|
||||||
},
|
},
|
||||||
|
onbeforeupdate(vn, old){
|
||||||
|
console.log('Connection, onbeforeupdate old',old, 'vn',vn);
|
||||||
|
},
|
||||||
view(vn){
|
view(vn){
|
||||||
// console.log('_ModeConnections view', vn.attrs.lang);
|
console.log('_ModeConnections view', vn.attrs.lang);
|
||||||
return m('main', {id:"content", 'class':'mode-connections'}, _dbs.data[vn.attrs.lang].map(p => {
|
return m('main', {id:"content", 'class':'mode-connections'}, _dbs.data[vn.attrs.lang].map(p => {
|
||||||
|
p.lang = vn.attrs.lang;
|
||||||
if(p.id == 'intro'){
|
if(p.id == 'intro'){
|
||||||
return m(_Intro,p);
|
return m(_Intro,p);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@ var _Dot = {
|
|||||||
nested:false,
|
nested:false,
|
||||||
links:null,
|
links:null,
|
||||||
parents:[],
|
parents:[],
|
||||||
lang:_dbs.lang,
|
lang:null,
|
||||||
setupTitle(vn){
|
setupTitle(vn){
|
||||||
this.title = vn.attrs.title;
|
this.title = vn.attrs.title;
|
||||||
if(!this.title) this.title = this.type;
|
if(!this.title) this.title = this.type;
|
||||||
@@ -64,6 +64,7 @@ var _Dot = {
|
|||||||
oninit(vn){
|
oninit(vn){
|
||||||
this.id = vn.attrs.id;
|
this.id = vn.attrs.id;
|
||||||
this.type = vn.attrs.type;
|
this.type = vn.attrs.type;
|
||||||
|
this.level = vn.attrs.level;
|
||||||
this.dottype = vn.attrs.dottype;
|
this.dottype = vn.attrs.dottype;
|
||||||
this.breadcrumb = vn.attrs.breadcrumb;
|
this.breadcrumb = vn.attrs.breadcrumb;
|
||||||
// console.log(`${this.id} -> ${this.dottype}`);
|
// console.log(`${this.id} -> ${this.dottype}`);
|
||||||
@@ -80,9 +81,10 @@ var _Dot = {
|
|||||||
// console.log('_Dot init '+this.id+' parents :',this.parents);
|
// console.log('_Dot init '+this.id+' parents :',this.parents);
|
||||||
}
|
}
|
||||||
this.nested = this.parents.length ? true : false;
|
this.nested = this.parents.length ? true : false;
|
||||||
|
|
||||||
// if(this.nested) console.log(`oninit ${this.id}`);
|
// if(this.nested) console.log(`oninit ${this.id}`);
|
||||||
|
|
||||||
|
this.lang = vn.attrs.lang;
|
||||||
|
|
||||||
this.setupTitle(vn);
|
this.setupTitle(vn);
|
||||||
this.setuptext(vn);
|
this.setuptext(vn);
|
||||||
},
|
},
|
||||||
@@ -94,14 +96,13 @@ var _Dot = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onbeforeupdate(vn){
|
onbeforeupdate(vn){
|
||||||
// if(this.opened) console.log(`onbeforeupdate ${this.id} : vn`,vn);
|
if(this.lang != vn.attrs.lang){
|
||||||
if(this.lang != _dbs.lang){
|
this.lang = vn.attrs.lang;
|
||||||
this.lang = _dbs.lang;
|
|
||||||
this.breadcrumb = vn.attrs.breadcrumb;
|
this.breadcrumb = vn.attrs.breadcrumb;
|
||||||
|
this.type = vn.attrs.type;
|
||||||
this.setuptext(vn);
|
this.setuptext(vn);
|
||||||
this.setupTitle(vn);
|
this.setupTitle(vn);
|
||||||
}
|
}
|
||||||
// this.opened = 0;
|
|
||||||
},
|
},
|
||||||
onupdate(vn){
|
onupdate(vn){
|
||||||
// if(this.nested) console.log(`onupdate ${this.id}`);
|
// if(this.nested) console.log(`onupdate ${this.id}`);
|
||||||
@@ -120,12 +121,13 @@ var _Dot = {
|
|||||||
setupLinks(vn, c, links){
|
setupLinks(vn, c, links){
|
||||||
return m('nav', {'class':`links ${c}`}, links.map(id => {
|
return m('nav', {'class':`links ${c}`}, links.map(id => {
|
||||||
// console.log(id);
|
// console.log(id);
|
||||||
if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
|
if(typeof _dbs.data_byid[this.lang][id] !== 'undefined'){
|
||||||
var obj = _dbs.data_byid[_dbs.lang][id];
|
var obj = _dbs.data_byid[this.lang][id];
|
||||||
// console.log('link to : obj', obj);
|
// console.log('link to : obj', obj);
|
||||||
return m(_Dot, {
|
return m(_Dot, {
|
||||||
"id":id,
|
"id":id,
|
||||||
'title':obj.title,
|
'title':obj.title,
|
||||||
|
// TODO: translate breadcrumb
|
||||||
'breadcrumb':obj.breadcrumb,
|
'breadcrumb':obj.breadcrumb,
|
||||||
'text':obj.text,
|
'text':obj.text,
|
||||||
'dottype':obj.dottype,
|
'dottype':obj.dottype,
|
||||||
@@ -135,14 +137,13 @@ var _Dot = {
|
|||||||
// activate link only if not in parents (already went through it)
|
// activate link only if not in parents (already went through it)
|
||||||
'active':vn.state.parents.indexOf(id) == -1 ? true:false,
|
'active':vn.state.parents.indexOf(id) == -1 ? true:false,
|
||||||
// 'nested':true,
|
// 'nested':true,
|
||||||
|
'lang':this.lang,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
viewOpenedContent(vn){
|
viewOpenedContent(vn){
|
||||||
// if(this.nested) console.log(`viewOpenedContent ${this.id} : vn`, vn);
|
|
||||||
// if(this.nested) console.log(`viewOpenedContent ${this.id} : this`, this);
|
|
||||||
return m('div', {
|
return m('div', {
|
||||||
'uid':this.id,
|
'uid':this.id,
|
||||||
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`},
|
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`},
|
||||||
@@ -157,7 +158,7 @@ var _Dot = {
|
|||||||
onclick(e){
|
onclick(e){
|
||||||
vn.state.opened = 0;
|
vn.state.opened = 0;
|
||||||
}
|
}
|
||||||
}, m('span', m.trust("🗙"))
|
}//, m('span') // , m.trust("🗙")
|
||||||
),
|
),
|
||||||
// Title
|
// Title
|
||||||
m('span', {'class':'title'}, m.trust(this.nested ? this.breadcrumb : this.title)),
|
m('span', {'class':'title'}, m.trust(this.nested ? this.breadcrumb : this.title)),
|
||||||
@@ -194,8 +195,6 @@ var _Dot = {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
viewPreviewContent(vn){
|
viewPreviewContent(vn){
|
||||||
// if(this.nested) console.log(`viewPreviewContent ${this.id} : vn`, vn);
|
|
||||||
// if(this.nested) console.log(`viewPreviewContent ${this.id} : this`, this);
|
|
||||||
return m('div', {
|
return m('div', {
|
||||||
'uid':this.id,
|
'uid':this.id,
|
||||||
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`
|
'class':`dot ${this.dottype}${this.nested ? ' nested':''}`
|
||||||
@@ -214,10 +213,6 @@ var _Dot = {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
view(vn){
|
view(vn){
|
||||||
// if (this.nested) console.log(`view ${this.id}`);
|
|
||||||
// if (this.opened) console.log(`view ${this.id} : vn`,vn);
|
|
||||||
// if (this.nested) console.log(`view ${this.id} : this`,this);
|
|
||||||
|
|
||||||
return this.active && vn.state.opened
|
return this.active && vn.state.opened
|
||||||
? this.viewOpenedContent(vn) // full view of dot with linked dots
|
? this.viewOpenedContent(vn) // full view of dot with linked dots
|
||||||
: this.viewPreviewContent(vn); // preview dot
|
: this.viewPreviewContent(vn); // preview dot
|
||||||
@@ -243,38 +238,18 @@ full list of black dotlikes from unicode
|
|||||||
// / /__/ _ \/ / / _ /
|
// / /__/ _ \/ / / _ /
|
||||||
// \___/_//_/_/_/\_,_/
|
// \___/_//_/_/_/\_,_/
|
||||||
var _Child = {
|
var _Child = {
|
||||||
// id:null,
|
// oninit(vn){},
|
||||||
// part:null,
|
// onbeforeupdate(vn, old){},
|
||||||
// type:null,
|
|
||||||
// dottype:null,
|
|
||||||
// // nested:false,
|
|
||||||
// text:'',
|
|
||||||
childs:[],
|
|
||||||
oninit(vn){
|
|
||||||
// // console.log('vn.attrs', vn.attrs);
|
|
||||||
// this.id = vn.attrs.id;
|
|
||||||
// this.type = vn.attrs.type;
|
|
||||||
// // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// this.dottype = vn.attrs.dottype;
|
|
||||||
},
|
|
||||||
onbeforeupdate(vn, old){
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// this.type = vn.attrs.type;
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
},
|
|
||||||
view(vn){
|
view(vn){
|
||||||
// return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type, 'dottype':this.dottype});
|
|
||||||
|
|
||||||
// if (typeof vn.attrs.childs === 'undefined'){
|
|
||||||
// debugger;
|
|
||||||
// }
|
|
||||||
return [
|
return [
|
||||||
m(_Dot, vn.attrs),
|
m(_Dot, vn.attrs),
|
||||||
// add children
|
// add children
|
||||||
typeof vn.attrs.childs !== 'undefined'
|
typeof vn.attrs.childs !== 'undefined'
|
||||||
? vn.attrs.childs.map(c => { return m(_Child, c); })
|
? vn.attrs.childs.map(c => {
|
||||||
|
c.lang = vn.attrs.lang;
|
||||||
|
c.level = vn.attrs.level + 1;
|
||||||
|
return m(_Child, c);
|
||||||
|
})
|
||||||
: null
|
: null
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -286,45 +261,19 @@ var _Child = {
|
|||||||
// / /___/ / / / /_/ / / / / /__/ __/
|
// / /___/ / / / /_/ / / / / /__/ __/
|
||||||
// /_____/_/ /_/\____/_/ /_/\___/\___/
|
// /_____/_/ /_/\____/_/ /_/\___/\___/
|
||||||
var _Enonce = {
|
var _Enonce = {
|
||||||
partid:null,
|
// oninit(vn){},
|
||||||
id:null,
|
// onbeforeupdate(vn, old) {},
|
||||||
title:null,
|
|
||||||
text:null,
|
|
||||||
dottype:null,
|
|
||||||
// nested:false,
|
|
||||||
childs:[],
|
|
||||||
oninit(vn){
|
|
||||||
// // // console.log('Enonce on init', vn);
|
|
||||||
// this.partid = vn.attrs.partid;
|
|
||||||
// this.id = vn.attrs.id;
|
|
||||||
// this.title = vn.attrs.title || "";
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
// this.childs = vn.attrs.childs || [];
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// this.dottype = vn.attrs.dottype;
|
|
||||||
},
|
|
||||||
onbeforeupdate(vn, old) {
|
|
||||||
// // console.log(vn.attrs.childs);
|
|
||||||
// this.title = vn.attrs.title || "";
|
|
||||||
// this.text = vn.attrs.text;
|
|
||||||
// this.childs = vn.attrs.childs || [];
|
|
||||||
// // this.nested = vn.attrs.nested || false;
|
|
||||||
// // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
|
|
||||||
// this.dottype = vn.attrs.dottype;
|
|
||||||
},
|
|
||||||
view(vn){
|
view(vn){
|
||||||
// if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
|
vn.attrs.level = 0;
|
||||||
return [
|
return [
|
||||||
// create dot
|
// create dot
|
||||||
// m(_Dot, {
|
|
||||||
// 'id':this.id
|
|
||||||
// 'text':this.text
|
|
||||||
// 'type':this.title
|
|
||||||
// 'dottype':this.dottype
|
|
||||||
// }),
|
|
||||||
m(_Dot, vn.attrs),
|
m(_Dot, vn.attrs),
|
||||||
// addd children
|
// addd children
|
||||||
vn.attrs.childs.map(c => { return m(_Child, c); })
|
vn.attrs.childs.map(c => {
|
||||||
|
c.lang = vn.attrs.lang;
|
||||||
|
c.level = 1;
|
||||||
|
return m(_Child, c);
|
||||||
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -339,15 +288,11 @@ var _Part = {
|
|||||||
oninit(vn){
|
oninit(vn){
|
||||||
this.id = vn.attrs.id;
|
this.id = vn.attrs.id;
|
||||||
this.title = vn.attrs.title || "";
|
this.title = vn.attrs.title || "";
|
||||||
this.enonces = vn.attrs.enonces;
|
|
||||||
},
|
},
|
||||||
onbeforeupdate(vn, old){
|
onbeforeupdate(vn, old){
|
||||||
// console.log('_Part, onbeforeupdate old',old);
|
|
||||||
this.title = vn.attrs.title || "";
|
this.title = vn.attrs.title || "";
|
||||||
this.enonces = vn.attrs.enonces;
|
|
||||||
},
|
},
|
||||||
view(vn){
|
view(vn){
|
||||||
// console.log(vn.attrs.enonces);
|
|
||||||
return m("section", {
|
return m("section", {
|
||||||
'id' :this.id,
|
'id' :this.id,
|
||||||
'class' :'part'
|
'class' :'part'
|
||||||
@@ -356,9 +301,9 @@ var _Part = {
|
|||||||
// create title node
|
// create title node
|
||||||
m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
|
m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
|
||||||
// create text node
|
// create text node
|
||||||
this.enonces.map(e => {
|
vn.attrs.enonces.map(e => {
|
||||||
// console.log(e.text);
|
// console.log(e.text);
|
||||||
// return m(_Enonce, Object.assign({"partid":this.id},e))
|
e.lang = vn.attrs.lang;
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "title":
|
case "title":
|
||||||
// handle titles
|
// handle titles
|
||||||
@@ -398,7 +343,6 @@ var _Intro = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ______ __ _
|
// ______ __ _
|
||||||
// / ____/___ ____ ____ ___ _____/ /_(_)___ ____ _____
|
// / ____/___ ____ ____ ___ _____/ /_(_)___ ____ _____
|
||||||
// / / / __ \/ __ \/ __ \/ _ \/ ___/ __/ / __ \/ __ \/ ___/
|
// / / / __ \/ __ \/ __ \/ _ \/ ___/ __/ / __ \/ __ \/ ___/
|
||||||
@@ -409,9 +353,13 @@ module.exports = {
|
|||||||
document.body.classList.add('mode-connections');
|
document.body.classList.add('mode-connections');
|
||||||
_Ui.init();
|
_Ui.init();
|
||||||
},
|
},
|
||||||
|
onbeforeupdate(vn, old){
|
||||||
|
console.log('Connection, onbeforeupdate old',old, 'vn',vn);
|
||||||
|
},
|
||||||
view(vn){
|
view(vn){
|
||||||
// console.log('_ModeConnections view', vn.attrs.lang);
|
console.log('_ModeConnections view', vn.attrs.lang);
|
||||||
return m('main', {id:"content", 'class':'mode-connections'}, _dbs.data[vn.attrs.lang].map(p => {
|
return m('main', {id:"content", 'class':'mode-connections'}, _dbs.data[vn.attrs.lang].map(p => {
|
||||||
|
p.lang = vn.attrs.lang;
|
||||||
if(p.id == 'intro'){
|
if(p.id == 'intro'){
|
||||||
return m(_Intro,p);
|
return m(_Intro,p);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
// /___/
|
// /___/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lang:'fr',
|
|
||||||
langs:[
|
langs:[
|
||||||
{
|
{
|
||||||
'lc':'lat',
|
'lc':'lat',
|
||||||
|
|||||||
Reference in New Issue
Block a user