fixed summary, fix dot dot title on filtred, fixed breadcrumb translation

This commit is contained in:
2018-11-03 17:31:47 +01:00
parent 4a3e6f2379
commit def5176164
13 changed files with 292 additions and 338 deletions
+34 -30
View File
@@ -5,6 +5,7 @@
// / (__ ) /_/ / / / /
// __/ /____/\____/_/ /_/
// /___/
var _i18n = require('./i18n');
module.exports = {
langs:[
@@ -38,42 +39,42 @@ module.exports = {
data_strct:{},
rx_id:/^(\d)(app|agd|\d\d|pr|ad|ap|c|p|d|a)(cd|sc|\d\d|d|c|a|l|p|\d)?(e|\d|sc)?(d|c|a|sc)?$/,
id_strct:[
{full:'Partie',dim:'Part.'},
{full:'partie',dim:'part.'},
{
'prop':{full:'Proposition', dim:'Prop.'}, // \d\d
'app' :{full:'Appendice', dim:'App.'},
'agd' :{full:'Definition generale des affections'},
'pr' :{full:'Preface', dim:'Pref.'},
'ad' :{full:'Definiton des affections'},
'ap' :{full:'Appendice', dim:'App.'},
'c' :{full:'Corollaire', dim:'Cor.'},
'p' :{full:'Postulat', dim:'Post.'},
'd' :{full:'Definition', dim:'Def.'},
'a' :{full:'Axiome', dim:'Ax.'},
'prop':{full:'proposition', dim:'prop.'}, // \d\d
'app' :{full:'appendice', dim:'app.'},
'agd' :{full:'def-gen-affect'},
'pr' :{full:'preface', dim:'pref.'},
'ad' :{full:'def-affect'},
'ap' :{full:'appendice', dim:'app.'},
'c' :{full:'corollaire', dim:'cor.'},
'p' :{full:'postulat', dim:'post.'},
'd' :{full:'definition', dim:'def.'},
'a' :{full:'axiom', dim:'ax.'},
},
{
// \d\d
// \d
'cd' :{full:'Corollaire Demonstration'},
'sc' :{full:'Scolie', dim:'Scol.'},
'd' :{full:'Demonstration', dim:'Demo.'},
'c' :{full:'Corollaire', dim:'Cor.'},
'a' :{full:'Axiome', dim:'Ax.'},
'l' :{full:'Lemme', dim:'Lem.'},
'p' :{full:'Postulat', dim:'Post.'},
'e' :{full:'Explication', dim:'Exp.'},
'cd' :{full:'corollaire-demo'},
'sc' :{full:'scolie', dim:'scol.'},
'd' :{full:'demonstration', dim:'demo.'},
'c' :{full:'corollaire', dim:'cor.'},
'a' :{full:'axiom', dim:'ax.'},
'l' :{full:'lemme', dim:'lem.'},
'p' :{full:'postulat', dim:'post.'},
'e' :{full:'explication', dim:'exp.'},
},
{
// \d
'e' :{full:'Explication', dim:'Exp.'},
'sc' :{full:'Scolie', dim:'Scol.'},
'c' :{full:'Corollaire', dim:'Cor.'},
'e' :{full:'explication', dim:'exp.'},
'sc' :{full:'scolie', dim:'scol.'},
'c' :{full:'corollaire', dim:'cor.'},
},
{
'd' :{full:'Demonstration', dim:'Demo.'},
'c' :{full:'Corollaire', dim:'Cor.'},
'a' :{full:'Axiome', dim:'Ax.'},
'sc' :{full:'Scolie', dim:'Scol.'},
'd' :{full:'demonstration', dim:'demo.'},
'c' :{full:'corollaire', dim:'cor.'},
'a' :{full:'axiom', dim:'ax.'},
'sc' :{full:'scolie', dim:'scol.'},
}
],
// loading progress
@@ -154,6 +155,8 @@ module.exports = {
this.data_byid[l] = {};
this.data_bytype[l] = {};
this.types[l] = [];
_i18n.setLang(l);
// loop through parts
for (let p in this.data[l]) {
if(this.data[l][p].type !== "intro"){
@@ -249,13 +252,14 @@ module.exports = {
breadcrumb_array.unshift(`${this.id_strct[i]['dim']} ${m_clean[i]}`);
}else{
// display mode
mode = i !== m_clean.length-1 ? 'dim' : 'full';
if(isNaN(m_clean[i])){ // if not a number we get the label
breadcrumb_array.unshift(`${this.id_strct[i][m_clean[i]][mode]}`);
// mode = i !== m_clean.length-1 ? 'dim' : 'full';
mode = 'full';
if(typeof m_clean[i] !== 'undefined' && isNaN(m_clean[i])){ // if not a number we get the label
breadcrumb_array.unshift(_i18n.t(`${this.id_strct[i][m_clean[i]][mode]}`));
// breadcrumb_array.splice(1, 0, `${m_clean[i]}`);
}else{ // if its a number
if(i == 1){ // we just add the number to the breadcrumb preceded by 'Proposition'
breadcrumb_array.unshift(`${this.id_strct[i]['prop'][mode]} ${m_clean[i]}`);
breadcrumb_array.unshift(_i18n.t(`${this.id_strct[i]['prop'][mode]}`) + ` ${m_clean[i]}`);
}else{ // we just add the number to the breadcrumb behind the last added item
// breadcrumb_array.unshift(`${m_clean[i]}`);
// debugger;