diff --git a/index_work_grid.html b/index_work_grid.html
index 6f8c42c..06697d5 100644
--- a/index_work_grid.html
+++ b/index_work_grid.html
@@ -804,7 +804,7 @@
div').length + 1,
- element = null,
- element = content.clone();
- //alert(size);
- element.attr('id', 'cg-'+size);
- //element.attr('class', "stripe-dark")
- //element.find('.delete-record').attr('data-id', size);
- element.appendTo('#condizioni');
- element.find('.sn').html(size);
- grammarconditions=grammarconditions+1
-
- if (size==1)
- jQuery('#grammarbutton').attr('style', "display:block;")
- });
-
- jQuery(document).delegate('a.add-record-sint', 'click', function(e) {
- e.preventDefault();
- var content = jQuery('#tiposintattico div'),
- size = jQuery('#condizioni >div').length + 1,
- element = null,
- element = content.clone();
- element.attr('id', 'ts-'+size);
- //element.attr('class', "stripe-dark")
- //element.find('.delete-record').attr('data-id', size);
- element.appendTo('#condizioni');
- element.find('.sn').html(size);
- if (size==1)
- jQuery('#grammarbutton').attr('style', "display:block;")
- });
-
-
- jQuery(document).delegate('select.catgram', 'change', function(e) {
- e.preventDefault();
- //alert ($('#types').find(":selected").val())
- alert ($(this).closest('div').attr('id'))
-
- containerid='dettaglio_'+$(this).closest('div').attr('id')
- //if ($('#types').find(":selected").val()=='verbovolgare'){
- if ($(this).val()=='verbovolgare'){
- //alert($('#types').find(":selected").val());
- var content = jQuery('#categoriaverbo >div'),
- size = jQuery('#dettaglifiltri').length + 1,
- element = null,
- element = content.clone();
-
- }
- if ($(this).val()=='sostantivovolgare'){
- //alert($('#types').find(":selected").val());
- var content = jQuery('#categoriasostantivo >div'),
- size = jQuery('#dettaglifiltri').length + 1,
- element = null,
- element = content.clone();
- }
- if ($(this).val()=='aggettivovolgare'){
- var keys = Object.keys(aggettivoJson.filtri);
- alert(keys)
- }
- element.attr('style',"display: block;")
- //element.appendTo('#dettaglifiltri');
-
- var test=jQuery('#'+containerid)
- test.remove()
-
-
- element.appendTo('#dettaglifiltri');
- var container = jQuery('#dettaglifiltri');
- container.attr('id', containerid);
- var divdf = jQuery('#divdettaglifiltri >div'),
- detelement = null,
- detelement = divdf.clone();
- detelement.attr('id','dettaglifiltri')
- detelement.appendTo("#query")
- element.find('.sn').html(size);
-
- });
-
-
- jQuery(document).delegate('input.delete-record', 'click', function(e) {
- e.preventDefault();
- var didConfirm = confirm("Sei sicuro di voler eliminare la condizione?");
- if (didConfirm == true) {
- var id = jQuery(this).attr('data-id');
- var targetDiv = jQuery(this).attr('targetDiv');
- jQuery('#rec-' + id).remove();
-
- if (jQuery('#condizioni >tbody >tr').length==0)
- jQuery('#grammarbutton').attr('style', "display:none;")
- //regnerate index number on table
- $('#condizioni_body tr').each(function(index){
- $(this).find('span.sn').html(index+1);
-
- });
- return true;
- } else {
- return false;
- }
-});
- });
\ No newline at end of file
+ $(this).addClass('bg-white').addClass('red');
+ $(this).siblings().removeClass('bg-white').removeClass('red');
+ });
+
+ jQuery(document).delegate('a.add-record', 'click', function(e) {
+ e.preventDefault();
+ var content = jQuery('#categoriagrammaticale div'),
+ size = jQuery('#condizioni >div').length + 1,
+ element = null,
+ element = content.clone();
+ //alert(size);
+ element.attr('id', 'cg-' + size);
+ //element.attr('class', "stripe-dark")
+ //element.find('.delete-record').attr('data-id', size);
+ element.appendTo('#condizioni');
+ element.find('.sn').html(size);
+ grammarconditions = grammarconditions + 1
+
+ if (size == 1)
+ jQuery('#grammarbutton').attr('style', "display:block;")
+ });
+
+ jQuery(document).delegate('a.add-record-sint', 'click', function(e) {
+ e.preventDefault();
+ var content = jQuery('#tiposintattico div'),
+ size = jQuery('#condizioni >div').length + 1,
+ element = null,
+ element = content.clone();
+ element.attr('id', 'ts-' + size);
+ //element.attr('class', "stripe-dark")
+ //element.find('.delete-record').attr('data-id', size);
+ element.appendTo('#condizioni');
+ element.find('.sn').html(size);
+ if (size == 1)
+ jQuery('#grammarbutton').attr('style', "display:block;")
+ });
+
+
+ jQuery(document).delegate('select.catgram', 'change', function(e) {
+ e.preventDefault();
+ //alert ($('#types').find(":selected").val())
+ alert($(this).closest('div').attr('id'))
+
+ containerid = 'dettaglio_' + $(this).closest('div').attr('id')
+ //if ($('#types').find(":selected").val()=='verbovolgare'){
+ if ($(this).val() == 'verbovolgare') {
+ //alert($('#types').find(":selected").val());
+ var content = jQuery('#categoriaverbo >div'),
+ size = jQuery('#dettaglifiltri').length + 1,
+ element = null,
+ element = content.clone();
+
+ }
+ if ($(this).val() == 'sostantivovolgare') {
+ //alert($('#types').find(":selected").val());
+ var content = jQuery('#categoriasostantivo >div'),
+ size = jQuery('#dettaglifiltri').length + 1,
+ element = null,
+ element = content.clone();
+ }
+
+ //alert($(this).val())
+
+ if (Object.keys(categorie).includes($(this).val())) {
+ //alert(categorie[$(this).val()])
+ var filtro = categorie[$(this).val()]
+ //var keys = Object.keys(aggettivoJson.filtri);
+ var keys = Object.keys(categorieJson[filtro])
+ for (key in keys) {
+ //alert(aggettivoJson.filtri[keys[key]])
+ var vals = categorieJson[filtro][keys[key]]
+ if (vals.length == 2) {
+ var element = $('
');
+ element.attr('class', ' w-15 pa1 mr2');
+ var rbfieldset = $('
'),
+ flexdiv1 = $('
'),
+ flexdiv2 = $('
'),
+ input1 = $('
'),
+ input2 = $('
'),
+ label1 = $('
'),
+ label2 = $('
');
+
+ rbfieldset.attr('id', keys[key]);
+ rbfieldset.attr('class', 'bn');
+ flexdiv1.attr('class', 'flex items-center mb2');
+ flexdiv2.attr('class', 'flex items-center mb2');
+ input1.attr('class', 'mr2 f6');
+ input2.attr('class', 'mr2 f6');
+ input1.attr('type', 'radio');
+ input2.attr('type', 'radio');
+ input1.attr('id', vals[0]);
+ input2.attr('id', vals[1]);
+ input1.attr('value', vals[0]);
+ input2.attr('value', vals[1]);
+ input1.attr('name', 'tra');
+ input2.attr('name', 'tra');
+ label1.attr('class', 'lh-copy');
+ label2.attr('class', 'lh-copy');
+ label1.attr('for', vals[0]);
+ label2.attr('for', vals[1]);
+ label1.append(vals[0]);
+ label2.append(vals[1]);
+
+ input1.appendTo(flexdiv1);
+ input2.appendTo(flexdiv2);
+ label1.appendTo(flexdiv1);
+ label2.appendTo(flexdiv2);
+ flexdiv1.appendTo(rbfieldset);
+ flexdiv2.appendTo(rbfieldset);
+ rbfieldset.appendTo(element);
+ element.attr('style', 'display:block')
+ element.appendTo('#dettaglifiltri');
+ }
+ }
+ for (key in keys) {
+ var vals = categorieJson[filtro][keys[key]]
+ if (vals.length > 2) {
+ var element = $('
');
+ element.attr('class', ' w-15 pa1 mr2');
+ var select = $('
')
+ select.attr('id', keys[key])
+ select.attr('title', keys[key])
+ for (val in vals) {
+ //alert(vals[val])
+ var seloption = $('
');
+ seloption.attr('value', vals[val]);
+ seloption.append(vals[val])
+ seloption.appendTo(select)
+ }
+ select.appendTo(element)
+ element.attr('style', 'display:block')
+ element.appendTo('#dettaglifiltri');
+
+ }
+
+ }
+ }
+ element.attr('style', "display: block;")
+ //element.appendTo('#dettaglifiltri');
+
+ var test = jQuery('#' + containerid)
+ test.remove()
+
+
+ element.appendTo('#dettaglifiltri');
+ var container = jQuery('#dettaglifiltri');
+ container.attr('id', containerid);
+ var divdf = jQuery('#divdettaglifiltri >div'),
+ detelement = null,
+ detelement = divdf.clone();
+ detelement.attr('id', 'dettaglifiltri')
+ detelement.appendTo("#query")
+ element.find('.sn').html(size);
+
+ });
+
+
+ jQuery(document).delegate('input.delete-record', 'click', function(e) {
+ e.preventDefault();
+ var didConfirm = confirm("Sei sicuro di voler eliminare la condizione?");
+ if (didConfirm == true) {
+ var id = jQuery(this).attr('data-id');
+ var targetDiv = jQuery(this).attr('targetDiv');
+ jQuery('#rec-' + id).remove();
+
+ if (jQuery('#condizioni >tbody >tr').length == 0)
+ jQuery('#grammarbutton').attr('style', "display:none;")
+ //regnerate index number on table
+ $('#condizioni_body tr').each(function(index) {
+ $(this).find('span.sn').html(index + 1);
+
+ });
+ return true;
+ } else {
+ return false;
+ }
+ });
+});
\ No newline at end of file