diff --git a/index_3.2.html b/index_3.2.html index 69ec2d6..be4df2e 100644 --- a/index_3.2.html +++ b/index_3.2.html @@ -427,7 +427,7 @@
- Definisci il contesto: + Restringi il contesto di ricerca:
@@ -779,7 +779,7 @@ class="row tab-content border bg-lida10 m-0 p-0" id="cla-TabContent">
- Definisci i filtri usando le clausole e le condizioni logiche: + Definisci i filtri usando le clausole e le condizioni logiche aggiunte:
Mostra Opzioni'); + $('#collapseOptions').on('hidden.bs.collapse', function (e) { + if (e.target.id == "collapseOptions") { + $("#showOptions").html('Mostra Opzioni'); + }; }) $('#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 @@ -1187,10 +1191,10 @@ $(document).ready(function() { tabID = 0; $('#sortable0').html(emptyClaList); }; - + 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,19 +1230,20 @@ $(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 { + $("#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(); }; + });