modfica funzioni caricamento iniziale

This commit is contained in:
cesare 2022-12-16 11:55:34 +01:00
parent e86f6e2f25
commit cc767c9735
1 changed files with 69 additions and 41 deletions

View File

@ -306,12 +306,18 @@ $(document).ready(function() {
containerForme = formeseconda containerForme = formeseconda
const endlc = performance.now(); const endlc = performance.now();
console.log(`Load `+cantica+` time: ${endlc - start} ms`); console.log(`Load `+cantica+` time: ${endlc - start} ms`);
for (cmpItem of containerForme) { for (var cmpItem of containerForme) {
formaItem = cmpItem.split("_") formaItem = cmpItem.split("_")
//listaCanti = createDivCanti(listaCanti, cantica, 'Canto ' + formaItem[1]) //createDivVerso(cantica, num, canto, forma, catgram, pos)
//var forma = new Object() if (! setVersi.has(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])){
setVersi = createDivVersi(setVersi, cantica, formaItem[3], 'Canto_' + formaItem[1]) createDivVerso(cantica, formaItem[3], 'Canto_' + formaItem[1], formaItem[0], formaItem[4], formaItem[2])
createSpanFormeNew(cantica, 'Canto_' + formaItem[1], formaItem[3], formaItem[0], formaItem[4], formaItem[2]) setVersi.add(cantica+ "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])
}
else{
//setVersi = createDivVersi(setVersi, cantica, formaItem[3], 'Canto_' + formaItem[1])
createSpanFormeNew(cantica, 'Canto_' + formaItem[1], formaItem[3], formaItem[0], formaItem[4], formaItem[2])
}
/* /*
forma.numverso = formaItem[3]; forma.numverso = formaItem[3];
forma.canto = 'Canto ' + formaItem[1]; forma.canto = 'Canto ' + formaItem[1];
@ -374,6 +380,28 @@ $(document).ready(function() {
} }
} }
function createDivVerso(cantica, num, canto, forma, catgram, pos) {
var elementoverso = $('<p />')
elementoverso.append(num + ". ")
elementoverso.attr("style", "line-height: 0.5em")
elementoverso.attr('class', 'f6 text-secondary text-nowrap font-weight-lighter')
elementoverso.attr('id', cantica + "_" + canto + "_" + num)
var spanoccorrenza = $('<span />')
var pos = parseInt(pos)
spanoccorrenza.attr('id', cantica + "_" + canto+ "_" + num + "_" + pos)
spanoccorrenza.attr('data-cg', catgram)
spanoccorrenza.append(forma+" ")
spanoccorrenza.appendTo(elementoverso)
elementoverso.appendTo('#' + cantica + canto)
}
/* /*
function createDivCanti(orderedListaCanti, cantica, canto) { function createDivCanti(orderedListaCanti, cantica, canto) {
if (orderedListaCanti.has(canto)) { if (orderedListaCanti.has(canto)) {
@ -523,41 +551,41 @@ coniugazione=[1|2|3|4|5]? {switch(parseInt(text())){
case(3): return ' Terza coniugazione'; case(3): return ' Terza coniugazione';
case(4): return ' Ausiliare essere' case(4): return ' Ausiliare essere'
case(5): return ' Ausiliare avere'}} case(5): return ' Ausiliare avere'}}
modotempo=modo:"ip" {return('Presente indicativo')}/ modotempo=modo:"ip" {return(' Presente indicativo')}/
"ib" {return("Passato Prossimo Indicativo")}/ "ib" {return(" Passato Prossimo Indicativo")}/
"ii" {return("Imperfetto Indicativo")}/ "ii" {return(" Imperfetto Indicativo")}/
"ir" {return("Passato Remoto Indicativo")}/ "ir" {return(" Passato Remoto Indicativo")}/
"is" {return( "Trapassato Prossimo Indicativo")}/ "is" {return( " Trapassato Prossimo Indicativo")}/
"it" {return( "Trapassato Remoto Indicativo")}/ "it" {return( " Trapassato Remoto Indicativo")}/
"if" {return("Futuro Semplice Indicativo")}/ "if" {return(" Futuro Semplice Indicativo")}/
"ia" {return("Futuro Anteriore Indicativo")}/ "ia" {return(" Futuro Anteriore Indicativo")}/
"cp" {return( "Presente Congiuntivo")}/ "cp" {return( " Presente Congiuntivo")}/
"ci" {return( "Imperfetto Congiuntivo")}/ "ci" {return( " Imperfetto Congiuntivo")}/
"cr" {return( "Passato Congiuntivo")}/ "cr" {return( " Passato Congiuntivo")}/
"ct" {return( "Trapassato Congiuntivo")}/ "ct" {return( " Trapassato Congiuntivo")}/
"dp" {return( "Presente Condizionale")}/ "dp" {return( " Presente Condizionale")}/
"dr" {return( "Passato Condizionale")}/ "dr" {return( " Passato Condizionale")}/
"mp" {return( "Presente Imperativo")}/ "mp" {return( " Presente Imperativo")}/
"fp" {return( "Presente Infinito")}/ "fp" {return( " Presente Infinito")}/
"fr" {return( "Passato Infinito")}/ "fr" {return( " Passato Infinito")}/
"pp" {return( "Presente Participio")}/ "pp" {return( " Presente Participio")}/
"pr" {return( "Passato Participio")}/ "pr" {return( " Passato Participio")}/
"gp" {return( "Presente Gerundio")}/ "gp" {return( " Presente Gerundio")}/
"gr" {return( "Passato Gerundio")}/ "gr" {return( " Passato Gerundio")}/
"pf" {return( "Participio Futuro")} "pf" {return( " Participio Futuro")}
persona="s1" {return('Prima persona singolare')}/ persona="s1" {return(' Prima persona singolare')}/
"s2" {return('Seconda persona singolare')}/ "s2" {return(' Seconda persona singolare')}/
"s3" {return('Terza persona singolare')}/ "s3" {return(' Terza persona singolare')}/
"p1" {return('Prima persona plurale')}/ "p1" {return(' Prima persona plurale')}/
"p2" {return('Seconda persona plurale')}/ "p2" {return(' Seconda persona plurale')}/
"p3" {return('Terza persona plurale')} "p3" {return(' Terza persona plurale')}
funzione="a" {return('Verbo Funzione Aggettivo')}/ funzione="a" {return(' Verbo Funzione Aggettivo')}/
"sm" {return('Verbo Funzione Sostantivo maschile')}/ "sm" {return(' Verbo Funzione Sostantivo maschile')}/
"sf" {return('Verbo Funzione Sostantivo femminile')}/ "sf" {return(' Verbo Funzione Sostantivo femminile')}/
"b" {return('Verbo Funzione Avverbio')}/ "b" {return(' Verbo Funzione Avverbio')}/
"l" {return('Verbo Funzione Locuzione')} "l" {return(' Verbo Funzione Locuzione')}
declinazione=[1|2|3|4|5] {switch(parseInt(text())){ declinazione=[1|2|3|4|5] {switch(parseInt(text())){
@ -571,9 +599,9 @@ genere=[f|m] {if (text()=='f') return ' Femminile'; else if (text()=='m') return
numero=[s|p] {if (text()=='s') return ' Singolare'; else if (text()=='p') return ' Plurale';} numero=[s|p] {if (text()=='s') return ' Singolare'; else if (text()=='p') return ' Plurale';}
grado="c+" {return('Grado c+ singolare')}/ grado="c+" {return(' Grado c+ singolare')}/
"c-" {return('Grado c-')}/ "c-" {return(' Grado c-')}/
"c=" {return('Grado c=')} "c=" {return(' Grado c=')}
Integer "integer" Integer "integer"
= _ [0-9]+ { return parseInt(text(), 10); } = _ [0-9]+ { return parseInt(text(), 10); }