ottimizzato codice

This commit is contained in:
cesare 2024-02-12 15:33:37 +01:00
parent 698bb099d9
commit 3fe867261d
2 changed files with 6 additions and 5 deletions

View File

@ -1408,7 +1408,7 @@ function resetFrasi(){
alert('Digitare una stringa da cercare')
return
}
if (jsonQuery['Clausola0']['lemma_forma'] == 'testo') {
if (jsonQuery['Clausola0']['lemma_forma'] == 'testo' && jsonQuery['Clausola0']['Attiva'] == 1) {
searchwords = jsonQuery['Clausola0']['queryText'].trim().split(' ')
var contesto = JSON.parse(jsonQuery['Clausola0']['contesto'])
var inf = []
@ -1470,6 +1470,10 @@ function resetFrasi(){
for (var ip=0; ip<=limit; ip++){
var fnd=true
if(cont.length && !cont.includes(parseInt(forme[ip].split('_')[1]))){
fnd=false;
break
}
for (var frind=0; frind<testo.length; frind++){
if (testo[frind].toLowerCase()!=forme[ip+frind].split('_')[0].toLowerCase()){
fnd=false;
@ -1478,10 +1482,7 @@ function resetFrasi(){
}
if (fnd){
//console.log('ipfound: '+forme[ip].split('_')[2]+' - '+forme[(ip+testo.length-1)].split('_')[2])
if(cont.length && !cont.includes(parseInt(forme[ip].split('_')[1]))){
continue
}
resultsInCantica.push(cantica)
resultsInCanto.push(cantica+'Canto '+forme[ip].split('_')[1])
var tstar= parseInt(forme[ip].split('_')[2])

View File

@ -459,7 +459,7 @@ function buildSQ(stquery) {
}
if (stquery['Clausola0']['queryText'] != "") {
if (stquery['Clausola0']['queryText'] != "" && stquery['Clausola0']['Attiva'] == 1) {
searchtext = stquery['Clausola0']['queryText']
let strval = searchtext
if (stquery['Clausola0']['lemma_forma'] == 'testo'){