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
+17 -4
View File
@@ -775,7 +775,8 @@ header {
margin: 0 0 0 70px; }
main#content {
margin-top: 5em; }
margin-top: 5em;
margin-bottom: 3em; }
main#content section.part {
position: relative;
margin-bottom: 2em; }
@@ -785,13 +786,18 @@ section.intro {
h1.part-title {
font-size: 1.8em;
margin: 0 0 0 70px;
padding-bottom: 0.5em;
margin: 0 0 0.3em 70px;
padding: 0.5em 0 0.2em;
font-weight: normal;
letter-spacing: 0.3em; }
letter-spacing: 0.3em;
display: inline-block;
border-bottom: 1px solid black;
white-space: nowrap; }
h1.part-title em {
font-size: 0.7em;
letter-spacing: normal; }
h1.part-title > em:first-of-type {
display: block; }
h2.title {
font-size: 1.2em;
@@ -921,6 +927,7 @@ main#content.mode-text .opened-link .close-link-btn {
border: 1px solid white;
width: 550px; }
.dot > span.title {
text-transform: capitalize;
padding: 0 0.6em 0 0; }
.dot.opened > span.title {
display: block; }
@@ -931,6 +938,11 @@ main#content.mode-text .opened-link .close-link-btn {
opacity: 0;
transition: opacity 0.4s ease-in-out;
max-width: 475px; }
.dot > p.summary a {
color: inherit;
text-decoration: none;
font-weight: bold;
pointer-events: none; }
.dot.preface .title {
display: none; }
.dot.preface p.summary {
@@ -1015,6 +1027,7 @@ main#content.mode-text .opened-link .close-link-btn {
font-size: 16px; }
footer {
height: 3em;
position: fixed;
bottom: 0;
background-color: white;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@
{
"index": 1,
"id": "P1",
"title": "_Primeira Parte_, SOBRE DEUS.",
"title": "_Primeira Parte,_ SOBRE DEUS.",
"enonces": [
{
"title":"DEFINIÇÕES",
@@ -726,7 +726,7 @@
{
"index": 2,
"id": "p2",
"title": "_Segunda Parte_, SOBRE _a Natureza e a Origem da_ MENTE.",
"title": "_Segunda Parte,_ SOBRE _a Natureza e a Origem da_ MENTE.",
"enonces": [
{
"id": "2pr",
@@ -1853,7 +1853,7 @@
{
"index": 3,
"id": "p3",
"title": "_Terceira Parte_, SOBRE _a Origem e a Natureza dos_ AFETOS.",
"title": "_Terceira Parte,_ SOBRE _a Origem e a Natureza dos_ AFETOS.",
"enonces": [
{
"id": "3pr",
@@ -3366,7 +3366,7 @@
{
"index": 4,
"id": "P4",
"title": "_Quarta Parte_, SOBRE a Servidão Humana, _nou_ sobre a FORÇA dos Afetos",
"title": "_Quarta Parte,_ SOBRE a Servidão Humana, _nou_ sobre a FORÇA dos Afetos",
"enonces": [
{
"id": "4pr",
@@ -4810,7 +4810,7 @@
{
"index": 5,
"id": "P5",
"title": "_Parte Quinta_, _SOBRE a Potência do Intelecto, _ou_ sobre a Liberdade Humana.",
"title": "_Parte Quinta,_ SOBRE a Potência do Intelecto, _ou_ sobre a Liberdade Humana.",
"enonces": [
{
"id": "5pr",
+5 -5
View File
@@ -7,7 +7,7 @@
{
"index": 1,
"id": "p1",
"title": "_Part I._ CONCERNING GOD.",
"title": "_Part I,_ CONCERNING GOD.",
"enonces": [
{
"title":"DEFINITIONS",
@@ -726,7 +726,7 @@
{
"index": 2,
"id": "p2",
"title": "_Part II_, OF _the Nature and Origin of_ THE MIND",
"title": "_Part II,_ OF _the Nature and Origin of_ THE MIND",
"enonces": [
{
"id": "2pr",
@@ -1858,7 +1858,7 @@
{
"index": 3,
"id": "p3",
"title": "_Part III_, ON _the Origin and Nature of the_ EMOTIONS.",
"title": "_Part III,_ ON _the Origin and Nature of the_ EMOTIONS.",
"enonces": [
{
"id": "3pr",
@@ -3372,7 +3372,7 @@
{
"index": 4,
"id": "p4",
"title": "_Part IV_, OF Human Bondage, _or_ the STRENGTH of the Emotions.",
"title": "_Part IV,_ OF Human Bondage, _or_ the STRENGTH of the Emotions.",
"enonces": [
{
"id": "4pr",
@@ -4785,7 +4785,7 @@
{
"index": 5,
"id": "p5",
"title": "_Part V_, OF the Power of the Understanding, _or_ of Human Freedom.",
"title": "_Part V,_ OF the Power of the Understanding, _or_ of Human Freedom.",
"enonces": [
{
"id": "5pr",
+4 -4
View File
@@ -726,7 +726,7 @@
{
"index": 2,
"id": "p2",
"title": "_Deuxième Partie_, DE _la Nature et de l'Origine de_ L'ÂME.",
"title": "_Deuxième Partie,_ DE _la Nature et de l'Origine de_ L'ÂME.",
"enonces": [
{
"id": "2pr",
@@ -1853,7 +1853,7 @@
{
"index": 3,
"id": "p3",
"title": "_Troisième Partie_, DE _l'Origine et de la Nature des_ AFFECTIONS.",
"title": "_Troisième Partie,_ DE _l'Origine et de la Nature des_ AFFECTIONS.",
"enonces": [
{
"id": "3pr",
@@ -3366,7 +3366,7 @@
{
"index": 4,
"id": "p4",
"title": "_Quatrième Partie_, DE la Servitude de l'Homme _ou_ des FORCES des Affections.",
"title": "_Quatrième Partie,_ DE la Servitude de l'Homme _ou_ des FORCES des Affections.",
"enonces": [
{
"id": "4pr",
@@ -4779,7 +4779,7 @@
{
"index": 5,
"id": "p5",
"title": "_Cinquième Partie_, DE la Puissance de l'Entendement _ou_ de la Liberté de l'Homme.",
"title": "_Cinquième Partie,_ DE la Puissance de l'Entendement _ou_ de la Liberté de l'Homme.",
"enonces": [
{
"id": "5pr",
@@ -722,7 +722,7 @@
{
"index": 2,
"id": "p2",
"title": "_Pars Secunda_, DE _Naturâ, & Origine_ MENTIS.",
"title": "_Pars Secunda,_ DE _Naturâ, & Origine_ MENTIS.",
"enonces": [
{
"id": "2pr",
@@ -1852,7 +1852,7 @@
{
"index": 3,
"id": "p3",
"title": "_Pars Tertia_, DE _Origine & Naturâ_ AFFECTUUM.",
"title": "_Pars Tertia,_ DE _Origine & Naturâ_ AFFECTUUM.",
"enonces": [
{
"id": "3pr",
@@ -3365,7 +3365,7 @@
{
"index": 4,
"id": "p4",
"title": "_Pars Quarta_, DE Servitute Humanâ, _seu de_ Affectuum VIRIBUS.",
"title": "_Pars Quarta,_ DE Servitute Humanâ, _seu de_ Affectuum VIRIBUS.",
"enonces": [
{
"id": "4pr",
@@ -4778,7 +4778,7 @@
{
"index": 5,
"id": "p5",
"title": "_Pars Quinta_, DE Potentiâ Intellectûs, _seu de_ Libertate Humanâ.",
"title": "_Pars Quinta,_ DE Potentiâ Intellectûs, _seu de_ Libertate Humanâ.",
"enonces": [
{
"id": "5pr",
+23 -2
View File
@@ -22,6 +22,7 @@ html, body{
}
$header_height:5em;
$footer_height:3em;
$dot_w:550px;
$bullet_w:40px;
$margin_left:50px + ($bullet_w/2);
@@ -195,6 +196,7 @@ header{
main#content{
margin-top: $header_height;
margin-bottom: $footer_height;
// margin: 5em;
// width: 450px;
// &>*{
@@ -227,14 +229,21 @@ section.intro{
h1.part-title{
font-size: 1.8em;
margin:0 0 0 $margin_left;
padding-bottom: 0.5em;
margin:0 0 0.3em $margin_left;
padding: 0.5em 0 0.2em;
font-weight: normal;
letter-spacing: 0.3em;
display: inline-block;
// border-top: 1px solid black;
border-bottom: 1px solid black;
white-space:nowrap;
em{
font-size: 0.7em;
letter-spacing: normal;
}
&>em:first-of-type{
display: block;
}
}
h2.title{
@@ -472,6 +481,7 @@ main#content.mode-connections{
// font-kerning: none;
// }
>span.title{
text-transform: capitalize;
padding: 0 0.6em 0 0;
}
&.opened>span.title{
@@ -486,6 +496,16 @@ main#content.mode-connections{
opacity: 0;
transition: opacity 0.4s ease-in-out;
max-width : $dot_w - $margin_left -5px;
// width: 200px;
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
a{
color: inherit;
text-decoration: none;
font-weight: bold;
pointer-events: none;
}
}
&.preface{
.title{display: none;}
@@ -636,6 +656,7 @@ main#content.mode-connections{
footer{
height: $footer_height;
position: fixed;
bottom: 0;
background-color: white;
+9 -3
View File
@@ -51,7 +51,10 @@ var _Dot = {
// remove img
this.summary = this.text.replace(/!\[[^\]]+\]\([^\)]+\)/g, "");
// get portion of text
this.summary = this.summary.match('([^ ]*[ ]{0,1}){1,6}')[0];
// this.summary = this.summary.match('([^ ]*[ ]{0,1}){1,6}')[0];
// https://stackoverflow.com/questions/5454235/shorten-string-without-cutting-words-in-javascript
// this.summary = this.summary.replace(/^(.{18}[^\s]*).*/, "$1");
this.summary = this.summary.substr(0, this.summary.lastIndexOf(' ', 30));
// end underscores (italic) splited by summarizing
this.summary = this.summary.trim().replace(/_([^_]+)$/g, "_$1_");
// remove brackets (links) splited by summarizing
@@ -161,7 +164,7 @@ var _Dot = {
}//, m('span') // , m.trust("🗙")
),
// Title
m('span', {'class':'title'}, m.trust(this.nested ? this.breadcrumb : this.title)),
m('span', {'class':'title'}, m.trust(this.nested || _dbs.active_type_filter ? this.breadcrumb : this.title)),
// full text
m('section', {
'class':'text',
@@ -207,7 +210,7 @@ var _Dot = {
onclick(e){
if(!vn.state.opened) vn.state.opened = 1;
}
}, m.trust(this.nested ? this.breadcrumb : this.title)),
}, m.trust(this.nested || _dbs.active_type_filter ? this.breadcrumb : this.title)),
m('p', {
'class':'summary',
onclick(e){
@@ -315,6 +318,9 @@ var _Part = {
e.lang = vn.attrs.lang;
switch (e.type) {
case "title":
// if(_dbs.active_type_filter){
// console.log('filter:', _dbs.active_type_filter, 'title:',e.title);
// }
// handle titles
return !_dbs.active_type_filter
? m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)))
+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;
+48
View File
@@ -63,6 +63,12 @@ module.exports = {
'bra':'definições',
'lat':'definitione'
},
'def.':{
'en':'def.',
'fr':'def.',
'bra':'def.',
'lat':'def.'
},
'explication':{
'en':'explanation',
'fr':'explication',
@@ -75,24 +81,48 @@ module.exports = {
'bra':'axioma',
'lat':'axiomata'
},
'ax.':{
'en':'ax.',
'fr':'ax.',
'bra':'ax.',
'lat':'ax.'
},
'proposition':{
'en':'proposition',
'fr':'proposition',
'bra':'proposiçaõ',
'lat':'propositio'
},
'prop.':{
'en':'prop.',
'fr':'prop.',
'bra':'prop.',
'lat':'prop.'
},
'demonstration':{
'en':'demonstration',
'fr':'demonstration',
'bra':'demonstraçaõ',
'lat':'demonstratio'
},
'demo.':{
'en':'demo.',
'fr':'demo.',
'bra':'demo.',
'lat':'demo.'
},
'corollaire':{
'en':'corollary',
'fr':'corollaire',
'bra':'corolário',
'lat':'corollarium'
},
'cor.':{
'en':'cor.',
'fr':'cor.',
'bra':'cor.',
'lat':'cor.'
},
'prop-axiom':{
'en':'prop-axiom',
'fr':'prop-axiom',
@@ -105,6 +135,12 @@ module.exports = {
'bra':'escólio',
'lat':'scholium'
},
'scol.':{
'en':'schol.',
'fr':'scol.',
'bra':'escól.',
'lat':'schol.'
},
'appendice':{
'en':'appendix',
'fr':'appendice',
@@ -129,6 +165,12 @@ module.exports = {
'bra':'lema',
'lat':'lemma'
},
'lem.':{
'en':'lem.',
'fr':'lem.',
'bra':'lem.',
'lat':'lem.'
},
'lemme-demonstration':{
'en':'lemma-demo',
'fr':'lemme-demo',
@@ -153,6 +195,12 @@ module.exports = {
'bra':'postulado',
'lat':'postulata'
},
'post.':{
'en':'post.',
'fr':'post.',
'bra':'post.',
'lat':'post.'
},
'def-affect':{
'en':'definitions of the emotions',
'fr':'définitions des affections',