This commit is contained in:
nicola 2022-12-22 16:02:22 +01:00
commit 3bcff38d0e
2 changed files with 24 additions and 19 deletions

View File

@ -427,7 +427,7 @@
<div class="row no-gutters px-2 pt-0 pb-2 border rounded bg-lida10"> <div class="row no-gutters px-2 pt-0 pb-2 border rounded bg-lida10">
<div class="col-12 pb-2 pt-0"> <div class="col-12 pb-2 pt-0">
<span class="small text-muted align-bottom" >Definisci il contesto:</span> <span class="small text-muted align-bottom" >Restringi il contesto di ricerca:</span>
</div> </div>
<div class="col p-0"> <div class="col p-0">
<div id="selectable0" class="ui-selectable ui-widget ui-helper-clearfix"> <div id="selectable0" class="ui-selectable ui-widget ui-helper-clearfix">
@ -779,7 +779,7 @@
class="row tab-content border bg-lida10 m-0 p-0" class="row tab-content border bg-lida10 m-0 p-0"
id="cla-TabContent"> id="cla-TabContent">
<div class="col-12"> <div class="col-12">
<span class="small text-muted align-bottom pr-2" id="tipoRicerca">Definisci i filtri usando le clausole e le condizioni logiche:</span> <span class="small text-muted align-bottom pr-2" id="tipoRicerca">Definisci i filtri usando le clausole e le condizioni logiche aggiunte:</span>
</div> </div>
<div <div
class="col-12 tab-pane fade show active px-1 py-2" class="col-12 tab-pane fade show active px-1 py-2"

View File

@ -55,8 +55,10 @@ $(document).ready(function() {
$("#collapseAdvanced").collapse('show'); $("#collapseAdvanced").collapse('show');
}) })
$('#collapseOptions').on('hidden.bs.collapse', function () { $('#collapseOptions').on('hidden.bs.collapse', function (e) {
$("#showOptions").html('<span class="small">Mostra Opzioni</span>'); if (e.target.id == "collapseOptions") {
$("#showOptions").html('<span class="small">Mostra Opzioni</span>');
};
}) })
$('#collapseOptions').on('shown.bs.collapse', function () { $('#collapseOptions').on('shown.bs.collapse', function () {
@ -227,9 +229,9 @@ $(document).ready(function() {
$(this).text("Seleziona i canti:") $(this).text("Seleziona i canti:")
});; });;
$("#contextText" + claIdNum).html("Tutta l'opera"); $("#contextText" + claIdNum).html("Tutta l'opera");
eval("window.context" + claIdNum + " = [[],[],[]]"); window["context" + claIdNum] = [[],[],[]];
eval("queryJson.Clausola" + claIdNum + ".contesto = jsonContext0"); eval("queryJson.Clausola" + claIdNum + ".contesto = jsonContext0");
$('#selectable' + claIdNum + " .show").removeClass( "show" ); $('#selectable' + claIdNum + " .show").removeClass("show");
}); });
// Evento: click sull'icona di add del contesto // Evento: click sull'icona di add del contesto
@ -242,7 +244,7 @@ $(document).ready(function() {
eval('window.context' + claIdNum + '[$(this).attr("id").substring(0,1)][$(this).attr("id").substring(2)] = 1'); eval('window.context' + claIdNum + '[$(this).attr("id").substring(0,1)][$(this).attr("id").substring(2)] = 1');
}); });
}; };
eval("var context = window.context" + claIdNum); var context = window["context" + claIdNum];
parseContext(claIdNum); parseContext(claIdNum);
hideContextCanti(claIdNum); hideContextCanti(claIdNum);
if ($(this).closest('.card').find('span:visible').length == 1) { if ($(this).closest('.card').find('span:visible').length == 1) {
@ -521,6 +523,8 @@ $(document).ready(function() {
queryJson.Clausola1.contesto = context0; queryJson.Clausola1.contesto = context0;
const myEngine = new Comunica.QueryEngine(); const myEngine = new Comunica.QueryEngine();
const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commediaontosintgra/query"; const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commediaontosintgra/query";
const jsonReplacer = (key, value) =>
typeof value === 'undefined' ? 0 : value;
// Fine variabili // Fine variabili
@ -1189,8 +1193,8 @@ $(document).ready(function() {
}; };
function parseContext(claIdNum) { function parseContext(claIdNum) {
var context = eval("window.context" + claIdNum) var context = window["context" + claIdNum];
var jsonContext = JSON.stringify(context); var jsonContext = JSON.stringify(context, jsonReplacer);
eval("queryJson.Clausola" + claIdNum + ".contesto = jsonContext"); eval("queryJson.Clausola" + claIdNum + ".contesto = jsonContext");
var contextStringParts = ["","",""]; var contextStringParts = ["","",""];
var contextString = []; var contextString = [];
@ -1207,7 +1211,7 @@ $(document).ready(function() {
rangeHolderE = j; rangeHolderE = j;
}; };
} else { } else {
if (rangeHolderE > 0) { if (rangeHolderE >= 0) {
if ( rangeHolderS == rangeHolderE) { if ( rangeHolderS == rangeHolderE) {
lastElem = (rangeHolderE+1); lastElem = (rangeHolderE+1);
} else { } else {
@ -1226,20 +1230,21 @@ $(document).ready(function() {
}; };
}; };
rangeHolderS = 0; rangeHolderS = 0;
rangeHolderE = 0; rangeHolderE = -1;
if (contextStringParts[i] != "") { if (contextStringParts[i] != "") {
contextStringParts[i] = contextStringParts[i] + "]" contextStringParts[i] = contextStringParts[i] + "]"
contextString.push(contextStringParts[i]); contextString.push(contextStringParts[i]);
} }
if (contextString.toString() != "") {
$("#contextText" + claIdNum).html(contextString.toString());
} else {
$("#contextText" + claIdNum).html("Tutta l'opera");
}
//return contextString.toString();
}; };
if (contextString.toString() != "") {
$("#contextText" + claIdNum).html(contextString.toString());
} else {
$("#contextText" + claIdNum).html("Tutta l'opera");
}
//return contextString.toString();
}; };
}); });