@@ -1928,9 +1924,9 @@
- - Nessuna
- clausola aggiunta.
+ clausola aggiunta. -->
diff --git a/js/script_4.8.js b/js/script_4.8.js
index 3cf9872..d1c127f 100644
--- a/js/script_4.8.js
+++ b/js/script_4.8.js
@@ -159,6 +159,9 @@ $(document).ready(function() {
$("#collapseLogic").collapse('show');
});
});
+ tabID++;
+ addGramCla("#sortable0", 1, tabID, 1);
+ $('#collapseLogic').attr('style', "display: d-flex;");
});
$('#searchSimple').on('click', function() {
@@ -293,7 +296,10 @@ $(document).ready(function() {
$('#tipogrammaticaleN').attr('style', "display: d-flex;");
$('#spanContenenti').attr('style', "display: d-flex;");
$('#tiposintatticoN').attr('style', "display: d-flex;");
- $('#cercaRiferimenti').attr('style', "display: none;");
+ $('#cercaRiferimenti').attr('style', "display: none;");
+ $("#contextDiv0").attr('style', "display: none");
+ $('#collapseLogic').attr('style', "display: d-flex;");
+
break;
case "riferimenti":
$('#cercaRiferimenti').attr('style', "display: d-flex;");
@@ -301,6 +307,8 @@ $(document).ready(function() {
$('#tipogrammaticaleN').attr('style', "display: none;");
$('#tiposintatticoN').attr('style', "display: none");
$('#spanContenenti').attr('style', "display: none;");
+ $('#collapseLogic').attr('style', "display: none;");
+ $("#contextDiv0").attr('style', "display: d-flex;");
break;
}
});
@@ -371,41 +379,16 @@ $(document).ready(function() {
$('#btnAddAnd').on('click', function() {
tabID++;
- addGramCla("#sortable0", 1, tabID, 1);
+ addGramCla("#sortable0", 1, tabID, 1,1);
$('#collapseLogic').attr('style', "display: d-flex;");
$("#unitaRicerca").prop('disabled',true);
- });
- // Evento: click sulla lista di clausole nel dropbox "Aggiungi clausola di tipo:" o "aggiungi condizione logica:"
- $('.addCCbtn').on('click', function() {
- var addCC = $(this).attr('id');
- $('#collapseLogic').show();
-
- switch (addCC) {
- case "btnAddCla1":
- tabID++;
- addGramCla("#sortable0", 1, tabID, 1);
- numberOfQueries++;
- break;
- case "btnAddCla2":
- tabID++;
- addSyntCla("#sortable0", 1, tabID, 1);
- numberOfQueries++;
- break;
- case "btnAddCla3":
- tabID++;
- addMetaCla("#sortable0", 0, tabID, 0);
- break;
- case "btnAddCond":
- addLogicCond("#sortable0", "OR");
- break;
- default:
- // $('#collapseLogic').hide();
- break;
- };
- refreshClaList();
- refreshSortables();
- });
-
+ });
+ $('#btnAddOr').on('click', function() {
+ tabID++;
+ addGramCla("#sortable0", 1, tabID, 1,2);
+ $('#collapseLogic').attr('style', "display: d-flex;");
+ $("#unitaRicerca").prop('disabled',true);
+ });
// Evento: clausola spostata nella lista
$('#sortable0').sortable({
opacity: 0.6,
@@ -804,14 +787,15 @@ $(document).ready(function() {
// Funzione di creazione del tab delle clausole grammaticali
- function addGramCla(sortableId, active, tabID, toExpand) {
+ function addGramCla(sortableId, active, tabID, toExpand, cond = 9999) {
if (active > 0) {
var checkInsert = ' checked="checked"';
} else {
var checkInsert = '';
};
- var claText = "Categoria grammaticale:
";
- addLIitem(sortableId, tabID, claText, checkInsert, toExpand);
+
+ var claText = ""; //Categoria grammaticale:
";
+ addLIitem(sortableId, tabID, claText, checkInsert, toExpand, cond);
var claClone = $("#grammaticaEsintassi").clone(true);
claClone.attr("id", "cla" + tabID);
claClone.attr("data-claActive", active);
@@ -824,7 +808,7 @@ $(document).ready(function() {
$('#cla' + tabID + " #queryTextN").attr("id", "queryText" + tabID);
$('#cla' + tabID + " #opzioni_testoN").attr("id", "opzioni_testo" + tabID);
$('#cla' + tabID + " #contextDivN").attr("id", "contextDiv" + tabID);
-
+ $("#contextDiv0").attr('style', "display: none");
addClaContext(tabID);
}
@@ -938,46 +922,6 @@ $(document).ready(function() {
};
}
- // Funzione di creazione del tab delle clausole sintattiche
- function addSyntCla(sortableId, active, tabID, toExpand) {
- if (active > 0) {
- var checkInsert = ' checked="checked"';
- } else {
- var checkInsert = '';
- };
- var claText = "Tipo sintattico:
";
- addLIitem(sortableId, tabID, claText, checkInsert, toExpand);
- var claClone = document.getElementById("tiposintatticoN").cloneNode(true);
-
- claClone.setAttribute("id", "cla" + tabID);
- claClone.setAttribute("data-claActive", active);
- claClone.setAttribute("aria-labelledby", "cla" + tabID + "-tab");
- claClone.setAttribute("style", "");
- $('#claBody' + tabID).append(claClone);
- $('#cla' + tabID + " #lemma_formaN").attr("id", "lemma_forma" + tabID);
- $('#cla' + tabID + " #queryTextN").attr("id", "queryText" + tabID);
- $('#cla' + tabID + " #opzioni_testoN").attr("id", "opzioni_testo" + tabID);
- $('#cla' + tabID + " #contextDivN").attr("id", "contextDiv" + tabID);
- addClaContext(tabID);
- }
-
- // Funzione di creazione del tab delle clausole metafore
- function addMetaCla(sortableId, active, tabID, toExpand) {
- var checkInsert = ' disabled';
- //if (active > 0) {
- // var checkInsert = '" checked="checked"';
- //} else {
- // var checkInsert = '"';
- //};
- var claText = "Clausola Metafore - non ancora implementata";
- addLIitem(sortableId, tabID, claText, checkInsert, toExpand);
- var claClone = document.getElementById("tipometaforaN").cloneNode(true);
- claClone.setAttribute("id", "cla" + tabID);
- claClone.setAttribute("data-claActive", active);
- claClone.setAttribute("aria-labelledby", "cla" + tabID + "-tab");
- claClone.setAttribute("style", "");
- $('#claBody' + tabID).append(claClone);
- }
// Funzione di creazione della parte di definizione del contesto delle clausole
function addClaContext(tabID) {
@@ -986,6 +930,8 @@ $(document).ready(function() {
contClone = contClone.outerHTML.replace(/xX0/g, "xX" + tabID);
contClone = contClone.replace(/-secondary/g, "-success");
contClone = contClone.replace(/sel-canto/g, "sel-canto suxess");
+
+
$("#contextDiv" + tabID).append($(contClone)[0]);
resetContext(tabID);
$("#selectable-xX" + tabID).selectable({
@@ -1028,7 +974,7 @@ $(document).ready(function() {
}
// Funzione di creazione del LI di una clausola nella lista sortable
- function addLIitem(sortableId, tabID, claText, checkInsert, toExpand) {
+ function addLIitem(sortableId, tabID, claText, checkInsert, toExpand, cond = 9999) {
claListLen++;
var cloneLI = document.getElementById("li-claxX1Xx").cloneNode(true);
cloneLI.setAttribute("style", "opacity: 0.1;");
@@ -1038,6 +984,14 @@ $(document).ready(function() {
if (checkInsert == ' disabled') {
cloneLI = cloneLI.replace(/claCollBtn/g, "claCollBtn " + checkInsert);
};
+ var boolCond = $('
')
+ switch (cond){
+ case 1: boolCond.append("AND");
+ break;
+ case 2: boolCond.append("OR");
+ break;
+ }
+ $(sortableId).append(boolCond)
$(sortableId).append($(cloneLI)[0]);
if (toExpand == 1) {
$("#claCollapse" + tabID).focus();
@@ -1094,7 +1048,7 @@ $(document).ready(function() {
$("#cla-defaultCond").remove();
} else {
if ($('#cla-defaultCond').length == 0) {
- $("#cla-list-row").prepend($(defaultCond));
+ //$("#cla-list-row").prepend($(defaultCond));
}
};
}