migiorie grafiche
This commit is contained in:
parent
628b1aa225
commit
3d5ba64760
2327
index_work_Nik.html
2327
index_work_Nik.html
File diff suppressed because it is too large
Load Diff
|
@ -9,11 +9,11 @@ $(document).ready(function() {
|
||||||
filterconditions = 0
|
filterconditions = 0
|
||||||
|
|
||||||
let filterToEdit = "";
|
let filterToEdit = "";
|
||||||
|
|
||||||
const myEngine = new Comunica.QueryEngine();
|
const myEngine = new Comunica.QueryEngine();
|
||||||
|
|
||||||
var queryFields = []; // Contiene le intestazioni di colonna della tabella dei risultati
|
var queryFields = []; // Contiene le intestazioni di colonna della tabella dei risultati
|
||||||
|
|
||||||
const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commediaontosintgra/query";
|
const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commediaontosintgra/query";
|
||||||
const sparqlGenerator = sparqljs.Generator;
|
const sparqlGenerator = sparqljs.Generator;
|
||||||
|
|
||||||
|
@ -487,8 +487,8 @@ $(document).ready(function() {
|
||||||
//element.find('.listacondizioni').append(dlclass);
|
//element.find('.listacondizioni').append(dlclass);
|
||||||
let virgola = tuttiFiltri.lastIndexOf(',');
|
let virgola = tuttiFiltri.lastIndexOf(',');
|
||||||
tuttiFiltri = tuttiFiltri.substring(0, virgola);
|
tuttiFiltri = tuttiFiltri.substring(0, virgola);
|
||||||
let txtAreaFiltri = '<textarea id = ' + 'textarea-'+filterconditions+
|
let txtAreaFiltri = '<textarea id = ' + 'textarea-' + filterconditions +
|
||||||
' readonly style="resize:none" class="bg-washed-blue bn" rows="2" cols="20" name="usrtxt" wrap="hard">' +
|
' readonly style="resize:none" class="bg-washed-blue bn" rows="2" cols="20" name="usrtxt" wrap="hard">' +
|
||||||
tuttiFiltri + "</textarea>"
|
tuttiFiltri + "</textarea>"
|
||||||
ddclass.append(txtAreaFiltri);
|
ddclass.append(txtAreaFiltri);
|
||||||
dlclass.append(dtclass);
|
dlclass.append(dtclass);
|
||||||
|
@ -513,11 +513,11 @@ $(document).ready(function() {
|
||||||
//aggiungo il filtro a quelli esistenti nel json
|
//aggiungo il filtro a quelli esistenti nel json
|
||||||
|
|
||||||
filtro['tipoClausola'] = tipoClausola
|
filtro['tipoClausola'] = tipoClausola
|
||||||
|
|
||||||
// checkedField = $('input[name=oggetto]:checked', '#filterform').val();
|
// checkedField = $('input[name=oggetto]:checked', '#filterform').val();
|
||||||
//
|
//
|
||||||
// filtro['lemma_forma'] = checkedField
|
// filtro['lemma_forma'] = checkedField
|
||||||
|
|
||||||
condizioniFiltro['filtro-' + filterconditions] = filtro
|
condizioniFiltro['filtro-' + filterconditions] = filtro
|
||||||
|
|
||||||
|
|
||||||
|
@ -543,37 +543,37 @@ $(document).ready(function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
jQuery(document).delegate('#grammarbutton', 'click', function(e) {
|
jQuery(document).delegate('#grammarbutton', 'click', function(e) {
|
||||||
|
|
||||||
var size = Object.keys(condizioniFiltro).length;
|
var size = Object.keys(condizioniFiltro).length;
|
||||||
if (size == 0){
|
if (size == 0) {
|
||||||
var clausola = $("#searchValue").val()
|
var clausola = $("#searchValue").val()
|
||||||
clausola = clausola.trim();
|
clausola = clausola.trim();
|
||||||
if (clausola == "" || clausola == ' '){
|
if (clausola == "" || clausola == ' ') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
filtro = {};
|
filtro = {};
|
||||||
filtro['query'] = clausola
|
filtro['query'] = clausola
|
||||||
condizioniFiltro['filtro-1'] = filtro;
|
condizioniFiltro['filtro-1'] = filtro;
|
||||||
|
|
||||||
}
|
}
|
||||||
spquery=buildSQ(condizioniFiltro)
|
spquery = buildSQ(condizioniFiltro)
|
||||||
queryFields = [];
|
queryFields = [];
|
||||||
for (var i in spquery.variables) {
|
for (var i in spquery.variables) {
|
||||||
queryFields.push(spquery.variables[i].variable.value);
|
queryFields.push(spquery.variables[i].variable.value);
|
||||||
}
|
}
|
||||||
execMySparqlQuery (new sparqlGenerator().stringify(spquery));
|
execMySparqlQuery(new sparqlGenerator().stringify(spquery));
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
async function execMySparqlQuery (spQuery){
|
async function execMySparqlQuery(spQuery) {
|
||||||
$("#loader").show();
|
$("#loader").show();
|
||||||
alert (new sparqlGenerator().stringify(spQuery));
|
alert(new sparqlGenerator().stringify(spQuery));
|
||||||
bindingsStream = await myEngine.queryBindings(spQuery, { sources: [ { type: 'sparql', value: sparqlEndpoint }, ], });
|
bindingsStream = await myEngine.queryBindings(spQuery, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
|
||||||
|
|
||||||
$("#sparqlquery").val(spQuery);
|
$("#sparqlquery").val(spQuery);
|
||||||
$("#copiaQuery").prop("disabled", false);
|
$("#copiaQuery").prop("disabled", false);
|
||||||
|
@ -596,7 +596,7 @@ $(document).ready(function() {
|
||||||
bindingsStream.on('data', (binding) => {
|
bindingsStream.on('data', (binding) => {
|
||||||
//console.log(binding.toString()); // Quick way to print bindings for testing
|
//console.log(binding.toString()); // Quick way to print bindings for testing
|
||||||
//console.log(binding.has('sub')); // Will be true
|
//console.log(binding.has('sub')); // Will be true
|
||||||
resultTablePart4 = '<tr><th scope="row" class="text-muted">' + rowNum++ + '</th>';
|
resultTablePart4 = '<tr><th scope="row" class="text-muted">' + rowNum++ + '</th>';
|
||||||
for (var i = 0; i < queryFields.length; i++) {
|
for (var i = 0; i < queryFields.length; i++) {
|
||||||
resultTablePart4 = resultTablePart4 + '<td class="text-muted">' + binding.get(queryFields[i]).value + "</td>";
|
resultTablePart4 = resultTablePart4 + '<td class="text-muted">' + binding.get(queryFields[i]).value + "</td>";
|
||||||
};
|
};
|
||||||
|
@ -613,19 +613,19 @@ $(document).ready(function() {
|
||||||
$("#resultsId1").append(resultTable);
|
$("#resultsId1").append(resultTable);
|
||||||
$("#risultatitesto").append("]");
|
$("#risultatitesto").append("]");
|
||||||
$("#copiaTesto").prop("disabled", false);
|
$("#copiaTesto").prop("disabled", false);
|
||||||
$('#resultTable').DataTable( {
|
$('#resultTable').DataTable({
|
||||||
colReorder: true,
|
colReorder: true,
|
||||||
language: {
|
language: {
|
||||||
url: 'dataTables.it-IT.json'
|
url: 'dataTables.it-IT.json'
|
||||||
},
|
},
|
||||||
//dom: 'Blfrtip',
|
//dom: 'Blfrtip',
|
||||||
dom: "<'row'<'col-sm-12 col-md-6'l><'col-sm-6 col-md-3'f><'col-sm-6 col-md-3 text-right'B>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
dom: "<'row'<'col-sm-12 col-md-6'l><'col-sm-6 col-md-3'f><'col-sm-6 col-md-3 text-right'B>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||||
buttons: [ 'copy', 'excel', 'print' ]
|
buttons: ['copy', 'excel', 'print']
|
||||||
});
|
});
|
||||||
setTimeout(function(){
|
setTimeout(function() {
|
||||||
buttonDiv = $("#resultsId1").find(".buttons-copy");
|
buttonDiv = $("#resultsId1").find(".buttons-copy");
|
||||||
$('<label class="input-group-text"><ion-icon name="copy"></ion-icon></label>').insertBefore(buttonDiv);
|
$('<label class="input-group-text"><ion-icon name="copy"></ion-icon></label>').insertBefore(buttonDiv);
|
||||||
},300);
|
}, 300);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function AggiornaFiltro(filtroId) {
|
function AggiornaFiltro(filtroId) {
|
||||||
|
@ -661,23 +661,23 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
let virgola = tuttiFiltri.lastIndexOf(',');
|
let virgola = tuttiFiltri.lastIndexOf(',');
|
||||||
tuttiFiltri = tuttiFiltri.substring(0, virgola);
|
tuttiFiltri = tuttiFiltri.substring(0, virgola);
|
||||||
|
|
||||||
|
|
||||||
let filterNum = filtroId.substring(7);
|
let filterNum = filtroId.substring(7);
|
||||||
|
|
||||||
|
|
||||||
$('#textarea-'+ filterNum).val(tuttiFiltri);
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#textarea-' + filterNum).val(tuttiFiltri);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (filterNum != 1) {
|
if (filterNum != 1) {
|
||||||
element.find('.andorconditions').attr('style', 'display.none');
|
element.find('.andorconditions').attr('style', 'display.none');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// rimuovo la finestra filtro
|
// rimuovo la finestra filtro
|
||||||
|
|
||||||
rmel = jQuery('#' + "cg-2")
|
rmel = jQuery('#' + "cg-2")
|
||||||
rmeldetail = jQuery('#' + 'dettaglio_' + "cg-2")
|
rmeldetail = jQuery('#' + 'dettaglio_' + "cg-2")
|
||||||
jQuery(rmel).remove();
|
jQuery(rmel).remove();
|
||||||
|
@ -692,57 +692,57 @@ $(document).ready(function() {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
||||||
Il Filtro "scritto" viene eliminato
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
jQuery(document).delegate('a.delete-written-filter', 'click', function(e) {
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
var didConfirm = confirm("Sei sicuro di voler cancellare il filtro?");
|
|
||||||
if (didConfirm == true) {
|
|
||||||
|
|
||||||
var targetDiv = jQuery(this).attr('target'); // nome filtro
|
|
||||||
|
|
||||||
rmel = jQuery('#' + targetDiv)
|
|
||||||
rmeldetail = jQuery('#' + targetDiv)
|
|
||||||
jQuery(rmel).remove();
|
|
||||||
jQuery(rmeldetail).remove();
|
|
||||||
// se c'è un solo filtro, mi assicuro che non sia visibile il dropbox and/or
|
|
||||||
size = jQuery('#filtri >div').length
|
|
||||||
|
|
||||||
//nasconde la condizione logica dal primo della lista dei filtri
|
|
||||||
if (size > 0) {
|
|
||||||
var filtriscr = jQuery('#filtri >div');
|
|
||||||
filtriscr.first().find('.andorconditions').attr('style', 'display:none');
|
|
||||||
} else { // eliminato l'ultimo filtro
|
|
||||||
jQuery('#filtri').attr('style', "display:none;")
|
|
||||||
}
|
|
||||||
|
|
||||||
delete condizioniFiltro[targetDiv];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
Il Filtro "scritto" viene editato
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
jQuery(document).delegate('a.edit-written-filter', 'click', function(e) {
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
if (clausolaVisibile)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
Il Filtro "scritto" viene eliminato
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
jQuery(document).delegate('a.delete-written-filter', 'click', function(e) {
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
var didConfirm = confirm("Sei sicuro di voler cancellare il filtro?");
|
||||||
|
if (didConfirm == true) {
|
||||||
|
|
||||||
|
var targetDiv = jQuery(this).attr('target'); // nome filtro
|
||||||
|
|
||||||
|
rmel = jQuery('#' + targetDiv)
|
||||||
|
rmeldetail = jQuery('#' + targetDiv)
|
||||||
|
jQuery(rmel).remove();
|
||||||
|
jQuery(rmeldetail).remove();
|
||||||
|
// se c'è un solo filtro, mi assicuro che non sia visibile il dropbox and/or
|
||||||
|
size = jQuery('#filtri >div').length
|
||||||
|
|
||||||
|
//nasconde la condizione logica dal primo della lista dei filtri
|
||||||
|
if (size > 0) {
|
||||||
|
var filtriscr = jQuery('#filtri >div');
|
||||||
|
filtriscr.first().find('.andorconditions').attr('style', 'display:none');
|
||||||
|
} else { // eliminato l'ultimo filtro
|
||||||
|
jQuery('#filtri').attr('style', "display:none;")
|
||||||
|
}
|
||||||
|
|
||||||
|
delete condizioniFiltro[targetDiv];
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
Il Filtro "scritto" viene editato
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
jQuery(document).delegate('a.edit-written-filter', 'click', function(e) {
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
if (clausolaVisibile)
|
||||||
|
return true;
|
||||||
|
|
||||||
var thisfilter = jQuery(this).attr('target');
|
var thisfilter = jQuery(this).attr('target');
|
||||||
tempfiltro = condizioniFiltro[thisfilter]
|
tempfiltro = condizioniFiltro[thisfilter]
|
||||||
tempfiltro['target'] = thisfilter
|
tempfiltro['target'] = thisfilter
|
||||||
|
@ -766,139 +766,150 @@ jQuery(document).delegate('a.edit-written-filter', 'click', function(e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
/*} else {
|
/*} else {
|
||||||
return false;
|
return false;
|
||||||
}*/
|
}*/
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Visualizza Categoria Grammaticale
|
* Visualizza Categoria Grammaticale
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showCategoriaGrammaticale(valoriFiltro = {}, filtroTarget = '') {
|
function showCategoriaGrammaticale(valoriFiltro = {}, filtroTarget = '') {
|
||||||
|
|
||||||
|
|
||||||
var content = jQuery('#categoriagrammaticale >div'),
|
var content = jQuery('#categoriagrammaticale >div'),
|
||||||
size = jQuery('#condizioni >div').length + 1,
|
size = jQuery('#condizioni >div').length + 1,
|
||||||
element = null,
|
element = null,
|
||||||
element = content.clone();
|
element = content.clone();
|
||||||
|
|
||||||
$(":radio").prop("checked", false);
|
checkedField = $('input[name=lemma_forma]:checked', '#filterform').val();
|
||||||
|
|
||||||
|
var radios = $(":radio");
|
||||||
|
|
||||||
|
|
||||||
|
//$(":radio").prop("checked", false);
|
||||||
$(":checkbox").prop("checked", false);
|
$(":checkbox").prop("checked", false);
|
||||||
|
//
|
||||||
|
// for (radio in radios) {
|
||||||
|
// if (radios[radio].val == checkedField) {
|
||||||
|
// radios[radio].checked = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
element.attr('id', 'cg-' + size);
|
||||||
|
element.find('.remove-filter').attr('target', 'cg-' + size);
|
||||||
|
element.find('.set-filter').attr('targetfilter', 'cg-' + size);
|
||||||
|
element.appendTo('#condizioni');
|
||||||
|
|
||||||
element.attr('id', 'cg-' + size);
|
if (!jQuery.isEmptyObject(valoriFiltro)) { // sto facendo la modfica di un filtro
|
||||||
element.find('.remove-filter').attr('target', 'cg-' + size);
|
|
||||||
element.find('.set-filter').attr('targetfilter', 'cg-' + size);
|
$("#types").val(valoriFiltro['categoria']).trigger("change");
|
||||||
element.appendTo('#condizioni');
|
var keys = Object.keys(valoriFiltro)//condizioniFiltro)
|
||||||
|
for (key in keys) {
|
||||||
|
myname = keys[key]
|
||||||
|
myname = myname.replaceAll('%20', ' ')
|
||||||
|
myval = valoriFiltro[keys[key]]
|
||||||
|
|
||||||
|
var edelement = $("[name='" + myname + "'");
|
||||||
|
var edeltype = edelement.attr('type')
|
||||||
|
//alert(edeltype)
|
||||||
|
if (edeltype !== undefined & (edeltype == 'radio' | edeltype == 'checkbox')) {
|
||||||
|
$('[value="' + myval + '"]').prop('checked', true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("[name='" + myname + "'").val(myval)
|
||||||
|
}
|
||||||
|
|
||||||
if (!jQuery.isEmptyObject(valoriFiltro)) { // sto facendo la modfica di un filtro
|
|
||||||
|
|
||||||
$("#types").val(valoriFiltro['categoria']).trigger("change");
|
|
||||||
var keys = Object.keys(valoriFiltro)//condizioniFiltro)
|
|
||||||
for (key in keys) {
|
|
||||||
myname = keys[key]
|
|
||||||
myname = myname.replaceAll('%20', ' ')
|
|
||||||
myval = valoriFiltro[keys[key]]
|
|
||||||
|
|
||||||
var edelement = $("[name='" + myname + "'");
|
|
||||||
var edeltype = edelement.attr('type')
|
|
||||||
//alert(edeltype)
|
|
||||||
if (edeltype !== undefined & (edeltype == 'radio' | edeltype == 'checkbox')) {
|
|
||||||
$('[value="' + myval + '"]').prop('checked', true);
|
|
||||||
}
|
}
|
||||||
else {
|
element.find('.update-filter').attr('targetfilter', filtroTarget);
|
||||||
$("[name='" + myname + "'").val(myval)
|
element.find(".set-filter").attr('style', 'display:none')
|
||||||
}
|
element.find(".update-filter").attr('style', 'display:compact')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
element.find('.update-filter').attr('targetfilter', filtroTarget);
|
else { //sto creando una clausola grammaticale nuova, definisco il valore di default
|
||||||
element.find(".set-filter").attr('style', 'display:none')
|
|
||||||
element.find(".update-filter").attr('style', 'display:compact')
|
|
||||||
|
|
||||||
}
|
|
||||||
else { //sto creando una clausola grammaticale nuova, definisco il valore di default
|
|
||||||
|
|
||||||
$("#types").val("verbovolgare").trigger("change");
|
|
||||||
}
|
|
||||||
valoriFiltro = {}
|
|
||||||
element.find('.sn').html(size);
|
|
||||||
grammarconditions = grammarconditions + 1
|
|
||||||
|
|
||||||
if (size == 1)
|
|
||||||
jQuery('#grammarbutton').attr('style', "display:block;")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Visualizza Clausola Sintattica
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
function showClausolaSintattica(valoriFiltro = {}, filtroTarget = '') {
|
|
||||||
|
|
||||||
|
|
||||||
var content = jQuery('#tiposintattico >div'),
|
|
||||||
size = jQuery('#condizioni >div').length + 1,
|
|
||||||
element = null,
|
|
||||||
element = content.clone();
|
|
||||||
element.attr('id', 'ts-' + size);
|
|
||||||
|
|
||||||
element.find('.remove-filter').attr('target', 'ts-' + size);
|
|
||||||
element.find('.set-filter').attr('targetfilter', 'ts-' + size);
|
|
||||||
element.appendTo('#condizioni');
|
|
||||||
if (!jQuery.isEmptyObject(valoriFiltro)) { // sto facendo l'edit di un filtro
|
|
||||||
|
|
||||||
$("#types").val(valoriFiltro['categoria']).trigger("change");
|
|
||||||
var keys = Object.keys(valoriFiltro)//condizioniFiltro)
|
|
||||||
for (key in keys) {
|
|
||||||
myname = keys[key]
|
|
||||||
myval = valoriFiltro[keys[key]]
|
|
||||||
var edelement = $("[name='" + myname + "'");
|
|
||||||
var edeltype = edelement.attr('type')
|
|
||||||
//alert(edeltype)
|
|
||||||
if (edeltype !== undefined & (edeltype == 'radio' | edeltype == 'checkbox')) {
|
|
||||||
$('[value="' + myval + '"]').prop('checked', true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("[name='" + myname + "'").val(myval)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
$("#types").val("verbovolgare").trigger("change");
|
||||||
}
|
}
|
||||||
|
valoriFiltro = {}
|
||||||
|
element.find('.sn').html(size);
|
||||||
|
grammarconditions = grammarconditions + 1
|
||||||
|
|
||||||
|
if (size == 1)
|
||||||
|
jQuery('#grammarbutton').attr('style', "display:block;")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
element.find('.sn').html(size);
|
/**
|
||||||
sintconditions = sintconditions + 1
|
Visualizza Clausola Sintattica
|
||||||
if (size == 1)
|
|
||||||
jQuery('#grammarbutton').attr('style', "display:block;")
|
*/
|
||||||
}
|
|
||||||
|
function showClausolaSintattica(valoriFiltro = {}, filtroTarget = '') {
|
||||||
|
|
||||||
|
|
||||||
jQuery(document).delegate('a.add-details', 'click', function(e) {
|
var content = jQuery('#tiposintattico >div'),
|
||||||
e.preventDefault();
|
size = jQuery('#condizioni >div').length + 1,
|
||||||
|
element = null,
|
||||||
|
element = content.clone();
|
||||||
|
element.attr('id', 'ts-' + size);
|
||||||
|
|
||||||
var targetDiv = jQuery(this).attr('target');
|
element.find('.remove-filter').attr('target', 'ts-' + size);
|
||||||
|
element.find('.set-filter').attr('targetfilter', 'ts-' + size);
|
||||||
|
element.appendTo('#condizioni');
|
||||||
|
if (!jQuery.isEmptyObject(valoriFiltro)) { // sto facendo l'edit di un filtro
|
||||||
|
|
||||||
rmel = jQuery('#' + targetDiv)
|
$("#types").val(valoriFiltro['categoria']).trigger("change");
|
||||||
var curstyle = rmel.attr('view')
|
var keys = Object.keys(valoriFiltro)//condizioniFiltro)
|
||||||
|
for (key in keys) {
|
||||||
|
myname = keys[key]
|
||||||
|
myval = valoriFiltro[keys[key]]
|
||||||
|
var edelement = $("[name='" + myname + "'");
|
||||||
|
var edeltype = edelement.attr('type')
|
||||||
|
//alert(edeltype)
|
||||||
|
if (edeltype !== undefined & (edeltype == 'radio' | edeltype == 'checkbox')) {
|
||||||
|
$('[value="' + myval + '"]').prop('checked', true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("[name='" + myname + "'").val(myval)
|
||||||
|
}
|
||||||
|
|
||||||
if (curstyle !== undefined && curstyle === 'y') {
|
|
||||||
|
|
||||||
rmel.children().attr('style', 'display:none');
|
}
|
||||||
rmel.attr('view', 'n')
|
}
|
||||||
}
|
|
||||||
else {
|
element.find('.sn').html(size);
|
||||||
rmel.attr('view', 'y')
|
sintconditions = sintconditions + 1
|
||||||
rmel.children().attr('style', 'display:block');
|
if (size == 1)
|
||||||
|
jQuery('#grammarbutton').attr('style', "display:block;")
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
|
jQuery(document).delegate('a.add-details', 'click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var targetDiv = jQuery(this).attr('target');
|
||||||
|
|
||||||
|
rmel = jQuery('#' + targetDiv)
|
||||||
|
var curstyle = rmel.attr('view')
|
||||||
|
|
||||||
|
if (curstyle !== undefined && curstyle === 'y') {
|
||||||
|
|
||||||
|
rmel.children().attr('style', 'display:none');
|
||||||
|
rmel.attr('view', 'n')
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rmel.attr('view', 'y')
|
||||||
|
rmel.children().attr('style', 'display:block');
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue