fixe language bug in dots
This commit is contained in:
Vendored
+27
-12
@@ -3232,9 +3232,9 @@ var _Dot = {
|
|||||||
opened:false,
|
opened:false,
|
||||||
links:null,
|
links:null,
|
||||||
parents:[],
|
parents:[],
|
||||||
oninit: function(vn){
|
lang:_dbs.lang,
|
||||||
this.id = vn.attrs.id;
|
setuptext:function(vn){
|
||||||
this.type = vn.attrs.type;
|
// console.log('setuptext', vn);
|
||||||
|
|
||||||
// construct text
|
// construct text
|
||||||
this.text = markdown.render(vn.attrs.text);
|
this.text = markdown.render(vn.attrs.text);
|
||||||
@@ -3246,6 +3246,13 @@ var _Dot = {
|
|||||||
this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
|
this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
|
||||||
this.summary = markdown.renderInline(this.summary) + " …";
|
this.summary = markdown.renderInline(this.summary) + " …";
|
||||||
|
|
||||||
|
},
|
||||||
|
oninit: function(vn){
|
||||||
|
this.id = vn.attrs.id;
|
||||||
|
this.type = vn.attrs.type;
|
||||||
|
|
||||||
|
this.setuptext(vn);
|
||||||
|
|
||||||
if(typeof vn.attrs.active !== 'undefined')
|
if(typeof vn.attrs.active !== 'undefined')
|
||||||
this.active = vn.attrs.active;
|
this.active = vn.attrs.active;
|
||||||
|
|
||||||
@@ -3268,6 +3275,11 @@ var _Dot = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onbeforeupdate: function(vn){
|
onbeforeupdate: function(vn){
|
||||||
|
// console.log('onbeforeupdate');
|
||||||
|
if(this.lang != _dbs.lang){
|
||||||
|
this.lang = _dbs.lang;
|
||||||
|
this.setuptext(vn);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
view: function(vn){
|
view: function(vn){
|
||||||
if (this.active && this.opened) {
|
if (this.active && this.opened) {
|
||||||
@@ -3278,15 +3290,17 @@ var _Dot = {
|
|||||||
this.links.to.length
|
this.links.to.length
|
||||||
? m('nav', {'class':'links to'}, this.links.to.map(function(id){
|
? m('nav', {'class':'links to'}, this.links.to.map(function(id){
|
||||||
// console.log(id);
|
// console.log(id);
|
||||||
return m(_Dot, {
|
if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
|
||||||
"id":id,
|
return m(_Dot, {
|
||||||
'text':_dbs.data_byid[_dbs.lang][id].text,
|
"id":id,
|
||||||
'type':'',
|
'text':_dbs.data_byid[_dbs.lang][id].text,
|
||||||
// passe the memory of crossed dots plus the current one
|
'type':'',
|
||||||
'parents':vn.state.parents.concat([vn.state.id]),
|
// passe the memory of crossed dots plus the current one
|
||||||
// activate link only if not in parents (already went through it)
|
'parents':vn.state.parents.concat([vn.state.id]),
|
||||||
'active':vn.state.parents.indexOf(id) == -1 ? true:false
|
// activate link only if not in parents (already went through it)
|
||||||
});
|
'active':vn.state.parents.indexOf(id) == -1 ? true:false
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
@@ -3348,6 +3362,7 @@ var _Dot = {
|
|||||||
m('p', {
|
m('p', {
|
||||||
'class':'summary',
|
'class':'summary',
|
||||||
onclick:function(e){
|
onclick:function(e){
|
||||||
|
// TODO: animate openening (text and links separatly)
|
||||||
vn.state.opened = true;
|
vn.state.opened = true;
|
||||||
}
|
}
|
||||||
}, m.trust(this.summary))
|
}, m.trust(this.summary))
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+27
-12
@@ -25,9 +25,9 @@ var _Dot = {
|
|||||||
opened:false,
|
opened:false,
|
||||||
links:null,
|
links:null,
|
||||||
parents:[],
|
parents:[],
|
||||||
oninit: function(vn){
|
lang:_dbs.lang,
|
||||||
this.id = vn.attrs.id;
|
setuptext:function(vn){
|
||||||
this.type = vn.attrs.type;
|
// console.log('setuptext', vn);
|
||||||
|
|
||||||
// construct text
|
// construct text
|
||||||
this.text = markdown.render(vn.attrs.text);
|
this.text = markdown.render(vn.attrs.text);
|
||||||
@@ -39,6 +39,13 @@ var _Dot = {
|
|||||||
this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
|
this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
|
||||||
this.summary = markdown.renderInline(this.summary) + " …";
|
this.summary = markdown.renderInline(this.summary) + " …";
|
||||||
|
|
||||||
|
},
|
||||||
|
oninit: function(vn){
|
||||||
|
this.id = vn.attrs.id;
|
||||||
|
this.type = vn.attrs.type;
|
||||||
|
|
||||||
|
this.setuptext(vn);
|
||||||
|
|
||||||
if(typeof vn.attrs.active !== 'undefined')
|
if(typeof vn.attrs.active !== 'undefined')
|
||||||
this.active = vn.attrs.active;
|
this.active = vn.attrs.active;
|
||||||
|
|
||||||
@@ -61,6 +68,11 @@ var _Dot = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onbeforeupdate: function(vn){
|
onbeforeupdate: function(vn){
|
||||||
|
// console.log('onbeforeupdate');
|
||||||
|
if(this.lang != _dbs.lang){
|
||||||
|
this.lang = _dbs.lang;
|
||||||
|
this.setuptext(vn);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
view: function(vn){
|
view: function(vn){
|
||||||
if (this.active && this.opened) {
|
if (this.active && this.opened) {
|
||||||
@@ -71,15 +83,17 @@ var _Dot = {
|
|||||||
this.links.to.length
|
this.links.to.length
|
||||||
? m('nav', {'class':'links to'}, this.links.to.map(function(id){
|
? m('nav', {'class':'links to'}, this.links.to.map(function(id){
|
||||||
// console.log(id);
|
// console.log(id);
|
||||||
return m(_Dot, {
|
if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
|
||||||
"id":id,
|
return m(_Dot, {
|
||||||
'text':_dbs.data_byid[_dbs.lang][id].text,
|
"id":id,
|
||||||
'type':'',
|
'text':_dbs.data_byid[_dbs.lang][id].text,
|
||||||
// passe the memory of crossed dots plus the current one
|
'type':'',
|
||||||
'parents':vn.state.parents.concat([vn.state.id]),
|
// passe the memory of crossed dots plus the current one
|
||||||
// activate link only if not in parents (already went through it)
|
'parents':vn.state.parents.concat([vn.state.id]),
|
||||||
'active':vn.state.parents.indexOf(id) == -1 ? true:false
|
// activate link only if not in parents (already went through it)
|
||||||
});
|
'active':vn.state.parents.indexOf(id) == -1 ? true:false
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
@@ -141,6 +155,7 @@ var _Dot = {
|
|||||||
m('p', {
|
m('p', {
|
||||||
'class':'summary',
|
'class':'summary',
|
||||||
onclick:function(e){
|
onclick:function(e){
|
||||||
|
// TODO: animate openening (text and links separatly)
|
||||||
vn.state.opened = true;
|
vn.state.opened = true;
|
||||||
}
|
}
|
||||||
}, m.trust(this.summary))
|
}, m.trust(this.summary))
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
rsync -rvc index.html CT-figli-deb9-lamp:www/ethica-spinoza.net/public_html/
|
rsync -rvc --delete-before \
|
||||||
rsync -rvc assets/dist CT-figli-deb9-lamp:www/ethica-spinoza.net/public_html/assets/
|
index.html \
|
||||||
rsync -rvc assets/jsondb CT-figli-deb9-lamp:www/ethica-spinoza.net/public_html/assets/
|
CT-figli-deb9-lamp:www/ethica-spinoza.net/public_html/
|
||||||
|
|
||||||
|
rsync -rvc --delete-before \
|
||||||
|
assets/dist \
|
||||||
|
CT-figli-deb9-lamp:www/ethica-spinoza.net/public_html/assets/
|
||||||
|
|
||||||
|
rsync -rvc --delete-before \
|
||||||
|
assets/jsondb \
|
||||||
|
CT-figli-deb9-lamp:www/ethica-spinoza.net/public_html/assets/
|
||||||
|
|||||||
Reference in New Issue
Block a user