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="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 class="col p-0">
<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"
id="cla-TabContent">
<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
class="col-12 tab-pane fade show active px-1 py-2"

View File

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