Parsing GUI: aggiunta nel JSON chiave "Riferimento100", campi e contesto
This commit is contained in:
parent
163c0c5efa
commit
7f5d1bf322
|
@ -779,14 +779,14 @@
|
|||
<div class="card-body p-0">
|
||||
|
||||
<div class="row card tab-content bg-lida10 m-0 p-0"
|
||||
id="cla-TabContent">
|
||||
id="cla-TabContentRif">
|
||||
<div
|
||||
class="col-12 justify-content-between d-sm-inline bg-lida10 px-2 py-1" id="cercaRiferimenti">
|
||||
<div class="col-12 p-0 pl-2">
|
||||
<span class="small text-muted align-bottom pr-2">Filtra per: </span>
|
||||
</div>
|
||||
<div class="col-12 tab-pane fade show active pt-1 pb-2 px-0"
|
||||
id="claRif0" aria-labelledby="claRif0-tab">
|
||||
id="claRif100" aria-labelledby="claRif100-tab">
|
||||
|
||||
|
||||
<div id="claRif-Advanced" style="display: d-flex">
|
||||
|
@ -795,27 +795,27 @@
|
|||
<div id="claRif-list-row"
|
||||
class="row mx-0 justify-content-between">
|
||||
<div class="col-12 p-0">
|
||||
<ul id="sortableRif0"
|
||||
<ul id="sortableRif100"
|
||||
class="condLIand list-group ui-sortable">
|
||||
<li id="li-claRif0"
|
||||
<li id="li-claRif100"
|
||||
class="list-group-item align-items-center my-1 p-0 border text-muted bg-lida-vis">
|
||||
<!-- <li id="li-claRif0"
|
||||
<!-- <li id="li-claRif100"
|
||||
class="list-group-item align-items-center my-1 ui-state-default ui-state-disabled ui-state-disabled-opacity-06 border text-muted bg-lida-vis small"> -->
|
||||
<!-- <div class="handle container p-0 pl-1"></div> -->
|
||||
<div id="collapseRifCla1" class="collapse show" aria-labelledby="headingC1" data-parent="#sortableRif0" style="">
|
||||
<div class="card-body p-0 mx-1 mb-1 bg-lida11 border rounded border-success" id="claRifBody1">
|
||||
<div style="" class="col-12 tab-pane px-0 bg-lida11 border-top" id="claRif1" role="tabpanel" aria-labelledby="claRif1-tab" data-clatype="Riferimento" data-claactive="1">
|
||||
<div id="collapseRifCla100" class="collapse show" aria-labelledby="headingC1" data-parent="#sortableRif100" style="">
|
||||
<div class="card-body p-0 mx-1 mb-1 bg-lida11 border rounded border-success" id="claRifBody100">
|
||||
<div style="" class="col-12 tab-pane px-0 bg-lida11 border-top campiRif" id="claRif100" role="tabpanel" aria-labelledby="claRif100-tab" data-clatype="Riferimento" data-claactive="1">
|
||||
<!-- INIZIO FORM RIFERIMENTI -->
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="commhRif0" class="text-muted control-label small pl-2 pt-2 m-0">Commentatore:</label>
|
||||
<label for="commRif100" class="text-muted control-label small pl-2 pt-2 m-0">Commentatore:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text"><ion-icon name="options"></ion-icon></label>
|
||||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="commRif0" id="filtraCommentatoreN" title="Autore della fonte"
|
||||
name="commRif100" id="Commentatore100" title="Autore della fonte"
|
||||
value="oggetto">
|
||||
<option value="all">Tutti i commentatori</option>
|
||||
</select>
|
||||
|
@ -823,19 +823,19 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="fontRifN" class="text-muted control-label small pl-2 pt-2 m-0">Fonte:</label>
|
||||
<label for="fontRif100" class="text-muted control-label small pl-2 pt-2 m-0">Fonte:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text"><ion-icon name="document-text"></ion-icon></label>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm monMe"
|
||||
id="fonteN" placeholder="inserisci una fonte"
|
||||
aria-describedby="name-desc" name="fontRifN">
|
||||
id="Fonte100" placeholder="inserisci una fonte"
|
||||
aria-describedby="name-desc" name="fontRif100">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="authRif0" class="text-muted control-label small pl-2 pt-2 m-0">Autore
|
||||
<label for="authRif100" class="text-muted control-label small pl-2 pt-2 m-0">Autore
|
||||
della fonte:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -843,7 +843,7 @@
|
|||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="authRif0" id="filtraAutoreN" title="Autore della fonte"
|
||||
name="authRif100" id="Autore_Fonte100" title="Autore della fonte"
|
||||
value="oggetto">
|
||||
<option value="all">Tutti gli autori</option>
|
||||
</select>
|
||||
|
@ -851,7 +851,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="areaRif0" class="text-muted control-label small pl-2 pt-2 m-0">Area
|
||||
<label for="areaRif100" class="text-muted control-label small pl-2 pt-2 m-0">Area
|
||||
tematica:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -859,18 +859,18 @@
|
|||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="areaRif0" id="filtraAreaTematicaN" title="Area Tematica"
|
||||
name="areaRif100" id="Area_Tematica100" title="Area Tematica"
|
||||
value="oggetto">
|
||||
<option value="all">Qualsiasi</option>
|
||||
<option value="supporto">Agiografia</option>
|
||||
<option value="loci">Apologetica</option>
|
||||
<option value="citazione">Etc...</option>
|
||||
<option value="agiografia">Agiografia</option>
|
||||
<option value="apologetica">Apologetica</option>
|
||||
<option value="altro">Etc...</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="tipoRif0" class="text-muted control-label small pl-2 pt-2 m-0">Tipo
|
||||
<label for="tipoRif100" class="text-muted control-label small pl-2 pt-2 m-0">Tipo
|
||||
riferimento:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -878,7 +878,7 @@
|
|||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="tipoRif0" id="filtraTipoRiferimentoN" title="Tipo riferimento"
|
||||
name="tipoRif100" id="Tipo_Riferimento100" title="Tipo riferimento"
|
||||
value="oggetto">
|
||||
<option value="all">Qualsiasi</option>
|
||||
<option value="supporto">Supporto esterno</option>
|
||||
|
@ -889,7 +889,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="tipoCitRif0" class="text-muted control-label small pl-2 pt-2 m-0">Tipo
|
||||
<label for="tipoCitRif100" class="text-muted control-label small pl-2 pt-2 m-0">Tipo
|
||||
citazione:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -897,18 +897,18 @@
|
|||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="tipoCitRif0" id="filtraCitazioneN" title="Tipo citazione"
|
||||
name="tipoCitRif100" id="Tipo_Citazione100" title="Tipo citazione"
|
||||
value="oggetto">
|
||||
<option value="all">Qualsiasi</option>
|
||||
<option value="filtraGenerica">Concordanza generica</option>
|
||||
<option value="filtraStringente">Concordanza stringente</option>
|
||||
<option value="filtraEsplicita">Citazione esplicita</option>
|
||||
<option value="generica">Concordanza generica</option>
|
||||
<option value="stringente">Concordanza stringente</option>
|
||||
<option value="esplicita">Citazione esplicita</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="contentRif0" class="text-muted control-label small pl-2 pt-2 m-0">Contenuto
|
||||
<label for="contentRif100" class="text-muted control-label small pl-2 pt-2 m-0">Contenuto
|
||||
del riferimento:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -916,22 +916,22 @@
|
|||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="contentRif0" id="filtraContenutoRiferimentoN" title="Contenuto del riferimento"
|
||||
name="contentRif100" id="Contenuto_Riferimento100" title="Contenuto del riferimento"
|
||||
value="oggetto">
|
||||
<option value="all">Qualsiasi</option>
|
||||
<option value="filtraGenerica">Personaggio</option>
|
||||
<option value="filtraStringente">Episodio</option>
|
||||
<option value="filtraEsplicita">Motivo</option>
|
||||
<option value="filtraGenerica">Immagine</option>
|
||||
<option value="filtraStringente">Stilema</option>
|
||||
<option value="filtraEsplicita">Topografia</option>
|
||||
<option value="filtraEsplicita">Teoria</option>
|
||||
<option value="personaggio">Personaggio</option>
|
||||
<option value="episodio">Episodio</option>
|
||||
<option value="motivo">Motivo</option>
|
||||
<option value="immagine">Immagine</option>
|
||||
<option value="stilema">Stilema</option>
|
||||
<option value="topografia">Topografia</option>
|
||||
<option value="teoria">Teoria</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="r_t_fRif0" class="text-muted control-label small pl-2 pt-2 m-0">Rapporto
|
||||
<label for="r_t_fRif100" class="text-muted control-label small pl-2 pt-2 m-0">Rapporto
|
||||
testo/fonte:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -939,37 +939,37 @@
|
|||
</div>
|
||||
<select
|
||||
class="form-control custom-select custom-select-sm catgram monMe bg-light text-muted border btn-outline-success"
|
||||
name="r_t_fRif0" id="filtraRapportoTestoFonteN" title="Rapporto testo/fonte"
|
||||
name="r_t_fRif100" id="Rapporto_Testo_Fonte100" title="Rapporto testo/fonte"
|
||||
value="oggetto">
|
||||
<option value="all">Qualsiasi</option>
|
||||
<option value="filtraConferma">Conferma</option>
|
||||
<option value="filtraContraddice">Contraddice</option>
|
||||
<option value="filtraEstende">Estende</option>
|
||||
<option value="conferma">Conferma</option>
|
||||
<option value="contraddice">Contraddice</option>
|
||||
<option value="estende">Estende</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="testoRifN" class="text-muted control-label small pl-2 pt-2 m-0">Testo della fonte:</label>
|
||||
<label for="testoRif100" class="text-muted control-label small pl-2 pt-2 m-0">Testo della fonte:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text"><ion-icon name="document-text"></ion-icon></label>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm monMe"
|
||||
id="filtraTestoN" placeholder="inserisci il testo da cercare"
|
||||
aria-describedby="name-desc" name="testoRifN">
|
||||
id="Testo_Fonte100" placeholder="inserisci il testo da cercare"
|
||||
aria-describedby="name-desc" name="testoRif100">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group px-1 pb-0 my-1">
|
||||
<label for="notaRifN" class="text-muted control-label small pl-2 pt-2 m-0">Testo della nota:</label>
|
||||
<label for="notaRif100" class="text-muted control-label small pl-2 pt-2 m-0">Testo della nota:</label>
|
||||
<div class="form-inline input-group px-1 pt-1" action="">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text"><ion-icon name="document-text"></ion-icon></label>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm monMe"
|
||||
id="filtraNotaN" placeholder="inserisci il testo da cercare"
|
||||
aria-describedby="name-desc" name="notaRifN">
|
||||
id="Testo_Nota100" placeholder="inserisci il testo da cercare"
|
||||
aria-describedby="name-desc" name="notaRif100">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -2119,6 +2119,7 @@ $(document).ready(function() {
|
|||
|
||||
});
|
||||
queryExecuted = true;
|
||||
//$(cantoDisplayed).attr('style', 'display: d-flex;');
|
||||
$("#cantica0").trigger("click");
|
||||
$("#vistaFrasi").css("display", "none");
|
||||
|
||||
|
|
157
js/script_5.0.js
157
js/script_5.0.js
|
@ -94,37 +94,15 @@ $(document).ready(function() {
|
|||
|
||||
// Funzioni di gestione del comportamento dei bottoni collapse
|
||||
$('#collapseAdvanced').on('hidden.bs.collapse', function (e) {
|
||||
// if (e.target.id == "collapseLogic") {
|
||||
// console.log("hidden")
|
||||
// if (queryJson.unitaRicerca == "riferimenti") {
|
||||
// $("#collapseRiferimenti").collapse('hide');
|
||||
// } else {
|
||||
// $("#collapseAdvanced").collapse('hide');
|
||||
$("#showLogic").html('<span class="text-muted">Mostra</span>');
|
||||
// }
|
||||
// };
|
||||
if (e.target.id == "collapseAdvanced") {
|
||||
$("#showLogic").html('<span class="text-muted">Mostra</span>');// }
|
||||
};
|
||||
})
|
||||
|
||||
$('#collapseAdvanced').on('shown.bs.collapse', function () {
|
||||
// console.log("shown")
|
||||
$("#showLogic").html('<span class="font-weight-bold text-muted">Nascondi</span>');
|
||||
// if (queryJson.unitaRicerca == "riferimenti") {
|
||||
// $("#collapseRiferimenti").collapse('show');
|
||||
// } else {
|
||||
// $("#collapseAdvanced").collapse('show');
|
||||
// }
|
||||
})
|
||||
|
||||
// $('#collapseOptions').on('hidden.bs.collapse', function (e) {
|
||||
// if (e.target.id == "collapseOptions") {
|
||||
// $("#showOptions").html('<span class="text-muted">Opzioni</span>');
|
||||
// };
|
||||
// })
|
||||
|
||||
// $('#collapseOptions').on('shown.bs.collapse', function () {
|
||||
// $("#showOptions").html('<span class="font-weight-bold text-muted">Opzioni</span>');
|
||||
// })
|
||||
|
||||
$('.collapse').on('hide.bs.collapse', function (e) {
|
||||
if (e.target.id.substr(0,11) == "collapseCla") {
|
||||
var claIdNum = e.target.id.substr(11);
|
||||
|
@ -287,25 +265,15 @@ $(document).ready(function() {
|
|||
// Evento: modifica dell'unita di ricerca'
|
||||
$("#unitaRicerca").on('change', function() {
|
||||
queryJson.unitaRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
|
||||
// console.log(this.value);
|
||||
switch (this.value) {
|
||||
case "versi":
|
||||
case "frase":
|
||||
case "periodo":
|
||||
case "discorso":
|
||||
// $('#cercaFrasiPeriodiDiscorsi').attr('style', "display: d-flex;");
|
||||
// $('#tipogrammaticaleN').attr('style', "display: d-flex;");
|
||||
// $('#spanContenenti').attr('style', "display: d-flex;");
|
||||
// $('#tiposintatticoN').attr('style', "display: d-flex;");
|
||||
// $('#cercaRiferimenti').attr('style', "display: none;");
|
||||
// $("#contextDiv0").attr('style', "display: none");
|
||||
// $('#collapseLogic').attr('style', "display: d-flex;");
|
||||
$("#collapseLogic").collapse('show');
|
||||
// $("#collapseRiferimenti").collapse('hide');
|
||||
$("#collapseLogic").collapse('show');
|
||||
break;
|
||||
case "riferimenti":
|
||||
// $("#collapseLogic").collapse('hide');
|
||||
$("#collapseRiferimenti").collapse('show');
|
||||
$("#collapseRiferimenti").collapse('show');
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -326,6 +294,10 @@ $(document).ready(function() {
|
|||
refreshClaList();
|
||||
});
|
||||
|
||||
$('#cla-TabContentRif').on('change', '.monMe', function() {
|
||||
updateClaRifListItem(100,100);
|
||||
});
|
||||
|
||||
// Evento: click sull'icona rimuovi clausola
|
||||
$('#cla-TabContent').on('click', '.removeCla', function() {
|
||||
if (!$(this).hasClass("disabled")) {
|
||||
|
@ -441,6 +413,7 @@ $(document).ready(function() {
|
|||
var claIdNum = $(this)[0].id.substring(15);
|
||||
resetContext(claIdNum);
|
||||
refreshClaList();
|
||||
updateClaRifListItem(100,100);
|
||||
});
|
||||
|
||||
// Evento: click sull'icona di add del contesto
|
||||
|
@ -459,6 +432,7 @@ $(document).ready(function() {
|
|||
$(this).closest('.card').find('div .sel-canti-intro').text("Selezionati tutti i canti.");
|
||||
};
|
||||
refreshClaList();
|
||||
updateClaRifListItem(100,100);
|
||||
});
|
||||
|
||||
// Evento: click sull'icona di save local
|
||||
|
@ -749,13 +723,13 @@ $(document).ready(function() {
|
|||
function fillOpzioniRiferimenti() {
|
||||
$.each(listaCommentatori, function (i, p) {
|
||||
if ( !!p && p.length > 2) {
|
||||
$('#filtraCommentatoreN').append($('<option></option>')
|
||||
$('#Commentatore100').append($('<option></option>')
|
||||
.val(p).html(p));
|
||||
};
|
||||
});
|
||||
$.each(listaAutoriFontiCitazioni, function (i, p) {
|
||||
if ( !!p && p.length > 2) {
|
||||
$('#filtraAutoreN').append($('<option></option>')
|
||||
$('#Autore_Fonte100').append($('<option></option>')
|
||||
.val(p).html(p));
|
||||
};
|
||||
});
|
||||
|
@ -1076,16 +1050,12 @@ $(document).ready(function() {
|
|||
|
||||
// Funzione di refresh della lista clausole nella tab principale e del json della query
|
||||
function refreshClaList(){
|
||||
// var l_f = $("form #lemma_forma")[0].options[$("form #lemma_forma")[0].selectedIndex].value;
|
||||
var qText = $("form #queryText")[0].value;
|
||||
console.log(qText)
|
||||
// var optText = $("form #opzioni_testo")[0].value;
|
||||
if (qText == "") { //disattivo clausola 0 se il testo e' vuoto
|
||||
var claActive = 0
|
||||
} else {
|
||||
var claActive = 1
|
||||
};
|
||||
// queryJson.Clausola0 = JSON.parse('{"queryText": "' + qText + '", "lemma_forma": "' + l_f + '", "opzioni_testo": "' + optText + '", "TipoClausola": "0", "Attiva": "' + claActive + '"}');
|
||||
queryJson.Clausola0 = JSON.parse('{"queryText": "' + qText + '", "lemma_forma": "", "opzioni_testo": "", "TipoClausola": "0", "Attiva": "' + claActive + '"}');
|
||||
queryJson.Clausola0.contesto = JSON.stringify(window.context0);
|
||||
queryJson.unitaRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
|
||||
|
@ -1101,8 +1071,6 @@ $(document).ready(function() {
|
|||
if ($(tabsContent).length == 1) {
|
||||
var remCla = tabsContent.find(".removeCla");
|
||||
remCla.addClass("disabled");
|
||||
// var disableCla = tabsContent.find(".claAct");
|
||||
// disableCla.prop('disabled', true);
|
||||
};
|
||||
} else {
|
||||
if (claListLen == 0 && condListLen == 0) {
|
||||
|
@ -1120,6 +1088,35 @@ $(document).ready(function() {
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Funzione di refresh dei filtri sulla ricerca dei Riferimenti
|
||||
function updateClaRifListItem(claRifIdNum, sortableRifId){
|
||||
//id="li-claRif100"
|
||||
//id="sortableRif100"
|
||||
//claRifIdNum = claRifIdNum || 100;
|
||||
//sortableRifId = sortableRifId || 100;
|
||||
var claText = '';
|
||||
var jsonTextToParse = '{';
|
||||
var claRifId = "claRif" + claRifIdNum;
|
||||
var claRifListItemId = "li-claRif" + claRifIdNum;
|
||||
var claRifSubParList = $("#" + claRifListItemId).find("select, input");
|
||||
claRifSubParList.each(function(){
|
||||
var claSubParType = $(this)[0].type;
|
||||
if (claSubParType == "select-one" && $(this)[0].selectedIndex != 0) {
|
||||
claText = claText + "; " + $(this)[0].options[$(this)[0].selectedIndex].text;
|
||||
jsonTextToParse = jsonTextToParse + ', "' + $(this)[0].id.replace(claRifIdNum,"") + '": "' + $(this)[0].options[$(this)[0].selectedIndex].value + '"';
|
||||
};
|
||||
if (claSubParType == "text" && $(this)[0].value) {
|
||||
claText = claText + "; " + $(this)[0].value;
|
||||
jsonTextToParse = jsonTextToParse + ', "' + $(this)[0].id.replace(claRifIdNum,"") + '": "' + $(this)[0].value + '"';
|
||||
};
|
||||
});
|
||||
jsonTextToParse = jsonTextToParse.replace('{, ','{') + '}'
|
||||
queryJson["Riferimento" + claRifIdNum] = JSON.parse(jsonTextToParse);
|
||||
queryJson["Riferimento" + claRifIdNum].contesto = JSON.stringify(window["context" + claRifIdNum]);
|
||||
console.log(queryJson);
|
||||
}
|
||||
|
||||
|
||||
// Funzione di creazione del LI nella lista delle clausole nel tab principale, aggiunta della clausola nel JSON
|
||||
function updateClaListItem(claIdNum, sortableId){
|
||||
|
@ -1138,56 +1135,6 @@ $(document).ready(function() {
|
|||
remCla.removeClass("disabled");
|
||||
}
|
||||
switch (claType) {
|
||||
/*
|
||||
case "Grammaticale":
|
||||
var l_f = $("form #lemma_forma" + claIdNum)[0].options[$("form #lemma_forma" + claIdNum)[0].selectedIndex].value;
|
||||
var l_f_t = $("form #lemma_forma" + claIdNum)[0].options[$("form #lemma_forma" + claIdNum)[0].selectedIndex].text;
|
||||
var qText = $("form #queryText" + claIdNum)[0].value;
|
||||
var optText = $("form #opzioni_testo" + claIdNum)[0].value;
|
||||
var optText_t = $("form #opzioni_testo" + claIdNum)[0].options[$("form #opzioni_testo" + claIdNum)[0].selectedIndex].text;
|
||||
if (qText != "") {
|
||||
termText = l_f_t + ' <span class="text-dark font-weight-bold">' + qText + '</span> ' + optText_t + '.<br>';
|
||||
};
|
||||
var jsonTextToParse = '{"queryText": "' + qText + '", "lemma_forma": "' + l_f + '", "opzioni_testo": "' + optText + '", "TipoClausola": "' + claType + '", "Attiva": "' + claActive + '"';
|
||||
var gramSelect = $("#" + claId).find(".catgram");
|
||||
var contextText = $("#contextText-xX" + claIdNum).text();
|
||||
claText = termText + "Categoria grammaticale: " + gramSelect[0].options[gramSelect[0].selectedIndex].text;
|
||||
jsonTextToParse = jsonTextToParse + ', "' + gramSelect.attr('name') + '": "' + gramSelect[0].options[gramSelect[0].selectedIndex].value + '"';
|
||||
var claSubParList = $("#" + claId).children(".dettaglifiltri").find("select, fieldset");
|
||||
claSubParList.each(function(){
|
||||
var claSubParType = $(this)[0].type;
|
||||
if (claSubParType == "fieldset" && $(this).find(":checked").length) {
|
||||
var claSubParName = $(this).find(":checked")[0].name;
|
||||
if (claSubParName.startsWith(claId)) {
|
||||
claSubParName = claSubParName.replace(claId,'');
|
||||
}
|
||||
claText = claText + "; " + $(this).find(":checked")[0].defaultValue;
|
||||
jsonTextToParse = jsonTextToParse + ', "' + claSubParName + '": "' + $(this).find(":checked")[0].value + '"';
|
||||
};
|
||||
if (claSubParType == "select-one" && $(this)[0].selectedIndex != 0) {
|
||||
claText = claText + "; " + $(this)[0].options[$(this)[0].selectedIndex].text;
|
||||
jsonTextToParse = jsonTextToParse + ', "' + $(this)[0].name + '": "' + $(this)[0].options[$(this)[0].selectedIndex].value + '"';
|
||||
};
|
||||
});
|
||||
claText = claText + '.<br>Contesto: ' + contextText;
|
||||
break;
|
||||
case "Sintattico":
|
||||
var l_f = $("form #lemma_forma" + claIdNum)[0].options[$("form #lemma_forma" + claIdNum)[0].selectedIndex].value;
|
||||
var l_f_t = $("form #lemma_forma" + claIdNum)[0].options[$("form #lemma_forma" + claIdNum)[0].selectedIndex].text;
|
||||
var qText = $("form #queryText" + claIdNum)[0].value;
|
||||
var optText = $("form #opzioni_testo" + claIdNum)[0].value;
|
||||
var optText_t = $("form #opzioni_testo" + claIdNum)[0].options[$("form #opzioni_testo" + claIdNum)[0].selectedIndex].text;
|
||||
if (qText != "") {
|
||||
termText = l_f_t + ' <span class="text-dark font-weight-bold">' + qText + '</span> ' + optText_t + '.<br>';
|
||||
};
|
||||
var jsonTextToParse = '{"queryText": "' + qText + '", "lemma_forma": "' + l_f + '", "opzioni_testo": "' + optText + '", "TipoClausola": "' + claType + '", "Attiva": "' + claActive + '"';
|
||||
var syntSelect = $("#" + claId).find("#synttypes");
|
||||
var funcSelect = $("#" + claId).find("#syntfunc");
|
||||
var contextText = $("#contextText-xX" + claIdNum).text();
|
||||
claText = termText + "Tipo sintattico: " + syntSelect[0].options[syntSelect[0].selectedIndex].text + ';<br>Livello di subordinazione: ' + funcSelect[0].options[funcSelect[0].selectedIndex].text + '.<br>Contesto: ' + contextText;
|
||||
jsonTextToParse = jsonTextToParse + ', "' + syntSelect.attr('name') + '": "' + syntSelect[0].options[syntSelect[0].selectedIndex].value + '", "' + funcSelect.attr('name') + '": "' + funcSelect[0].options[funcSelect[0].selectedIndex].value + '"';
|
||||
break;
|
||||
*/
|
||||
case "Clausola":
|
||||
var l_f = $("form #lemma_forma" + claIdNum)[0].options[$("form #lemma_forma" + claIdNum)[0].selectedIndex].value;
|
||||
var l_f_t = $("form #lemma_forma" + claIdNum)[0].options[$("form #lemma_forma" + claIdNum)[0].selectedIndex].text;
|
||||
|
@ -1585,9 +1532,27 @@ $(document).ready(function() {
|
|||
claListLen = 0;
|
||||
condListLen = 0;
|
||||
tabID = 0;
|
||||
$('#sortable0').html(emptyClaList);
|
||||
$('#sortable0').html(emptyClaList);
|
||||
resetRif(100);
|
||||
};
|
||||
|
||||
function resetRif(claRifIdNum) {
|
||||
var claRifListItemId = "li-claRif" + claRifIdNum;
|
||||
var claRifSubParList = $("#" + claRifListItemId).find("select, input");
|
||||
claRifSubParList.each(function(){
|
||||
var claSubParType = $(this)[0].type;
|
||||
if (claSubParType == "select-one" && $(this)[0].selectedIndex != 0) {
|
||||
$(this)[0].selectedIndex = 0;
|
||||
};
|
||||
if (claSubParType == "text" && $(this)[0].value) {
|
||||
$(this)[0].value = "";
|
||||
};
|
||||
});
|
||||
resetContext(claRifIdNum);
|
||||
queryJson["Riferimento" + claRifIdNum] = JSON.parse('{}');
|
||||
queryJson["Riferimento" + claRifIdNum].contesto = JSON.stringify(window["context" + claRifIdNum]);
|
||||
};
|
||||
|
||||
function parseContext(claIdNum) {
|
||||
var context = window["context" + claIdNum];
|
||||
var contextStringParts = ["","",""];
|
||||
|
|
Loading…
Reference in New Issue