Ripristinato il "save" e "load" delle query su disco
This commit is contained in:
parent
4bbd451b9c
commit
73657243e0
217
js/script_5.1.js
217
js/script_5.1.js
|
@ -153,10 +153,12 @@ $(document).ready(function() {
|
||||||
if (claListLen == 0){
|
if (claListLen == 0){
|
||||||
tabID++;
|
tabID++;
|
||||||
addClausola("#sortable0",1,tabID,1);
|
addClausola("#sortable0",1,tabID,1);
|
||||||
|
refreshClaList();
|
||||||
};
|
};
|
||||||
if (rifListLen == 0){
|
if (rifListLen == 0){
|
||||||
rifID++;
|
rifID++;
|
||||||
addRiferimento("#sortableRif0",1,rifID,1);
|
addRiferimento("#sortableRif0",1,rifID,1);
|
||||||
|
refreshClaList();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -294,10 +296,8 @@ $(document).ready(function() {
|
||||||
// Evento: modifica di un campo clausole
|
// Evento: modifica di un campo clausole
|
||||||
$("form #lemma_forma,#queryText,#opzioni_testo").on('change', function() {
|
$("form #lemma_forma,#queryText,#opzioni_testo").on('change', function() {
|
||||||
if ($(this)[0].id == "queryText"){
|
if ($(this)[0].id == "queryText"){
|
||||||
//var orgSelection = $('#lemma_forma option:selected')[0].value
|
|
||||||
var qText = $(this)[0].value;
|
var qText = $(this)[0].value;
|
||||||
if (qText !== null && qText !== '') {qText = ' "' + qText + '"';}
|
if (qText !== null && qText !== '') {qText = ' "' + qText + '"';}
|
||||||
//setLemmaForma(qText,orgSelection);
|
|
||||||
};
|
};
|
||||||
refreshClaList();
|
refreshClaList();
|
||||||
});
|
});
|
||||||
|
@ -337,7 +337,7 @@ $(document).ready(function() {
|
||||||
if (queryJson.unitaRicerca == "riferimento") {
|
if (queryJson.unitaRicerca == "riferimento") {
|
||||||
condListRifLen--;
|
condListRifLen--;
|
||||||
if (rifListLen == 0 && condListRifLen == 0) {
|
if (rifListLen == 0 && condListRifLen == 0) {
|
||||||
$('#sortableRif0').html(emptyClaList);
|
$('#sortableRif0').html(emptyRifList);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
condListLen--;
|
condListLen--;
|
||||||
|
@ -494,7 +494,7 @@ $(document).ready(function() {
|
||||||
// Evento: click sul bottone di reset semplice
|
// Evento: click sul bottone di reset semplice
|
||||||
$('#cleanresult').on('click', function() {
|
$('#cleanresult').on('click', function() {
|
||||||
resetResult();
|
resetResult();
|
||||||
resetSimpleGui();
|
$('#queryText').val("");
|
||||||
refreshClaList();
|
refreshClaList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -502,7 +502,6 @@ $(document).ready(function() {
|
||||||
$('#cleanresult2').on('click', function() {
|
$('#cleanresult2').on('click', function() {
|
||||||
resetResult();
|
resetResult();
|
||||||
resetAdvGui();
|
resetAdvGui();
|
||||||
refreshClaList();
|
|
||||||
if (claListLen == 0){
|
if (claListLen == 0){
|
||||||
tabID++;
|
tabID++;
|
||||||
addClausola("#sortable0",1,tabID,1);
|
addClausola("#sortable0",1,tabID,1);
|
||||||
|
@ -511,6 +510,7 @@ $(document).ready(function() {
|
||||||
rifID++;
|
rifID++;
|
||||||
addRiferimento("#sortableRif0",1,rifID,1);
|
addRiferimento("#sortableRif0",1,rifID,1);
|
||||||
};
|
};
|
||||||
|
refreshClaList();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Evento: click sull'icona rimuovi nota
|
// Evento: click sull'icona rimuovi nota
|
||||||
|
@ -687,13 +687,13 @@ $(document).ready(function() {
|
||||||
<ion-icon name="refresh-circle"></ion-icon></button></div>';
|
<ion-icon name="refresh-circle"></ion-icon></button></div>';
|
||||||
const iconCloseCond = '<div class="p-0 mr-3 mt-0 text-right text-success"><span class="iconClClass removeCond"><ion-icon name="close-circle"></ion-icon></span></div>';
|
const iconCloseCond = '<div class="p-0 mr-3 mt-0 text-right text-success"><span class="iconClClass removeCond"><ion-icon name="close-circle"></ion-icon></span></div>';
|
||||||
const emptyClaList = '<li id="li-cla0" class="list-group-item align-items-center my-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna clausola aggiunta.</li>';
|
const emptyClaList = '<li id="li-cla0" class="list-group-item align-items-center my-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna clausola aggiunta.</li>';
|
||||||
|
const emptyRifList = '<li id="li-rif0" class="list-group-item align-items-center my-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna clausola aggiunta.</li>';
|
||||||
const defaultCond = '<div id="cla-defaultCond" class="col-12 p-1 small font-weight-bold text-muted"> Clausole e condizioni in AND di default</div>';
|
const defaultCond = '<div id="cla-defaultCond" class="col-12 p-1 small font-weight-bold text-muted"> Clausole e condizioni in AND di default</div>';
|
||||||
const defaultRifCond = '<div id="cla-defaultRifCond" class="col-12 p-1 small font-weight-bold text-muted"> Clausole e condizioni in AND di default</div>';
|
const defaultRifCond = '<div id="cla-defaultRifCond" class="col-12 p-1 small font-weight-bold text-muted"> Clausole e condizioni in AND di default</div>';
|
||||||
const emptyNoteList = '<div class="card card-body well well-sm m-1 mt-2 p-0" id="noteCard0"><span class="p-3 text-muted bg-lida-vis small" style="opacity: 0.6;">Nessun commento visualizzato</span></div>';
|
const emptyNoteList = '<div class="card card-body well well-sm m-1 mt-2 p-0" id="noteCard0"><span class="p-3 text-muted bg-lida-vis small" style="opacity: 0.6;">Nessun commento visualizzato</span></div>';
|
||||||
//const emptyInfo = '<div class="card card-body well well-sm m-1 mt-2 p-0" id="infoCard0"><span class="p-3 text-muted bg-lida-vis small" style="opacity: 0.6;">Nessuna struttura visualizzata</span></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": "", "TipoClausola": "0", "Attiva": "0"}';
|
||||||
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';
|
||||||
|
@ -731,7 +731,6 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Funzioni di gestione del tab Periodo, usate da synthgraph.js
|
// Funzioni di gestione del tab Periodo, usate da synthgraph.js
|
||||||
|
|
||||||
fillStructCard = function(lisid){
|
fillStructCard = function(lisid){
|
||||||
var cantiche=["Inferno", "Purgatorio","Paradiso"];
|
var cantiche=["Inferno", "Purgatorio","Paradiso"];
|
||||||
var romani = ["I","II","III","IV","V","VI","VII","VIII","IX","X",
|
var romani = ["I","II","III","IV","V","VI","VII","VIII","IX","X",
|
||||||
|
@ -772,7 +771,7 @@ $(document).ready(function() {
|
||||||
$('#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);
|
||||||
addClaContext(tabID);
|
addClaContext(tabID);
|
||||||
refreshClaList();
|
// refreshClaList();
|
||||||
refreshSortables();
|
refreshSortables();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,7 +787,7 @@ $(document).ready(function() {
|
||||||
$("#rif" + rifID).attr("data-claActive", active);
|
$("#rif" + rifID).attr("data-claActive", active);
|
||||||
$("#rif" + rifID).attr("style", "");
|
$("#rif" + rifID).attr("style", "");
|
||||||
addClaContext(rifID);
|
addClaContext(rifID);
|
||||||
refreshClaList();
|
// refreshClaList();
|
||||||
refreshSortables();
|
refreshSortables();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,7 +922,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
// Funzione di creazione del LI delle condizioni logiche
|
// Funzione di creazione del LI delle condizioni logiche
|
||||||
function addLogicCond(sortableId,condtype){
|
function addLogicCond(sortableId,condtype){
|
||||||
if (queryJson.unitaRicerca == "riferimento") {
|
if (~sortableId.indexOf("Rif")) {
|
||||||
condListRifLen++;
|
condListRifLen++;
|
||||||
var sortableIdNum = "Rif" + condListRifLen;
|
var sortableIdNum = "Rif" + condListRifLen;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1003,8 +1002,7 @@ $(document).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
var claActive = 1
|
var claActive = 1
|
||||||
};
|
};
|
||||||
queryJson.Clausola0 = JSON.parse('{"queryText": "' + qText + '", "lemma_forma": "", "opzioni_testo": "", "TipoClausola": "0", "Attiva": "' + claActive + '"}');
|
queryJson.Clausola0 = JSON.parse('{"queryText": "' + qText + '", "TipoClausola": "0", "Attiva": "' + claActive + '"}');
|
||||||
queryJson.Clausola0.contesto = JSON.stringify(window.context0);
|
|
||||||
queryJson.unitaRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
|
queryJson.unitaRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
|
||||||
var claLiArray = $("#sortable0").find(".claLI");
|
var claLiArray = $("#sortable0").find(".claLI");
|
||||||
var countActCla = 0;
|
var countActCla = 0;
|
||||||
|
@ -1076,7 +1074,7 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (rifLiArray == 0 && condListRifLen == 0) {
|
if (rifLiArray == 0 && condListRifLen == 0) {
|
||||||
$('#sortableRif0').html(emptyClaList);
|
$('#sortableRif0').html(emptyRifList);
|
||||||
queryJson.EsprLogicaRif = "";
|
queryJson.EsprLogicaRif = "";
|
||||||
queryJson.LogicaGuiRif = "";
|
queryJson.LogicaGuiRif = "";
|
||||||
}
|
}
|
||||||
|
@ -1108,6 +1106,7 @@ $(document).ready(function() {
|
||||||
var rifListItemId = "li-rif" + rifIdNum;
|
var rifListItemId = "li-rif" + rifIdNum;
|
||||||
var rifSubParList = $("#li-rif" + rifIdNum).find("select, input");
|
var rifSubParList = $("#li-rif" + rifIdNum).find("select, input");
|
||||||
var contextText = $("#contextText-xX" + rifIdNum).text();
|
var contextText = $("#contextText-xX" + rifIdNum).text();
|
||||||
|
var claType = $("#" + rifId).attr('data-claType');
|
||||||
var claActive = $("#" + rifId).attr('data-claActive');
|
var claActive = $("#" + rifId).attr('data-claActive');
|
||||||
if (claActive > 0) {
|
if (claActive > 0) {
|
||||||
checkInsert = ' checked="checked"';
|
checkInsert = ' checked="checked"';
|
||||||
|
@ -1127,7 +1126,7 @@ $(document).ready(function() {
|
||||||
if (!($(this).prop("disabled"))) {
|
if (!($(this).prop("disabled"))) {
|
||||||
rifText = rifText + $(this)[0].title + ': <span class="font-italic">' + $(this)[0].options[$(this)[0].selectedIndex].text + '</span>; ';
|
rifText = rifText + $(this)[0].title + ': <span class="font-italic">' + $(this)[0].options[$(this)[0].selectedIndex].text + '</span>; ';
|
||||||
};
|
};
|
||||||
jsonTextToParse = jsonTextToParse + ', "' + $(this)[0].id.replace(rifIdNum, "") + '": "' + $(this)[0].options[$(this)[0].selectedIndex].value + '"';
|
jsonTextToParse = jsonTextToParse + ', "' + $(this)[0].id.replace(rifIdNum, "") + '": "' + $(this)[0].options[$(this)[0].selectedIndex].value + '", "TipoClausola": "' + claType + '", "Attiva": "' + claActive + '"';
|
||||||
if ($(this)[0].id.startsWith("Tipo_Riferimento")) {
|
if ($(this)[0].id.startsWith("Tipo_Riferimento")) {
|
||||||
if ($(this)[0][3].selected) {
|
if ($(this)[0][3].selected) {
|
||||||
$('#Tipo_Citazione' + rifIdNum)[0].removeAttribute("style");
|
$('#Tipo_Citazione' + rifIdNum)[0].removeAttribute("style");
|
||||||
|
@ -1226,6 +1225,7 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
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]);
|
||||||
|
console.log(queryJson);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Funzione di refresh dei placeholders e attivazione/disattivazione bottoni nelle liste sortable
|
// Funzione di refresh dei placeholders e attivazione/disattivazione bottoni nelle liste sortable
|
||||||
|
@ -1436,6 +1436,7 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
function makeUpGui(queryJson) {
|
function makeUpGui(queryJson) {
|
||||||
|
var domElementsNames = [["#sortable","Clausola",queryJson.LogicaGui],["#sortableRif","Riferimento",queryJson.LogicaGuiRif]]
|
||||||
// 1. verifica json legit --> TO DO
|
// 1. verifica json legit --> TO DO
|
||||||
// -------------------
|
// -------------------
|
||||||
// Pulizia ricerca avanzata:
|
// Pulizia ricerca avanzata:
|
||||||
|
@ -1451,21 +1452,91 @@ $(document).ready(function() {
|
||||||
// Rigenerazione Clausola0:
|
// Rigenerazione Clausola0:
|
||||||
if (queryJson["Clausola0"].Attiva) {
|
if (queryJson["Clausola0"].Attiva) {
|
||||||
$("#queryText").val(queryJson["Clausola0"].queryText);
|
$("#queryText").val(queryJson["Clausola0"].queryText);
|
||||||
$("#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);
|
$("#unitaRicerca").val(queryJson.unitaRicerca);
|
||||||
// Generazione lista clausole e condizioni con elementi padre:
|
if (queryJson.unitaRicerca == "riferimento") {
|
||||||
guiLogicString = queryJson.LogicaGui;
|
$("#collapseLogicRif").collapse('show');
|
||||||
var clau2Make = "";
|
} else {
|
||||||
var claParent = []; // array di coppie [elemento, elemento padre]
|
$("#collapseLogicCla").collapse('show');
|
||||||
var treeLevel = []; // pila di elementi padre
|
};
|
||||||
|
// Generazione lista clausole e condizioni con elementi padre, per clausole e riferimenti:
|
||||||
|
for (var i = 0; i <= 1; i++) {
|
||||||
|
var clau2Make = "";
|
||||||
|
var claParent = []; // array di coppie [elemento, elemento padre]
|
||||||
|
var treeLevel = []; // pila di elementi padre
|
||||||
|
fillStructureArrays(treeLevel, claParent, domElementsNames[i])
|
||||||
|
$(claParent).each(function() {
|
||||||
|
var itm = $(this)[0]
|
||||||
|
if ($(this)[0] == "OR" || $(this)[0] == "AND") {
|
||||||
|
addLogicCond($(this)[1], $(this)[0]);
|
||||||
|
} else {
|
||||||
|
clau2Make = queryJson[domElementsNames[i][1] + itm].TipoClausola;
|
||||||
|
var active = queryJson[domElementsNames[i][1] + itm].Attiva
|
||||||
|
switch (clau2Make) {
|
||||||
|
case "Clausola":
|
||||||
|
tabID++;
|
||||||
|
addClausola($(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);
|
||||||
|
var selectedValue = queryJson["Clausola" + itm].typeGramm0;
|
||||||
|
if (selectedValue != "all") {
|
||||||
|
$("#grammtypes" + tabID).val(selectedValue);
|
||||||
|
addCatgramSubcla("cla" + tabID, selectedValue);
|
||||||
|
var ks = Object.keys(queryJson["Clausola" + itm]);
|
||||||
|
for (var j = 6; j < ks.length - 1; j++) {
|
||||||
|
var melID = "cla" + tabID + ks[j];
|
||||||
|
var melement = document.getElementById(melID);
|
||||||
|
if (melement) {
|
||||||
|
switch (melement.type) {
|
||||||
|
case "fieldset":
|
||||||
|
var sval = queryJson["Clausola" + itm][ks[j]]
|
||||||
|
$("#cla" + tabID + sval.replace(/\s/g, '')).attr("checked", true);
|
||||||
|
break;
|
||||||
|
case "select-one":
|
||||||
|
melement.value = ([queryJson["Clausola" + itm][ks[j]]])
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (queryJson["Clausola" + itm].typeSyntax0 != "all") {
|
||||||
|
$("#cla" + tabID + " #synttypes").val(queryJson["Clausola" + itm].typeSyntax0);
|
||||||
|
}
|
||||||
|
if (queryJson["Clausola" + itm].functionSyntax != "all") {
|
||||||
|
$("#cla" + tabID + " #syntfunc").val(queryJson["Clausola" + itm].functionSyntax);
|
||||||
|
}
|
||||||
|
window["context" + tabID] = JSON.parse(queryJson["Clausola" + itm].contesto);
|
||||||
|
parseContext(tabID);
|
||||||
|
break;
|
||||||
|
case "Riferimento":
|
||||||
|
rifID++;
|
||||||
|
addRiferimento($(this)[1], active, rifID, 0);
|
||||||
|
var ks = Object.keys(queryJson["Riferimento" + itm]);
|
||||||
|
for (var j = 0; j < ks.length - 1; j++) {
|
||||||
|
var melID = ks[j] + rifID;
|
||||||
|
var melement = document.getElementById(melID);
|
||||||
|
if (melement) {
|
||||||
|
melement.value = ([queryJson["Riferimento" + itm][ks[j]]])
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window["context" + rifID] = JSON.parse(queryJson["Riferimento" + itm].contesto);
|
||||||
|
parseContext(rifID);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
refreshClaList();
|
||||||
|
refreshSortables();
|
||||||
|
};
|
||||||
|
|
||||||
|
function fillStructureArrays(treeLevel,claParent,domElementsNamesArray) {
|
||||||
var condNum = 0;
|
var condNum = 0;
|
||||||
|
var guiLogicString = domElementsNamesArray[2];
|
||||||
for (var i=0; i < guiLogicString.length; i++) {
|
for (var i=0; i < guiLogicString.length; i++) {
|
||||||
switch (guiLogicString[i]) {
|
switch (guiLogicString[i]) {
|
||||||
case "(":
|
case "(":
|
||||||
|
@ -1475,99 +1546,23 @@ $(document).ready(function() {
|
||||||
break;
|
break;
|
||||||
case "OR":
|
case "OR":
|
||||||
claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
|
claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
|
||||||
treeLevel.push("#sortable" + ++condNum);
|
treeLevel.push(domElementsNamesArray[0] + ++condNum);
|
||||||
break;
|
break;
|
||||||
case "AND":
|
case "AND":
|
||||||
if (i > 1) {
|
if (i > 1) {
|
||||||
claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
|
claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
|
||||||
treeLevel.push("#sortable" + ++condNum);
|
treeLevel.push(domElementsNamesArray[0] + ++condNum);
|
||||||
} else {
|
} else {
|
||||||
treeLevel.push("#sortable0");
|
treeLevel.push(domElementsNamesArray[0]+"0");
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
claParent.push([guiLogicString[i].replace("Clausola", ""), treeLevel[treeLevel.length - 1]]);
|
claParent.push([guiLogicString[i].replace(domElementsNamesArray[1], ""), treeLevel[treeLevel.length - 1]]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
$(claParent).each(function(){
|
|
||||||
var itm = $(this)[0]
|
|
||||||
if ($(this)[0] == "OR" || $(this)[0] == "AND") {
|
|
||||||
addLogicCond($(this)[1],$(this)[0]);
|
|
||||||
}
|
|
||||||
if (itm != "OR" && itm != "AND") {
|
|
||||||
clau2Make = queryJson["Clausola" + itm].TipoClausola;
|
|
||||||
active = queryJson["Clausola" + itm].Attiva
|
|
||||||
tabID++;
|
|
||||||
switch (clau2Make) {
|
|
||||||
case "Grammaticale":
|
|
||||||
selectedValue = queryJson["Clausola" + itm].typeGramm0;
|
|
||||||
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") {
|
|
||||||
$("#grammtypes" + tabID).val(selectedValue);
|
|
||||||
addCatgramSubcla("cla" + tabID, selectedValue);
|
|
||||||
var ks = Object.keys(queryJson["Clausola" + itm]);
|
|
||||||
for (var j = 6; j < ks.length - 1; j++) {
|
|
||||||
var melID = "cla" + tabID + ks[j];
|
|
||||||
var melement = document.getElementById(melID);
|
|
||||||
switch (melement.type) {
|
|
||||||
case "fieldset":
|
|
||||||
var sval = queryJson["Clausola" + itm][ks[j]]
|
|
||||||
$("#cla" + tabID + sval.replace(/\s/g, '')).attr("checked", true);
|
|
||||||
break;
|
|
||||||
case "select-one":
|
|
||||||
melement.value = ([queryJson["Clausola" + itm][ks[j]]])
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
window["context" + tabID] = JSON.parse(queryJson["Clausola" + itm].contesto);
|
|
||||||
parseContext(tabID);
|
|
||||||
break;
|
|
||||||
case "Sintattico":
|
|
||||||
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 != ".+") {
|
|
||||||
$("#cla" + tabID + " #synttypes").val(queryJson["Clausola" + itm].typeSyntax0);
|
|
||||||
}
|
|
||||||
if (queryJson["Clausola" + itm].functionSyntax != ".+") {
|
|
||||||
$("#cla" + tabID + " #syntfunc").val(queryJson["Clausola" + itm].functionSyntax);
|
|
||||||
}
|
|
||||||
window["context" + tabID] = JSON.parse(queryJson["Clausola" + itm].contesto);
|
|
||||||
parseContext(tabID);
|
|
||||||
break;
|
|
||||||
// case "Metafora":
|
|
||||||
// addMetaCla($(this)[1],active,tabID,0);
|
|
||||||
// break;
|
|
||||||
default:
|
|
||||||
};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
refreshClaList();
|
|
||||||
refreshSortables();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function resetSimpleGui() {
|
|
||||||
$('#queryText').val("");
|
|
||||||
setLemmaForma("","forma");
|
|
||||||
$('#opzioni_testo').val("parola");
|
|
||||||
resetContext(0);
|
|
||||||
};
|
|
||||||
|
|
||||||
function setLemmaForma(qText,newSelection) {
|
|
||||||
var newOptions = {['La forma' + qText]: 'forma', ['Il lemma' + qText]: 'lemma', ['Il testo' + qText]: 'testo'};
|
|
||||||
$("#lemma_forma").empty();
|
|
||||||
$.each(newOptions, function(key,value) {
|
|
||||||
$("#lemma_forma").append($("<option></option>").attr("value", value).text(key));
|
|
||||||
});
|
|
||||||
$("#lemma_forma").val(newSelection);
|
|
||||||
};
|
|
||||||
|
|
||||||
function resetContext(claIdNum) {
|
function resetContext(claIdNum) {
|
||||||
$('#selectable-xX' + claIdNum + " .ui-selectee").each(function() {
|
$('#selectable-xX' + claIdNum + " .ui-selectee").each(function() {
|
||||||
$(this).attr('style', "line-height: 1.2em");
|
$(this).attr('style', "line-height: 1.2em");
|
||||||
|
@ -1583,6 +1578,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function resetAdvGui() {
|
function resetAdvGui() {
|
||||||
for (var i in ["#cla-TabContent","#rif-TabContent"]) {
|
for (var i in ["#cla-TabContent","#rif-TabContent"]) {
|
||||||
|
$("#unitaRicerca").val("verso");
|
||||||
var tabsContent=$(i).find(".tab-pane:not(:first)");
|
var tabsContent=$(i).find(".tab-pane:not(:first)");
|
||||||
if ($(tabsContent).length) {
|
if ($(tabsContent).length) {
|
||||||
var claIdNum = '';
|
var claIdNum = '';
|
||||||
|
@ -1599,7 +1595,8 @@ $(document).ready(function() {
|
||||||
tabID = 0;
|
tabID = 0;
|
||||||
rifID = 100;
|
rifID = 100;
|
||||||
$('#sortable0').html(emptyClaList);
|
$('#sortable0').html(emptyClaList);
|
||||||
$('#sortableRif0').html(emptyClaList);
|
$('#sortableRif0').html(emptyRifList);
|
||||||
|
$("#collapseLogicCla").collapse('show');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue