Load query da disco funzionante, bug selezione contesto risolti
This commit is contained in:
parent
a4b05de3f4
commit
9dfe860b8a
|
@ -1637,6 +1637,15 @@
|
||||||
<div class="border bg-light well m-0" id="contextDivN"></div>
|
<div class="border bg-light well m-0" id="contextDivN"></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- FINE TIPO SINTATTICO -->
|
<!-- FINE TIPO SINTATTICO -->
|
||||||
|
<!-- TIPO METAFORA -->
|
||||||
|
|
||||||
|
<div style="display: none;"
|
||||||
|
class="col-12 tab-pane px-0 bg-white border-top" id="tipometaforaN"
|
||||||
|
role="tabpanel" aria-labelledby="claN-tab"
|
||||||
|
data-claType="Metafora" data-claActive="1">
|
||||||
|
</div>
|
||||||
|
<!-- FINE TIPO METAFORA -->
|
||||||
|
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
<ul>
|
<ul>
|
||||||
<!-- LI CLAUSOLA -->
|
<!-- LI CLAUSOLA -->
|
||||||
|
|
132
js/script_3.3.js
132
js/script_3.3.js
|
@ -1,6 +1,5 @@
|
||||||
/**
|
/**
|
||||||
*unita' di ricerca:
|
*
|
||||||
verso discorso periodo frase metafora sintagma lemma forma
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* necessari per il bundle:
|
/* necessari per il bundle:
|
||||||
|
@ -114,7 +113,7 @@ $(document).ready(function() {
|
||||||
handle: ".handle"
|
handle: ".handle"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Inizializza selectable-xX0 e definisce le funzioni
|
// Inizializza selectable-xX0 e definisce le funzioni
|
||||||
$("#selectable-xX0").selectable({
|
$("#selectable-xX0").selectable({
|
||||||
filter: ".sel-canto",
|
filter: ".sel-canto",
|
||||||
selected: function(event, ui) {
|
selected: function(event, ui) {
|
||||||
|
@ -180,18 +179,18 @@ $(document).ready(function() {
|
||||||
switch (addCC) {
|
switch (addCC) {
|
||||||
case "btnAddCla1":
|
case "btnAddCla1":
|
||||||
tabID++;
|
tabID++;
|
||||||
addGramCla(1,tabID);
|
addGramCla("#sortable0",1,tabID,1);
|
||||||
break;
|
break;
|
||||||
case "btnAddCla2":
|
case "btnAddCla2":
|
||||||
tabID++;
|
tabID++;
|
||||||
addSyntCla(1,tabID);
|
addSyntCla("#sortable0",1,tabID,1);
|
||||||
break;
|
break;
|
||||||
case "btnAddCla3":
|
case "btnAddCla3":
|
||||||
tabID++;
|
tabID++;
|
||||||
addMetaCla(0,tabID);
|
addMetaCla("#sortable0",0,tabID,0);
|
||||||
break;
|
break;
|
||||||
case "btnAddCond":
|
case "btnAddCond":
|
||||||
addLogicCond("OR","#sortable0");
|
addLogicCond("#sortable0","OR");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
};
|
};
|
||||||
|
@ -306,6 +305,7 @@ $(document).ready(function() {
|
||||||
var tabPaneId = ($(this).closest('.tab-pane').attr("id"));
|
var tabPaneId = ($(this).closest('.tab-pane').attr("id"));
|
||||||
var selectedValue = $(this).val();
|
var selectedValue = $(this).val();
|
||||||
addCatgramSubcla(tabPaneId,selectedValue);
|
addCatgramSubcla(tabPaneId,selectedValue);
|
||||||
|
refreshClaList();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Evento: Submit form
|
// Evento: Submit form
|
||||||
|
@ -507,8 +507,6 @@ $(document).ready(function() {
|
||||||
const defaultCond = '<div id="cla-defaultCond" class="col-12 px-0 pb-1 small font-weight-bold text-muted">Clausole e condizioni in AND di default</div>';
|
const defaultCond = '<div id="cla-defaultCond" class="col-12 px-0 pb-1 small font-weight-bold text-muted">Clausole e condizioni in AND di default</div>';
|
||||||
const canticheList = ["Inferno","Purgatorio","Paradiso"];
|
const canticheList = ["Inferno","Purgatorio","Paradiso"];
|
||||||
const cla0JsonText = '{"queryText": "", "lemma_forma": "lemma", "opzioni_testo": "parola", "TipoClausola": "0", "Attiva": "0"}';
|
const cla0JsonText = '{"queryText": "", "lemma_forma": "lemma", "opzioni_testo": "parola", "TipoClausola": "0", "Attiva": "0"}';
|
||||||
const newGramJsonText = '{"queryText": "", "lemma_forma": "forma", "opzioni_testo": "parola", "TipoClausola": "Grammaticale", "Attiva": "1", "typeGramm0": "all"}';
|
|
||||||
const newSyntJsonText = '{"queryText": "", "lemma_forma": "forma", "opzioni_testo": "parola", "TipoClausola": "Sintattico", "Attiva": "1", "typeSyntax0": ".+", "functionSyntax": ".+"}';
|
|
||||||
const condLIplaceholderText1 = 'Trascina qui almeno 1 clausola o condizione';
|
const condLIplaceholderText1 = 'Trascina qui almeno 1 clausola o condizione';
|
||||||
const condLIplaceholderText2 = 'Trascina qui almeno 2 clausole o condizioni';
|
const condLIplaceholderText2 = 'Trascina qui almeno 2 clausole o condizioni';
|
||||||
const condLIplaceholderText1d = 'Trascina qui almeno 1 clausola o condizione, oppure attiva le clausole inattive';
|
const condLIplaceholderText1d = 'Trascina qui almeno 1 clausola o condizione, oppure attiva le clausole inattive';
|
||||||
|
@ -532,8 +530,6 @@ $(document).ready(function() {
|
||||||
queryJson.Clausola0 = JSON.parse(cla0JsonText);
|
queryJson.Clausola0 = JSON.parse(cla0JsonText);
|
||||||
queryJson.Clausola0.contesto = JSON.stringify(contextEmpty);
|
queryJson.Clausola0.contesto = JSON.stringify(contextEmpty);
|
||||||
window.context0 = JSON.parse(JSON.stringify(contextEmpty));
|
window.context0 = JSON.parse(JSON.stringify(contextEmpty));
|
||||||
//const myEngine = new Comunica.QueryEngine();
|
|
||||||
//const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commediaontosintgra/query";
|
|
||||||
const jsonReplacer = (key, value) =>
|
const jsonReplacer = (key, value) =>
|
||||||
typeof value === 'undefined' ? 0 : value;
|
typeof value === 'undefined' ? 0 : value;
|
||||||
|
|
||||||
|
@ -612,15 +608,14 @@ $(document).ready(function() {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Funzione di creazione del tab delle clausole grammaticali
|
// Funzione di creazione del tab delle clausole grammaticali
|
||||||
function addGramCla(active,tabID){
|
function addGramCla(sortableId,active,tabID,toExpand){
|
||||||
if (active > 0) {
|
if (active > 0) {
|
||||||
var checkInsert = ' checked="checked"';
|
var checkInsert = ' checked="checked"';
|
||||||
} else {
|
} else {
|
||||||
var checkInsert = '';
|
var checkInsert = '';
|
||||||
};
|
};
|
||||||
var sortableId = "#sortable0";
|
|
||||||
var claText = "Categoria grammaticale: <br>";
|
var claText = "Categoria grammaticale: <br>";
|
||||||
addLIitem(sortableId,tabID,claText,checkInsert);
|
addLIitem(sortableId,tabID,claText,checkInsert,toExpand);
|
||||||
var claClone = document.getElementById("tipogrammaticaleN").cloneNode(true);
|
var claClone = document.getElementById("tipogrammaticaleN").cloneNode(true);
|
||||||
claClone.setAttribute("id","cla" + tabID);
|
claClone.setAttribute("id","cla" + tabID);
|
||||||
claClone.setAttribute("data-claActive", active);
|
claClone.setAttribute("data-claActive", active);
|
||||||
|
@ -633,7 +628,6 @@ $(document).ready(function() {
|
||||||
$('#cla' + tabID + " #queryTextN").attr("id","queryText" + tabID);
|
$('#cla' + tabID + " #queryTextN").attr("id","queryText" + tabID);
|
||||||
$('#cla' + tabID + " #opzioni_testoN").attr("id","opzioni_testo" + tabID);
|
$('#cla' + tabID + " #opzioni_testoN").attr("id","opzioni_testo" + tabID);
|
||||||
$('#cla' + tabID + " #contextDivN").attr("id","contextDiv" + tabID);
|
$('#cla' + tabID + " #contextDivN").attr("id","contextDiv" + tabID);
|
||||||
queryJson["Clausola" + tabID] = JSON.parse(newGramJsonText);
|
|
||||||
addClaContext(tabID);
|
addClaContext(tabID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,7 +682,6 @@ $(document).ready(function() {
|
||||||
rbfieldset.appendTo(element);
|
rbfieldset.appendTo(element);
|
||||||
var iconR = $(iconReset);
|
var iconR = $(iconReset);
|
||||||
iconR.appendTo(element);
|
iconR.appendTo(element);
|
||||||
//element.attr('style', 'display:block');
|
|
||||||
element.appendTo(dettagliBox);
|
element.appendTo(dettagliBox);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -714,7 +707,6 @@ $(document).ready(function() {
|
||||||
label1.appendTo(flexdiv1);
|
label1.appendTo(flexdiv1);
|
||||||
flexdiv1.appendTo(rbfieldset);
|
flexdiv1.appendTo(rbfieldset);
|
||||||
rbfieldset.appendTo(element);
|
rbfieldset.appendTo(element);
|
||||||
//element.attr('style', 'display:block');
|
|
||||||
element.appendTo(dettagliBox);
|
element.appendTo(dettagliBox);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -731,7 +723,6 @@ $(document).ready(function() {
|
||||||
seloption.appendTo(select);
|
seloption.appendTo(select);
|
||||||
}
|
}
|
||||||
select.appendTo(element);
|
select.appendTo(element);
|
||||||
//element.attr('style', 'display:block');
|
|
||||||
element.appendTo(dettagliBox);
|
element.appendTo(dettagliBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -739,20 +730,18 @@ $(document).ready(function() {
|
||||||
if (element) {
|
if (element) {
|
||||||
element.attr('style', "display: block;");
|
element.attr('style', "display: block;");
|
||||||
element.appendTo(dettagliBox);
|
element.appendTo(dettagliBox);
|
||||||
refreshClaList();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione di creazione del tab delle clausole sintattiche
|
// Funzione di creazione del tab delle clausole sintattiche
|
||||||
function addSyntCla(active,tabID){
|
function addSyntCla(sortableId,active,tabID,toExpand){
|
||||||
if (active > 0) {
|
if (active > 0) {
|
||||||
var checkInsert = ' checked="checked"';
|
var checkInsert = ' checked="checked"';
|
||||||
} else {
|
} else {
|
||||||
var checkInsert = '';
|
var checkInsert = '';
|
||||||
};
|
};
|
||||||
var sortableId = "#sortable0";
|
|
||||||
var claText = "Tipo sintattico: <br>";
|
var claText = "Tipo sintattico: <br>";
|
||||||
addLIitem(sortableId,tabID,claText,checkInsert);
|
addLIitem(sortableId,tabID,claText,checkInsert,toExpand);
|
||||||
var claClone = document.getElementById("tiposintatticoN").cloneNode(true);
|
var claClone = document.getElementById("tiposintatticoN").cloneNode(true);
|
||||||
claClone.setAttribute("id","cla" + tabID);
|
claClone.setAttribute("id","cla" + tabID);
|
||||||
claClone.setAttribute("data-claActive",active);
|
claClone.setAttribute("data-claActive",active);
|
||||||
|
@ -763,21 +752,25 @@ $(document).ready(function() {
|
||||||
$('#cla' + tabID + " #queryTextN").attr("id","queryText" + tabID);
|
$('#cla' + tabID + " #queryTextN").attr("id","queryText" + tabID);
|
||||||
$('#cla' + tabID + " #opzioni_testoN").attr("id","opzioni_testo" + tabID);
|
$('#cla' + tabID + " #opzioni_testoN").attr("id","opzioni_testo" + tabID);
|
||||||
$('#cla' + tabID + " #contextDivN").attr("id","contextDiv" + tabID);
|
$('#cla' + tabID + " #contextDivN").attr("id","contextDiv" + tabID);
|
||||||
queryJson["Clausola" + tabID] = JSON.parse(newSyntJsonText);
|
|
||||||
addClaContext(tabID);
|
addClaContext(tabID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione di creazione del tab delle clausole metafore
|
// Funzione di creazione del tab delle clausole metafore
|
||||||
function addMetaCla(active,tabID){
|
function addMetaCla(sortableId,active,tabID,toExpand){
|
||||||
var checkInsert = ' disabled';
|
var checkInsert = ' disabled';
|
||||||
//if (active > 0) {
|
//if (active > 0) {
|
||||||
// var checkInsert = '" checked="checked"';
|
// var checkInsert = '" checked="checked"';
|
||||||
//} else {
|
//} else {
|
||||||
// var checkInsert = '"';
|
// var checkInsert = '"';
|
||||||
//};
|
//};
|
||||||
var sortableId = "#sortable0";
|
|
||||||
var claText = "Clausola Metafore - non ancora implementata";
|
var claText = "Clausola Metafore - non ancora implementata";
|
||||||
addLIitem(sortableId,tabID,claText,checkInsert);
|
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", "background-color: #edf9f3 !important;");
|
||||||
|
$('#claBody' + tabID).append(claClone);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione di creazione della parte di definizione del contesto delle clausole
|
// Funzione di creazione della parte di definizione del contesto delle clausole
|
||||||
|
@ -799,7 +792,7 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Funzione di creazione del LI delle condizioni logiche
|
// Funzione di creazione del LI delle condizioni logiche
|
||||||
function addLogicCond(condtype,sortableId){
|
function addLogicCond(sortableId,condtype){
|
||||||
condListLen++;
|
condListLen++;
|
||||||
var cloneLI = document.getElementById("condxX4Xx").cloneNode(true);
|
var cloneLI = document.getElementById("condxX4Xx").cloneNode(true);
|
||||||
cloneLI.removeAttribute("style");
|
cloneLI.removeAttribute("style");
|
||||||
|
@ -828,7 +821,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione di creazione del LI di una clausola nella lista sortable
|
// Funzione di creazione del LI di una clausola nella lista sortable
|
||||||
function addLIitem(sortableId,tabID,claText,checkInsert){
|
function addLIitem(sortableId,tabID,claText,checkInsert,toExpand){
|
||||||
claListLen++;
|
claListLen++;
|
||||||
var cloneLI = document.getElementById("li-claxX1Xx").cloneNode(true);
|
var cloneLI = document.getElementById("li-claxX1Xx").cloneNode(true);
|
||||||
cloneLI.setAttribute("style", "opacity: 0.1;");
|
cloneLI.setAttribute("style", "opacity: 0.1;");
|
||||||
|
@ -836,8 +829,10 @@ $(document).ready(function() {
|
||||||
cloneLI = cloneLI.replace(/xX2Xx/g, claText)
|
cloneLI = cloneLI.replace(/xX2Xx/g, claText)
|
||||||
cloneLI = cloneLI.replace(/xX3Xx"/g, tabID + '" ' + checkInsert)
|
cloneLI = cloneLI.replace(/xX3Xx"/g, tabID + '" ' + checkInsert)
|
||||||
$(sortableId).append($(cloneLI)[0]);
|
$(sortableId).append($(cloneLI)[0]);
|
||||||
$("#claCollapse" + tabID).focus();
|
if (toExpand == 1){
|
||||||
$("#claCollapse" + tabID).trigger("click");
|
$("#claCollapse" + tabID).focus();
|
||||||
|
$("#claCollapse" + tabID).trigger("click");
|
||||||
|
}
|
||||||
$("#li-cla" + tabID).fadeTo(1000,1);
|
$("#li-cla" + tabID).fadeTo(1000,1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -949,7 +944,7 @@ $(document).ready(function() {
|
||||||
if ($("#" + claListItemId)[0]) {
|
if ($("#" + claListItemId)[0]) {
|
||||||
$("#" + claListItemId + " .clatext").replaceWith('<span class="small clatext">' + claText + '</span>');
|
$("#" + claListItemId + " .clatext").replaceWith('<span class="small clatext">' + claText + '</span>');
|
||||||
} else {
|
} else {
|
||||||
addLIitem(sortableId,claIdNum,claText,checkInsert);
|
addLIitem(sortableId,claIdNum,claText,checkInsert,0);
|
||||||
};
|
};
|
||||||
queryJson["Clausola" + claIdNum] = JSON.parse(jsonTextToParse + '}');
|
queryJson["Clausola" + claIdNum] = JSON.parse(jsonTextToParse + '}');
|
||||||
queryJson["Clausola" + claIdNum].contesto = JSON.stringify(window["context" + claIdNum]);
|
queryJson["Clausola" + claIdNum].contesto = JSON.stringify(window["context" + claIdNum]);
|
||||||
|
@ -1027,6 +1022,8 @@ $(document).ready(function() {
|
||||||
if ($(placeholderID).length) {
|
if ($(placeholderID).length) {
|
||||||
$(placeholderID).remove();
|
$(placeholderID).remove();
|
||||||
};
|
};
|
||||||
|
$(iconSpan).attr("class","iconClClass NOremoveCond");
|
||||||
|
$(iconDiv).attr("class","p-0 mr-3 mt-1 text-right text-muted");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($(placeholderID).length) {
|
if ($(placeholderID).length) {
|
||||||
|
@ -1125,21 +1122,26 @@ $(document).ready(function() {
|
||||||
// -------------------
|
// -------------------
|
||||||
// Pulizia ricerca avanzata:
|
// Pulizia ricerca avanzata:
|
||||||
resetAdvGui();
|
resetAdvGui();
|
||||||
console.log(queryJson);
|
// Imposta checkbox: .attr("checked", true)
|
||||||
// Imposta checkbox:
|
|
||||||
if (queryJson["QueryAvanzata"] == 1) {
|
if (queryJson["QueryAvanzata"] == 1) {
|
||||||
$("#cla-Advanced").attr('style', "display: block;");
|
$("#cla-Advanced").attr('style', "display: block;");
|
||||||
$("#advanSW").prop("checked", true);
|
$("#searchToggle").prop("checked", true);
|
||||||
} else {
|
} else {
|
||||||
$("#cla-Advanced").attr('style', "display: none;");
|
$("#cla-Advanced").attr('style', "display: none;");
|
||||||
$("#advanSW").prop("checked", false);
|
$("#searchToggle").prop("checked", false);
|
||||||
};
|
};
|
||||||
// Rigenerazione Clausola0:
|
// Rigenerazione Clausola0:
|
||||||
if (queryJson["Clausola0"].Attiva) {
|
if (queryJson["Clausola0"].Attiva) {
|
||||||
$("#cla0 #lemma_forma").val(queryJson["Clausola0"].lemma_forma);
|
$("#queryText").val(queryJson["Clausola0"].queryText);
|
||||||
$("#cla0 #queryText").val(queryJson["Clausola0"].queryText);
|
$("#opzioni_testo").val(queryJson["Clausola0"].opzioni_testo);
|
||||||
$("#cla0 #opzioni_testo").val(queryJson["Clausola0"].opzioni_testo);
|
var qText = queryJson["Clausola0"].queryText;
|
||||||
|
if (qText !== null && qText !== '') {qText = ' "' + qText + '"';}
|
||||||
|
setLemmaForma(qText,queryJson["Clausola0"].lemma_forma);
|
||||||
|
resetContext(0);
|
||||||
|
window.context0 = JSON.parse(queryJson.Clausola0.contesto);
|
||||||
|
parseContext(0);
|
||||||
};
|
};
|
||||||
|
$("#unitaRicerca").val(queryJson.unitaRicerca);
|
||||||
// Generazione lista clausole e condizioni con elementi padre:
|
// Generazione lista clausole e condizioni con elementi padre:
|
||||||
guiLogicString = queryJson.LogicaGui;
|
guiLogicString = queryJson.LogicaGui;
|
||||||
var clau2Make = "";
|
var clau2Make = "";
|
||||||
|
@ -1169,8 +1171,11 @@ $(document).ready(function() {
|
||||||
claParent.push([guiLogicString[i].replace("Clausola", ""), treeLevel[treeLevel.length - 1]]);
|
claParent.push([guiLogicString[i].replace("Clausola", ""), treeLevel[treeLevel.length - 1]]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
$(claParent).each(function(){ // rigenero le clausole nei tab PRIMA, per poter POI ricostruire la lista nel tab principale
|
$(claParent).each(function(){
|
||||||
var itm = $(this)[0]
|
var itm = $(this)[0]
|
||||||
|
if ($(this)[0] == "OR" || $(this)[0] == "AND") {
|
||||||
|
addLogicCond($(this)[1],$(this)[0]);
|
||||||
|
}
|
||||||
if (itm != "OR" && itm != "AND") {
|
if (itm != "OR" && itm != "AND") {
|
||||||
clau2Make = queryJson["Clausola" + itm].TipoClausola;
|
clau2Make = queryJson["Clausola" + itm].TipoClausola;
|
||||||
active = queryJson["Clausola" + itm].Attiva
|
active = queryJson["Clausola" + itm].Attiva
|
||||||
|
@ -1178,12 +1183,15 @@ $(document).ready(function() {
|
||||||
switch (clau2Make) {
|
switch (clau2Make) {
|
||||||
case "Grammaticale":
|
case "Grammaticale":
|
||||||
selectedValue = queryJson["Clausola" + itm].typeGramm0;
|
selectedValue = queryJson["Clausola" + itm].typeGramm0;
|
||||||
addGramCla(active,tabID);
|
addGramCla($(this)[1],active,tabID,0);
|
||||||
|
$("#lemma_forma" + tabID).val(queryJson["Clausola" + itm].lemma_forma);
|
||||||
|
$("#queryText" + tabID).val(queryJson["Clausola" + itm].queryText);
|
||||||
|
$("#opzioni_testo" + tabID).val(queryJson["Clausola" + itm].opzioni_testo);
|
||||||
if (selectedValue != "all") {
|
if (selectedValue != "all") {
|
||||||
$("#cla" + tabID + " .catgram").val(selectedValue);
|
$("#grammtypes" + tabID).val(selectedValue);
|
||||||
addCatgramSubcla("cla" + tabID, selectedValue);
|
addCatgramSubcla("cla" + tabID, selectedValue);
|
||||||
var ks = Object.keys(queryJson["Clausola" + itm]);
|
var ks = Object.keys(queryJson["Clausola" + itm]);
|
||||||
for (var j = 5; j < ks.length; j++) {
|
for (var j = 6; j < ks.length - 1; j++) {
|
||||||
var melID = "cla" + tabID + ks[j];
|
var melID = "cla" + tabID + ks[j];
|
||||||
var melement = document.getElementById(melID);
|
var melement = document.getElementById(melID);
|
||||||
switch (melement.type) {
|
switch (melement.type) {
|
||||||
|
@ -1198,35 +1206,36 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
window["context" + tabID] = JSON.parse(queryJson["Clausola" + itm].contesto);
|
||||||
|
parseContext(tabID);
|
||||||
break;
|
break;
|
||||||
case "Sintattico":
|
case "Sintattico":
|
||||||
addSyntCla(active,tabID);
|
addSyntCla($(this)[1],active,tabID,0);
|
||||||
|
$("#lemma_forma" + tabID).val(queryJson["Clausola" + itm].lemma_forma);
|
||||||
|
$("#queryText" + tabID).val(queryJson["Clausola" + itm].queryText);
|
||||||
|
$("#opzioni_testo" + tabID).val(queryJson["Clausola" + itm].opzioni_testo);
|
||||||
if (queryJson["Clausola" + itm].typeSyntax0 != ".+") {
|
if (queryJson["Clausola" + itm].typeSyntax0 != ".+") {
|
||||||
$("#cla" + tabID + " #synttypes").val(queryJson["Clausola" + itm].typeSyntax0);
|
$("#cla" + tabID + " #synttypes").val(queryJson["Clausola" + itm].typeSyntax0);
|
||||||
}
|
}
|
||||||
if (queryJson["Clausola" + itm].functionSyntax != ".+") {
|
if (queryJson["Clausola" + itm].functionSyntax != ".+") {
|
||||||
$("#cla" + tabID + " #syntfunc").val(queryJson["Clausola" + itm].functionSyntax);
|
$("#cla" + tabID + " #syntfunc").val(queryJson["Clausola" + itm].functionSyntax);
|
||||||
}
|
}
|
||||||
|
window["context" + tabID] = JSON.parse(queryJson["Clausola" + itm].contesto);
|
||||||
|
parseContext(tabID);
|
||||||
break;
|
break;
|
||||||
case "Metafore":
|
case "Metafora":
|
||||||
addMetaCla(active,tabID);
|
addMetaCla($(this)[1],active,tabID,0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
$(claParent).each(function(){ // rigenero le liste di clausole e condizioni logiche nel tab principale
|
refreshClaList();
|
||||||
if ($(this)[0] == "OR" || $(this)[0] == "AND") {
|
refreshSortables();
|
||||||
addLogicCond($(this)[0],$(this)[1]);
|
|
||||||
} else {
|
|
||||||
updateClaListItem($(this)[0], $(this)[1]);
|
|
||||||
refreshSortables();
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function resetSimpleGui() {
|
function resetSimpleGui() {
|
||||||
$('#queryText').val("")
|
$('#queryText').val("");
|
||||||
setLemmaForma("","forma");
|
setLemmaForma("","forma");
|
||||||
$('#opzioni_testo').val("parola");
|
$('#opzioni_testo').val("parola");
|
||||||
resetContext(0);
|
resetContext(0);
|
||||||
|
@ -1251,7 +1260,6 @@ $(document).ready(function() {
|
||||||
});;
|
});;
|
||||||
$("#contextText-xX" + claIdNum).html("Tutta l'opera");
|
$("#contextText-xX" + claIdNum).html("Tutta l'opera");
|
||||||
window["context" + claIdNum] = JSON.parse(JSON.stringify(contextEmpty));
|
window["context" + claIdNum] = JSON.parse(JSON.stringify(contextEmpty));
|
||||||
queryJson["Clausola" + claIdNum].contesto = JSON.stringify(window["context" + claIdNum]);
|
|
||||||
$('#selectable-xX' + claIdNum + " .show").removeClass("show");
|
$('#selectable-xX' + claIdNum + " .show").removeClass("show");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1261,7 +1269,6 @@ $(document).ready(function() {
|
||||||
var claIdNum = '';
|
var claIdNum = '';
|
||||||
$(tabsContent).each(function(){
|
$(tabsContent).each(function(){
|
||||||
claIdNum = $(this)[0].id.substring(3);
|
claIdNum = $(this)[0].id.substring(3);
|
||||||
delete queryJson["Clausola" + claIdNum];
|
|
||||||
delete window["context" + claIdNum];
|
delete window["context" + claIdNum];
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
|
@ -1274,8 +1281,6 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function parseContext(claIdNum) {
|
function parseContext(claIdNum) {
|
||||||
var context = window["context" + claIdNum];
|
var context = window["context" + claIdNum];
|
||||||
var jsonContext = JSON.stringify(context, jsonReplacer);
|
|
||||||
queryJson["Clausola" + claIdNum].contesto = jsonContext;
|
|
||||||
var contextStringParts = ["","",""];
|
var contextStringParts = ["","",""];
|
||||||
var contextString = [];
|
var contextString = [];
|
||||||
var rangeHolderS = 0;
|
var rangeHolderS = 0;
|
||||||
|
@ -1317,13 +1322,12 @@ $(document).ready(function() {
|
||||||
contextStringParts[i] = contextStringParts[i] + "]"
|
contextStringParts[i] = contextStringParts[i] + "]"
|
||||||
contextString.push(contextStringParts[i]);
|
contextString.push(contextStringParts[i]);
|
||||||
}
|
}
|
||||||
if ((contextString.toString() != "") && (totCan < 100)) {
|
|
||||||
$("#contextText-xX" + claIdNum).html(contextString.toString());
|
|
||||||
} else {
|
|
||||||
resetContext(claIdNum)
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
if ((contextString.toString() != "") && (totCan < 100)) {
|
||||||
|
$("#contextText-xX" + claIdNum).html(contextString.toString());
|
||||||
|
} else {
|
||||||
|
resetContext(claIdNum)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue