contesti, in progress

This commit is contained in:
cesare 2023-12-14 10:36:45 +01:00
parent 036d1f5f28
commit 4545f129a5
1 changed files with 14 additions and 6 deletions

View File

@ -807,18 +807,23 @@ function buildFilterContextJson( contextcantiche) {
var contextfilter=[]
var cantichecontextfilter=[]
var cgroup=JSON.parse(contextgroup)
filters=JSON.parse(filtercontexttemplate)
cantichefilters=JSON.parse(filtercontextcantichetemplate)
//var contextfilter=[]
//var cantichecontextfilter=[]
//var cgroup=JSON.parse(contextgroup)
//filters=JSON.parse(filtercontexttemplate)
//cantichefilters=JSON.parse(filtercontextcantichetemplate)
var canticheliteral=['Inferno', 'Purgatorio', 'Paradiso']
for (var ky in contextcantiche){
for (var ky in contextcantiche){
var contextfilter=[]
var cantichecontextfilter=[]
var cgroup=JSON.parse(contextgroup)
if(contextcantiche.hasOwnProperty(ky)){
console.log(`test ${ky} : ${contextcantiche[ky]}`)
var cfilter=JSON.parse(canticacontexttemplate);
cfilter['value']=canticheliteral[ky-1]
cantichecontextfilter.push(cfilter)
for (var kval in contextcantiche[ky]){
@ -829,7 +834,10 @@ function buildFilterContextJson( contextcantiche) {
}
}
if (contextfilter.length>0){
var filters=JSON.parse(filtercontexttemplate)
var cantichefilters=JSON.parse(filtercontextcantichetemplate)
filters['expression']['args'].push(contextfilter)
//resfilters.push(filters)
cgroup.patterns.splice(0,0,filters)
cantichefilters['expression']['args'].push(cantichecontextfilter)